{"version":3,"file":"WorksGallery.Bm5imcOC.mjs","names":["createElement","p","toTransformString","setWidthHeight","specialKeyUsed","getElementsFromOption","isSafari","getViewportSize","parsePaddingOption","getPanAreaSize","lazyLoadData","ZoomLevel","lazyLoadSlide","LOAD_STATE","MAX_IMAGE_WIDTH","PhotoSwipeEvent","Eventable","Placeholder","Content","PhotoSwipeBase","defaultOptions","PhotoSwipeDynamicCaption"],"sources":["https:/unpkg.com/photoswipe","https:/unpkg.com/photoswipe/dist/photoswipe-lightbox.esm.js","https:/unpkg.com/photoswipe-dynamic-caption-plugin/photoswipe-dynamic-caption-plugin.esm.js","https:/framerusercontent.com/modules/RGI2tlVTDGo9psGXLwOZ/TtKHjAzSNsxDOG9RjpK3/WorksGallery.js"],"sourcesContent":["/*!\n  * PhotoSwipe 5.4.4 - https://photoswipe.com\n  * (c) 2024 Dmytro Semenov\n  */\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/**\r\n * @template {keyof HTMLElementTagNameMap} T\r\n * @param {string} className\r\n * @param {T} tagName\r\n * @param {Node} [appendToEl]\r\n * @returns {HTMLElementTagNameMap[T]}\r\n */\nfunction createElement(className, tagName, appendToEl) {\n  const el = document.createElement(tagName);\n\n  if (className) {\n    el.className = className;\n  }\n\n  if (appendToEl) {\n    appendToEl.appendChild(el);\n  }\n\n  return el;\n}\n/**\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {Point}\r\n */\n\nfunction equalizePoints(p1, p2) {\n  p1.x = p2.x;\n  p1.y = p2.y;\n\n  if (p2.id !== undefined) {\n    p1.id = p2.id;\n  }\n\n  return p1;\n}\n/**\r\n * @param {Point} p\r\n */\n\nfunction roundPoint(p) {\n  p.x = Math.round(p.x);\n  p.y = Math.round(p.y);\n}\n/**\r\n * Returns distance between two points.\r\n *\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {number}\r\n */\n\nfunction getDistanceBetween(p1, p2) {\n  const x = Math.abs(p1.x - p2.x);\n  const y = Math.abs(p1.y - p2.y);\n  return Math.sqrt(x * x + y * y);\n}\n/**\r\n * Whether X and Y positions of points are equal\r\n *\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {boolean}\r\n */\n\nfunction pointsEqual(p1, p2) {\n  return p1.x === p2.x && p1.y === p2.y;\n}\n/**\r\n * The float result between the min and max values.\r\n *\r\n * @param {number} val\r\n * @param {number} min\r\n * @param {number} max\r\n * @returns {number}\r\n */\n\nfunction clamp(val, min, max) {\n  return Math.min(Math.max(val, min), max);\n}\n/**\r\n * Get transform string\r\n *\r\n * @param {number} x\r\n * @param {number} [y]\r\n * @param {number} [scale]\r\n * @returns {string}\r\n */\n\nfunction toTransformString(x, y, scale) {\n  let propValue = `translate3d(${x}px,${y || 0}px,0)`;\n\n  if (scale !== undefined) {\n    propValue += ` scale3d(${scale},${scale},1)`;\n  }\n\n  return propValue;\n}\n/**\r\n * Apply transform:translate(x, y) scale(scale) to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {number} x\r\n * @param {number} [y]\r\n * @param {number} [scale]\r\n */\n\nfunction setTransform(el, x, y, scale) {\n  el.style.transform = toTransformString(x, y, scale);\n}\nconst defaultCSSEasing = 'cubic-bezier(.4,0,.22,1)';\n/**\r\n * Apply CSS transition to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {string} [prop] CSS property to animate\r\n * @param {number} [duration] in ms\r\n * @param {string} [ease] CSS easing function\r\n */\n\nfunction setTransitionStyle(el, prop, duration, ease) {\n  // inOut: 'cubic-bezier(.4, 0, .22, 1)', // for \"toggle state\" transitions\n  // out: 'cubic-bezier(0, 0, .22, 1)', // for \"show\" transitions\n  // in: 'cubic-bezier(.4, 0, 1, 1)'// for \"hide\" transitions\n  el.style.transition = prop ? `${prop} ${duration}ms ${ease || defaultCSSEasing}` : 'none';\n}\n/**\r\n * Apply width and height CSS properties to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {string | number} w\r\n * @param {string | number} h\r\n */\n\nfunction setWidthHeight(el, w, h) {\n  el.style.width = typeof w === 'number' ? `${w}px` : w;\n  el.style.height = typeof h === 'number' ? `${h}px` : h;\n}\n/**\r\n * @param {HTMLElement} el\r\n */\n\nfunction removeTransitionStyle(el) {\n  setTransitionStyle(el);\n}\n/**\r\n * @param {HTMLImageElement} img\r\n * @returns {Promise<HTMLImageElement | void>}\r\n */\n\nfunction decodeImage(img) {\n  if ('decode' in img) {\n    return img.decode().catch(() => {});\n  }\n\n  if (img.complete) {\n    return Promise.resolve(img);\n  }\n\n  return new Promise((resolve, reject) => {\n    img.onload = () => resolve(img);\n\n    img.onerror = reject;\n  });\n}\n/** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */\n\n/** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */\n\nconst LOAD_STATE = {\n  IDLE: 'idle',\n  LOADING: 'loading',\n  LOADED: 'loaded',\n  ERROR: 'error'\n};\n/**\r\n * Check if click or keydown event was dispatched\r\n * with a special key or via mouse wheel.\r\n *\r\n * @param {MouseEvent | KeyboardEvent} e\r\n * @returns {boolean}\r\n */\n\nfunction specialKeyUsed(e) {\n  return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;\n}\n/**\r\n * Parse `gallery` or `children` options.\r\n *\r\n * @param {import('../photoswipe.js').ElementProvider} [option]\r\n * @param {string} [legacySelector]\r\n * @param {HTMLElement | Document} [parent]\r\n * @returns HTMLElement[]\r\n */\n\nfunction getElementsFromOption(option, legacySelector, parent = document) {\n  /** @type {HTMLElement[]} */\n  let elements = [];\n\n  if (option instanceof Element) {\n    elements = [option];\n  } else if (option instanceof NodeList || Array.isArray(option)) {\n    elements = Array.from(option);\n  } else {\n    const selector = typeof option === 'string' ? option : legacySelector;\n\n    if (selector) {\n      elements = Array.from(parent.querySelectorAll(selector));\n    }\n  }\n\n  return elements;\n}\n/**\r\n * Check if browser is Safari\r\n *\r\n * @returns {boolean}\r\n */\n\nfunction isSafari() {\n  return !!(navigator.vendor && navigator.vendor.match(/apple/i));\n}\n\n// Detect passive event listener support\nlet supportsPassive = false;\n/* eslint-disable */\n\ntry {\n  /* @ts-ignore */\n  window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n    get: () => {\n      supportsPassive = true;\n    }\n  }));\n} catch (e) {}\n/* eslint-enable */\n\n/**\r\n * @typedef {Object} PoolItem\r\n * @prop {HTMLElement | Window | Document | undefined | null} target\r\n * @prop {string} type\r\n * @prop {EventListenerOrEventListenerObject} listener\r\n * @prop {boolean} [passive]\r\n */\n\n\nclass DOMEvents {\n  constructor() {\n    /**\r\n     * @type {PoolItem[]}\r\n     * @private\r\n     */\n    this._pool = [];\n  }\n  /**\r\n   * Adds event listeners\r\n   *\r\n   * @param {PoolItem['target']} target\r\n   * @param {PoolItem['type']} type Can be multiple, separated by space.\r\n   * @param {PoolItem['listener']} listener\r\n   * @param {PoolItem['passive']} [passive]\r\n   */\n\n\n  add(target, type, listener, passive) {\n    this._toggleListener(target, type, listener, passive);\n  }\n  /**\r\n   * Removes event listeners\r\n   *\r\n   * @param {PoolItem['target']} target\r\n   * @param {PoolItem['type']} type\r\n   * @param {PoolItem['listener']} listener\r\n   * @param {PoolItem['passive']} [passive]\r\n   */\n\n\n  remove(target, type, listener, passive) {\n    this._toggleListener(target, type, listener, passive, true);\n  }\n  /**\r\n   * Removes all bound events\r\n   */\n\n\n  removeAll() {\n    this._pool.forEach(poolItem => {\n      this._toggleListener(poolItem.target, poolItem.type, poolItem.listener, poolItem.passive, true, true);\n    });\n\n    this._pool = [];\n  }\n  /**\r\n   * Adds or removes event\r\n   *\r\n   * @private\r\n   * @param {PoolItem['target']} target\r\n   * @param {PoolItem['type']} type\r\n   * @param {PoolItem['listener']} listener\r\n   * @param {PoolItem['passive']} [passive]\r\n   * @param {boolean} [unbind] Whether the event should be added or removed\r\n   * @param {boolean} [skipPool] Whether events pool should be skipped\r\n   */\n\n\n  _toggleListener(target, type, listener, passive, unbind, skipPool) {\n    if (!target) {\n      return;\n    }\n\n    const methodName = unbind ? 'removeEventListener' : 'addEventListener';\n    const types = type.split(' ');\n    types.forEach(eType => {\n      if (eType) {\n        // Events pool is used to easily unbind all events when PhotoSwipe is closed,\n        // so developer doesn't need to do this manually\n        if (!skipPool) {\n          if (unbind) {\n            // Remove from the events pool\n            this._pool = this._pool.filter(poolItem => {\n              return poolItem.type !== eType || poolItem.listener !== listener || poolItem.target !== target;\n            });\n          } else {\n            // Add to the events pool\n            this._pool.push({\n              target,\n              type: eType,\n              listener,\n              passive\n            });\n          }\n        } // most PhotoSwipe events call preventDefault,\n        // and we do not need browser to scroll the page\n\n\n        const eventOptions = supportsPassive ? {\n          passive: passive || false\n        } : false;\n        target[methodName](eType, listener, eventOptions);\n      }\n    });\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/**\r\n * @param {PhotoSwipeOptions} options\r\n * @param {PhotoSwipeBase} pswp\r\n * @returns {Point}\r\n */\nfunction getViewportSize(options, pswp) {\n  if (options.getViewportSizeFn) {\n    const newViewportSize = options.getViewportSizeFn(options, pswp);\n\n    if (newViewportSize) {\n      return newViewportSize;\n    }\n  }\n\n  return {\n    x: document.documentElement.clientWidth,\n    // TODO: height on mobile is very incosistent due to toolbar\n    // find a way to improve this\n    //\n    // document.documentElement.clientHeight - doesn't seem to work well\n    y: window.innerHeight\n  };\n}\n/**\r\n * Parses padding option.\r\n * Supported formats:\r\n *\r\n * // Object\r\n * padding: {\r\n *  top: 0,\r\n *  bottom: 0,\r\n *  left: 0,\r\n *  right: 0\r\n * }\r\n *\r\n * // A function that returns the object\r\n * paddingFn: (viewportSize, itemData, index) => {\r\n *  return {\r\n *    top: 0,\r\n *    bottom: 0,\r\n *    left: 0,\r\n *    right: 0\r\n *  };\r\n * }\r\n *\r\n * // Legacy variant\r\n * paddingLeft: 0,\r\n * paddingRight: 0,\r\n * paddingTop: 0,\r\n * paddingBottom: 0,\r\n *\r\n * @param {'left' | 'top' | 'bottom' | 'right'} prop\r\n * @param {PhotoSwipeOptions} options PhotoSwipe options\r\n * @param {Point} viewportSize PhotoSwipe viewport size, for example: { x:800, y:600 }\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {number} index Slide index\r\n * @returns {number}\r\n */\n\nfunction parsePaddingOption(prop, options, viewportSize, itemData, index) {\n  let paddingValue = 0;\n\n  if (options.paddingFn) {\n    paddingValue = options.paddingFn(viewportSize, itemData, index)[prop];\n  } else if (options.padding) {\n    paddingValue = options.padding[prop];\n  } else {\n    const legacyPropName = 'padding' + prop[0].toUpperCase() + prop.slice(1); // @ts-expect-error\n\n    if (options[legacyPropName]) {\n      // @ts-expect-error\n      paddingValue = options[legacyPropName];\n    }\n  }\n\n  return Number(paddingValue) || 0;\n}\n/**\r\n * @param {PhotoSwipeOptions} options\r\n * @param {Point} viewportSize\r\n * @param {SlideData} itemData\r\n * @param {number} index\r\n * @returns {Point}\r\n */\n\nfunction getPanAreaSize(options, viewportSize, itemData, index) {\n  return {\n    x: viewportSize.x - parsePaddingOption('left', options, viewportSize, itemData, index) - parsePaddingOption('right', options, viewportSize, itemData, index),\n    y: viewportSize.y - parsePaddingOption('top', options, viewportSize, itemData, index) - parsePaddingOption('bottom', options, viewportSize, itemData, index)\n  };\n}\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {Record<Axis, number>} Point */\n\n/** @typedef {'x' | 'y'} Axis */\n\n/**\r\n * Calculates minimum, maximum and initial (center) bounds of a slide\r\n */\n\nclass PanBounds {\n  /**\r\n   * @param {Slide} slide\r\n   */\n  constructor(slide) {\n    this.slide = slide;\n    this.currZoomLevel = 1;\n    this.center =\n    /** @type {Point} */\n    {\n      x: 0,\n      y: 0\n    };\n    this.max =\n    /** @type {Point} */\n    {\n      x: 0,\n      y: 0\n    };\n    this.min =\n    /** @type {Point} */\n    {\n      x: 0,\n      y: 0\n    };\n  }\n  /**\r\n   * _getItemBounds\r\n   *\r\n   * @param {number} currZoomLevel\r\n   */\n\n\n  update(currZoomLevel) {\n    this.currZoomLevel = currZoomLevel;\n\n    if (!this.slide.width) {\n      this.reset();\n    } else {\n      this._updateAxis('x');\n\n      this._updateAxis('y');\n\n      this.slide.pswp.dispatch('calcBounds', {\n        slide: this.slide\n      });\n    }\n  }\n  /**\r\n   * _calculateItemBoundsForAxis\r\n   *\r\n   * @param {Axis} axis\r\n   */\n\n\n  _updateAxis(axis) {\n    const {\n      pswp\n    } = this.slide;\n    const elSize = this.slide[axis === 'x' ? 'width' : 'height'] * this.currZoomLevel;\n    const paddingProp = axis === 'x' ? 'left' : 'top';\n    const padding = parsePaddingOption(paddingProp, pswp.options, pswp.viewportSize, this.slide.data, this.slide.index);\n    const panAreaSize = this.slide.panAreaSize[axis]; // Default position of element.\n    // By default, it is center of viewport:\n\n    this.center[axis] = Math.round((panAreaSize - elSize) / 2) + padding; // maximum pan position\n\n    this.max[axis] = elSize > panAreaSize ? Math.round(panAreaSize - elSize) + padding : this.center[axis]; // minimum pan position\n\n    this.min[axis] = elSize > panAreaSize ? padding : this.center[axis];\n  } // _getZeroBounds\n\n\n  reset() {\n    this.center.x = 0;\n    this.center.y = 0;\n    this.max.x = 0;\n    this.max.y = 0;\n    this.min.x = 0;\n    this.min.y = 0;\n  }\n  /**\r\n   * Correct pan position if it's beyond the bounds\r\n   *\r\n   * @param {Axis} axis x or y\r\n   * @param {number} panOffset\r\n   * @returns {number}\r\n   */\n\n\n  correctPan(axis, panOffset) {\n    // checkPanBounds\n    return clamp(panOffset, this.max[axis], this.min[axis]);\n  }\n\n}\n\nconst MAX_IMAGE_WIDTH = 4000;\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/** @typedef {'fit' | 'fill' | number | ((zoomLevelObject: ZoomLevel) => number)} ZoomLevelOption */\n\n/**\r\n * Calculates zoom levels for specific slide.\r\n * Depends on viewport size and image size.\r\n */\n\nclass ZoomLevel {\n  /**\r\n   * @param {PhotoSwipeOptions} options PhotoSwipe options\r\n   * @param {SlideData} itemData Slide data\r\n   * @param {number} index Slide index\r\n   * @param {PhotoSwipe} [pswp] PhotoSwipe instance, can be undefined if not initialized yet\r\n   */\n  constructor(options, itemData, index, pswp) {\n    this.pswp = pswp;\n    this.options = options;\n    this.itemData = itemData;\n    this.index = index;\n    /** @type { Point | null } */\n\n    this.panAreaSize = null;\n    /** @type { Point | null } */\n\n    this.elementSize = null;\n    this.fit = 1;\n    this.fill = 1;\n    this.vFill = 1;\n    this.initial = 1;\n    this.secondary = 1;\n    this.max = 1;\n    this.min = 1;\n  }\n  /**\r\n   * Calculate initial, secondary and maximum zoom level for the specified slide.\r\n   *\r\n   * It should be called when either image or viewport size changes.\r\n   *\r\n   * @param {number} maxWidth\r\n   * @param {number} maxHeight\r\n   * @param {Point} panAreaSize\r\n   */\n\n\n  update(maxWidth, maxHeight, panAreaSize) {\n    /** @type {Point} */\n    const elementSize = {\n      x: maxWidth,\n      y: maxHeight\n    };\n    this.elementSize = elementSize;\n    this.panAreaSize = panAreaSize;\n    const hRatio = panAreaSize.x / elementSize.x;\n    const vRatio = panAreaSize.y / elementSize.y;\n    this.fit = Math.min(1, hRatio < vRatio ? hRatio : vRatio);\n    this.fill = Math.min(1, hRatio > vRatio ? hRatio : vRatio); // zoom.vFill defines zoom level of the image\n    // when it has 100% of viewport vertical space (height)\n\n    this.vFill = Math.min(1, vRatio);\n    this.initial = this._getInitial();\n    this.secondary = this._getSecondary();\n    this.max = Math.max(this.initial, this.secondary, this._getMax());\n    this.min = Math.min(this.fit, this.initial, this.secondary);\n\n    if (this.pswp) {\n      this.pswp.dispatch('zoomLevelsUpdate', {\n        zoomLevels: this,\n        slideData: this.itemData\n      });\n    }\n  }\n  /**\r\n   * Parses user-defined zoom option.\r\n   *\r\n   * @private\r\n   * @param {'initial' | 'secondary' | 'max'} optionPrefix Zoom level option prefix (initial, secondary, max)\r\n   * @returns { number | undefined }\r\n   */\n\n\n  _parseZoomLevelOption(optionPrefix) {\n    const optionName =\n    /** @type {'initialZoomLevel' | 'secondaryZoomLevel' | 'maxZoomLevel'} */\n    optionPrefix + 'ZoomLevel';\n    const optionValue = this.options[optionName];\n\n    if (!optionValue) {\n      return;\n    }\n\n    if (typeof optionValue === 'function') {\n      return optionValue(this);\n    }\n\n    if (optionValue === 'fill') {\n      return this.fill;\n    }\n\n    if (optionValue === 'fit') {\n      return this.fit;\n    }\n\n    return Number(optionValue);\n  }\n  /**\r\n   * Get zoom level to which image will be zoomed after double-tap gesture,\r\n   * or when user clicks on zoom icon,\r\n   * or mouse-click on image itself.\r\n   * If you return 1 image will be zoomed to its original size.\r\n   *\r\n   * @private\r\n   * @return {number}\r\n   */\n\n\n  _getSecondary() {\n    let currZoomLevel = this._parseZoomLevelOption('secondary');\n\n    if (currZoomLevel) {\n      return currZoomLevel;\n    } // 3x of \"fit\" state, but not larger than original\n\n\n    currZoomLevel = Math.min(1, this.fit * 3);\n\n    if (this.elementSize && currZoomLevel * this.elementSize.x > MAX_IMAGE_WIDTH) {\n      currZoomLevel = MAX_IMAGE_WIDTH / this.elementSize.x;\n    }\n\n    return currZoomLevel;\n  }\n  /**\r\n   * Get initial image zoom level.\r\n   *\r\n   * @private\r\n   * @return {number}\r\n   */\n\n\n  _getInitial() {\n    return this._parseZoomLevelOption('initial') || this.fit;\n  }\n  /**\r\n   * Maximum zoom level when user zooms\r\n   * via zoom/pinch gesture,\r\n   * via cmd/ctrl-wheel or via trackpad.\r\n   *\r\n   * @private\r\n   * @return {number}\r\n   */\n\n\n  _getMax() {\n    // max zoom level is x4 from \"fit state\",\n    // used for zoom gesture and ctrl/trackpad zoom\n    return this._parseZoomLevelOption('max') || Math.max(1, this.fit * 4);\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n/**\r\n * Renders and allows to control a single slide\r\n */\n\nclass Slide {\n  /**\r\n   * @param {SlideData} data\r\n   * @param {number} index\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(data, index, pswp) {\n    this.data = data;\n    this.index = index;\n    this.pswp = pswp;\n    this.isActive = index === pswp.currIndex;\n    this.currentResolution = 0;\n    /** @type {Point} */\n\n    this.panAreaSize = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point} */\n\n    this.pan = {\n      x: 0,\n      y: 0\n    };\n    this.isFirstSlide = this.isActive && !pswp.opener.isOpen;\n    this.zoomLevels = new ZoomLevel(pswp.options, data, index, pswp);\n    this.pswp.dispatch('gettingData', {\n      slide: this,\n      data: this.data,\n      index\n    });\n    this.content = this.pswp.contentLoader.getContentBySlide(this);\n    this.container = createElement('pswp__zoom-wrap', 'div');\n    /** @type {HTMLElement | null} */\n\n    this.holderElement = null;\n    this.currZoomLevel = 1;\n    /** @type {number} */\n\n    this.width = this.content.width;\n    /** @type {number} */\n\n    this.height = this.content.height;\n    this.heavyAppended = false;\n    this.bounds = new PanBounds(this);\n    this.prevDisplayedWidth = -1;\n    this.prevDisplayedHeight = -1;\n    this.pswp.dispatch('slideInit', {\n      slide: this\n    });\n  }\n  /**\r\n   * If this slide is active/current/visible\r\n   *\r\n   * @param {boolean} isActive\r\n   */\n\n\n  setIsActive(isActive) {\n    if (isActive && !this.isActive) {\n      // slide just became active\n      this.activate();\n    } else if (!isActive && this.isActive) {\n      // slide just became non-active\n      this.deactivate();\n    }\n  }\n  /**\r\n   * Appends slide content to DOM\r\n   *\r\n   * @param {HTMLElement} holderElement\r\n   */\n\n\n  append(holderElement) {\n    this.holderElement = holderElement;\n    this.container.style.transformOrigin = '0 0'; // Slide appended to DOM\n\n    if (!this.data) {\n      return;\n    }\n\n    this.calculateSize();\n    this.load();\n    this.updateContentSize();\n    this.appendHeavy();\n    this.holderElement.appendChild(this.container);\n    this.zoomAndPanToInitial();\n    this.pswp.dispatch('firstZoomPan', {\n      slide: this\n    });\n    this.applyCurrentZoomPan();\n    this.pswp.dispatch('afterSetContent', {\n      slide: this\n    });\n\n    if (this.isActive) {\n      this.activate();\n    }\n  }\n\n  load() {\n    this.content.load(false);\n    this.pswp.dispatch('slideLoad', {\n      slide: this\n    });\n  }\n  /**\r\n   * Append \"heavy\" DOM elements\r\n   *\r\n   * This may depend on a type of slide,\r\n   * but generally these are large images.\r\n   */\n\n\n  appendHeavy() {\n    const {\n      pswp\n    } = this;\n    const appendHeavyNearby = true; // todo\n    // Avoid appending heavy elements during animations\n\n    if (this.heavyAppended || !pswp.opener.isOpen || pswp.mainScroll.isShifted() || !this.isActive && !appendHeavyNearby) {\n      return;\n    }\n\n    if (this.pswp.dispatch('appendHeavy', {\n      slide: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    this.heavyAppended = true;\n    this.content.append();\n    this.pswp.dispatch('appendHeavyContent', {\n      slide: this\n    });\n  }\n  /**\r\n   * Triggered when this slide is active (selected).\r\n   *\r\n   * If it's part of opening/closing transition -\r\n   * activate() will trigger after the transition is ended.\r\n   */\n\n\n  activate() {\n    this.isActive = true;\n    this.appendHeavy();\n    this.content.activate();\n    this.pswp.dispatch('slideActivate', {\n      slide: this\n    });\n  }\n  /**\r\n   * Triggered when this slide becomes inactive.\r\n   *\r\n   * Slide can become inactive only after it was active.\r\n   */\n\n\n  deactivate() {\n    this.isActive = false;\n    this.content.deactivate();\n\n    if (this.currZoomLevel !== this.zoomLevels.initial) {\n      // allow filtering\n      this.calculateSize();\n    } // reset zoom level\n\n\n    this.currentResolution = 0;\n    this.zoomAndPanToInitial();\n    this.applyCurrentZoomPan();\n    this.updateContentSize();\n    this.pswp.dispatch('slideDeactivate', {\n      slide: this\n    });\n  }\n  /**\r\n   * The slide should destroy itself, it will never be used again.\r\n   * (unbind all events and destroy internal components)\r\n   */\n\n\n  destroy() {\n    this.content.hasSlide = false;\n    this.content.remove();\n    this.container.remove();\n    this.pswp.dispatch('slideDestroy', {\n      slide: this\n    });\n  }\n\n  resize() {\n    if (this.currZoomLevel === this.zoomLevels.initial || !this.isActive) {\n      // Keep initial zoom level if it was before the resize,\n      // as well as when this slide is not active\n      // Reset position and scale to original state\n      this.calculateSize();\n      this.currentResolution = 0;\n      this.zoomAndPanToInitial();\n      this.applyCurrentZoomPan();\n      this.updateContentSize();\n    } else {\n      // readjust pan position if it's beyond the bounds\n      this.calculateSize();\n      this.bounds.update(this.currZoomLevel);\n      this.panTo(this.pan.x, this.pan.y);\n    }\n  }\n  /**\r\n   * Apply size to current slide content,\r\n   * based on the current resolution and scale.\r\n   *\r\n   * @param {boolean} [force] if size should be updated even if dimensions weren't changed\r\n   */\n\n\n  updateContentSize(force) {\n    // Use initial zoom level\n    // if resolution is not defined (user didn't zoom yet)\n    const scaleMultiplier = this.currentResolution || this.zoomLevels.initial;\n\n    if (!scaleMultiplier) {\n      return;\n    }\n\n    const width = Math.round(this.width * scaleMultiplier) || this.pswp.viewportSize.x;\n    const height = Math.round(this.height * scaleMultiplier) || this.pswp.viewportSize.y;\n\n    if (!this.sizeChanged(width, height) && !force) {\n      return;\n    }\n\n    this.content.setDisplayedSize(width, height);\n  }\n  /**\r\n   * @param {number} width\r\n   * @param {number} height\r\n   */\n\n\n  sizeChanged(width, height) {\n    if (width !== this.prevDisplayedWidth || height !== this.prevDisplayedHeight) {\n      this.prevDisplayedWidth = width;\n      this.prevDisplayedHeight = height;\n      return true;\n    }\n\n    return false;\n  }\n  /** @returns {HTMLImageElement | HTMLDivElement | null | undefined} */\n\n\n  getPlaceholderElement() {\n    var _this$content$placeho;\n\n    return (_this$content$placeho = this.content.placeholder) === null || _this$content$placeho === void 0 ? void 0 : _this$content$placeho.element;\n  }\n  /**\r\n   * Zoom current slide image to...\r\n   *\r\n   * @param {number} destZoomLevel Destination zoom level.\r\n   * @param {Point} [centerPoint]\r\n   * Transform origin center point, or false if viewport center should be used.\r\n   * @param {number | false} [transitionDuration] Transition duration, may be set to 0.\r\n   * @param {boolean} [ignoreBounds] Minimum and maximum zoom levels will be ignored.\r\n   */\n\n\n  zoomTo(destZoomLevel, centerPoint, transitionDuration, ignoreBounds) {\n    const {\n      pswp\n    } = this;\n\n    if (!this.isZoomable() || pswp.mainScroll.isShifted()) {\n      return;\n    }\n\n    pswp.dispatch('beforeZoomTo', {\n      destZoomLevel,\n      centerPoint,\n      transitionDuration\n    }); // stop all pan and zoom transitions\n\n    pswp.animations.stopAllPan(); // if (!centerPoint) {\n    //   centerPoint = pswp.getViewportCenterPoint();\n    // }\n\n    const prevZoomLevel = this.currZoomLevel;\n\n    if (!ignoreBounds) {\n      destZoomLevel = clamp(destZoomLevel, this.zoomLevels.min, this.zoomLevels.max);\n    } // if (transitionDuration === undefined) {\n    //   transitionDuration = this.pswp.options.zoomAnimationDuration;\n    // }\n\n\n    this.setZoomLevel(destZoomLevel);\n    this.pan.x = this.calculateZoomToPanOffset('x', centerPoint, prevZoomLevel);\n    this.pan.y = this.calculateZoomToPanOffset('y', centerPoint, prevZoomLevel);\n    roundPoint(this.pan);\n\n    const finishTransition = () => {\n      this._setResolution(destZoomLevel);\n\n      this.applyCurrentZoomPan();\n    };\n\n    if (!transitionDuration) {\n      finishTransition();\n    } else {\n      pswp.animations.startTransition({\n        isPan: true,\n        name: 'zoomTo',\n        target: this.container,\n        transform: this.getCurrentTransform(),\n        onComplete: finishTransition,\n        duration: transitionDuration,\n        easing: pswp.options.easing\n      });\n    }\n  }\n  /**\r\n   * @param {Point} [centerPoint]\r\n   */\n\n\n  toggleZoom(centerPoint) {\n    this.zoomTo(this.currZoomLevel === this.zoomLevels.initial ? this.zoomLevels.secondary : this.zoomLevels.initial, centerPoint, this.pswp.options.zoomAnimationDuration);\n  }\n  /**\r\n   * Updates zoom level property and recalculates new pan bounds,\r\n   * unlike zoomTo it does not apply transform (use applyCurrentZoomPan)\r\n   *\r\n   * @param {number} currZoomLevel\r\n   */\n\n\n  setZoomLevel(currZoomLevel) {\n    this.currZoomLevel = currZoomLevel;\n    this.bounds.update(this.currZoomLevel);\n  }\n  /**\r\n   * Get pan position after zoom at a given `point`.\r\n   *\r\n   * Always call setZoomLevel(newZoomLevel) beforehand to recalculate\r\n   * pan bounds according to the new zoom level.\r\n   *\r\n   * @param {'x' | 'y'} axis\r\n   * @param {Point} [point]\r\n   * point based on which zoom is performed, usually refers to the current mouse position,\r\n   * if false - viewport center will be used.\r\n   * @param {number} [prevZoomLevel] Zoom level before new zoom was applied.\r\n   * @returns {number}\r\n   */\n\n\n  calculateZoomToPanOffset(axis, point, prevZoomLevel) {\n    const totalPanDistance = this.bounds.max[axis] - this.bounds.min[axis];\n\n    if (totalPanDistance === 0) {\n      return this.bounds.center[axis];\n    }\n\n    if (!point) {\n      point = this.pswp.getViewportCenterPoint();\n    }\n\n    if (!prevZoomLevel) {\n      prevZoomLevel = this.zoomLevels.initial;\n    }\n\n    const zoomFactor = this.currZoomLevel / prevZoomLevel;\n    return this.bounds.correctPan(axis, (this.pan[axis] - point[axis]) * zoomFactor + point[axis]);\n  }\n  /**\r\n   * Apply pan and keep it within bounds.\r\n   *\r\n   * @param {number} panX\r\n   * @param {number} panY\r\n   */\n\n\n  panTo(panX, panY) {\n    this.pan.x = this.bounds.correctPan('x', panX);\n    this.pan.y = this.bounds.correctPan('y', panY);\n    this.applyCurrentZoomPan();\n  }\n  /**\r\n   * If the slide in the current state can be panned by the user\r\n   * @returns {boolean}\r\n   */\n\n\n  isPannable() {\n    return Boolean(this.width) && this.currZoomLevel > this.zoomLevels.fit;\n  }\n  /**\r\n   * If the slide can be zoomed\r\n   * @returns {boolean}\r\n   */\n\n\n  isZoomable() {\n    return Boolean(this.width) && this.content.isZoomable();\n  }\n  /**\r\n   * Apply transform and scale based on\r\n   * the current pan position (this.pan) and zoom level (this.currZoomLevel)\r\n   */\n\n\n  applyCurrentZoomPan() {\n    this._applyZoomTransform(this.pan.x, this.pan.y, this.currZoomLevel);\n\n    if (this === this.pswp.currSlide) {\n      this.pswp.dispatch('zoomPanUpdate', {\n        slide: this\n      });\n    }\n  }\n\n  zoomAndPanToInitial() {\n    this.currZoomLevel = this.zoomLevels.initial; // pan according to the zoom level\n\n    this.bounds.update(this.currZoomLevel);\n    equalizePoints(this.pan, this.bounds.center);\n    this.pswp.dispatch('initialZoomPan', {\n      slide: this\n    });\n  }\n  /**\r\n   * Set translate and scale based on current resolution\r\n   *\r\n   * @param {number} x\r\n   * @param {number} y\r\n   * @param {number} zoom\r\n   * @private\r\n   */\n\n\n  _applyZoomTransform(x, y, zoom) {\n    zoom /= this.currentResolution || this.zoomLevels.initial;\n    setTransform(this.container, x, y, zoom);\n  }\n\n  calculateSize() {\n    const {\n      pswp\n    } = this;\n    equalizePoints(this.panAreaSize, getPanAreaSize(pswp.options, pswp.viewportSize, this.data, this.index));\n    this.zoomLevels.update(this.width, this.height, this.panAreaSize);\n    pswp.dispatch('calcSlideSize', {\n      slide: this\n    });\n  }\n  /** @returns {string} */\n\n\n  getCurrentTransform() {\n    const scale = this.currZoomLevel / (this.currentResolution || this.zoomLevels.initial);\n    return toTransformString(this.pan.x, this.pan.y, scale);\n  }\n  /**\r\n   * Set resolution and re-render the image.\r\n   *\r\n   * For example, if the real image size is 2000x1500,\r\n   * and resolution is 0.5 - it will be rendered as 1000x750.\r\n   *\r\n   * Image with zoom level 2 and resolution 0.5 is\r\n   * the same as image with zoom level 1 and resolution 1.\r\n   *\r\n   * Used to optimize animations and make\r\n   * sure that browser renders image in the highest quality.\r\n   * Also used by responsive images to load the correct one.\r\n   *\r\n   * @param {number} newResolution\r\n   */\n\n\n  _setResolution(newResolution) {\n    if (newResolution === this.currentResolution) {\n      return;\n    }\n\n    this.currentResolution = newResolution;\n    this.updateContentSize();\n    this.pswp.dispatch('resolutionChanged');\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('./gestures.js').default} Gestures */\n\nconst PAN_END_FRICTION = 0.35;\nconst VERTICAL_DRAG_FRICTION = 0.6; // 1 corresponds to the third of viewport height\n\nconst MIN_RATIO_TO_CLOSE = 0.4; // Minimum speed required to navigate\n// to next or previous slide\n\nconst MIN_NEXT_SLIDE_SPEED = 0.5;\n/**\r\n * @param {number} initialVelocity\r\n * @param {number} decelerationRate\r\n * @returns {number}\r\n */\n\nfunction project(initialVelocity, decelerationRate) {\n  return initialVelocity * decelerationRate / (1 - decelerationRate);\n}\n/**\r\n * Handles single pointer dragging\r\n */\n\n\nclass DragHandler {\n  /**\r\n   * @param {Gestures} gestures\r\n   */\n  constructor(gestures) {\n    this.gestures = gestures;\n    this.pswp = gestures.pswp;\n    /** @type {Point} */\n\n    this.startPan = {\n      x: 0,\n      y: 0\n    };\n  }\n\n  start() {\n    if (this.pswp.currSlide) {\n      equalizePoints(this.startPan, this.pswp.currSlide.pan);\n    }\n\n    this.pswp.animations.stopAll();\n  }\n\n  change() {\n    const {\n      p1,\n      prevP1,\n      dragAxis\n    } = this.gestures;\n    const {\n      currSlide\n    } = this.pswp;\n\n    if (dragAxis === 'y' && this.pswp.options.closeOnVerticalDrag && currSlide && currSlide.currZoomLevel <= currSlide.zoomLevels.fit && !this.gestures.isMultitouch) {\n      // Handle vertical drag to close\n      const panY = currSlide.pan.y + (p1.y - prevP1.y);\n\n      if (!this.pswp.dispatch('verticalDrag', {\n        panY\n      }).defaultPrevented) {\n        this._setPanWithFriction('y', panY, VERTICAL_DRAG_FRICTION);\n\n        const bgOpacity = 1 - Math.abs(this._getVerticalDragRatio(currSlide.pan.y));\n        this.pswp.applyBgOpacity(bgOpacity);\n        currSlide.applyCurrentZoomPan();\n      }\n    } else {\n      const mainScrollChanged = this._panOrMoveMainScroll('x');\n\n      if (!mainScrollChanged) {\n        this._panOrMoveMainScroll('y');\n\n        if (currSlide) {\n          roundPoint(currSlide.pan);\n          currSlide.applyCurrentZoomPan();\n        }\n      }\n    }\n  }\n\n  end() {\n    const {\n      velocity\n    } = this.gestures;\n    const {\n      mainScroll,\n      currSlide\n    } = this.pswp;\n    let indexDiff = 0;\n    this.pswp.animations.stopAll(); // Handle main scroll if it's shifted\n\n    if (mainScroll.isShifted()) {\n      // Position of the main scroll relative to the viewport\n      const mainScrollShiftDiff = mainScroll.x - mainScroll.getCurrSlideX(); // Ratio between 0 and 1:\n      // 0 - slide is not visible at all,\n      // 0.5 - half of the slide is visible\n      // 1 - slide is fully visible\n\n      const currentSlideVisibilityRatio = mainScrollShiftDiff / this.pswp.viewportSize.x; // Go next slide.\n      //\n      // - if velocity and its direction is matched,\n      //   and we see at least tiny part of the next slide\n      //\n      // - or if we see less than 50% of the current slide\n      //   and velocity is close to 0\n      //\n\n      if (velocity.x < -MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio < 0 || velocity.x < 0.1 && currentSlideVisibilityRatio < -0.5) {\n        // Go to next slide\n        indexDiff = 1;\n        velocity.x = Math.min(velocity.x, 0);\n      } else if (velocity.x > MIN_NEXT_SLIDE_SPEED && currentSlideVisibilityRatio > 0 || velocity.x > -0.1 && currentSlideVisibilityRatio > 0.5) {\n        // Go to prev slide\n        indexDiff = -1;\n        velocity.x = Math.max(velocity.x, 0);\n      }\n\n      mainScroll.moveIndexBy(indexDiff, true, velocity.x);\n    } // Restore zoom level\n\n\n    if (currSlide && currSlide.currZoomLevel > currSlide.zoomLevels.max || this.gestures.isMultitouch) {\n      this.gestures.zoomLevels.correctZoomPan(true);\n    } else {\n      // we run two animations instead of one,\n      // as each axis has own pan boundaries and thus different spring function\n      // (correctZoomPan does not have this functionality,\n      //  it animates all properties with single timing function)\n      this._finishPanGestureForAxis('x');\n\n      this._finishPanGestureForAxis('y');\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {'x' | 'y'} axis\r\n   */\n\n\n  _finishPanGestureForAxis(axis) {\n    const {\n      velocity\n    } = this.gestures;\n    const {\n      currSlide\n    } = this.pswp;\n\n    if (!currSlide) {\n      return;\n    }\n\n    const {\n      pan,\n      bounds\n    } = currSlide;\n    const panPos = pan[axis];\n    const restoreBgOpacity = this.pswp.bgOpacity < 1 && axis === 'y'; // 0.995 means - scroll view loses 0.5% of its velocity per millisecond\n    // Increasing this number will reduce travel distance\n\n    const decelerationRate = 0.995; // 0.99\n    // Pan position if there is no bounds\n\n    const projectedPosition = panPos + project(velocity[axis], decelerationRate);\n\n    if (restoreBgOpacity) {\n      const vDragRatio = this._getVerticalDragRatio(panPos);\n\n      const projectedVDragRatio = this._getVerticalDragRatio(projectedPosition); // If we are above and moving upwards,\n      // or if we are below and moving downwards\n\n\n      if (vDragRatio < 0 && projectedVDragRatio < -MIN_RATIO_TO_CLOSE || vDragRatio > 0 && projectedVDragRatio > MIN_RATIO_TO_CLOSE) {\n        this.pswp.close();\n        return;\n      }\n    } // Pan position with corrected bounds\n\n\n    const correctedPanPosition = bounds.correctPan(axis, projectedPosition); // Exit if pan position should not be changed\n    // or if speed it too low\n\n    if (panPos === correctedPanPosition) {\n      return;\n    } // Overshoot if the final position is out of pan bounds\n\n\n    const dampingRatio = correctedPanPosition === projectedPosition ? 1 : 0.82;\n    const initialBgOpacity = this.pswp.bgOpacity;\n    const totalPanDist = correctedPanPosition - panPos;\n    this.pswp.animations.startSpring({\n      name: 'panGesture' + axis,\n      isPan: true,\n      start: panPos,\n      end: correctedPanPosition,\n      velocity: velocity[axis],\n      dampingRatio,\n      onUpdate: pos => {\n        // Animate opacity of background relative to Y pan position of an image\n        if (restoreBgOpacity && this.pswp.bgOpacity < 1) {\n          // 0 - start of animation, 1 - end of animation\n          const animationProgressRatio = 1 - (correctedPanPosition - pos) / totalPanDist; // We clamp opacity to keep it between 0 and 1.\n          // As progress ratio can be larger than 1 due to overshoot,\n          // and we do not want to bounce opacity.\n\n          this.pswp.applyBgOpacity(clamp(initialBgOpacity + (1 - initialBgOpacity) * animationProgressRatio, 0, 1));\n        }\n\n        pan[axis] = Math.floor(pos);\n        currSlide.applyCurrentZoomPan();\n      }\n    });\n  }\n  /**\r\n   * Update position of the main scroll,\r\n   * or/and update pan position of the current slide.\r\n   *\r\n   * Should return true if it changes (or can change) main scroll.\r\n   *\r\n   * @private\r\n   * @param {'x' | 'y'} axis\r\n   * @returns {boolean}\r\n   */\n\n\n  _panOrMoveMainScroll(axis) {\n    const {\n      p1,\n      dragAxis,\n      prevP1,\n      isMultitouch\n    } = this.gestures;\n    const {\n      currSlide,\n      mainScroll\n    } = this.pswp;\n    const delta = p1[axis] - prevP1[axis];\n    const newMainScrollX = mainScroll.x + delta;\n\n    if (!delta || !currSlide) {\n      return false;\n    } // Always move main scroll if image can not be panned\n\n\n    if (axis === 'x' && !currSlide.isPannable() && !isMultitouch) {\n      mainScroll.moveTo(newMainScrollX, true);\n      return true; // changed main scroll\n    }\n\n    const {\n      bounds\n    } = currSlide;\n    const newPan = currSlide.pan[axis] + delta;\n\n    if (this.pswp.options.allowPanToNext && dragAxis === 'x' && axis === 'x' && !isMultitouch) {\n      const currSlideMainScrollX = mainScroll.getCurrSlideX(); // Position of the main scroll relative to the viewport\n\n      const mainScrollShiftDiff = mainScroll.x - currSlideMainScrollX;\n      const isLeftToRight = delta > 0;\n      const isRightToLeft = !isLeftToRight;\n\n      if (newPan > bounds.min[axis] && isLeftToRight) {\n        // Panning from left to right, beyond the left edge\n        // Wether the image was at minimum pan position (or less)\n        // when this drag gesture started.\n        // Minimum pan position refers to the left edge of the image.\n        const wasAtMinPanPosition = bounds.min[axis] <= this.startPan[axis];\n\n        if (wasAtMinPanPosition) {\n          mainScroll.moveTo(newMainScrollX, true);\n          return true;\n        } else {\n          this._setPanWithFriction(axis, newPan); //currSlide.pan[axis] = newPan;\n\n        }\n      } else if (newPan < bounds.max[axis] && isRightToLeft) {\n        // Paning from right to left, beyond the right edge\n        // Maximum pan position refers to the right edge of the image.\n        const wasAtMaxPanPosition = this.startPan[axis] <= bounds.max[axis];\n\n        if (wasAtMaxPanPosition) {\n          mainScroll.moveTo(newMainScrollX, true);\n          return true;\n        } else {\n          this._setPanWithFriction(axis, newPan); //currSlide.pan[axis] = newPan;\n\n        }\n      } else {\n        // If main scroll is shifted\n        if (mainScrollShiftDiff !== 0) {\n          // If main scroll is shifted right\n          if (mainScrollShiftDiff > 0\n          /*&& isRightToLeft*/\n          ) {\n            mainScroll.moveTo(Math.max(newMainScrollX, currSlideMainScrollX), true);\n            return true;\n          } else if (mainScrollShiftDiff < 0\n          /*&& isLeftToRight*/\n          ) {\n            // Main scroll is shifted left (Position is less than 0 comparing to the viewport 0)\n            mainScroll.moveTo(Math.min(newMainScrollX, currSlideMainScrollX), true);\n            return true;\n          }\n        } else {\n          // We are within pan bounds, so just pan\n          this._setPanWithFriction(axis, newPan);\n        }\n      }\n    } else {\n      if (axis === 'y') {\n        // Do not pan vertically if main scroll is shifted o\n        if (!mainScroll.isShifted() && bounds.min.y !== bounds.max.y) {\n          this._setPanWithFriction(axis, newPan);\n        }\n      } else {\n        this._setPanWithFriction(axis, newPan);\n      }\n    }\n\n    return false;\n  } // If we move above - the ratio is negative\n  // If we move below the ratio is positive\n\n  /**\r\n   * Relation between pan Y position and third of viewport height.\r\n   *\r\n   * When we are at initial position (center bounds) - the ratio is 0,\r\n   * if position is shifted upwards - the ratio is negative,\r\n   * if position is shifted downwards - the ratio is positive.\r\n   *\r\n   * @private\r\n   * @param {number} panY The current pan Y position.\r\n   * @returns {number}\r\n   */\n\n\n  _getVerticalDragRatio(panY) {\n    var _this$pswp$currSlide$, _this$pswp$currSlide;\n\n    return (panY - ((_this$pswp$currSlide$ = (_this$pswp$currSlide = this.pswp.currSlide) === null || _this$pswp$currSlide === void 0 ? void 0 : _this$pswp$currSlide.bounds.center.y) !== null && _this$pswp$currSlide$ !== void 0 ? _this$pswp$currSlide$ : 0)) / (this.pswp.viewportSize.y / 3);\n  }\n  /**\r\n   * Set pan position of the current slide.\r\n   * Apply friction if the position is beyond the pan bounds,\r\n   * or if custom friction is defined.\r\n   *\r\n   * @private\r\n   * @param {'x' | 'y'} axis\r\n   * @param {number} potentialPan\r\n   * @param {number} [customFriction] (0.1 - 1)\r\n   */\n\n\n  _setPanWithFriction(axis, potentialPan, customFriction) {\n    const {\n      currSlide\n    } = this.pswp;\n\n    if (!currSlide) {\n      return;\n    }\n\n    const {\n      pan,\n      bounds\n    } = currSlide;\n    const correctedPan = bounds.correctPan(axis, potentialPan); // If we are out of pan bounds\n\n    if (correctedPan !== potentialPan || customFriction) {\n      const delta = Math.round(potentialPan - pan[axis]);\n      pan[axis] += delta * (customFriction || PAN_END_FRICTION);\n    } else {\n      pan[axis] = potentialPan;\n    }\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('./gestures.js').default} Gestures */\n\nconst UPPER_ZOOM_FRICTION = 0.05;\nconst LOWER_ZOOM_FRICTION = 0.15;\n/**\r\n * Get center point between two points\r\n *\r\n * @param {Point} p\r\n * @param {Point} p1\r\n * @param {Point} p2\r\n * @returns {Point}\r\n */\n\nfunction getZoomPointsCenter(p, p1, p2) {\n  p.x = (p1.x + p2.x) / 2;\n  p.y = (p1.y + p2.y) / 2;\n  return p;\n}\n\nclass ZoomHandler {\n  /**\r\n   * @param {Gestures} gestures\r\n   */\n  constructor(gestures) {\n    this.gestures = gestures;\n    /**\r\n     * @private\r\n     * @type {Point}\r\n     */\n\n    this._startPan = {\n      x: 0,\n      y: 0\n    };\n    /**\r\n     * @private\r\n     * @type {Point}\r\n     */\n\n    this._startZoomPoint = {\n      x: 0,\n      y: 0\n    };\n    /**\r\n     * @private\r\n     * @type {Point}\r\n     */\n\n    this._zoomPoint = {\n      x: 0,\n      y: 0\n    };\n    /** @private */\n\n    this._wasOverFitZoomLevel = false;\n    /** @private */\n\n    this._startZoomLevel = 1;\n  }\n\n  start() {\n    const {\n      currSlide\n    } = this.gestures.pswp;\n\n    if (currSlide) {\n      this._startZoomLevel = currSlide.currZoomLevel;\n      equalizePoints(this._startPan, currSlide.pan);\n    }\n\n    this.gestures.pswp.animations.stopAllPan();\n    this._wasOverFitZoomLevel = false;\n  }\n\n  change() {\n    const {\n      p1,\n      startP1,\n      p2,\n      startP2,\n      pswp\n    } = this.gestures;\n    const {\n      currSlide\n    } = pswp;\n\n    if (!currSlide) {\n      return;\n    }\n\n    const minZoomLevel = currSlide.zoomLevels.min;\n    const maxZoomLevel = currSlide.zoomLevels.max;\n\n    if (!currSlide.isZoomable() || pswp.mainScroll.isShifted()) {\n      return;\n    }\n\n    getZoomPointsCenter(this._startZoomPoint, startP1, startP2);\n    getZoomPointsCenter(this._zoomPoint, p1, p2);\n\n    let currZoomLevel = 1 / getDistanceBetween(startP1, startP2) * getDistanceBetween(p1, p2) * this._startZoomLevel; // slightly over the zoom.fit\n\n\n    if (currZoomLevel > currSlide.zoomLevels.initial + currSlide.zoomLevels.initial / 15) {\n      this._wasOverFitZoomLevel = true;\n    }\n\n    if (currZoomLevel < minZoomLevel) {\n      if (pswp.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= currSlide.zoomLevels.initial) {\n        // fade out background if zooming out\n        const bgOpacity = 1 - (minZoomLevel - currZoomLevel) / (minZoomLevel / 1.2);\n\n        if (!pswp.dispatch('pinchClose', {\n          bgOpacity\n        }).defaultPrevented) {\n          pswp.applyBgOpacity(bgOpacity);\n        }\n      } else {\n        // Apply the friction if zoom level is below the min\n        currZoomLevel = minZoomLevel - (minZoomLevel - currZoomLevel) * LOWER_ZOOM_FRICTION;\n      }\n    } else if (currZoomLevel > maxZoomLevel) {\n      // Apply the friction if zoom level is above the max\n      currZoomLevel = maxZoomLevel + (currZoomLevel - maxZoomLevel) * UPPER_ZOOM_FRICTION;\n    }\n\n    currSlide.pan.x = this._calculatePanForZoomLevel('x', currZoomLevel);\n    currSlide.pan.y = this._calculatePanForZoomLevel('y', currZoomLevel);\n    currSlide.setZoomLevel(currZoomLevel);\n    currSlide.applyCurrentZoomPan();\n  }\n\n  end() {\n    const {\n      pswp\n    } = this.gestures;\n    const {\n      currSlide\n    } = pswp;\n\n    if ((!currSlide || currSlide.currZoomLevel < currSlide.zoomLevels.initial) && !this._wasOverFitZoomLevel && pswp.options.pinchToClose) {\n      pswp.close();\n    } else {\n      this.correctZoomPan();\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {'x' | 'y'} axis\r\n   * @param {number} currZoomLevel\r\n   * @returns {number}\r\n   */\n\n\n  _calculatePanForZoomLevel(axis, currZoomLevel) {\n    const zoomFactor = currZoomLevel / this._startZoomLevel;\n    return this._zoomPoint[axis] - (this._startZoomPoint[axis] - this._startPan[axis]) * zoomFactor;\n  }\n  /**\r\n   * Correct currZoomLevel and pan if they are\r\n   * beyond minimum or maximum values.\r\n   * With animation.\r\n   *\r\n   * @param {boolean} [ignoreGesture]\r\n   * Wether gesture coordinates should be ignored when calculating destination pan position.\r\n   */\n\n\n  correctZoomPan(ignoreGesture) {\n    const {\n      pswp\n    } = this.gestures;\n    const {\n      currSlide\n    } = pswp;\n\n    if (!(currSlide !== null && currSlide !== void 0 && currSlide.isZoomable())) {\n      return;\n    }\n\n    if (this._zoomPoint.x === 0) {\n      ignoreGesture = true;\n    }\n\n    const prevZoomLevel = currSlide.currZoomLevel;\n    /** @type {number} */\n\n    let destinationZoomLevel;\n    let currZoomLevelNeedsChange = true;\n\n    if (prevZoomLevel < currSlide.zoomLevels.initial) {\n      destinationZoomLevel = currSlide.zoomLevels.initial; // zoom to min\n    } else if (prevZoomLevel > currSlide.zoomLevels.max) {\n      destinationZoomLevel = currSlide.zoomLevels.max; // zoom to max\n    } else {\n      currZoomLevelNeedsChange = false;\n      destinationZoomLevel = prevZoomLevel;\n    }\n\n    const initialBgOpacity = pswp.bgOpacity;\n    const restoreBgOpacity = pswp.bgOpacity < 1;\n    const initialPan = equalizePoints({\n      x: 0,\n      y: 0\n    }, currSlide.pan);\n    let destinationPan = equalizePoints({\n      x: 0,\n      y: 0\n    }, initialPan);\n\n    if (ignoreGesture) {\n      this._zoomPoint.x = 0;\n      this._zoomPoint.y = 0;\n      this._startZoomPoint.x = 0;\n      this._startZoomPoint.y = 0;\n      this._startZoomLevel = prevZoomLevel;\n      equalizePoints(this._startPan, initialPan);\n    }\n\n    if (currZoomLevelNeedsChange) {\n      destinationPan = {\n        x: this._calculatePanForZoomLevel('x', destinationZoomLevel),\n        y: this._calculatePanForZoomLevel('y', destinationZoomLevel)\n      };\n    } // set zoom level, so pan bounds are updated according to it\n\n\n    currSlide.setZoomLevel(destinationZoomLevel);\n    destinationPan = {\n      x: currSlide.bounds.correctPan('x', destinationPan.x),\n      y: currSlide.bounds.correctPan('y', destinationPan.y)\n    }; // return zoom level and its bounds to initial\n\n    currSlide.setZoomLevel(prevZoomLevel);\n    const panNeedsChange = !pointsEqual(destinationPan, initialPan);\n\n    if (!panNeedsChange && !currZoomLevelNeedsChange && !restoreBgOpacity) {\n      // update resolution after gesture\n      currSlide._setResolution(destinationZoomLevel);\n\n      currSlide.applyCurrentZoomPan(); // nothing to animate\n\n      return;\n    }\n\n    pswp.animations.stopAllPan();\n    pswp.animations.startSpring({\n      isPan: true,\n      start: 0,\n      end: 1000,\n      velocity: 0,\n      dampingRatio: 1,\n      naturalFrequency: 40,\n      onUpdate: now => {\n        now /= 1000; // 0 - start, 1 - end\n\n        if (panNeedsChange || currZoomLevelNeedsChange) {\n          if (panNeedsChange) {\n            currSlide.pan.x = initialPan.x + (destinationPan.x - initialPan.x) * now;\n            currSlide.pan.y = initialPan.y + (destinationPan.y - initialPan.y) * now;\n          }\n\n          if (currZoomLevelNeedsChange) {\n            const newZoomLevel = prevZoomLevel + (destinationZoomLevel - prevZoomLevel) * now;\n            currSlide.setZoomLevel(newZoomLevel);\n          }\n\n          currSlide.applyCurrentZoomPan();\n        } // Restore background opacity\n\n\n        if (restoreBgOpacity && pswp.bgOpacity < 1) {\n          // We clamp opacity to keep it between 0 and 1.\n          // As progress ratio can be larger than 1 due to overshoot,\n          // and we do not want to bounce opacity.\n          pswp.applyBgOpacity(clamp(initialBgOpacity + (1 - initialBgOpacity) * now, 0, 1));\n        }\n      },\n      onComplete: () => {\n        // update resolution after transition ends\n        currSlide._setResolution(destinationZoomLevel);\n\n        currSlide.applyCurrentZoomPan();\n      }\n    });\n  }\n\n}\n\n/**\r\n * @template {string} T\r\n * @template {string} P\r\n * @typedef {import('../types.js').AddPostfix<T, P>} AddPostfix<T, P>\r\n */\n\n/** @typedef {import('./gestures.js').default} Gestures */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {'imageClick' | 'bgClick' | 'tap' | 'doubleTap'} Actions */\n\n/**\r\n * Whether the tap was performed on the main slide\r\n * (rather than controls or caption).\r\n *\r\n * @param {PointerEvent} event\r\n * @returns {boolean}\r\n */\nfunction didTapOnMainContent(event) {\n  return !!\n  /** @type {HTMLElement} */\n  event.target.closest('.pswp__container');\n}\n/**\r\n * Tap, double-tap handler.\r\n */\n\n\nclass TapHandler {\n  /**\r\n   * @param {Gestures} gestures\r\n   */\n  constructor(gestures) {\n    this.gestures = gestures;\n  }\n  /**\r\n   * @param {Point} point\r\n   * @param {PointerEvent} originalEvent\r\n   */\n\n\n  click(point, originalEvent) {\n    const targetClassList =\n    /** @type {HTMLElement} */\n    originalEvent.target.classList;\n    const isImageClick = targetClassList.contains('pswp__img');\n    const isBackgroundClick = targetClassList.contains('pswp__item') || targetClassList.contains('pswp__zoom-wrap');\n\n    if (isImageClick) {\n      this._doClickOrTapAction('imageClick', point, originalEvent);\n    } else if (isBackgroundClick) {\n      this._doClickOrTapAction('bgClick', point, originalEvent);\n    }\n  }\n  /**\r\n   * @param {Point} point\r\n   * @param {PointerEvent} originalEvent\r\n   */\n\n\n  tap(point, originalEvent) {\n    if (didTapOnMainContent(originalEvent)) {\n      this._doClickOrTapAction('tap', point, originalEvent);\n    }\n  }\n  /**\r\n   * @param {Point} point\r\n   * @param {PointerEvent} originalEvent\r\n   */\n\n\n  doubleTap(point, originalEvent) {\n    if (didTapOnMainContent(originalEvent)) {\n      this._doClickOrTapAction('doubleTap', point, originalEvent);\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {Actions} actionName\r\n   * @param {Point} point\r\n   * @param {PointerEvent} originalEvent\r\n   */\n\n\n  _doClickOrTapAction(actionName, point, originalEvent) {\n    var _this$gestures$pswp$e;\n\n    const {\n      pswp\n    } = this.gestures;\n    const {\n      currSlide\n    } = pswp;\n    const actionFullName =\n    /** @type {AddPostfix<Actions, 'Action'>} */\n    actionName + 'Action';\n    const optionValue = pswp.options[actionFullName];\n\n    if (pswp.dispatch(actionFullName, {\n      point,\n      originalEvent\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (typeof optionValue === 'function') {\n      optionValue.call(pswp, point, originalEvent);\n      return;\n    }\n\n    switch (optionValue) {\n      case 'close':\n      case 'next':\n        pswp[optionValue]();\n        break;\n\n      case 'zoom':\n        currSlide === null || currSlide === void 0 || currSlide.toggleZoom(point);\n        break;\n\n      case 'zoom-or-close':\n        // by default click zooms current image,\n        // if it can not be zoomed - gallery will be closed\n        if (currSlide !== null && currSlide !== void 0 && currSlide.isZoomable() && currSlide.zoomLevels.secondary !== currSlide.zoomLevels.initial) {\n          currSlide.toggleZoom(point);\n        } else if (pswp.options.clickToCloseNonZoomable) {\n          pswp.close();\n        }\n\n        break;\n\n      case 'toggle-controls':\n        (_this$gestures$pswp$e = this.gestures.pswp.element) === null || _this$gestures$pswp$e === void 0 || _this$gestures$pswp$e.classList.toggle('pswp--ui-visible'); // if (_controlsVisible) {\n        //   _ui.hideControls();\n        // } else {\n        //   _ui.showControls();\n        // }\n\n        break;\n    }\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n// How far should user should drag\n// until we can determine that the gesture is swipe and its direction\n\nconst AXIS_SWIPE_HYSTERISIS = 10; //const PAN_END_FRICTION = 0.35;\n\nconst DOUBLE_TAP_DELAY = 300; // ms\n\nconst MIN_TAP_DISTANCE = 25; // px\n\n/**\r\n * Gestures class bind touch, pointer or mouse events\r\n * and emits drag to drag-handler and zoom events zoom-handler.\r\n *\r\n * Drag and zoom events are emited in requestAnimationFrame,\r\n * and only when one of pointers was actually changed.\r\n */\n\nclass Gestures {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp;\n    /** @type {'x' | 'y' | null} */\n\n    this.dragAxis = null; // point objects are defined once and reused\n    // PhotoSwipe keeps track only of two pointers, others are ignored\n\n    /** @type {Point} */\n\n    this.p1 = {\n      x: 0,\n      y: 0\n    }; // the first pressed pointer\n\n    /** @type {Point} */\n\n    this.p2 = {\n      x: 0,\n      y: 0\n    }; // the second pressed pointer\n\n    /** @type {Point} */\n\n    this.prevP1 = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point} */\n\n    this.prevP2 = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point} */\n\n    this.startP1 = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point} */\n\n    this.startP2 = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point} */\n\n    this.velocity = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point}\r\n     * @private\r\n     */\n\n    this._lastStartP1 = {\n      x: 0,\n      y: 0\n    };\n    /** @type {Point}\r\n     * @private\r\n     */\n\n    this._intervalP1 = {\n      x: 0,\n      y: 0\n    };\n    /** @private */\n\n    this._numActivePoints = 0;\n    /** @type {Point[]}\r\n     * @private\r\n     */\n\n    this._ongoingPointers = [];\n    /** @private */\n\n    this._touchEventEnabled = 'ontouchstart' in window;\n    /** @private */\n\n    this._pointerEventEnabled = !!window.PointerEvent;\n    this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1;\n    /** @private */\n\n    this._numActivePoints = 0;\n    /** @private */\n\n    this._intervalTime = 0;\n    /** @private */\n\n    this._velocityCalculated = false;\n    this.isMultitouch = false;\n    this.isDragging = false;\n    this.isZooming = false;\n    /** @type {number | null} */\n\n    this.raf = null;\n    /** @type {NodeJS.Timeout | null}\r\n     * @private\r\n     */\n\n    this._tapTimer = null;\n\n    if (!this.supportsTouch) {\n      // disable pan to next slide for non-touch devices\n      pswp.options.allowPanToNext = false;\n    }\n\n    this.drag = new DragHandler(this);\n    this.zoomLevels = new ZoomHandler(this);\n    this.tapHandler = new TapHandler(this);\n    pswp.on('bindEvents', () => {\n      pswp.events.add(pswp.scrollWrap, 'click',\n      /** @type EventListener */\n      this._onClick.bind(this));\n\n      if (this._pointerEventEnabled) {\n        this._bindEvents('pointer', 'down', 'up', 'cancel');\n      } else if (this._touchEventEnabled) {\n        this._bindEvents('touch', 'start', 'end', 'cancel'); // In previous versions we also bound mouse event here,\n        // in case device supports both touch and mouse events,\n        // but newer versions of browsers now support PointerEvent.\n        // on iOS10 if you bind touchmove/end after touchstart,\n        // and you don't preventDefault touchstart (which PhotoSwipe does),\n        // preventDefault will have no effect on touchmove and touchend.\n        // Unless you bind it previously.\n\n\n        if (pswp.scrollWrap) {\n          pswp.scrollWrap.ontouchmove = () => {};\n\n          pswp.scrollWrap.ontouchend = () => {};\n        }\n      } else {\n        this._bindEvents('mouse', 'down', 'up');\n      }\n    });\n  }\n  /**\r\n   * @private\r\n   * @param {'mouse' | 'touch' | 'pointer'} pref\r\n   * @param {'down' | 'start'} down\r\n   * @param {'up' | 'end'} up\r\n   * @param {'cancel'} [cancel]\r\n   */\n\n\n  _bindEvents(pref, down, up, cancel) {\n    const {\n      pswp\n    } = this;\n    const {\n      events\n    } = pswp;\n    const cancelEvent = cancel ? pref + cancel : '';\n    events.add(pswp.scrollWrap, pref + down,\n    /** @type EventListener */\n    this.onPointerDown.bind(this));\n    events.add(window, pref + 'move',\n    /** @type EventListener */\n    this.onPointerMove.bind(this));\n    events.add(window, pref + up,\n    /** @type EventListener */\n    this.onPointerUp.bind(this));\n\n    if (cancelEvent) {\n      events.add(pswp.scrollWrap, cancelEvent,\n      /** @type EventListener */\n      this.onPointerUp.bind(this));\n    }\n  }\n  /**\r\n   * @param {PointerEvent} e\r\n   */\n\n\n  onPointerDown(e) {\n    // We do not call preventDefault for touch events\n    // to allow browser to show native dialog on longpress\n    // (the one that allows to save image or open it in new tab).\n    //\n    // Desktop Safari allows to drag images when preventDefault isn't called on mousedown,\n    // even though preventDefault IS called on mousemove. That's why we preventDefault mousedown.\n    const isMousePointer = e.type === 'mousedown' || e.pointerType === 'mouse'; // Allow dragging only via left mouse button.\n    // http://www.quirksmode.org/js/events_properties.html\n    // https://developer.mozilla.org/en-US/docs/Web/API/event.button\n\n    if (isMousePointer && e.button > 0) {\n      return;\n    }\n\n    const {\n      pswp\n    } = this; // if PhotoSwipe is opening or closing\n\n    if (!pswp.opener.isOpen) {\n      e.preventDefault();\n      return;\n    }\n\n    if (pswp.dispatch('pointerDown', {\n      originalEvent: e\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (isMousePointer) {\n      pswp.mouseDetected(); // preventDefault mouse event to prevent\n      // browser image drag feature\n\n      this._preventPointerEventBehaviour(e, 'down');\n    }\n\n    pswp.animations.stopAll();\n\n    this._updatePoints(e, 'down');\n\n    if (this._numActivePoints === 1) {\n      this.dragAxis = null; // we need to store initial point to determine the main axis,\n      // drag is activated only after the axis is determined\n\n      equalizePoints(this.startP1, this.p1);\n    }\n\n    if (this._numActivePoints > 1) {\n      // Tap or double tap should not trigger if more than one pointer\n      this._clearTapTimer();\n\n      this.isMultitouch = true;\n    } else {\n      this.isMultitouch = false;\n    }\n  }\n  /**\r\n   * @param {PointerEvent} e\r\n   */\n\n\n  onPointerMove(e) {\n    this._preventPointerEventBehaviour(e, 'move');\n\n    if (!this._numActivePoints) {\n      return;\n    }\n\n    this._updatePoints(e, 'move');\n\n    if (this.pswp.dispatch('pointerMove', {\n      originalEvent: e\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (this._numActivePoints === 1 && !this.isDragging) {\n      if (!this.dragAxis) {\n        this._calculateDragDirection();\n      } // Drag axis was detected, emit drag.start\n\n\n      if (this.dragAxis && !this.isDragging) {\n        if (this.isZooming) {\n          this.isZooming = false;\n          this.zoomLevels.end();\n        }\n\n        this.isDragging = true;\n\n        this._clearTapTimer(); // Tap can not trigger after drag\n        // Adjust starting point\n\n\n        this._updateStartPoints();\n\n        this._intervalTime = Date.now(); //this._startTime = this._intervalTime;\n\n        this._velocityCalculated = false;\n        equalizePoints(this._intervalP1, this.p1);\n        this.velocity.x = 0;\n        this.velocity.y = 0;\n        this.drag.start();\n\n        this._rafStopLoop();\n\n        this._rafRenderLoop();\n      }\n    } else if (this._numActivePoints > 1 && !this.isZooming) {\n      this._finishDrag();\n\n      this.isZooming = true; // Adjust starting points\n\n      this._updateStartPoints();\n\n      this.zoomLevels.start();\n\n      this._rafStopLoop();\n\n      this._rafRenderLoop();\n    }\n  }\n  /**\r\n   * @private\r\n   */\n\n\n  _finishDrag() {\n    if (this.isDragging) {\n      this.isDragging = false; // Try to calculate velocity,\n      // if it wasn't calculated yet in drag.change\n\n      if (!this._velocityCalculated) {\n        this._updateVelocity(true);\n      }\n\n      this.drag.end();\n      this.dragAxis = null;\n    }\n  }\n  /**\r\n   * @param {PointerEvent} e\r\n   */\n\n\n  onPointerUp(e) {\n    if (!this._numActivePoints) {\n      return;\n    }\n\n    this._updatePoints(e, 'up');\n\n    if (this.pswp.dispatch('pointerUp', {\n      originalEvent: e\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (this._numActivePoints === 0) {\n      this._rafStopLoop();\n\n      if (this.isDragging) {\n        this._finishDrag();\n      } else if (!this.isZooming && !this.isMultitouch) {\n        //this.zoomLevels.correctZoomPan();\n        this._finishTap(e);\n      }\n    }\n\n    if (this._numActivePoints < 2 && this.isZooming) {\n      this.isZooming = false;\n      this.zoomLevels.end();\n\n      if (this._numActivePoints === 1) {\n        // Since we have 1 point left, we need to reinitiate drag\n        this.dragAxis = null;\n\n        this._updateStartPoints();\n      }\n    }\n  }\n  /**\r\n   * @private\r\n   */\n\n\n  _rafRenderLoop() {\n    if (this.isDragging || this.isZooming) {\n      this._updateVelocity();\n\n      if (this.isDragging) {\n        // make sure that pointer moved since the last update\n        if (!pointsEqual(this.p1, this.prevP1)) {\n          this.drag.change();\n        }\n      } else\n        /* if (this.isZooming) */\n        {\n          if (!pointsEqual(this.p1, this.prevP1) || !pointsEqual(this.p2, this.prevP2)) {\n            this.zoomLevels.change();\n          }\n        }\n\n      this._updatePrevPoints();\n\n      this.raf = requestAnimationFrame(this._rafRenderLoop.bind(this));\n    }\n  }\n  /**\r\n   * Update velocity at 50ms interval\r\n   *\r\n   * @private\r\n   * @param {boolean} [force]\r\n   */\n\n\n  _updateVelocity(force) {\n    const time = Date.now();\n    const duration = time - this._intervalTime;\n\n    if (duration < 50 && !force) {\n      return;\n    }\n\n    this.velocity.x = this._getVelocity('x', duration);\n    this.velocity.y = this._getVelocity('y', duration);\n    this._intervalTime = time;\n    equalizePoints(this._intervalP1, this.p1);\n    this._velocityCalculated = true;\n  }\n  /**\r\n   * @private\r\n   * @param {PointerEvent} e\r\n   */\n\n\n  _finishTap(e) {\n    const {\n      mainScroll\n    } = this.pswp; // Do not trigger tap events if main scroll is shifted\n\n    if (mainScroll.isShifted()) {\n      // restore main scroll position\n      // (usually happens if stopped in the middle of animation)\n      mainScroll.moveIndexBy(0, true);\n      return;\n    } // Do not trigger tap for touchcancel or pointercancel\n\n\n    if (e.type.indexOf('cancel') > 0) {\n      return;\n    } // Trigger click instead of tap for mouse events\n\n\n    if (e.type === 'mouseup' || e.pointerType === 'mouse') {\n      this.tapHandler.click(this.startP1, e);\n      return;\n    } // Disable delay if there is no doubleTapAction\n\n\n    const tapDelay = this.pswp.options.doubleTapAction ? DOUBLE_TAP_DELAY : 0; // If tapTimer is defined - we tapped recently,\n    // check if the current tap is close to the previous one,\n    // if yes - trigger double tap\n\n    if (this._tapTimer) {\n      this._clearTapTimer(); // Check if two taps were more or less on the same place\n\n\n      if (getDistanceBetween(this._lastStartP1, this.startP1) < MIN_TAP_DISTANCE) {\n        this.tapHandler.doubleTap(this.startP1, e);\n      }\n    } else {\n      equalizePoints(this._lastStartP1, this.startP1);\n      this._tapTimer = setTimeout(() => {\n        this.tapHandler.tap(this.startP1, e);\n\n        this._clearTapTimer();\n      }, tapDelay);\n    }\n  }\n  /**\r\n   * @private\r\n   */\n\n\n  _clearTapTimer() {\n    if (this._tapTimer) {\n      clearTimeout(this._tapTimer);\n      this._tapTimer = null;\n    }\n  }\n  /**\r\n   * Get velocity for axis\r\n   *\r\n   * @private\r\n   * @param {'x' | 'y'} axis\r\n   * @param {number} duration\r\n   * @returns {number}\r\n   */\n\n\n  _getVelocity(axis, duration) {\n    // displacement is like distance, but can be negative.\n    const displacement = this.p1[axis] - this._intervalP1[axis];\n\n    if (Math.abs(displacement) > 1 && duration > 5) {\n      return displacement / duration;\n    }\n\n    return 0;\n  }\n  /**\r\n   * @private\r\n   */\n\n\n  _rafStopLoop() {\n    if (this.raf) {\n      cancelAnimationFrame(this.raf);\n      this.raf = null;\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {PointerEvent} e\r\n   * @param {'up' | 'down' | 'move'} pointerType Normalized pointer type\r\n   */\n\n\n  _preventPointerEventBehaviour(e, pointerType) {\n    const preventPointerEvent = this.pswp.applyFilters('preventPointerEvent', true, e, pointerType);\n\n    if (preventPointerEvent) {\n      e.preventDefault();\n    }\n  }\n  /**\r\n   * Parses and normalizes points from the touch, mouse or pointer event.\r\n   * Updates p1 and p2.\r\n   *\r\n   * @private\r\n   * @param {PointerEvent | TouchEvent} e\r\n   * @param {'up' | 'down' | 'move'} pointerType Normalized pointer type\r\n   */\n\n\n  _updatePoints(e, pointerType) {\n    if (this._pointerEventEnabled) {\n      const pointerEvent =\n      /** @type {PointerEvent} */\n      e; // Try to find the current pointer in ongoing pointers by its ID\n\n      const pointerIndex = this._ongoingPointers.findIndex(ongoingPointer => {\n        return ongoingPointer.id === pointerEvent.pointerId;\n      });\n\n      if (pointerType === 'up' && pointerIndex > -1) {\n        // release the pointer - remove it from ongoing\n        this._ongoingPointers.splice(pointerIndex, 1);\n      } else if (pointerType === 'down' && pointerIndex === -1) {\n        // add new pointer\n        this._ongoingPointers.push(this._convertEventPosToPoint(pointerEvent, {\n          x: 0,\n          y: 0\n        }));\n      } else if (pointerIndex > -1) {\n        // update existing pointer\n        this._convertEventPosToPoint(pointerEvent, this._ongoingPointers[pointerIndex]);\n      }\n\n      this._numActivePoints = this._ongoingPointers.length; // update points that PhotoSwipe uses\n      // to calculate position and scale\n\n      if (this._numActivePoints > 0) {\n        equalizePoints(this.p1, this._ongoingPointers[0]);\n      }\n\n      if (this._numActivePoints > 1) {\n        equalizePoints(this.p2, this._ongoingPointers[1]);\n      }\n    } else {\n      const touchEvent =\n      /** @type {TouchEvent} */\n      e;\n      this._numActivePoints = 0;\n\n      if (touchEvent.type.indexOf('touch') > -1) {\n        // Touch Event\n        // https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n        if (touchEvent.touches && touchEvent.touches.length > 0) {\n          this._convertEventPosToPoint(touchEvent.touches[0], this.p1);\n\n          this._numActivePoints++;\n\n          if (touchEvent.touches.length > 1) {\n            this._convertEventPosToPoint(touchEvent.touches[1], this.p2);\n\n            this._numActivePoints++;\n          }\n        }\n      } else {\n        // Mouse Event\n        this._convertEventPosToPoint(\n        /** @type {PointerEvent} */\n        e, this.p1);\n\n        if (pointerType === 'up') {\n          // clear all points on mouseup\n          this._numActivePoints = 0;\n        } else {\n          this._numActivePoints++;\n        }\n      }\n    }\n  }\n  /** update points that were used during previous rAF tick\r\n   * @private\r\n   */\n\n\n  _updatePrevPoints() {\n    equalizePoints(this.prevP1, this.p1);\n    equalizePoints(this.prevP2, this.p2);\n  }\n  /** update points at the start of gesture\r\n   * @private\r\n   */\n\n\n  _updateStartPoints() {\n    equalizePoints(this.startP1, this.p1);\n    equalizePoints(this.startP2, this.p2);\n\n    this._updatePrevPoints();\n  }\n  /** @private */\n\n\n  _calculateDragDirection() {\n    if (this.pswp.mainScroll.isShifted()) {\n      // if main scroll position is shifted – direction is always horizontal\n      this.dragAxis = 'x';\n    } else {\n      // calculate delta of the last touchmove tick\n      const diff = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);\n\n      if (diff !== 0) {\n        // check if pointer was shifted horizontally or vertically\n        const axisToCheck = diff > 0 ? 'x' : 'y';\n\n        if (Math.abs(this.p1[axisToCheck] - this.startP1[axisToCheck]) >= AXIS_SWIPE_HYSTERISIS) {\n          this.dragAxis = axisToCheck;\n        }\n      }\n    }\n  }\n  /**\r\n   * Converts touch, pointer or mouse event\r\n   * to PhotoSwipe point.\r\n   *\r\n   * @private\r\n   * @param {Touch | PointerEvent} e\r\n   * @param {Point} p\r\n   * @returns {Point}\r\n   */\n\n\n  _convertEventPosToPoint(e, p) {\n    p.x = e.pageX - this.pswp.offset.x;\n    p.y = e.pageY - this.pswp.offset.y;\n\n    if ('pointerId' in e) {\n      p.id = e.pointerId;\n    } else if (e.identifier !== undefined) {\n      p.id = e.identifier;\n    }\n\n    return p;\n  }\n  /**\r\n   * @private\r\n   * @param {PointerEvent} e\r\n   */\n\n\n  _onClick(e) {\n    // Do not allow click event to pass through after drag\n    if (this.pswp.mainScroll.isShifted()) {\n      e.preventDefault();\n      e.stopPropagation();\n    }\n  }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('./slide/slide.js').default} Slide */\n\n/** @typedef {{ el: HTMLDivElement; slide?: Slide }} ItemHolder */\n\nconst MAIN_SCROLL_END_FRICTION = 0.35; // const MIN_SWIPE_TRANSITION_DURATION = 250;\n// const MAX_SWIPE_TRABSITION_DURATION = 500;\n// const DEFAULT_SWIPE_TRANSITION_DURATION = 333;\n\n/**\r\n * Handles movement of the main scrolling container\r\n * (for example, it repositions when user swipes left or right).\r\n *\r\n * Also stores its state.\r\n */\n\nclass MainScroll {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp;\n    this.x = 0;\n    this.slideWidth = 0;\n    /** @private */\n\n    this._currPositionIndex = 0;\n    /** @private */\n\n    this._prevPositionIndex = 0;\n    /** @private */\n\n    this._containerShiftIndex = -1;\n    /** @type {ItemHolder[]} */\n\n    this.itemHolders = [];\n  }\n  /**\r\n   * Position the scroller and slide containers\r\n   * according to viewport size.\r\n   *\r\n   * @param {boolean} [resizeSlides] Whether slides content should resized\r\n   */\n\n\n  resize(resizeSlides) {\n    const {\n      pswp\n    } = this;\n    const newSlideWidth = Math.round(pswp.viewportSize.x + pswp.viewportSize.x * pswp.options.spacing); // Mobile browsers might trigger a resize event during a gesture.\n    // (due to toolbar appearing or hiding).\n    // Avoid re-adjusting main scroll position if width wasn't changed\n\n    const slideWidthChanged = newSlideWidth !== this.slideWidth;\n\n    if (slideWidthChanged) {\n      this.slideWidth = newSlideWidth;\n      this.moveTo(this.getCurrSlideX());\n    }\n\n    this.itemHolders.forEach((itemHolder, index) => {\n      if (slideWidthChanged) {\n        setTransform(itemHolder.el, (index + this._containerShiftIndex) * this.slideWidth);\n      }\n\n      if (resizeSlides && itemHolder.slide) {\n        itemHolder.slide.resize();\n      }\n    });\n  }\n  /**\r\n   * Reset X position of the main scroller to zero\r\n   */\n\n\n  resetPosition() {\n    // Position on the main scroller (offset)\n    // it is independent from slide index\n    this._currPositionIndex = 0;\n    this._prevPositionIndex = 0; // This will force recalculation of size on next resize()\n\n    this.slideWidth = 0; // _containerShiftIndex*viewportSize will give you amount of transform of the current slide\n\n    this._containerShiftIndex = -1;\n  }\n  /**\r\n   * Create and append array of three items\r\n   * that hold data about slides in DOM\r\n   */\n\n\n  appendHolders() {\n    this.itemHolders = []; // append our three slide holders -\n    // previous, current, and next\n\n    for (let i = 0; i < 3; i++) {\n      const el = createElement('pswp__item', 'div', this.pswp.container);\n      el.setAttribute('role', 'group');\n      el.setAttribute('aria-roledescription', 'slide');\n      el.setAttribute('aria-hidden', 'true'); // hide nearby item holders until initial zoom animation finishes (to avoid extra Paints)\n\n      el.style.display = i === 1 ? 'block' : 'none';\n      this.itemHolders.push({\n        el //index: -1\n\n      });\n    }\n  }\n  /**\r\n   * Whether the main scroll can be horizontally swiped to the next or previous slide.\r\n   * @returns {boolean}\r\n   */\n\n\n  canBeSwiped() {\n    return this.pswp.getNumItems() > 1;\n  }\n  /**\r\n   * Move main scroll by X amount of slides.\r\n   * For example:\r\n   *   `-1` will move to the previous slide,\r\n   *    `0` will reset the scroll position of the current slide,\r\n   *    `3` will move three slides forward\r\n   *\r\n   * If loop option is enabled - index will be automatically looped too,\r\n   * (for example `-1` will move to the last slide of the gallery).\r\n   *\r\n   * @param {number} diff\r\n   * @param {boolean} [animate]\r\n   * @param {number} [velocityX]\r\n   * @returns {boolean} whether index was changed or not\r\n   */\n\n\n  moveIndexBy(diff, animate, velocityX) {\n    const {\n      pswp\n    } = this;\n    let newIndex = pswp.potentialIndex + diff;\n    const numSlides = pswp.getNumItems();\n\n    if (pswp.canLoop()) {\n      newIndex = pswp.getLoopedIndex(newIndex);\n      const distance = (diff + numSlides) % numSlides;\n\n      if (distance <= numSlides / 2) {\n        // go forward\n        diff = distance;\n      } else {\n        // go backwards\n        diff = distance - numSlides;\n      }\n    } else {\n      if (newIndex < 0) {\n        newIndex = 0;\n      } else if (newIndex >= numSlides) {\n        newIndex = numSlides - 1;\n      }\n\n      diff = newIndex - pswp.potentialIndex;\n    }\n\n    pswp.potentialIndex = newIndex;\n    this._currPositionIndex -= diff;\n    pswp.animations.stopMainScroll();\n    const destinationX = this.getCurrSlideX();\n\n    if (!animate) {\n      this.moveTo(destinationX);\n      this.updateCurrItem();\n    } else {\n      pswp.animations.startSpring({\n        isMainScroll: true,\n        start: this.x,\n        end: destinationX,\n        velocity: velocityX || 0,\n        naturalFrequency: 30,\n        dampingRatio: 1,\n        //0.7,\n        onUpdate: x => {\n          this.moveTo(x);\n        },\n        onComplete: () => {\n          this.updateCurrItem();\n          pswp.appendHeavy();\n        }\n      });\n      let currDiff = pswp.potentialIndex - pswp.currIndex;\n\n      if (pswp.canLoop()) {\n        const currDistance = (currDiff + numSlides) % numSlides;\n\n        if (currDistance <= numSlides / 2) {\n          // go forward\n          currDiff = currDistance;\n        } else {\n          // go backwards\n          currDiff = currDistance - numSlides;\n        }\n      } // Force-append new slides during transition\n      // if difference between slides is more than 1\n\n\n      if (Math.abs(currDiff) > 1) {\n        this.updateCurrItem();\n      }\n    }\n\n    return Boolean(diff);\n  }\n  /**\r\n   * X position of the main scroll for the current slide\r\n   * (ignores position during dragging)\r\n   * @returns {number}\r\n   */\n\n\n  getCurrSlideX() {\n    return this.slideWidth * this._currPositionIndex;\n  }\n  /**\r\n   * Whether scroll position is shifted.\r\n   * For example, it will return true if the scroll is being dragged or animated.\r\n   * @returns {boolean}\r\n   */\n\n\n  isShifted() {\n    return this.x !== this.getCurrSlideX();\n  }\n  /**\r\n   * Update slides X positions and set their content\r\n   */\n\n\n  updateCurrItem() {\n    var _this$itemHolders$;\n\n    const {\n      pswp\n    } = this;\n    const positionDifference = this._prevPositionIndex - this._currPositionIndex;\n\n    if (!positionDifference) {\n      return;\n    }\n\n    this._prevPositionIndex = this._currPositionIndex;\n    pswp.currIndex = pswp.potentialIndex;\n    let diffAbs = Math.abs(positionDifference);\n    /** @type {ItemHolder | undefined} */\n\n    let tempHolder;\n\n    if (diffAbs >= 3) {\n      this._containerShiftIndex += positionDifference + (positionDifference > 0 ? -3 : 3);\n      diffAbs = 3; // If slides are changed by 3 screens or more - clean up previous slides\n\n      this.itemHolders.forEach(itemHolder => {\n        var _itemHolder$slide;\n\n        (_itemHolder$slide = itemHolder.slide) === null || _itemHolder$slide === void 0 || _itemHolder$slide.destroy();\n        itemHolder.slide = undefined;\n      });\n    }\n\n    for (let i = 0; i < diffAbs; i++) {\n      if (positionDifference > 0) {\n        tempHolder = this.itemHolders.shift();\n\n        if (tempHolder) {\n          this.itemHolders[2] = tempHolder; // move first to last\n\n          this._containerShiftIndex++;\n          setTransform(tempHolder.el, (this._containerShiftIndex + 2) * this.slideWidth);\n          pswp.setContent(tempHolder, pswp.currIndex - diffAbs + i + 2);\n        }\n      } else {\n        tempHolder = this.itemHolders.pop();\n\n        if (tempHolder) {\n          this.itemHolders.unshift(tempHolder); // move last to first\n\n          this._containerShiftIndex--;\n          setTransform(tempHolder.el, this._containerShiftIndex * this.slideWidth);\n          pswp.setContent(tempHolder, pswp.currIndex + diffAbs - i - 2);\n        }\n      }\n    } // Reset transfrom every 50ish navigations in one direction.\n    //\n    // Otherwise transform will keep growing indefinitely,\n    // which might cause issues as browsers have a maximum transform limit.\n    // I wasn't able to reach it, but just to be safe.\n    // This should not cause noticable lag.\n\n\n    if (Math.abs(this._containerShiftIndex) > 50 && !this.isShifted()) {\n      this.resetPosition();\n      this.resize();\n    } // Pan transition might be running (and consntantly updating pan position)\n\n\n    pswp.animations.stopAllPan();\n    this.itemHolders.forEach((itemHolder, i) => {\n      if (itemHolder.slide) {\n        // Slide in the 2nd holder is always active\n        itemHolder.slide.setIsActive(i === 1);\n      }\n    });\n    pswp.currSlide = (_this$itemHolders$ = this.itemHolders[1]) === null || _this$itemHolders$ === void 0 ? void 0 : _this$itemHolders$.slide;\n    pswp.contentLoader.updateLazy(positionDifference);\n\n    if (pswp.currSlide) {\n      pswp.currSlide.applyCurrentZoomPan();\n    }\n\n    pswp.dispatch('change');\n  }\n  /**\r\n   * Move the X position of the main scroll container\r\n   *\r\n   * @param {number} x\r\n   * @param {boolean} [dragging]\r\n   */\n\n\n  moveTo(x, dragging) {\n    if (!this.pswp.canLoop() && dragging) {\n      // Apply friction\n      let newSlideIndexOffset = (this.slideWidth * this._currPositionIndex - x) / this.slideWidth;\n      newSlideIndexOffset += this.pswp.currIndex;\n      const delta = Math.round(x - this.x);\n\n      if (newSlideIndexOffset < 0 && delta > 0 || newSlideIndexOffset >= this.pswp.getNumItems() - 1 && delta < 0) {\n        x = this.x + delta * MAIN_SCROLL_END_FRICTION;\n      }\n    }\n\n    this.x = x;\n\n    if (this.pswp.container) {\n      setTransform(this.pswp.container, x);\n    }\n\n    this.pswp.dispatch('moveMainScroll', {\n      x,\n      dragging: dragging !== null && dragging !== void 0 ? dragging : false\n    });\n  }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/**\r\n * @template T\r\n * @typedef {import('./types.js').Methods<T>} Methods<T>\r\n */\n\nconst KeyboardKeyCodesMap = {\n  Escape: 27,\n  z: 90,\n  ArrowLeft: 37,\n  ArrowUp: 38,\n  ArrowRight: 39,\n  ArrowDown: 40,\n  Tab: 9\n};\n/**\r\n * @template {keyof KeyboardKeyCodesMap} T\r\n * @param {T} key\r\n * @param {boolean} isKeySupported\r\n * @returns {T | number | undefined}\r\n */\n\nconst getKeyboardEventKey = (key, isKeySupported) => {\n  return isKeySupported ? key : KeyboardKeyCodesMap[key];\n};\n/**\r\n * - Manages keyboard shortcuts.\r\n * - Helps trap focus within photoswipe.\r\n */\n\n\nclass Keyboard {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp;\n    /** @private */\n\n    this._wasFocused = false;\n    pswp.on('bindEvents', () => {\n      if (pswp.options.trapFocus) {\n        // Dialog was likely opened by keyboard if initial point is not defined\n        if (!pswp.options.initialPointerPos) {\n          // focus causes layout,\n          // which causes lag during the animation,\n          // that's why we delay it until the opener transition ends\n          this._focusRoot();\n        }\n\n        pswp.events.add(document, 'focusin',\n        /** @type EventListener */\n        this._onFocusIn.bind(this));\n      }\n\n      pswp.events.add(document, 'keydown',\n      /** @type EventListener */\n      this._onKeyDown.bind(this));\n    });\n    const lastActiveElement =\n    /** @type {HTMLElement} */\n    document.activeElement;\n    pswp.on('destroy', () => {\n      if (pswp.options.returnFocus && lastActiveElement && this._wasFocused) {\n        lastActiveElement.focus();\n      }\n    });\n  }\n  /** @private */\n\n\n  _focusRoot() {\n    if (!this._wasFocused && this.pswp.element) {\n      this.pswp.element.focus();\n      this._wasFocused = true;\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {KeyboardEvent} e\r\n   */\n\n\n  _onKeyDown(e) {\n    const {\n      pswp\n    } = this;\n\n    if (pswp.dispatch('keydown', {\n      originalEvent: e\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (specialKeyUsed(e)) {\n      // don't do anything if special key pressed\n      // to prevent from overriding default browser actions\n      // for example, in Chrome on Mac cmd+arrow-left returns to previous page\n      return;\n    }\n    /** @type {Methods<PhotoSwipe> | undefined} */\n\n\n    let keydownAction;\n    /** @type {'x' | 'y' | undefined} */\n\n    let axis;\n    let isForward = false;\n    const isKeySupported = ('key' in e);\n\n    switch (isKeySupported ? e.key : e.keyCode) {\n      case getKeyboardEventKey('Escape', isKeySupported):\n        if (pswp.options.escKey) {\n          keydownAction = 'close';\n        }\n\n        break;\n\n      case getKeyboardEventKey('z', isKeySupported):\n        keydownAction = 'toggleZoom';\n        break;\n\n      case getKeyboardEventKey('ArrowLeft', isKeySupported):\n        axis = 'x';\n        break;\n\n      case getKeyboardEventKey('ArrowUp', isKeySupported):\n        axis = 'y';\n        break;\n\n      case getKeyboardEventKey('ArrowRight', isKeySupported):\n        axis = 'x';\n        isForward = true;\n        break;\n\n      case getKeyboardEventKey('ArrowDown', isKeySupported):\n        isForward = true;\n        axis = 'y';\n        break;\n\n      case getKeyboardEventKey('Tab', isKeySupported):\n        this._focusRoot();\n\n        break;\n    } // if left/right/top/bottom key\n\n\n    if (axis) {\n      // prevent page scroll\n      e.preventDefault();\n      const {\n        currSlide\n      } = pswp;\n\n      if (pswp.options.arrowKeys && axis === 'x' && pswp.getNumItems() > 1) {\n        keydownAction = isForward ? 'next' : 'prev';\n      } else if (currSlide && currSlide.currZoomLevel > currSlide.zoomLevels.fit) {\n        // up/down arrow keys pan the image vertically\n        // left/right arrow keys pan horizontally.\n        // Unless there is only one image,\n        // or arrowKeys option is disabled\n        currSlide.pan[axis] += isForward ? -80 : 80;\n        currSlide.panTo(currSlide.pan.x, currSlide.pan.y);\n      }\n    }\n\n    if (keydownAction) {\n      e.preventDefault(); // @ts-ignore\n\n      pswp[keydownAction]();\n    }\n  }\n  /**\r\n   * Trap focus inside photoswipe\r\n   *\r\n   * @private\r\n   * @param {FocusEvent} e\r\n   */\n\n\n  _onFocusIn(e) {\n    const {\n      template\n    } = this.pswp;\n\n    if (template && document !== e.target && template !== e.target && !template.contains(\n    /** @type {Node} */\n    e.target)) {\n      // focus root element\n      template.focus();\n    }\n  }\n\n}\n\nconst DEFAULT_EASING = 'cubic-bezier(.4,0,.22,1)';\n/** @typedef {import('./animations.js').SharedAnimationProps} SharedAnimationProps */\n\n/** @typedef {Object} DefaultCssAnimationProps\r\n *\r\n * @prop {HTMLElement} target\r\n * @prop {number} [duration]\r\n * @prop {string} [easing]\r\n * @prop {string} [transform]\r\n * @prop {string} [opacity]\r\n * */\n\n/** @typedef {SharedAnimationProps & DefaultCssAnimationProps} CssAnimationProps */\n\n/**\r\n * Runs CSS transition.\r\n */\n\nclass CSSAnimation {\n  /**\r\n   * onComplete can be unpredictable, be careful about current state\r\n   *\r\n   * @param {CssAnimationProps} props\r\n   */\n  constructor(props) {\n    var _props$prop;\n\n    this.props = props;\n    const {\n      target,\n      onComplete,\n      transform,\n      onFinish = () => {},\n      duration = 333,\n      easing = DEFAULT_EASING\n    } = props;\n    this.onFinish = onFinish; // support only transform and opacity\n\n    const prop = transform ? 'transform' : 'opacity';\n    const propValue = (_props$prop = props[prop]) !== null && _props$prop !== void 0 ? _props$prop : '';\n    /** @private */\n\n    this._target = target;\n    /** @private */\n\n    this._onComplete = onComplete;\n    /** @private */\n\n    this._finished = false;\n    /** @private */\n\n    this._onTransitionEnd = this._onTransitionEnd.bind(this); // Using timeout hack to make sure that animation\n    // starts even if the animated property was changed recently,\n    // otherwise transitionend might not fire or transition won't start.\n    // https://drafts.csswg.org/css-transitions/#starting\n    //\n    // ¯\\_(ツ)_/¯\n\n    /** @private */\n\n    this._helperTimeout = setTimeout(() => {\n      setTransitionStyle(target, prop, duration, easing);\n      this._helperTimeout = setTimeout(() => {\n        target.addEventListener('transitionend', this._onTransitionEnd, false);\n        target.addEventListener('transitioncancel', this._onTransitionEnd, false); // Safari occasionally does not emit transitionend event\n        // if element property was modified during the transition,\n        // which may be caused by resize or third party component,\n        // using timeout as a safety fallback\n\n        this._helperTimeout = setTimeout(() => {\n          this._finalizeAnimation();\n        }, duration + 500);\n        target.style[prop] = propValue;\n      }, 30); // Do not reduce this number\n    }, 0);\n  }\n  /**\r\n   * @private\r\n   * @param {TransitionEvent} e\r\n   */\n\n\n  _onTransitionEnd(e) {\n    if (e.target === this._target) {\n      this._finalizeAnimation();\n    }\n  }\n  /**\r\n   * @private\r\n   */\n\n\n  _finalizeAnimation() {\n    if (!this._finished) {\n      this._finished = true;\n      this.onFinish();\n\n      if (this._onComplete) {\n        this._onComplete();\n      }\n    }\n  } // Destroy is called automatically onFinish\n\n\n  destroy() {\n    if (this._helperTimeout) {\n      clearTimeout(this._helperTimeout);\n    }\n\n    removeTransitionStyle(this._target);\n\n    this._target.removeEventListener('transitionend', this._onTransitionEnd, false);\n\n    this._target.removeEventListener('transitioncancel', this._onTransitionEnd, false);\n\n    if (!this._finished) {\n      this._finalizeAnimation();\n    }\n  }\n\n}\n\nconst DEFAULT_NATURAL_FREQUENCY = 12;\nconst DEFAULT_DAMPING_RATIO = 0.75;\n/**\r\n * Spring easing helper\r\n */\n\nclass SpringEaser {\n  /**\r\n   * @param {number} initialVelocity Initial velocity, px per ms.\r\n   *\r\n   * @param {number} [dampingRatio]\r\n   * Determines how bouncy animation will be.\r\n   * From 0 to 1, 0 - always overshoot, 1 - do not overshoot.\r\n   * \"overshoot\" refers to part of animation that\r\n   * goes beyond the final value.\r\n   *\r\n   * @param {number} [naturalFrequency]\r\n   * Determines how fast animation will slow down.\r\n   * The higher value - the stiffer the transition will be,\r\n   * and the faster it will slow down.\r\n   * Recommended value from 10 to 50\r\n   */\n  constructor(initialVelocity, dampingRatio, naturalFrequency) {\n    this.velocity = initialVelocity * 1000; // convert to \"pixels per second\"\n    // https://en.wikipedia.org/wiki/Damping_ratio\n\n    this._dampingRatio = dampingRatio || DEFAULT_DAMPING_RATIO; // https://en.wikipedia.org/wiki/Natural_frequency\n\n    this._naturalFrequency = naturalFrequency || DEFAULT_NATURAL_FREQUENCY;\n    this._dampedFrequency = this._naturalFrequency;\n\n    if (this._dampingRatio < 1) {\n      this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio);\n    }\n  }\n  /**\r\n   * @param {number} deltaPosition Difference between current and end position of the animation\r\n   * @param {number} deltaTime Frame duration in milliseconds\r\n   *\r\n   * @returns {number} Displacement, relative to the end position.\r\n   */\n\n\n  easeFrame(deltaPosition, deltaTime) {\n    // Inspired by Apple Webkit and Android spring function implementation\n    // https://en.wikipedia.org/wiki/Oscillation\n    // https://en.wikipedia.org/wiki/Damping_ratio\n    // we ignore mass (assume that it's 1kg)\n    let displacement = 0;\n    let coeff;\n    deltaTime /= 1000;\n    const naturalDumpingPow = Math.E ** (-this._dampingRatio * this._naturalFrequency * deltaTime);\n\n    if (this._dampingRatio === 1) {\n      coeff = this.velocity + this._naturalFrequency * deltaPosition;\n      displacement = (deltaPosition + coeff * deltaTime) * naturalDumpingPow;\n      this.velocity = displacement * -this._naturalFrequency + coeff * naturalDumpingPow;\n    } else if (this._dampingRatio < 1) {\n      coeff = 1 / this._dampedFrequency * (this._dampingRatio * this._naturalFrequency * deltaPosition + this.velocity);\n      const dumpedFCos = Math.cos(this._dampedFrequency * deltaTime);\n      const dumpedFSin = Math.sin(this._dampedFrequency * deltaTime);\n      displacement = naturalDumpingPow * (deltaPosition * dumpedFCos + coeff * dumpedFSin);\n      this.velocity = displacement * -this._naturalFrequency * this._dampingRatio + naturalDumpingPow * (-this._dampedFrequency * deltaPosition * dumpedFSin + this._dampedFrequency * coeff * dumpedFCos);\n    } // Overdamped (>1) damping ratio is not supported\n\n\n    return displacement;\n  }\n\n}\n\n/** @typedef {import('./animations.js').SharedAnimationProps} SharedAnimationProps */\n\n/**\r\n * @typedef {Object} DefaultSpringAnimationProps\r\n *\r\n * @prop {number} start\r\n * @prop {number} end\r\n * @prop {number} velocity\r\n * @prop {number} [dampingRatio]\r\n * @prop {number} [naturalFrequency]\r\n * @prop {(end: number) => void} onUpdate\r\n */\n\n/** @typedef {SharedAnimationProps & DefaultSpringAnimationProps} SpringAnimationProps */\n\nclass SpringAnimation {\n  /**\r\n   * @param {SpringAnimationProps} props\r\n   */\n  constructor(props) {\n    this.props = props;\n    this._raf = 0;\n    const {\n      start,\n      end,\n      velocity,\n      onUpdate,\n      onComplete,\n      onFinish = () => {},\n      dampingRatio,\n      naturalFrequency\n    } = props;\n    this.onFinish = onFinish;\n    const easer = new SpringEaser(velocity, dampingRatio, naturalFrequency);\n    let prevTime = Date.now();\n    let deltaPosition = start - end;\n\n    const animationLoop = () => {\n      if (this._raf) {\n        deltaPosition = easer.easeFrame(deltaPosition, Date.now() - prevTime); // Stop the animation if velocity is low and position is close to end\n\n        if (Math.abs(deltaPosition) < 1 && Math.abs(easer.velocity) < 50) {\n          // Finalize the animation\n          onUpdate(end);\n\n          if (onComplete) {\n            onComplete();\n          }\n\n          this.onFinish();\n        } else {\n          prevTime = Date.now();\n          onUpdate(deltaPosition + end);\n          this._raf = requestAnimationFrame(animationLoop);\n        }\n      }\n    };\n\n    this._raf = requestAnimationFrame(animationLoop);\n  } // Destroy is called automatically onFinish\n\n\n  destroy() {\n    if (this._raf >= 0) {\n      cancelAnimationFrame(this._raf);\n    }\n\n    this._raf = 0;\n  }\n\n}\n\n/** @typedef {import('./css-animation.js').CssAnimationProps} CssAnimationProps */\n\n/** @typedef {import('./spring-animation.js').SpringAnimationProps} SpringAnimationProps */\n\n/** @typedef {Object} SharedAnimationProps\r\n * @prop {string} [name]\r\n * @prop {boolean} [isPan]\r\n * @prop {boolean} [isMainScroll]\r\n * @prop {VoidFunction} [onComplete]\r\n * @prop {VoidFunction} [onFinish]\r\n */\n\n/** @typedef {SpringAnimation | CSSAnimation} Animation */\n\n/** @typedef {SpringAnimationProps | CssAnimationProps} AnimationProps */\n\n/**\r\n * Manages animations\r\n */\n\nclass Animations {\n  constructor() {\n    /** @type {Animation[]} */\n    this.activeAnimations = [];\n  }\n  /**\r\n   * @param {SpringAnimationProps} props\r\n   */\n\n\n  startSpring(props) {\n    this._start(props, true);\n  }\n  /**\r\n   * @param {CssAnimationProps} props\r\n   */\n\n\n  startTransition(props) {\n    this._start(props);\n  }\n  /**\r\n   * @private\r\n   * @param {AnimationProps} props\r\n   * @param {boolean} [isSpring]\r\n   * @returns {Animation}\r\n   */\n\n\n  _start(props, isSpring) {\n    const animation = isSpring ? new SpringAnimation(\n    /** @type SpringAnimationProps */\n    props) : new CSSAnimation(\n    /** @type CssAnimationProps */\n    props);\n    this.activeAnimations.push(animation);\n\n    animation.onFinish = () => this.stop(animation);\n\n    return animation;\n  }\n  /**\r\n   * @param {Animation} animation\r\n   */\n\n\n  stop(animation) {\n    animation.destroy();\n    const index = this.activeAnimations.indexOf(animation);\n\n    if (index > -1) {\n      this.activeAnimations.splice(index, 1);\n    }\n  }\n\n  stopAll() {\n    // _stopAllAnimations\n    this.activeAnimations.forEach(animation => {\n      animation.destroy();\n    });\n    this.activeAnimations = [];\n  }\n  /**\r\n   * Stop all pan or zoom transitions\r\n   */\n\n\n  stopAllPan() {\n    this.activeAnimations = this.activeAnimations.filter(animation => {\n      if (animation.props.isPan) {\n        animation.destroy();\n        return false;\n      }\n\n      return true;\n    });\n  }\n\n  stopMainScroll() {\n    this.activeAnimations = this.activeAnimations.filter(animation => {\n      if (animation.props.isMainScroll) {\n        animation.destroy();\n        return false;\n      }\n\n      return true;\n    });\n  }\n  /**\r\n   * Returns true if main scroll transition is running\r\n   */\n  // isMainScrollRunning() {\n  //   return this.activeAnimations.some((animation) => {\n  //     return animation.props.isMainScroll;\n  //   });\n  // }\n\n  /**\r\n   * Returns true if any pan or zoom transition is running\r\n   */\n\n\n  isPanRunning() {\n    return this.activeAnimations.some(animation => {\n      return animation.props.isPan;\n    });\n  }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/**\r\n * Handles scroll wheel.\r\n * Can pan and zoom current slide image.\r\n */\nclass ScrollWheel {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp;\n    pswp.events.add(pswp.element, 'wheel',\n    /** @type EventListener */\n    this._onWheel.bind(this));\n  }\n  /**\r\n   * @private\r\n   * @param {WheelEvent} e\r\n   */\n\n\n  _onWheel(e) {\n    e.preventDefault();\n    const {\n      currSlide\n    } = this.pswp;\n    let {\n      deltaX,\n      deltaY\n    } = e;\n\n    if (!currSlide) {\n      return;\n    }\n\n    if (this.pswp.dispatch('wheel', {\n      originalEvent: e\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (e.ctrlKey || this.pswp.options.wheelToZoom) {\n      // zoom\n      if (currSlide.isZoomable()) {\n        let zoomFactor = -deltaY;\n\n        if (e.deltaMode === 1\n        /* DOM_DELTA_LINE */\n        ) {\n          zoomFactor *= 0.05;\n        } else {\n          zoomFactor *= e.deltaMode ? 1 : 0.002;\n        }\n\n        zoomFactor = 2 ** zoomFactor;\n        const destZoomLevel = currSlide.currZoomLevel * zoomFactor;\n        currSlide.zoomTo(destZoomLevel, {\n          x: e.clientX,\n          y: e.clientY\n        });\n      }\n    } else {\n      // pan\n      if (currSlide.isPannable()) {\n        if (e.deltaMode === 1\n        /* DOM_DELTA_LINE */\n        ) {\n          // 18 - average line height\n          deltaX *= 18;\n          deltaY *= 18;\n        }\n\n        currSlide.panTo(currSlide.pan.x - deltaX, currSlide.pan.y - deltaY);\n      }\n    }\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/**\r\n * @template T\r\n * @typedef {import('../types.js').Methods<T>} Methods<T>\r\n */\n\n/**\r\n * @typedef {Object} UIElementMarkupProps\r\n * @prop {boolean} [isCustomSVG]\r\n * @prop {string} inner\r\n * @prop {string} [outlineID]\r\n * @prop {number | string} [size]\r\n */\n\n/**\r\n * @typedef {Object} UIElementData\r\n * @prop {DefaultUIElements | string} [name]\r\n * @prop {string} [className]\r\n * @prop {UIElementMarkup} [html]\r\n * @prop {boolean} [isButton]\r\n * @prop {keyof HTMLElementTagNameMap} [tagName]\r\n * @prop {string} [title]\r\n * @prop {string} [ariaLabel]\r\n * @prop {(element: HTMLElement, pswp: PhotoSwipe) => void} [onInit]\r\n * @prop {Methods<PhotoSwipe> | ((e: MouseEvent, element: HTMLElement, pswp: PhotoSwipe) => void)} [onClick]\r\n * @prop {'bar' | 'wrapper' | 'root'} [appendTo]\r\n * @prop {number} [order]\r\n */\n\n/** @typedef {'arrowPrev' | 'arrowNext' | 'close' | 'zoom' | 'counter'} DefaultUIElements */\n\n/** @typedef {string | UIElementMarkupProps} UIElementMarkup */\n\n/**\r\n * @param {UIElementMarkup} [htmlData]\r\n * @returns {string}\r\n */\n\nfunction addElementHTML(htmlData) {\n  if (typeof htmlData === 'string') {\n    // Allow developers to provide full svg,\n    // For example:\n    // <svg viewBox=\"0 0 32 32\" width=\"32\" height=\"32\" aria-hidden=\"true\" class=\"pswp__icn\">\n    //   <path d=\"...\" />\n    //   <circle ... />\n    // </svg>\n    // Can also be any HTML string.\n    return htmlData;\n  }\n\n  if (!htmlData || !htmlData.isCustomSVG) {\n    return '';\n  }\n\n  const svgData = htmlData;\n  let out = '<svg aria-hidden=\"true\" class=\"pswp__icn\" viewBox=\"0 0 %d %d\" width=\"%d\" height=\"%d\">'; // replace all %d with size\n\n  out = out.split('%d').join(\n  /** @type {string} */\n  svgData.size || 32); // Icons may contain outline/shadow,\n  // to make it we \"clone\" base icon shape and add border to it.\n  // Icon itself and border are styled via CSS.\n  //\n  // Property shadowID defines ID of element that should be cloned.\n\n  if (svgData.outlineID) {\n    out += '<use class=\"pswp__icn-shadow\" xlink:href=\"#' + svgData.outlineID + '\"/>';\n  }\n\n  out += svgData.inner;\n  out += '</svg>';\n  return out;\n}\n\nclass UIElement {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   * @param {UIElementData} data\r\n   */\n  constructor(pswp, data) {\n    var _container;\n\n    const name = data.name || data.className;\n    let elementHTML = data.html; // @ts-expect-error lookup only by `data.name` maybe?\n\n    if (pswp.options[name] === false) {\n      // exit if element is disabled from options\n      return;\n    } // Allow to override SVG icons from options\n    // @ts-expect-error lookup only by `data.name` maybe?\n\n\n    if (typeof pswp.options[name + 'SVG'] === 'string') {\n      // arrowPrevSVG\n      // arrowNextSVG\n      // closeSVG\n      // zoomSVG\n      // @ts-expect-error lookup only by `data.name` maybe?\n      elementHTML = pswp.options[name + 'SVG'];\n    }\n\n    pswp.dispatch('uiElementCreate', {\n      data\n    });\n    let className = '';\n\n    if (data.isButton) {\n      className += 'pswp__button ';\n      className += data.className || `pswp__button--${data.name}`;\n    } else {\n      className += data.className || `pswp__${data.name}`;\n    }\n\n    let tagName = data.isButton ? data.tagName || 'button' : data.tagName || 'div';\n    tagName =\n    /** @type {keyof HTMLElementTagNameMap} */\n    tagName.toLowerCase();\n    /** @type {HTMLElement} */\n\n    const element = createElement(className, tagName);\n\n    if (data.isButton) {\n      if (tagName === 'button') {\n        /** @type {HTMLButtonElement} */\n        element.type = 'button';\n      }\n\n      let {\n        title\n      } = data;\n      const {\n        ariaLabel\n      } = data; // @ts-expect-error lookup only by `data.name` maybe?\n\n      if (typeof pswp.options[name + 'Title'] === 'string') {\n        // @ts-expect-error lookup only by `data.name` maybe?\n        title = pswp.options[name + 'Title'];\n      }\n\n      if (title) {\n        element.title = title;\n      }\n\n      const ariaText = ariaLabel || title;\n\n      if (ariaText) {\n        element.setAttribute('aria-label', ariaText);\n      }\n    }\n\n    element.innerHTML = addElementHTML(elementHTML);\n\n    if (data.onInit) {\n      data.onInit(element, pswp);\n    }\n\n    if (data.onClick) {\n      element.onclick = e => {\n        if (typeof data.onClick === 'string') {\n          // @ts-ignore\n          pswp[data.onClick]();\n        } else if (typeof data.onClick === 'function') {\n          data.onClick(e, element, pswp);\n        }\n      };\n    } // Top bar is default position\n\n\n    const appendTo = data.appendTo || 'bar';\n    /** @type {HTMLElement | undefined} root element by default */\n\n    let container = pswp.element;\n\n    if (appendTo === 'bar') {\n      if (!pswp.topBar) {\n        pswp.topBar = createElement('pswp__top-bar pswp__hide-on-close', 'div', pswp.scrollWrap);\n      }\n\n      container = pswp.topBar;\n    } else {\n      // element outside of top bar gets a secondary class\n      // that makes element fade out on close\n      element.classList.add('pswp__hide-on-close');\n\n      if (appendTo === 'wrapper') {\n        container = pswp.scrollWrap;\n      }\n    }\n\n    (_container = container) === null || _container === void 0 || _container.appendChild(pswp.applyFilters('uiElement', element, data));\n  }\n\n}\n\n/*\r\n  Backward and forward arrow buttons\r\n */\n\n/** @typedef {import('./ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/**\r\n *\r\n * @param {HTMLElement} element\r\n * @param {PhotoSwipe} pswp\r\n * @param {boolean} [isNextButton]\r\n */\nfunction initArrowButton(element, pswp, isNextButton) {\n  element.classList.add('pswp__button--arrow'); // TODO: this should point to a unique id for this instance\n\n  element.setAttribute('aria-controls', 'pswp__items');\n  pswp.on('change', () => {\n    if (!pswp.options.loop) {\n      if (isNextButton) {\n        /** @type {HTMLButtonElement} */\n        element.disabled = !(pswp.currIndex < pswp.getNumItems() - 1);\n      } else {\n        /** @type {HTMLButtonElement} */\n        element.disabled = !(pswp.currIndex > 0);\n      }\n    }\n  });\n}\n/** @type {UIElementData} */\n\n\nconst arrowPrev = {\n  name: 'arrowPrev',\n  className: 'pswp__button--arrow--prev',\n  title: 'Previous',\n  order: 10,\n  isButton: true,\n  appendTo: 'wrapper',\n  html: {\n    isCustomSVG: true,\n    size: 60,\n    inner: '<path d=\"M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z\" id=\"pswp__icn-arrow\"/>',\n    outlineID: 'pswp__icn-arrow'\n  },\n  onClick: 'prev',\n  onInit: initArrowButton\n};\n/** @type {UIElementData} */\n\nconst arrowNext = {\n  name: 'arrowNext',\n  className: 'pswp__button--arrow--next',\n  title: 'Next',\n  order: 11,\n  isButton: true,\n  appendTo: 'wrapper',\n  html: {\n    isCustomSVG: true,\n    size: 60,\n    inner: '<use xlink:href=\"#pswp__icn-arrow\"/>',\n    outlineID: 'pswp__icn-arrow'\n  },\n  onClick: 'next',\n  onInit: (el, pswp) => {\n    initArrowButton(el, pswp, true);\n  }\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst closeButton = {\n  name: 'close',\n  title: 'Close',\n  order: 20,\n  isButton: true,\n  html: {\n    isCustomSVG: true,\n    inner: '<path d=\"M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z\" id=\"pswp__icn-close\"/>',\n    outlineID: 'pswp__icn-close'\n  },\n  onClick: 'close'\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst zoomButton = {\n  name: 'zoom',\n  title: 'Zoom',\n  order: 10,\n  isButton: true,\n  html: {\n    isCustomSVG: true,\n    // eslint-disable-next-line max-len\n    inner: '<path d=\"M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z\" id=\"pswp__icn-zoom\"/>' + '<path fill=\"currentColor\" class=\"pswp__zoom-icn-bar-h\" d=\"M11 16v-2h6v2z\"/>' + '<path fill=\"currentColor\" class=\"pswp__zoom-icn-bar-v\" d=\"M13 12h2v6h-2z\"/>',\n    outlineID: 'pswp__icn-zoom'\n  },\n  onClick: 'toggleZoom'\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst loadingIndicator = {\n  name: 'preloader',\n  appendTo: 'bar',\n  order: 7,\n  html: {\n    isCustomSVG: true,\n    // eslint-disable-next-line max-len\n    inner: '<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z\" id=\"pswp__icn-loading\"/>',\n    outlineID: 'pswp__icn-loading'\n  },\n  onInit: (indicatorElement, pswp) => {\n    /** @type {boolean | undefined} */\n    let isVisible;\n    /** @type {NodeJS.Timeout | null} */\n\n    let delayTimeout = null;\n    /**\r\n     * @param {string} className\r\n     * @param {boolean} add\r\n     */\n\n    const toggleIndicatorClass = (className, add) => {\n      indicatorElement.classList.toggle('pswp__preloader--' + className, add);\n    };\n    /**\r\n     * @param {boolean} visible\r\n     */\n\n\n    const setIndicatorVisibility = visible => {\n      if (isVisible !== visible) {\n        isVisible = visible;\n        toggleIndicatorClass('active', visible);\n      }\n    };\n\n    const updatePreloaderVisibility = () => {\n      var _pswp$currSlide;\n\n      if (!((_pswp$currSlide = pswp.currSlide) !== null && _pswp$currSlide !== void 0 && _pswp$currSlide.content.isLoading())) {\n        setIndicatorVisibility(false);\n\n        if (delayTimeout) {\n          clearTimeout(delayTimeout);\n          delayTimeout = null;\n        }\n\n        return;\n      }\n\n      if (!delayTimeout) {\n        // display loading indicator with delay\n        delayTimeout = setTimeout(() => {\n          var _pswp$currSlide2;\n\n          setIndicatorVisibility(Boolean((_pswp$currSlide2 = pswp.currSlide) === null || _pswp$currSlide2 === void 0 ? void 0 : _pswp$currSlide2.content.isLoading()));\n          delayTimeout = null;\n        }, pswp.options.preloaderDelay);\n      }\n    };\n\n    pswp.on('change', updatePreloaderVisibility);\n    pswp.on('loadComplete', e => {\n      if (pswp.currSlide === e.slide) {\n        updatePreloaderVisibility();\n      }\n    }); // expose the method\n\n    if (pswp.ui) {\n      pswp.ui.updatePreloaderVisibility = updatePreloaderVisibility;\n    }\n  }\n};\n\n/** @type {import('./ui-element.js').UIElementData} UIElementData */\nconst counterIndicator = {\n  name: 'counter',\n  order: 5,\n  onInit: (counterElement, pswp) => {\n    pswp.on('change', () => {\n      counterElement.innerText = pswp.currIndex + 1 + pswp.options.indexIndicatorSep + pswp.getNumItems();\n    });\n  }\n};\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('./ui-element.js').UIElementData} UIElementData */\n\n/**\r\n * Set special class on element when image is zoomed.\r\n *\r\n * By default, it is used to adjust\r\n * zoom icon and zoom cursor via CSS.\r\n *\r\n * @param {HTMLElement} el\r\n * @param {boolean} isZoomedIn\r\n */\n\nfunction setZoomedIn(el, isZoomedIn) {\n  el.classList.toggle('pswp--zoomed-in', isZoomedIn);\n}\n\nclass UI {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp;\n    this.isRegistered = false;\n    /** @type {UIElementData[]} */\n\n    this.uiElementsData = [];\n    /** @type {(UIElement | UIElementData)[]} */\n\n    this.items = [];\n    /** @type {() => void} */\n\n    this.updatePreloaderVisibility = () => {};\n    /**\r\n     * @private\r\n     * @type {number | undefined}\r\n     */\n\n\n    this._lastUpdatedZoomLevel = undefined;\n  }\n\n  init() {\n    const {\n      pswp\n    } = this;\n    this.isRegistered = false;\n    this.uiElementsData = [closeButton, arrowPrev, arrowNext, zoomButton, loadingIndicator, counterIndicator];\n    pswp.dispatch('uiRegister'); // sort by order\n\n    this.uiElementsData.sort((a, b) => {\n      // default order is 0\n      return (a.order || 0) - (b.order || 0);\n    });\n    this.items = [];\n    this.isRegistered = true;\n    this.uiElementsData.forEach(uiElementData => {\n      this.registerElement(uiElementData);\n    });\n    pswp.on('change', () => {\n      var _pswp$element;\n\n      (_pswp$element = pswp.element) === null || _pswp$element === void 0 || _pswp$element.classList.toggle('pswp--one-slide', pswp.getNumItems() === 1);\n    });\n    pswp.on('zoomPanUpdate', () => this._onZoomPanUpdate());\n  }\n  /**\r\n   * @param {UIElementData} elementData\r\n   */\n\n\n  registerElement(elementData) {\n    if (this.isRegistered) {\n      this.items.push(new UIElement(this.pswp, elementData));\n    } else {\n      this.uiElementsData.push(elementData);\n    }\n  }\n  /**\r\n   * Fired each time zoom or pan position is changed.\r\n   * Update classes that control visibility of zoom button and cursor icon.\r\n   *\r\n   * @private\r\n   */\n\n\n  _onZoomPanUpdate() {\n    const {\n      template,\n      currSlide,\n      options\n    } = this.pswp;\n\n    if (this.pswp.opener.isClosing || !template || !currSlide) {\n      return;\n    }\n\n    let {\n      currZoomLevel\n    } = currSlide; // if not open yet - check against initial zoom level\n\n    if (!this.pswp.opener.isOpen) {\n      currZoomLevel = currSlide.zoomLevels.initial;\n    }\n\n    if (currZoomLevel === this._lastUpdatedZoomLevel) {\n      return;\n    }\n\n    this._lastUpdatedZoomLevel = currZoomLevel;\n    const currZoomLevelDiff = currSlide.zoomLevels.initial - currSlide.zoomLevels.secondary; // Initial and secondary zoom levels are almost equal\n\n    if (Math.abs(currZoomLevelDiff) < 0.01 || !currSlide.isZoomable()) {\n      // disable zoom\n      setZoomedIn(template, false);\n      template.classList.remove('pswp--zoom-allowed');\n      return;\n    }\n\n    template.classList.add('pswp--zoom-allowed');\n    const potentialZoomLevel = currZoomLevel === currSlide.zoomLevels.initial ? currSlide.zoomLevels.secondary : currSlide.zoomLevels.initial;\n    setZoomedIn(template, potentialZoomLevel <= currZoomLevel);\n\n    if (options.imageClickAction === 'zoom' || options.imageClickAction === 'zoom-or-close') {\n      template.classList.add('pswp--click-to-zoom');\n    }\n  }\n\n}\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {{ x: number; y: number; w: number; innerRect?: { w: number; h: number; x: number; y: number } }} Bounds */\n\n/**\r\n * @param {HTMLElement} el\r\n * @returns Bounds\r\n */\nfunction getBoundsByElement(el) {\n  const thumbAreaRect = el.getBoundingClientRect();\n  return {\n    x: thumbAreaRect.left,\n    y: thumbAreaRect.top,\n    w: thumbAreaRect.width\n  };\n}\n/**\r\n * @param {HTMLElement} el\r\n * @param {number} imageWidth\r\n * @param {number} imageHeight\r\n * @returns Bounds\r\n */\n\n\nfunction getCroppedBoundsByElement(el, imageWidth, imageHeight) {\n  const thumbAreaRect = el.getBoundingClientRect(); // fill image into the area\n  // (do they same as object-fit:cover does to retrieve coordinates)\n\n  const hRatio = thumbAreaRect.width / imageWidth;\n  const vRatio = thumbAreaRect.height / imageHeight;\n  const fillZoomLevel = hRatio > vRatio ? hRatio : vRatio;\n  const offsetX = (thumbAreaRect.width - imageWidth * fillZoomLevel) / 2;\n  const offsetY = (thumbAreaRect.height - imageHeight * fillZoomLevel) / 2;\n  /**\r\n   * Coordinates of the image,\r\n   * as if it was not cropped,\r\n   * height is calculated automatically\r\n   *\r\n   * @type {Bounds}\r\n   */\n\n  const bounds = {\n    x: thumbAreaRect.left + offsetX,\n    y: thumbAreaRect.top + offsetY,\n    w: imageWidth * fillZoomLevel\n  }; // Coordinates of inner crop area\n  // relative to the image\n\n  bounds.innerRect = {\n    w: thumbAreaRect.width,\n    h: thumbAreaRect.height,\n    x: offsetX,\n    y: offsetY\n  };\n  return bounds;\n}\n/**\r\n * Get dimensions of thumbnail image\r\n * (click on which opens photoswipe or closes photoswipe to)\r\n *\r\n * @param {number} index\r\n * @param {SlideData} itemData\r\n * @param {PhotoSwipe} instance PhotoSwipe instance\r\n * @returns {Bounds | undefined}\r\n */\n\n\nfunction getThumbBounds(index, itemData, instance) {\n  // legacy event, before filters were introduced\n  const event = instance.dispatch('thumbBounds', {\n    index,\n    itemData,\n    instance\n  }); // @ts-expect-error\n\n  if (event.thumbBounds) {\n    // @ts-expect-error\n    return event.thumbBounds;\n  }\n\n  const {\n    element\n  } = itemData;\n  /** @type {Bounds | undefined} */\n\n  let thumbBounds;\n  /** @type {HTMLElement | null | undefined} */\n\n  let thumbnail;\n\n  if (element && instance.options.thumbSelector !== false) {\n    const thumbSelector = instance.options.thumbSelector || 'img';\n    thumbnail = element.matches(thumbSelector) ? element :\n    /** @type {HTMLElement | null} */\n    element.querySelector(thumbSelector);\n  }\n\n  thumbnail = instance.applyFilters('thumbEl', thumbnail, itemData, index);\n\n  if (thumbnail) {\n    if (!itemData.thumbCropped) {\n      thumbBounds = getBoundsByElement(thumbnail);\n    } else {\n      thumbBounds = getCroppedBoundsByElement(thumbnail, itemData.width || itemData.w || 0, itemData.height || itemData.h || 0);\n    }\n  }\n\n  return instance.applyFilters('thumbBounds', thumbBounds, itemData, index);\n}\n\n/** @typedef {import('../lightbox/lightbox.js').default} PhotoSwipeLightbox */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').DataSource} DataSource */\n\n/** @typedef {import('../ui/ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('../slide/content.js').default} ContentDefault */\n\n/** @typedef {import('../slide/slide.js').default} Slide */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/** @typedef {import('../slide/zoom-level.js').default} ZoomLevel */\n\n/** @typedef {import('../slide/get-thumb-bounds.js').Bounds} Bounds */\n\n/**\r\n * Allow adding an arbitrary props to the Content\r\n * https://photoswipe.com/custom-content/#using-webp-image-format\r\n * @typedef {ContentDefault & Record<string, any>} Content\r\n */\n\n/** @typedef {{ x?: number; y?: number }} Point */\n\n/**\r\n * @typedef {Object} PhotoSwipeEventsMap https://photoswipe.com/events/\r\n *\r\n *\r\n * https://photoswipe.com/adding-ui-elements/\r\n *\r\n * @prop {undefined} uiRegister\r\n * @prop {{ data: UIElementData }} uiElementCreate\r\n *\r\n *\r\n * https://photoswipe.com/events/#initialization-events\r\n *\r\n * @prop {undefined} beforeOpen\r\n * @prop {undefined} firstUpdate\r\n * @prop {undefined} initialLayout\r\n * @prop {undefined} change\r\n * @prop {undefined} afterInit\r\n * @prop {undefined} bindEvents\r\n *\r\n *\r\n * https://photoswipe.com/events/#opening-or-closing-transition-events\r\n *\r\n * @prop {undefined} openingAnimationStart\r\n * @prop {undefined} openingAnimationEnd\r\n * @prop {undefined} closingAnimationStart\r\n * @prop {undefined} closingAnimationEnd\r\n *\r\n *\r\n * https://photoswipe.com/events/#closing-events\r\n *\r\n * @prop {undefined} close\r\n * @prop {undefined} destroy\r\n *\r\n *\r\n * https://photoswipe.com/events/#pointer-and-gesture-events\r\n *\r\n * @prop {{ originalEvent: PointerEvent }} pointerDown\r\n * @prop {{ originalEvent: PointerEvent }} pointerMove\r\n * @prop {{ originalEvent: PointerEvent }} pointerUp\r\n * @prop {{ bgOpacity: number }} pinchClose can be default prevented\r\n * @prop {{ panY: number }} verticalDrag can be default prevented\r\n *\r\n *\r\n * https://photoswipe.com/events/#slide-content-events\r\n *\r\n * @prop {{ content: Content }} contentInit\r\n * @prop {{ content: Content; isLazy: boolean }} contentLoad can be default prevented\r\n * @prop {{ content: Content; isLazy: boolean }} contentLoadImage can be default prevented\r\n * @prop {{ content: Content; slide: Slide; isError?: boolean }} loadComplete\r\n * @prop {{ content: Content; slide: Slide }} loadError\r\n * @prop {{ content: Content; width: number; height: number }} contentResize can be default prevented\r\n * @prop {{ content: Content; width: number; height: number; slide: Slide }} imageSizeChange\r\n * @prop {{ content: Content }} contentLazyLoad can be default prevented\r\n * @prop {{ content: Content }} contentAppend can be default prevented\r\n * @prop {{ content: Content }} contentActivate can be default prevented\r\n * @prop {{ content: Content }} contentDeactivate can be default prevented\r\n * @prop {{ content: Content }} contentRemove can be default prevented\r\n * @prop {{ content: Content }} contentDestroy can be default prevented\r\n *\r\n *\r\n * undocumented\r\n *\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} imageClickAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} bgClickAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} tapAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} doubleTapAction can be default prevented\r\n *\r\n * @prop {{ originalEvent: KeyboardEvent }} keydown can be default prevented\r\n * @prop {{ x: number; dragging: boolean }} moveMainScroll\r\n * @prop {{ slide: Slide }} firstZoomPan\r\n * @prop {{ slide: Slide | undefined, data: SlideData, index: number }} gettingData\r\n * @prop {undefined} beforeResize\r\n * @prop {undefined} resize\r\n * @prop {undefined} viewportSize\r\n * @prop {undefined} updateScrollOffset\r\n * @prop {{ slide: Slide }} slideInit\r\n * @prop {{ slide: Slide }} afterSetContent\r\n * @prop {{ slide: Slide }} slideLoad\r\n * @prop {{ slide: Slide }} appendHeavy can be default prevented\r\n * @prop {{ slide: Slide }} appendHeavyContent\r\n * @prop {{ slide: Slide }} slideActivate\r\n * @prop {{ slide: Slide }} slideDeactivate\r\n * @prop {{ slide: Slide }} slideDestroy\r\n * @prop {{ destZoomLevel: number, centerPoint: Point | undefined, transitionDuration: number | false | undefined }} beforeZoomTo\r\n * @prop {{ slide: Slide }} zoomPanUpdate\r\n * @prop {{ slide: Slide }} initialZoomPan\r\n * @prop {{ slide: Slide }} calcSlideSize\r\n * @prop {undefined} resolutionChanged\r\n * @prop {{ originalEvent: WheelEvent }} wheel can be default prevented\r\n * @prop {{ content: Content }} contentAppendImage can be default prevented\r\n * @prop {{ index: number; itemData: SlideData }} lazyLoadSlide can be default prevented\r\n * @prop {undefined} lazyLoad\r\n * @prop {{ slide: Slide }} calcBounds\r\n * @prop {{ zoomLevels: ZoomLevel, slideData: SlideData }} zoomLevelsUpdate\r\n *\r\n *\r\n * legacy\r\n *\r\n * @prop {undefined} init\r\n * @prop {undefined} initialZoomIn\r\n * @prop {undefined} initialZoomOut\r\n * @prop {undefined} initialZoomInEnd\r\n * @prop {undefined} initialZoomOutEnd\r\n * @prop {{ dataSource: DataSource | undefined, numItems: number }} numItems\r\n * @prop {{ itemData: SlideData; index: number }} itemData\r\n * @prop {{ index: number, itemData: SlideData, instance: PhotoSwipe }} thumbBounds\r\n */\n\n/**\r\n * @typedef {Object} PhotoSwipeFiltersMap https://photoswipe.com/filters/\r\n *\r\n * @prop {(numItems: number, dataSource: DataSource | undefined) => number} numItems\r\n * Modify the total amount of slides. Example on Data sources page.\r\n * https://photoswipe.com/filters/#numitems\r\n *\r\n * @prop {(itemData: SlideData, index: number) => SlideData} itemData\r\n * Modify slide item data. Example on Data sources page.\r\n * https://photoswipe.com/filters/#itemdata\r\n *\r\n * @prop {(itemData: SlideData, element: HTMLElement, linkEl: HTMLAnchorElement) => SlideData} domItemData\r\n * Modify item data when it's parsed from DOM element. Example on Data sources page.\r\n * https://photoswipe.com/filters/#domitemdata\r\n *\r\n * @prop {(clickedIndex: number, e: MouseEvent, instance: PhotoSwipeLightbox) => number} clickedIndex\r\n * Modify clicked gallery item index.\r\n * https://photoswipe.com/filters/#clickedindex\r\n *\r\n * @prop {(placeholderSrc: string | false, content: Content) => string | false} placeholderSrc\r\n * Modify placeholder image source.\r\n * https://photoswipe.com/filters/#placeholdersrc\r\n *\r\n * @prop {(isContentLoading: boolean, content: Content) => boolean} isContentLoading\r\n * Modify if the content is currently loading.\r\n * https://photoswipe.com/filters/#iscontentloading\r\n *\r\n * @prop {(isContentZoomable: boolean, content: Content) => boolean} isContentZoomable\r\n * Modify if the content can be zoomed.\r\n * https://photoswipe.com/filters/#iscontentzoomable\r\n *\r\n * @prop {(useContentPlaceholder: boolean, content: Content) => boolean} useContentPlaceholder\r\n * Modify if the placeholder should be used for the content.\r\n * https://photoswipe.com/filters/#usecontentplaceholder\r\n *\r\n * @prop {(isKeepingPlaceholder: boolean, content: Content) => boolean} isKeepingPlaceholder\r\n * Modify if the placeholder should be kept after the content is loaded.\r\n * https://photoswipe.com/filters/#iskeepingplaceholder\r\n *\r\n *\r\n * @prop {(contentErrorElement: HTMLElement, content: Content) => HTMLElement} contentErrorElement\r\n * Modify an element when the content has error state (for example, if image cannot be loaded).\r\n * https://photoswipe.com/filters/#contenterrorelement\r\n *\r\n * @prop {(element: HTMLElement, data: UIElementData) => HTMLElement} uiElement\r\n * Modify a UI element that's being created.\r\n * https://photoswipe.com/filters/#uielement\r\n *\r\n * @prop {(thumbnail: HTMLElement | null | undefined, itemData: SlideData, index: number) => HTMLElement} thumbEl\r\n * Modify the thumbnail element from which opening zoom animation starts or ends.\r\n * https://photoswipe.com/filters/#thumbel\r\n *\r\n * @prop {(thumbBounds: Bounds | undefined, itemData: SlideData, index: number) => Bounds} thumbBounds\r\n * Modify the thumbnail bounds from which opening zoom animation starts or ends.\r\n * https://photoswipe.com/filters/#thumbbounds\r\n *\r\n * @prop {(srcsetSizesWidth: number, content: Content) => number} srcsetSizesWidth\r\n *\r\n * @prop {(preventPointerEvent: boolean, event: PointerEvent, pointerType: string) => boolean} preventPointerEvent\r\n *\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeFiltersMap} T\r\n * @typedef {{ fn: PhotoSwipeFiltersMap[T], priority: number }} Filter\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {PhotoSwipeEventsMap[T] extends undefined ? PhotoSwipeEvent<T> : PhotoSwipeEvent<T> & PhotoSwipeEventsMap[T]} AugmentedEvent\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {(event: AugmentedEvent<T>) => void} EventCallback\r\n */\n\n/**\r\n * Base PhotoSwipe event object\r\n *\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n */\nclass PhotoSwipeEvent {\n  /**\r\n   * @param {T} type\r\n   * @param {PhotoSwipeEventsMap[T]} [details]\r\n   */\n  constructor(type, details) {\n    this.type = type;\n    this.defaultPrevented = false;\n\n    if (details) {\n      Object.assign(this, details);\n    }\n  }\n\n  preventDefault() {\n    this.defaultPrevented = true;\n  }\n\n}\n/**\r\n * PhotoSwipe base class that can listen and dispatch for events.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox, extended by base.js\r\n */\n\n\nclass Eventable {\n  constructor() {\n    /**\r\n     * @type {{ [T in keyof PhotoSwipeEventsMap]?: ((event: AugmentedEvent<T>) => void)[] }}\r\n     */\n    this._listeners = {};\n    /**\r\n     * @type {{ [T in keyof PhotoSwipeFiltersMap]?: Filter<T>[] }}\r\n     */\n\n    this._filters = {};\n    /** @type {PhotoSwipe | undefined} */\n\n    this.pswp = undefined;\n    /** @type {PhotoSwipeOptions | undefined} */\n\n    this.options = undefined;\n  }\n  /**\r\n   * @template {keyof PhotoSwipeFiltersMap} T\r\n   * @param {T} name\r\n   * @param {PhotoSwipeFiltersMap[T]} fn\r\n   * @param {number} priority\r\n   */\n\n\n  addFilter(name, fn, priority = 100) {\n    var _this$_filters$name, _this$_filters$name2, _this$pswp;\n\n    if (!this._filters[name]) {\n      this._filters[name] = [];\n    }\n\n    (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.push({\n      fn,\n      priority\n    });\n    (_this$_filters$name2 = this._filters[name]) === null || _this$_filters$name2 === void 0 || _this$_filters$name2.sort((f1, f2) => f1.priority - f2.priority);\n    (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.addFilter(name, fn, priority);\n  }\n  /**\r\n   * @template {keyof PhotoSwipeFiltersMap} T\r\n   * @param {T} name\r\n   * @param {PhotoSwipeFiltersMap[T]} fn\r\n   */\n\n\n  removeFilter(name, fn) {\n    if (this._filters[name]) {\n      // @ts-expect-error\n      this._filters[name] = this._filters[name].filter(filter => filter.fn !== fn);\n    }\n\n    if (this.pswp) {\n      this.pswp.removeFilter(name, fn);\n    }\n  }\n  /**\r\n   * @template {keyof PhotoSwipeFiltersMap} T\r\n   * @param {T} name\r\n   * @param {Parameters<PhotoSwipeFiltersMap[T]>} args\r\n   * @returns {Parameters<PhotoSwipeFiltersMap[T]>[0]}\r\n   */\n\n\n  applyFilters(name, ...args) {\n    var _this$_filters$name3;\n\n    (_this$_filters$name3 = this._filters[name]) === null || _this$_filters$name3 === void 0 || _this$_filters$name3.forEach(filter => {\n      // @ts-expect-error\n      args[0] = filter.fn.apply(this, args);\n    });\n    return args[0];\n  }\n  /**\r\n   * @template {keyof PhotoSwipeEventsMap} T\r\n   * @param {T} name\r\n   * @param {EventCallback<T>} fn\r\n   */\n\n\n  on(name, fn) {\n    var _this$_listeners$name, _this$pswp2;\n\n    if (!this._listeners[name]) {\n      this._listeners[name] = [];\n    }\n\n    (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.push(fn); // When binding events to lightbox,\n    // also bind events to PhotoSwipe Core,\n    // if it's open.\n\n    (_this$pswp2 = this.pswp) === null || _this$pswp2 === void 0 || _this$pswp2.on(name, fn);\n  }\n  /**\r\n   * @template {keyof PhotoSwipeEventsMap} T\r\n   * @param {T} name\r\n   * @param {EventCallback<T>} fn\r\n   */\n\n\n  off(name, fn) {\n    var _this$pswp3;\n\n    if (this._listeners[name]) {\n      // @ts-expect-error\n      this._listeners[name] = this._listeners[name].filter(listener => fn !== listener);\n    }\n\n    (_this$pswp3 = this.pswp) === null || _this$pswp3 === void 0 || _this$pswp3.off(name, fn);\n  }\n  /**\r\n   * @template {keyof PhotoSwipeEventsMap} T\r\n   * @param {T} name\r\n   * @param {PhotoSwipeEventsMap[T]} [details]\r\n   * @returns {AugmentedEvent<T>}\r\n   */\n\n\n  dispatch(name, details) {\n    var _this$_listeners$name2;\n\n    if (this.pswp) {\n      return this.pswp.dispatch(name, details);\n    }\n\n    const event =\n    /** @type {AugmentedEvent<T>} */\n    new PhotoSwipeEvent(name, details);\n    (_this$_listeners$name2 = this._listeners[name]) === null || _this$_listeners$name2 === void 0 || _this$_listeners$name2.forEach(listener => {\n      listener.call(this, event);\n    });\n    return event;\n  }\n\n}\n\nclass Placeholder {\n  /**\r\n   * @param {string | false} imageSrc\r\n   * @param {HTMLElement} container\r\n   */\n  constructor(imageSrc, container) {\n    // Create placeholder\n    // (stretched thumbnail or simple div behind the main image)\n\n    /** @type {HTMLImageElement | HTMLDivElement | null} */\n    this.element = createElement('pswp__img pswp__img--placeholder', imageSrc ? 'img' : 'div', container);\n\n    if (imageSrc) {\n      const imgEl =\n      /** @type {HTMLImageElement} */\n      this.element;\n      imgEl.decoding = 'async';\n      imgEl.alt = '';\n      imgEl.src = imageSrc;\n      imgEl.setAttribute('role', 'presentation');\n    }\n\n    this.element.setAttribute('aria-hidden', 'true');\n  }\n  /**\r\n   * @param {number} width\r\n   * @param {number} height\r\n   */\n\n\n  setDisplayedSize(width, height) {\n    if (!this.element) {\n      return;\n    }\n\n    if (this.element.tagName === 'IMG') {\n      // Use transform scale() to modify img placeholder size\n      // (instead of changing width/height directly).\n      // This helps with performance, specifically in iOS15 Safari.\n      setWidthHeight(this.element, 250, 'auto');\n      this.element.style.transformOrigin = '0 0';\n      this.element.style.transform = toTransformString(0, 0, width / 250);\n    } else {\n      setWidthHeight(this.element, width, height);\n    }\n  }\n\n  destroy() {\n    var _this$element;\n\n    if ((_this$element = this.element) !== null && _this$element !== void 0 && _this$element.parentNode) {\n      this.element.remove();\n    }\n\n    this.element = null;\n  }\n\n}\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../util/util.js').LoadState} LoadState */\n\nclass Content {\n  /**\r\n   * @param {SlideData} itemData Slide data\r\n   * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance\r\n   * @param {number} index\r\n   */\n  constructor(itemData, instance, index) {\n    this.instance = instance;\n    this.data = itemData;\n    this.index = index;\n    /** @type {HTMLImageElement | HTMLDivElement | undefined} */\n\n    this.element = undefined;\n    /** @type {Placeholder | undefined} */\n\n    this.placeholder = undefined;\n    /** @type {Slide | undefined} */\n\n    this.slide = undefined;\n    this.displayedImageWidth = 0;\n    this.displayedImageHeight = 0;\n    this.width = Number(this.data.w) || Number(this.data.width) || 0;\n    this.height = Number(this.data.h) || Number(this.data.height) || 0;\n    this.isAttached = false;\n    this.hasSlide = false;\n    this.isDecoding = false;\n    /** @type {LoadState} */\n\n    this.state = LOAD_STATE.IDLE;\n\n    if (this.data.type) {\n      this.type = this.data.type;\n    } else if (this.data.src) {\n      this.type = 'image';\n    } else {\n      this.type = 'html';\n    }\n\n    this.instance.dispatch('contentInit', {\n      content: this\n    });\n  }\n\n  removePlaceholder() {\n    if (this.placeholder && !this.keepPlaceholder()) {\n      // With delay, as image might be loaded, but not rendered\n      setTimeout(() => {\n        if (this.placeholder) {\n          this.placeholder.destroy();\n          this.placeholder = undefined;\n        }\n      }, 1000);\n    }\n  }\n  /**\r\n   * Preload content\r\n   *\r\n   * @param {boolean} isLazy\r\n   * @param {boolean} [reload]\r\n   */\n\n\n  load(isLazy, reload) {\n    if (this.slide && this.usePlaceholder()) {\n      if (!this.placeholder) {\n        const placeholderSrc = this.instance.applyFilters('placeholderSrc', // use  image-based placeholder only for the first slide,\n        // as rendering (even small stretched thumbnail) is an expensive operation\n        this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : false, this);\n        this.placeholder = new Placeholder(placeholderSrc, this.slide.container);\n      } else {\n        const placeholderEl = this.placeholder.element; // Add placeholder to DOM if it was already created\n\n        if (placeholderEl && !placeholderEl.parentElement) {\n          this.slide.container.prepend(placeholderEl);\n        }\n      }\n    }\n\n    if (this.element && !reload) {\n      return;\n    }\n\n    if (this.instance.dispatch('contentLoad', {\n      content: this,\n      isLazy\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (this.isImageContent()) {\n      this.element = createElement('pswp__img', 'img'); // Start loading only after width is defined, as sizes might depend on it.\n      // Due to Safari feature, we must define sizes before srcset.\n\n      if (this.displayedImageWidth) {\n        this.loadImage(isLazy);\n      }\n    } else {\n      this.element = createElement('pswp__content', 'div');\n      this.element.innerHTML = this.data.html || '';\n    }\n\n    if (reload && this.slide) {\n      this.slide.updateContentSize(true);\n    }\n  }\n  /**\r\n   * Preload image\r\n   *\r\n   * @param {boolean} isLazy\r\n   */\n\n\n  loadImage(isLazy) {\n    var _this$data$src, _this$data$alt;\n\n    if (!this.isImageContent() || !this.element || this.instance.dispatch('contentLoadImage', {\n      content: this,\n      isLazy\n    }).defaultPrevented) {\n      return;\n    }\n\n    const imageElement =\n    /** @type HTMLImageElement */\n    this.element;\n    this.updateSrcsetSizes();\n\n    if (this.data.srcset) {\n      imageElement.srcset = this.data.srcset;\n    }\n\n    imageElement.src = (_this$data$src = this.data.src) !== null && _this$data$src !== void 0 ? _this$data$src : '';\n    imageElement.alt = (_this$data$alt = this.data.alt) !== null && _this$data$alt !== void 0 ? _this$data$alt : '';\n    this.state = LOAD_STATE.LOADING;\n\n    if (imageElement.complete) {\n      this.onLoaded();\n    } else {\n      imageElement.onload = () => {\n        this.onLoaded();\n      };\n\n      imageElement.onerror = () => {\n        this.onError();\n      };\n    }\n  }\n  /**\r\n   * Assign slide to content\r\n   *\r\n   * @param {Slide} slide\r\n   */\n\n\n  setSlide(slide) {\n    this.slide = slide;\n    this.hasSlide = true;\n    this.instance = slide.pswp; // todo: do we need to unset slide?\n  }\n  /**\r\n   * Content load success handler\r\n   */\n\n\n  onLoaded() {\n    this.state = LOAD_STATE.LOADED;\n\n    if (this.slide && this.element) {\n      this.instance.dispatch('loadComplete', {\n        slide: this.slide,\n        content: this\n      }); // if content is reloaded\n\n      if (this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode) {\n        this.append();\n        this.slide.updateContentSize(true);\n      }\n\n      if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n        this.removePlaceholder();\n      }\n    }\n  }\n  /**\r\n   * Content load error handler\r\n   */\n\n\n  onError() {\n    this.state = LOAD_STATE.ERROR;\n\n    if (this.slide) {\n      this.displayError();\n      this.instance.dispatch('loadComplete', {\n        slide: this.slide,\n        isError: true,\n        content: this\n      });\n      this.instance.dispatch('loadError', {\n        slide: this.slide,\n        content: this\n      });\n    }\n  }\n  /**\r\n   * @returns {Boolean} If the content is currently loading\r\n   */\n\n\n  isLoading() {\n    return this.instance.applyFilters('isContentLoading', this.state === LOAD_STATE.LOADING, this);\n  }\n  /**\r\n   * @returns {Boolean} If the content is in error state\r\n   */\n\n\n  isError() {\n    return this.state === LOAD_STATE.ERROR;\n  }\n  /**\r\n   * @returns {boolean} If the content is image\r\n   */\n\n\n  isImageContent() {\n    return this.type === 'image';\n  }\n  /**\r\n   * Update content size\r\n   *\r\n   * @param {Number} width\r\n   * @param {Number} height\r\n   */\n\n\n  setDisplayedSize(width, height) {\n    if (!this.element) {\n      return;\n    }\n\n    if (this.placeholder) {\n      this.placeholder.setDisplayedSize(width, height);\n    }\n\n    if (this.instance.dispatch('contentResize', {\n      content: this,\n      width,\n      height\n    }).defaultPrevented) {\n      return;\n    }\n\n    setWidthHeight(this.element, width, height);\n\n    if (this.isImageContent() && !this.isError()) {\n      const isInitialSizeUpdate = !this.displayedImageWidth && width;\n      this.displayedImageWidth = width;\n      this.displayedImageHeight = height;\n\n      if (isInitialSizeUpdate) {\n        this.loadImage(false);\n      } else {\n        this.updateSrcsetSizes();\n      }\n\n      if (this.slide) {\n        this.instance.dispatch('imageSizeChange', {\n          slide: this.slide,\n          width,\n          height,\n          content: this\n        });\n      }\n    }\n  }\n  /**\r\n   * @returns {boolean} If the content can be zoomed\r\n   */\n\n\n  isZoomable() {\n    return this.instance.applyFilters('isContentZoomable', this.isImageContent() && this.state !== LOAD_STATE.ERROR, this);\n  }\n  /**\r\n   * Update image srcset sizes attribute based on width and height\r\n   */\n\n\n  updateSrcsetSizes() {\n    // Handle srcset sizes attribute.\n    //\n    // Never lower quality, if it was increased previously.\n    // Chrome does this automatically, Firefox and Safari do not,\n    // so we store largest used size in dataset.\n    if (!this.isImageContent() || !this.element || !this.data.srcset) {\n      return;\n    }\n\n    const image =\n    /** @type HTMLImageElement */\n    this.element;\n    const sizesWidth = this.instance.applyFilters('srcsetSizesWidth', this.displayedImageWidth, this);\n\n    if (!image.dataset.largestUsedSize || sizesWidth > parseInt(image.dataset.largestUsedSize, 10)) {\n      image.sizes = sizesWidth + 'px';\n      image.dataset.largestUsedSize = String(sizesWidth);\n    }\n  }\n  /**\r\n   * @returns {boolean} If content should use a placeholder (from msrc by default)\r\n   */\n\n\n  usePlaceholder() {\n    return this.instance.applyFilters('useContentPlaceholder', this.isImageContent(), this);\n  }\n  /**\r\n   * Preload content with lazy-loading param\r\n   */\n\n\n  lazyLoad() {\n    if (this.instance.dispatch('contentLazyLoad', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    this.load(true);\n  }\n  /**\r\n   * @returns {boolean} If placeholder should be kept after content is loaded\r\n   */\n\n\n  keepPlaceholder() {\n    return this.instance.applyFilters('isKeepingPlaceholder', this.isLoading(), this);\n  }\n  /**\r\n   * Destroy the content\r\n   */\n\n\n  destroy() {\n    this.hasSlide = false;\n    this.slide = undefined;\n\n    if (this.instance.dispatch('contentDestroy', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    this.remove();\n\n    if (this.placeholder) {\n      this.placeholder.destroy();\n      this.placeholder = undefined;\n    }\n\n    if (this.isImageContent() && this.element) {\n      this.element.onload = null;\n      this.element.onerror = null;\n      this.element = undefined;\n    }\n  }\n  /**\r\n   * Display error message\r\n   */\n\n\n  displayError() {\n    if (this.slide) {\n      var _this$instance$option, _this$instance$option2;\n\n      let errorMsgEl = createElement('pswp__error-msg', 'div');\n      errorMsgEl.innerText = (_this$instance$option = (_this$instance$option2 = this.instance.options) === null || _this$instance$option2 === void 0 ? void 0 : _this$instance$option2.errorMsg) !== null && _this$instance$option !== void 0 ? _this$instance$option : '';\n      errorMsgEl =\n      /** @type {HTMLDivElement} */\n      this.instance.applyFilters('contentErrorElement', errorMsgEl, this);\n      this.element = createElement('pswp__content pswp__error-msg-container', 'div');\n      this.element.appendChild(errorMsgEl);\n      this.slide.container.innerText = '';\n      this.slide.container.appendChild(this.element);\n      this.slide.updateContentSize(true);\n      this.removePlaceholder();\n    }\n  }\n  /**\r\n   * Append the content\r\n   */\n\n\n  append() {\n    if (this.isAttached || !this.element) {\n      return;\n    }\n\n    this.isAttached = true;\n\n    if (this.state === LOAD_STATE.ERROR) {\n      this.displayError();\n      return;\n    }\n\n    if (this.instance.dispatch('contentAppend', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    const supportsDecode = ('decode' in this.element);\n\n    if (this.isImageContent()) {\n      // Use decode() on nearby slides\n      //\n      // Nearby slide images are in DOM and not hidden via display:none.\n      // However, they are placed offscreen (to the left and right side).\n      //\n      // Some browsers do not composite the image until it's actually visible,\n      // using decode() helps.\n      //\n      // You might ask \"why dont you just decode() and then append all images\",\n      // that's because I want to show image before it's fully loaded,\n      // as browser can render parts of image while it is loading.\n      // We do not do this in Safari due to partial loading bug.\n      if (supportsDecode && this.slide && (!this.slide.isActive || isSafari())) {\n        this.isDecoding = true; // purposefully using finally instead of then,\n        // as if srcset sizes changes dynamically - it may cause decode error\n\n        /** @type {HTMLImageElement} */\n\n        this.element.decode().catch(() => {}).finally(() => {\n          this.isDecoding = false;\n          this.appendImage();\n        });\n      } else {\n        this.appendImage();\n      }\n    } else if (this.slide && !this.element.parentNode) {\n      this.slide.container.appendChild(this.element);\n    }\n  }\n  /**\r\n   * Activate the slide,\r\n   * active slide is generally the current one,\r\n   * meaning the user can see it.\r\n   */\n\n\n  activate() {\n    if (this.instance.dispatch('contentActivate', {\n      content: this\n    }).defaultPrevented || !this.slide) {\n      return;\n    }\n\n    if (this.isImageContent() && this.isDecoding && !isSafari()) {\n      // add image to slide when it becomes active,\n      // even if it's not finished decoding\n      this.appendImage();\n    } else if (this.isError()) {\n      this.load(false, true); // try to reload\n    }\n\n    if (this.slide.holderElement) {\n      this.slide.holderElement.setAttribute('aria-hidden', 'false');\n    }\n  }\n  /**\r\n   * Deactivate the content\r\n   */\n\n\n  deactivate() {\n    this.instance.dispatch('contentDeactivate', {\n      content: this\n    });\n\n    if (this.slide && this.slide.holderElement) {\n      this.slide.holderElement.setAttribute('aria-hidden', 'true');\n    }\n  }\n  /**\r\n   * Remove the content from DOM\r\n   */\n\n\n  remove() {\n    this.isAttached = false;\n\n    if (this.instance.dispatch('contentRemove', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (this.element && this.element.parentNode) {\n      this.element.remove();\n    }\n\n    if (this.placeholder && this.placeholder.element) {\n      this.placeholder.element.remove();\n    }\n  }\n  /**\r\n   * Append the image content to slide container\r\n   */\n\n\n  appendImage() {\n    if (!this.isAttached) {\n      return;\n    }\n\n    if (this.instance.dispatch('contentAppendImage', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    } // ensure that element exists and is not already appended\n\n\n    if (this.slide && this.element && !this.element.parentNode) {\n      this.slide.container.appendChild(this.element);\n    }\n\n    if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n      this.removePlaceholder();\n    }\n  }\n\n}\n\n/** @typedef {import('./content.js').default} Content */\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\nconst MIN_SLIDES_TO_CACHE = 5;\n/**\r\n * Lazy-load an image\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance\r\n * @param {number} index\r\n * @returns {Content} Image that is being decoded or false.\r\n */\n\nfunction lazyLoadData(itemData, instance, index) {\n  const content = instance.createContentFromData(itemData, index);\n  /** @type {ZoomLevel | undefined} */\n\n  let zoomLevel;\n  const {\n    options\n  } = instance; // We need to know dimensions of the image to preload it,\n  // as it might use srcset, and we need to define sizes\n\n  if (options) {\n    zoomLevel = new ZoomLevel(options, itemData, -1);\n    let viewportSize;\n\n    if (instance.pswp) {\n      viewportSize = instance.pswp.viewportSize;\n    } else {\n      viewportSize = getViewportSize(options, instance);\n    }\n\n    const panAreaSize = getPanAreaSize(options, viewportSize, itemData, index);\n    zoomLevel.update(content.width, content.height, panAreaSize);\n  }\n\n  content.lazyLoad();\n\n  if (zoomLevel) {\n    content.setDisplayedSize(Math.ceil(content.width * zoomLevel.initial), Math.ceil(content.height * zoomLevel.initial));\n  }\n\n  return content;\n}\n/**\r\n * Lazy-loads specific slide.\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * By default, it loads image based on viewport size and initial zoom level.\r\n *\r\n * @param {number} index Slide index\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox eventable instance\r\n * @returns {Content | undefined}\r\n */\n\nfunction lazyLoadSlide(index, instance) {\n  const itemData = instance.getItemData(index);\n\n  if (instance.dispatch('lazyLoadSlide', {\n    index,\n    itemData\n  }).defaultPrevented) {\n    return;\n  }\n\n  return lazyLoadData(itemData, instance, index);\n}\n\nclass ContentLoader {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp; // Total amount of cached images\n\n    this.limit = Math.max(pswp.options.preload[0] + pswp.options.preload[1] + 1, MIN_SLIDES_TO_CACHE);\n    /** @type {Content[]} */\n\n    this._cachedItems = [];\n  }\n  /**\r\n   * Lazy load nearby slides based on `preload` option.\r\n   *\r\n   * @param {number} [diff] Difference between slide indexes that was changed recently, or 0.\r\n   */\n\n\n  updateLazy(diff) {\n    const {\n      pswp\n    } = this;\n\n    if (pswp.dispatch('lazyLoad').defaultPrevented) {\n      return;\n    }\n\n    const {\n      preload\n    } = pswp.options;\n    const isForward = diff === undefined ? true : diff >= 0;\n    let i; // preload[1] - num items to preload in forward direction\n\n    for (i = 0; i <= preload[1]; i++) {\n      this.loadSlideByIndex(pswp.currIndex + (isForward ? i : -i));\n    } // preload[0] - num items to preload in backward direction\n\n\n    for (i = 1; i <= preload[0]; i++) {\n      this.loadSlideByIndex(pswp.currIndex + (isForward ? -i : i));\n    }\n  }\n  /**\r\n   * @param {number} initialIndex\r\n   */\n\n\n  loadSlideByIndex(initialIndex) {\n    const index = this.pswp.getLoopedIndex(initialIndex); // try to get cached content\n\n    let content = this.getContentByIndex(index);\n\n    if (!content) {\n      // no cached content, so try to load from scratch:\n      content = lazyLoadSlide(index, this.pswp); // if content can be loaded, add it to cache:\n\n      if (content) {\n        this.addToCache(content);\n      }\n    }\n  }\n  /**\r\n   * @param {Slide} slide\r\n   * @returns {Content}\r\n   */\n\n\n  getContentBySlide(slide) {\n    let content = this.getContentByIndex(slide.index);\n\n    if (!content) {\n      // create content if not found in cache\n      content = this.pswp.createContentFromData(slide.data, slide.index);\n      this.addToCache(content);\n    } // assign slide to content\n\n\n    content.setSlide(slide);\n    return content;\n  }\n  /**\r\n   * @param {Content} content\r\n   */\n\n\n  addToCache(content) {\n    // move to the end of array\n    this.removeByIndex(content.index);\n\n    this._cachedItems.push(content);\n\n    if (this._cachedItems.length > this.limit) {\n      // Destroy the first content that's not attached\n      const indexToRemove = this._cachedItems.findIndex(item => {\n        return !item.isAttached && !item.hasSlide;\n      });\n\n      if (indexToRemove !== -1) {\n        const removedItem = this._cachedItems.splice(indexToRemove, 1)[0];\n\n        removedItem.destroy();\n      }\n    }\n  }\n  /**\r\n   * Removes an image from cache, does not destroy() it, just removes.\r\n   *\r\n   * @param {number} index\r\n   */\n\n\n  removeByIndex(index) {\n    const indexToRemove = this._cachedItems.findIndex(item => item.index === index);\n\n    if (indexToRemove !== -1) {\n      this._cachedItems.splice(indexToRemove, 1);\n    }\n  }\n  /**\r\n   * @param {number} index\r\n   * @returns {Content | undefined}\r\n   */\n\n\n  getContentByIndex(index) {\n    return this._cachedItems.find(content => content.index === index);\n  }\n\n  destroy() {\n    this._cachedItems.forEach(content => content.destroy());\n\n    this._cachedItems = [];\n  }\n\n}\n\n/** @typedef {import(\"../photoswipe.js\").default} PhotoSwipe */\n\n/** @typedef {import(\"../slide/slide.js\").SlideData} SlideData */\n\n/**\r\n * PhotoSwipe base class that can retrieve data about every slide.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox\r\n */\n\nclass PhotoSwipeBase extends Eventable {\n  /**\r\n   * Get total number of slides\r\n   *\r\n   * @returns {number}\r\n   */\n  getNumItems() {\n    var _this$options;\n\n    let numItems = 0;\n    const dataSource = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.dataSource;\n\n    if (dataSource && 'length' in dataSource) {\n      // may be an array or just object with length property\n      numItems = dataSource.length;\n    } else if (dataSource && 'gallery' in dataSource) {\n      // query DOM elements\n      if (!dataSource.items) {\n        dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\n      }\n\n      if (dataSource.items) {\n        numItems = dataSource.items.length;\n      }\n    } // legacy event, before filters were introduced\n\n\n    const event = this.dispatch('numItems', {\n      dataSource,\n      numItems\n    });\n    return this.applyFilters('numItems', event.numItems, dataSource);\n  }\n  /**\r\n   * @param {SlideData} slideData\r\n   * @param {number} index\r\n   * @returns {Content}\r\n   */\n\n\n  createContentFromData(slideData, index) {\n    return new Content(slideData, this, index);\n  }\n  /**\r\n   * Get item data by index.\r\n   *\r\n   * \"item data\" should contain normalized information that PhotoSwipe needs to generate a slide.\r\n   * For example, it may contain properties like\r\n   * `src`, `srcset`, `w`, `h`, which will be used to generate a slide with image.\r\n   *\r\n   * @param {number} index\r\n   * @returns {SlideData}\r\n   */\n\n\n  getItemData(index) {\n    var _this$options2;\n\n    const dataSource = (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.dataSource;\n    /** @type {SlideData | HTMLElement} */\n\n    let dataSourceItem = {};\n\n    if (Array.isArray(dataSource)) {\n      // Datasource is an array of elements\n      dataSourceItem = dataSource[index];\n    } else if (dataSource && 'gallery' in dataSource) {\n      // dataSource has gallery property,\n      // thus it was created by Lightbox, based on\n      // gallery and children options\n      // query DOM elements\n      if (!dataSource.items) {\n        dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\n      }\n\n      dataSourceItem = dataSource.items[index];\n    }\n\n    let itemData = dataSourceItem;\n\n    if (itemData instanceof Element) {\n      itemData = this._domElementToItemData(itemData);\n    } // Dispatching the itemData event,\n    // it's a legacy verion before filters were introduced\n\n\n    const event = this.dispatch('itemData', {\n      itemData: itemData || {},\n      index\n    });\n    return this.applyFilters('itemData', event.itemData, index);\n  }\n  /**\r\n   * Get array of gallery DOM elements,\r\n   * based on childSelector and gallery element.\r\n   *\r\n   * @param {HTMLElement} galleryElement\r\n   * @returns {HTMLElement[]}\r\n   */\n\n\n  _getGalleryDOMElements(galleryElement) {\n    var _this$options3, _this$options4;\n\n    if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.children || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.childSelector) {\n      return getElementsFromOption(this.options.children, this.options.childSelector, galleryElement) || [];\n    }\n\n    return [galleryElement];\n  }\n  /**\r\n   * Converts DOM element to item data object.\r\n   *\r\n   * @param {HTMLElement} element DOM element\r\n   * @returns {SlideData}\r\n   */\n\n\n  _domElementToItemData(element) {\n    /** @type {SlideData} */\n    const itemData = {\n      element\n    };\n    const linkEl =\n    /** @type {HTMLAnchorElement} */\n    element.tagName === 'A' ? element : element.querySelector('a');\n\n    if (linkEl) {\n      // src comes from data-pswp-src attribute,\n      // if it's empty link href is used\n      itemData.src = linkEl.dataset.pswpSrc || linkEl.href;\n\n      if (linkEl.dataset.pswpSrcset) {\n        itemData.srcset = linkEl.dataset.pswpSrcset;\n      }\n\n      itemData.width = linkEl.dataset.pswpWidth ? parseInt(linkEl.dataset.pswpWidth, 10) : 0;\n      itemData.height = linkEl.dataset.pswpHeight ? parseInt(linkEl.dataset.pswpHeight, 10) : 0; // support legacy w & h properties\n\n      itemData.w = itemData.width;\n      itemData.h = itemData.height;\n\n      if (linkEl.dataset.pswpType) {\n        itemData.type = linkEl.dataset.pswpType;\n      }\n\n      const thumbnailEl = element.querySelector('img');\n\n      if (thumbnailEl) {\n        var _thumbnailEl$getAttri;\n\n        // msrc is URL to placeholder image that's displayed before large image is loaded\n        // by default it's displayed only for the first slide\n        itemData.msrc = thumbnailEl.currentSrc || thumbnailEl.src;\n        itemData.alt = (_thumbnailEl$getAttri = thumbnailEl.getAttribute('alt')) !== null && _thumbnailEl$getAttri !== void 0 ? _thumbnailEl$getAttri : '';\n      }\n\n      if (linkEl.dataset.pswpCropped || linkEl.dataset.cropped) {\n        itemData.thumbCropped = true;\n      }\n    }\n\n    return this.applyFilters('domItemData', itemData, element, linkEl);\n  }\n  /**\r\n   * Lazy-load by slide data\r\n   *\r\n   * @param {SlideData} itemData Data about the slide\r\n   * @param {number} index\r\n   * @returns {Content} Image that is being decoded or false.\r\n   */\n\n\n  lazyLoadData(itemData, index) {\n    return lazyLoadData(itemData, this, index);\n  }\n\n}\n\n/** @typedef {import('./photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('./slide/get-thumb-bounds.js').Bounds} Bounds */\n\n/** @typedef {import('./util/animations.js').AnimationProps} AnimationProps */\n// some browsers do not paint\n// elements which opacity is set to 0,\n// since we need to pre-render elements for the animation -\n// we set it to the minimum amount\n\nconst MIN_OPACITY = 0.003;\n/**\r\n * Manages opening and closing transitions of the PhotoSwipe.\r\n *\r\n * It can perform zoom, fade or no transition.\r\n */\n\nclass Opener {\n  /**\r\n   * @param {PhotoSwipe} pswp\r\n   */\n  constructor(pswp) {\n    this.pswp = pswp;\n    this.isClosed = true;\n    this.isOpen = false;\n    this.isClosing = false;\n    this.isOpening = false;\n    /**\r\n     * @private\r\n     * @type {number | false | undefined}\r\n     */\n\n    this._duration = undefined;\n    /** @private */\n\n    this._useAnimation = false;\n    /** @private */\n\n    this._croppedZoom = false;\n    /** @private */\n\n    this._animateRootOpacity = false;\n    /** @private */\n\n    this._animateBgOpacity = false;\n    /**\r\n     * @private\r\n     * @type { HTMLDivElement | HTMLImageElement | null | undefined }\r\n     */\n\n    this._placeholder = undefined;\n    /**\r\n     * @private\r\n     * @type { HTMLDivElement | undefined }\r\n     */\n\n    this._opacityElement = undefined;\n    /**\r\n     * @private\r\n     * @type { HTMLDivElement | undefined }\r\n     */\n\n    this._cropContainer1 = undefined;\n    /**\r\n     * @private\r\n     * @type { HTMLElement | null | undefined }\r\n     */\n\n    this._cropContainer2 = undefined;\n    /**\r\n     * @private\r\n     * @type {Bounds | undefined}\r\n     */\n\n    this._thumbBounds = undefined;\n    this._prepareOpen = this._prepareOpen.bind(this); // Override initial zoom and pan position\n\n    pswp.on('firstZoomPan', this._prepareOpen);\n  }\n\n  open() {\n    this._prepareOpen();\n\n    this._start();\n  }\n\n  close() {\n    if (this.isClosed || this.isClosing || this.isOpening) {\n      // if we close during opening animation\n      // for now do nothing,\n      // browsers aren't good at changing the direction of the CSS transition\n      return;\n    }\n\n    const slide = this.pswp.currSlide;\n    this.isOpen = false;\n    this.isOpening = false;\n    this.isClosing = true;\n    this._duration = this.pswp.options.hideAnimationDuration;\n\n    if (slide && slide.currZoomLevel * slide.width >= this.pswp.options.maxWidthToAnimate) {\n      this._duration = 0;\n    }\n\n    this._applyStartProps();\n\n    setTimeout(() => {\n      this._start();\n    }, this._croppedZoom ? 30 : 0);\n  }\n  /** @private */\n\n\n  _prepareOpen() {\n    this.pswp.off('firstZoomPan', this._prepareOpen);\n\n    if (!this.isOpening) {\n      const slide = this.pswp.currSlide;\n      this.isOpening = true;\n      this.isClosing = false;\n      this._duration = this.pswp.options.showAnimationDuration;\n\n      if (slide && slide.zoomLevels.initial * slide.width >= this.pswp.options.maxWidthToAnimate) {\n        this._duration = 0;\n      }\n\n      this._applyStartProps();\n    }\n  }\n  /** @private */\n\n\n  _applyStartProps() {\n    const {\n      pswp\n    } = this;\n    const slide = this.pswp.currSlide;\n    const {\n      options\n    } = pswp;\n\n    if (options.showHideAnimationType === 'fade') {\n      options.showHideOpacity = true;\n      this._thumbBounds = undefined;\n    } else if (options.showHideAnimationType === 'none') {\n      options.showHideOpacity = false;\n      this._duration = 0;\n      this._thumbBounds = undefined;\n    } else if (this.isOpening && pswp._initialThumbBounds) {\n      // Use initial bounds if defined\n      this._thumbBounds = pswp._initialThumbBounds;\n    } else {\n      this._thumbBounds = this.pswp.getThumbBounds();\n    }\n\n    this._placeholder = slide === null || slide === void 0 ? void 0 : slide.getPlaceholderElement();\n    pswp.animations.stopAll(); // Discard animations when duration is less than 50ms\n\n    this._useAnimation = Boolean(this._duration && this._duration > 50);\n    this._animateZoom = Boolean(this._thumbBounds) && (slide === null || slide === void 0 ? void 0 : slide.content.usePlaceholder()) && (!this.isClosing || !pswp.mainScroll.isShifted());\n\n    if (!this._animateZoom) {\n      this._animateRootOpacity = true;\n\n      if (this.isOpening && slide) {\n        slide.zoomAndPanToInitial();\n        slide.applyCurrentZoomPan();\n      }\n    } else {\n      var _options$showHideOpac;\n\n      this._animateRootOpacity = (_options$showHideOpac = options.showHideOpacity) !== null && _options$showHideOpac !== void 0 ? _options$showHideOpac : false;\n    }\n\n    this._animateBgOpacity = !this._animateRootOpacity && this.pswp.options.bgOpacity > MIN_OPACITY;\n    this._opacityElement = this._animateRootOpacity ? pswp.element : pswp.bg;\n\n    if (!this._useAnimation) {\n      this._duration = 0;\n      this._animateZoom = false;\n      this._animateBgOpacity = false;\n      this._animateRootOpacity = true;\n\n      if (this.isOpening) {\n        if (pswp.element) {\n          pswp.element.style.opacity = String(MIN_OPACITY);\n        }\n\n        pswp.applyBgOpacity(1);\n      }\n\n      return;\n    }\n\n    if (this._animateZoom && this._thumbBounds && this._thumbBounds.innerRect) {\n      var _this$pswp$currSlide;\n\n      // Properties are used when animation from cropped thumbnail\n      this._croppedZoom = true;\n      this._cropContainer1 = this.pswp.container;\n      this._cropContainer2 = (_this$pswp$currSlide = this.pswp.currSlide) === null || _this$pswp$currSlide === void 0 ? void 0 : _this$pswp$currSlide.holderElement;\n\n      if (pswp.container) {\n        pswp.container.style.overflow = 'hidden';\n        pswp.container.style.width = pswp.viewportSize.x + 'px';\n      }\n    } else {\n      this._croppedZoom = false;\n    }\n\n    if (this.isOpening) {\n      // Apply styles before opening transition\n      if (this._animateRootOpacity) {\n        if (pswp.element) {\n          pswp.element.style.opacity = String(MIN_OPACITY);\n        }\n\n        pswp.applyBgOpacity(1);\n      } else {\n        if (this._animateBgOpacity && pswp.bg) {\n          pswp.bg.style.opacity = String(MIN_OPACITY);\n        }\n\n        if (pswp.element) {\n          pswp.element.style.opacity = '1';\n        }\n      }\n\n      if (this._animateZoom) {\n        this._setClosedStateZoomPan();\n\n        if (this._placeholder) {\n          // tell browser that we plan to animate the placeholder\n          this._placeholder.style.willChange = 'transform'; // hide placeholder to allow hiding of\n          // elements that overlap it (such as icons over the thumbnail)\n\n          this._placeholder.style.opacity = String(MIN_OPACITY);\n        }\n      }\n    } else if (this.isClosing) {\n      // hide nearby slides to make sure that\n      // they are not painted during the transition\n      if (pswp.mainScroll.itemHolders[0]) {\n        pswp.mainScroll.itemHolders[0].el.style.display = 'none';\n      }\n\n      if (pswp.mainScroll.itemHolders[2]) {\n        pswp.mainScroll.itemHolders[2].el.style.display = 'none';\n      }\n\n      if (this._croppedZoom) {\n        if (pswp.mainScroll.x !== 0) {\n          // shift the main scroller to zero position\n          pswp.mainScroll.resetPosition();\n          pswp.mainScroll.resize();\n        }\n      }\n    }\n  }\n  /** @private */\n\n\n  _start() {\n    if (this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === 'IMG') {\n      // To ensure smooth animation\n      // we wait till the current slide image placeholder is decoded,\n      // but no longer than 250ms,\n      // and no shorter than 50ms\n      // (just using requestanimationframe is not enough in Firefox,\n      // for some reason)\n      new Promise(resolve => {\n        let decoded = false;\n        let isDelaying = true;\n        decodeImage(\n        /** @type {HTMLImageElement} */\n        this._placeholder).finally(() => {\n          decoded = true;\n\n          if (!isDelaying) {\n            resolve(true);\n          }\n        });\n        setTimeout(() => {\n          isDelaying = false;\n\n          if (decoded) {\n            resolve(true);\n          }\n        }, 50);\n        setTimeout(resolve, 250);\n      }).finally(() => this._initiate());\n    } else {\n      this._initiate();\n    }\n  }\n  /** @private */\n\n\n  _initiate() {\n    var _this$pswp$element, _this$pswp$element2;\n\n    (_this$pswp$element = this.pswp.element) === null || _this$pswp$element === void 0 || _this$pswp$element.style.setProperty('--pswp-transition-duration', this._duration + 'ms');\n    this.pswp.dispatch(this.isOpening ? 'openingAnimationStart' : 'closingAnimationStart'); // legacy event\n\n    this.pswp.dispatch(\n    /** @type {'initialZoomIn' | 'initialZoomOut'} */\n    'initialZoom' + (this.isOpening ? 'In' : 'Out'));\n    (_this$pswp$element2 = this.pswp.element) === null || _this$pswp$element2 === void 0 || _this$pswp$element2.classList.toggle('pswp--ui-visible', this.isOpening);\n\n    if (this.isOpening) {\n      if (this._placeholder) {\n        // unhide the placeholder\n        this._placeholder.style.opacity = '1';\n      }\n\n      this._animateToOpenState();\n    } else if (this.isClosing) {\n      this._animateToClosedState();\n    }\n\n    if (!this._useAnimation) {\n      this._onAnimationComplete();\n    }\n  }\n  /** @private */\n\n\n  _onAnimationComplete() {\n    const {\n      pswp\n    } = this;\n    this.isOpen = this.isOpening;\n    this.isClosed = this.isClosing;\n    this.isOpening = false;\n    this.isClosing = false;\n    pswp.dispatch(this.isOpen ? 'openingAnimationEnd' : 'closingAnimationEnd'); // legacy event\n\n    pswp.dispatch(\n    /** @type {'initialZoomInEnd' | 'initialZoomOutEnd'} */\n    'initialZoom' + (this.isOpen ? 'InEnd' : 'OutEnd'));\n\n    if (this.isClosed) {\n      pswp.destroy();\n    } else if (this.isOpen) {\n      var _pswp$currSlide;\n\n      if (this._animateZoom && pswp.container) {\n        pswp.container.style.overflow = 'visible';\n        pswp.container.style.width = '100%';\n      }\n\n      (_pswp$currSlide = pswp.currSlide) === null || _pswp$currSlide === void 0 || _pswp$currSlide.applyCurrentZoomPan();\n    }\n  }\n  /** @private */\n\n\n  _animateToOpenState() {\n    const {\n      pswp\n    } = this;\n\n    if (this._animateZoom) {\n      if (this._croppedZoom && this._cropContainer1 && this._cropContainer2) {\n        this._animateTo(this._cropContainer1, 'transform', 'translate3d(0,0,0)');\n\n        this._animateTo(this._cropContainer2, 'transform', 'none');\n      }\n\n      if (pswp.currSlide) {\n        pswp.currSlide.zoomAndPanToInitial();\n\n        this._animateTo(pswp.currSlide.container, 'transform', pswp.currSlide.getCurrentTransform());\n      }\n    }\n\n    if (this._animateBgOpacity && pswp.bg) {\n      this._animateTo(pswp.bg, 'opacity', String(pswp.options.bgOpacity));\n    }\n\n    if (this._animateRootOpacity && pswp.element) {\n      this._animateTo(pswp.element, 'opacity', '1');\n    }\n  }\n  /** @private */\n\n\n  _animateToClosedState() {\n    const {\n      pswp\n    } = this;\n\n    if (this._animateZoom) {\n      this._setClosedStateZoomPan(true);\n    } // do not animate opacity if it's already at 0\n\n\n    if (this._animateBgOpacity && pswp.bgOpacity > 0.01 && pswp.bg) {\n      this._animateTo(pswp.bg, 'opacity', '0');\n    }\n\n    if (this._animateRootOpacity && pswp.element) {\n      this._animateTo(pswp.element, 'opacity', '0');\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {boolean} [animate]\r\n   */\n\n\n  _setClosedStateZoomPan(animate) {\n    if (!this._thumbBounds) return;\n    const {\n      pswp\n    } = this;\n    const {\n      innerRect\n    } = this._thumbBounds;\n    const {\n      currSlide,\n      viewportSize\n    } = pswp;\n\n    if (this._croppedZoom && innerRect && this._cropContainer1 && this._cropContainer2) {\n      const containerOnePanX = -viewportSize.x + (this._thumbBounds.x - innerRect.x) + innerRect.w;\n      const containerOnePanY = -viewportSize.y + (this._thumbBounds.y - innerRect.y) + innerRect.h;\n      const containerTwoPanX = viewportSize.x - innerRect.w;\n      const containerTwoPanY = viewportSize.y - innerRect.h;\n\n      if (animate) {\n        this._animateTo(this._cropContainer1, 'transform', toTransformString(containerOnePanX, containerOnePanY));\n\n        this._animateTo(this._cropContainer2, 'transform', toTransformString(containerTwoPanX, containerTwoPanY));\n      } else {\n        setTransform(this._cropContainer1, containerOnePanX, containerOnePanY);\n        setTransform(this._cropContainer2, containerTwoPanX, containerTwoPanY);\n      }\n    }\n\n    if (currSlide) {\n      equalizePoints(currSlide.pan, innerRect || this._thumbBounds);\n      currSlide.currZoomLevel = this._thumbBounds.w / currSlide.width;\n\n      if (animate) {\n        this._animateTo(currSlide.container, 'transform', currSlide.getCurrentTransform());\n      } else {\n        currSlide.applyCurrentZoomPan();\n      }\n    }\n  }\n  /**\r\n   * @private\r\n   * @param {HTMLElement} target\r\n   * @param {'transform' | 'opacity'} prop\r\n   * @param {string} propValue\r\n   */\n\n\n  _animateTo(target, prop, propValue) {\n    if (!this._duration) {\n      target.style[prop] = propValue;\n      return;\n    }\n\n    const {\n      animations\n    } = this.pswp;\n    /** @type {AnimationProps} */\n\n    const animProps = {\n      duration: this._duration,\n      easing: this.pswp.options.easing,\n      onComplete: () => {\n        if (!animations.activeAnimations.length) {\n          this._onAnimationComplete();\n        }\n      },\n      target\n    };\n    animProps[prop] = propValue;\n    animations.startTransition(animProps);\n  }\n\n}\n\n/**\r\n * @template T\r\n * @typedef {import('./types.js').Type<T>} Type<T>\r\n */\n\n/** @typedef {import('./slide/slide.js').SlideData} SlideData */\n\n/** @typedef {import('./slide/zoom-level.js').ZoomLevelOption} ZoomLevelOption */\n\n/** @typedef {import('./ui/ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('./main-scroll.js').ItemHolder} ItemHolder */\n\n/** @typedef {import('./core/eventable.js').PhotoSwipeEventsMap} PhotoSwipeEventsMap */\n\n/** @typedef {import('./core/eventable.js').PhotoSwipeFiltersMap} PhotoSwipeFiltersMap */\n\n/** @typedef {import('./slide/get-thumb-bounds').Bounds} Bounds */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {import('./core/eventable.js').EventCallback<T>} EventCallback<T>\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {import('./core/eventable.js').AugmentedEvent<T>} AugmentedEvent<T>\r\n */\n\n/** @typedef {{ x: number; y: number; id?: string | number }} Point */\n\n/** @typedef {{ top: number; bottom: number; left: number; right: number }} Padding */\n\n/** @typedef {SlideData[]} DataSourceArray */\n\n/** @typedef {{ gallery: HTMLElement; items?: HTMLElement[] }} DataSourceObject */\n\n/** @typedef {DataSourceArray | DataSourceObject} DataSource */\n\n/** @typedef {(point: Point, originalEvent: PointerEvent) => void} ActionFn */\n\n/** @typedef {'close' | 'next' | 'zoom' | 'zoom-or-close' | 'toggle-controls'} ActionType */\n\n/** @typedef {Type<PhotoSwipe> | { default: Type<PhotoSwipe> }} PhotoSwipeModule */\n\n/** @typedef {PhotoSwipeModule | Promise<PhotoSwipeModule> | (() => Promise<PhotoSwipeModule>)} PhotoSwipeModuleOption */\n\n/**\r\n * @typedef {string | NodeListOf<HTMLElement> | HTMLElement[] | HTMLElement} ElementProvider\r\n */\n\n/** @typedef {Partial<PreparedPhotoSwipeOptions>} PhotoSwipeOptions https://photoswipe.com/options/ */\n\n/**\r\n * @typedef {Object} PreparedPhotoSwipeOptions\r\n *\r\n * @prop {DataSource} [dataSource]\r\n * Pass an array of any items via dataSource option. Its length will determine amount of slides\r\n * (which may be modified further from numItems event).\r\n *\r\n * Each item should contain data that you need to generate slide\r\n * (for image slide it would be src (image URL), width (image width), height, srcset, alt).\r\n *\r\n * If these properties are not present in your initial array, you may \"pre-parse\" each item from itemData filter.\r\n *\r\n * @prop {number} bgOpacity\r\n * Background backdrop opacity, always define it via this option and not via CSS rgba color.\r\n *\r\n * @prop {number} spacing\r\n * Spacing between slides. Defined as ratio relative to the viewport width (0.1 = 10% of viewport).\r\n *\r\n * @prop {boolean} allowPanToNext\r\n * Allow swipe navigation to the next slide when the current slide is zoomed. Does not apply to mouse events.\r\n *\r\n * @prop {boolean} loop\r\n * If set to true you'll be able to swipe from the last to the first image.\r\n * Option is always false when there are less than 3 slides.\r\n *\r\n * @prop {boolean} [wheelToZoom]\r\n * By default PhotoSwipe zooms image with ctrl-wheel, if you enable this option - image will zoom just via wheel.\r\n *\r\n * @prop {boolean} pinchToClose\r\n * Pinch touch gesture to close the gallery.\r\n *\r\n * @prop {boolean} closeOnVerticalDrag\r\n * Vertical drag gesture to close the PhotoSwipe.\r\n *\r\n * @prop {Padding} [padding]\r\n * Slide area padding (in pixels).\r\n *\r\n * @prop {(viewportSize: Point, itemData: SlideData, index: number) => Padding} [paddingFn]\r\n * The option is checked frequently, so make sure it's performant. Overrides padding option if defined. For example:\r\n *\r\n * @prop {number | false} hideAnimationDuration\r\n * Transition duration in milliseconds, can be 0.\r\n *\r\n * @prop {number | false} showAnimationDuration\r\n * Transition duration in milliseconds, can be 0.\r\n *\r\n * @prop {number | false} zoomAnimationDuration\r\n * Transition duration in milliseconds, can be 0.\r\n *\r\n * @prop {string} easing\r\n * String, 'cubic-bezier(.4,0,.22,1)'. CSS easing function for open/close/zoom transitions.\r\n *\r\n * @prop {boolean} escKey\r\n * Esc key to close.\r\n *\r\n * @prop {boolean} arrowKeys\r\n * Left/right arrow keys for navigation.\r\n *\r\n * @prop {boolean} trapFocus\r\n * Trap focus within PhotoSwipe element while it's open.\r\n *\r\n * @prop {boolean} returnFocus\r\n * Restore focus the last active element after PhotoSwipe is closed.\r\n *\r\n * @prop {boolean} clickToCloseNonZoomable\r\n * If image is not zoomable (for example, smaller than viewport) it can be closed by clicking on it.\r\n *\r\n * @prop {ActionType | ActionFn | false} imageClickAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {ActionType | ActionFn | false} bgClickAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {ActionType | ActionFn | false} tapAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {ActionType | ActionFn | false} doubleTapAction\r\n * Refer to click and tap actions page.\r\n *\r\n * @prop {number} preloaderDelay\r\n * Delay before the loading indicator will be displayed,\r\n * if image is loaded during it - the indicator will not be displayed at all. Can be zero.\r\n *\r\n * @prop {string} indexIndicatorSep\r\n * Used for slide count indicator (\"1 of 10 \").\r\n *\r\n * @prop {(options: PhotoSwipeOptions, pswp: PhotoSwipeBase) => Point} [getViewportSizeFn]\r\n * A function that should return slide viewport width and height, in format {x: 100, y: 100}.\r\n *\r\n * @prop {string} errorMsg\r\n * Message to display when the image wasn't able to load. If you need to display HTML - use contentErrorElement filter.\r\n *\r\n * @prop {[number, number]} preload\r\n * Lazy loading of nearby slides based on direction of movement. Should be an array with two integers,\r\n * first one - number of items to preload before the current image, second one - after the current image.\r\n * Two nearby images are always loaded.\r\n *\r\n * @prop {string} [mainClass]\r\n * Class that will be added to the root element of PhotoSwipe, may contain multiple separated by space.\r\n * Example on Styling page.\r\n *\r\n * @prop {HTMLElement} [appendToEl]\r\n * Element to which PhotoSwipe dialog will be appended when it opens.\r\n *\r\n * @prop {number} maxWidthToAnimate\r\n * Maximum width of image to animate, if initial rendered image width\r\n * is larger than this value - the opening/closing transition will be automatically disabled.\r\n *\r\n * @prop {string} [closeTitle]\r\n * Translating\r\n *\r\n * @prop {string} [zoomTitle]\r\n * Translating\r\n *\r\n * @prop {string} [arrowPrevTitle]\r\n * Translating\r\n *\r\n * @prop {string} [arrowNextTitle]\r\n * Translating\r\n *\r\n * @prop {'zoom' | 'fade' | 'none'} [showHideAnimationType]\r\n * To adjust opening or closing transition type use lightbox option `showHideAnimationType` (`String`).\r\n * It supports three values - `zoom` (default), `fade` (default if there is no thumbnail) and `none`.\r\n *\r\n * Animations are automatically disabled if user `(prefers-reduced-motion: reduce)`.\r\n *\r\n * @prop {number} index\r\n * Defines start slide index.\r\n *\r\n * @prop {(e: MouseEvent) => number} [getClickedIndexFn]\r\n *\r\n * @prop {boolean} [arrowPrev]\r\n * @prop {boolean} [arrowNext]\r\n * @prop {boolean} [zoom]\r\n * @prop {boolean} [close]\r\n * @prop {boolean} [counter]\r\n *\r\n * @prop {string} [arrowPrevSVG]\r\n * @prop {string} [arrowNextSVG]\r\n * @prop {string} [zoomSVG]\r\n * @prop {string} [closeSVG]\r\n * @prop {string} [counterSVG]\r\n *\r\n * @prop {string} [arrowPrevTitle]\r\n * @prop {string} [arrowNextTitle]\r\n * @prop {string} [zoomTitle]\r\n * @prop {string} [closeTitle]\r\n * @prop {string} [counterTitle]\r\n *\r\n * @prop {ZoomLevelOption} [initialZoomLevel]\r\n * @prop {ZoomLevelOption} [secondaryZoomLevel]\r\n * @prop {ZoomLevelOption} [maxZoomLevel]\r\n *\r\n * @prop {boolean} [mouseMovePan]\r\n * @prop {Point | null} [initialPointerPos]\r\n * @prop {boolean} [showHideOpacity]\r\n *\r\n * @prop {PhotoSwipeModuleOption} [pswpModule]\r\n * @prop {() => Promise<any>} [openPromise]\r\n * @prop {boolean} [preloadFirstSlide]\r\n * @prop {ElementProvider} [gallery]\r\n * @prop {string} [gallerySelector]\r\n * @prop {ElementProvider} [children]\r\n * @prop {string} [childSelector]\r\n * @prop {string | false} [thumbSelector]\r\n */\n\n/** @type {PreparedPhotoSwipeOptions} */\n\nconst defaultOptions = {\n  allowPanToNext: true,\n  spacing: 0.1,\n  loop: true,\n  pinchToClose: true,\n  closeOnVerticalDrag: true,\n  hideAnimationDuration: 333,\n  showAnimationDuration: 333,\n  zoomAnimationDuration: 333,\n  escKey: true,\n  arrowKeys: true,\n  trapFocus: true,\n  returnFocus: true,\n  maxWidthToAnimate: 4000,\n  clickToCloseNonZoomable: true,\n  imageClickAction: 'zoom-or-close',\n  bgClickAction: 'close',\n  tapAction: 'toggle-controls',\n  doubleTapAction: 'zoom',\n  indexIndicatorSep: ' / ',\n  preloaderDelay: 2000,\n  bgOpacity: 0.8,\n  index: 0,\n  errorMsg: 'The image cannot be loaded',\n  preload: [1, 2],\n  easing: 'cubic-bezier(.4,0,.22,1)'\n};\n/**\r\n * PhotoSwipe Core\r\n */\n\nclass PhotoSwipe extends PhotoSwipeBase {\n  /**\r\n   * @param {PhotoSwipeOptions} [options]\r\n   */\n  constructor(options) {\n    super();\n    this.options = this._prepareOptions(options || {});\n    /**\r\n     * offset of viewport relative to document\r\n     *\r\n     * @type {Point}\r\n     */\n\n    this.offset = {\n      x: 0,\n      y: 0\n    };\n    /**\r\n     * @type {Point}\r\n     * @private\r\n     */\n\n    this._prevViewportSize = {\n      x: 0,\n      y: 0\n    };\n    /**\r\n     * Size of scrollable PhotoSwipe viewport\r\n     *\r\n     * @type {Point}\r\n     */\n\n    this.viewportSize = {\n      x: 0,\n      y: 0\n    };\n    /**\r\n     * background (backdrop) opacity\r\n     */\n\n    this.bgOpacity = 1;\n    this.currIndex = 0;\n    this.potentialIndex = 0;\n    this.isOpen = false;\n    this.isDestroying = false;\n    this.hasMouse = false;\n    /**\r\n     * @private\r\n     * @type {SlideData}\r\n     */\n\n    this._initialItemData = {};\n    /** @type {Bounds | undefined} */\n\n    this._initialThumbBounds = undefined;\n    /** @type {HTMLDivElement | undefined} */\n\n    this.topBar = undefined;\n    /** @type {HTMLDivElement | undefined} */\n\n    this.element = undefined;\n    /** @type {HTMLDivElement | undefined} */\n\n    this.template = undefined;\n    /** @type {HTMLDivElement | undefined} */\n\n    this.container = undefined;\n    /** @type {HTMLElement | undefined} */\n\n    this.scrollWrap = undefined;\n    /** @type {Slide | undefined} */\n\n    this.currSlide = undefined;\n    this.events = new DOMEvents();\n    this.animations = new Animations();\n    this.mainScroll = new MainScroll(this);\n    this.gestures = new Gestures(this);\n    this.opener = new Opener(this);\n    this.keyboard = new Keyboard(this);\n    this.contentLoader = new ContentLoader(this);\n  }\n  /** @returns {boolean} */\n\n\n  init() {\n    if (this.isOpen || this.isDestroying) {\n      return false;\n    }\n\n    this.isOpen = true;\n    this.dispatch('init'); // legacy\n\n    this.dispatch('beforeOpen');\n\n    this._createMainStructure(); // add classes to the root element of PhotoSwipe\n\n\n    let rootClasses = 'pswp--open';\n\n    if (this.gestures.supportsTouch) {\n      rootClasses += ' pswp--touch';\n    }\n\n    if (this.options.mainClass) {\n      rootClasses += ' ' + this.options.mainClass;\n    }\n\n    if (this.element) {\n      this.element.className += ' ' + rootClasses;\n    }\n\n    this.currIndex = this.options.index || 0;\n    this.potentialIndex = this.currIndex;\n    this.dispatch('firstUpdate'); // starting index can be modified here\n    // initialize scroll wheel handler to block the scroll\n\n    this.scrollWheel = new ScrollWheel(this); // sanitize index\n\n    if (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) {\n      this.currIndex = 0;\n    }\n\n    if (!this.gestures.supportsTouch) {\n      // enable mouse features if no touch support detected\n      this.mouseDetected();\n    } // causes forced synchronous layout\n\n\n    this.updateSize();\n    this.offset.y = window.pageYOffset;\n    this._initialItemData = this.getItemData(this.currIndex);\n    this.dispatch('gettingData', {\n      index: this.currIndex,\n      data: this._initialItemData,\n      slide: undefined\n    }); // *Layout* - calculate size and position of elements here\n\n    this._initialThumbBounds = this.getThumbBounds();\n    this.dispatch('initialLayout');\n    this.on('openingAnimationEnd', () => {\n      const {\n        itemHolders\n      } = this.mainScroll; // Add content to the previous and next slide\n\n      if (itemHolders[0]) {\n        itemHolders[0].el.style.display = 'block';\n        this.setContent(itemHolders[0], this.currIndex - 1);\n      }\n\n      if (itemHolders[2]) {\n        itemHolders[2].el.style.display = 'block';\n        this.setContent(itemHolders[2], this.currIndex + 1);\n      }\n\n      this.appendHeavy();\n      this.contentLoader.updateLazy();\n      this.events.add(window, 'resize', this._handlePageResize.bind(this));\n      this.events.add(window, 'scroll', this._updatePageScrollOffset.bind(this));\n      this.dispatch('bindEvents');\n    }); // set content for center slide (first time)\n\n    if (this.mainScroll.itemHolders[1]) {\n      this.setContent(this.mainScroll.itemHolders[1], this.currIndex);\n    }\n\n    this.dispatch('change');\n    this.opener.open();\n    this.dispatch('afterInit');\n    return true;\n  }\n  /**\r\n   * Get looped slide index\r\n   * (for example, -1 will return the last slide)\r\n   *\r\n   * @param {number} index\r\n   * @returns {number}\r\n   */\n\n\n  getLoopedIndex(index) {\n    const numSlides = this.getNumItems();\n\n    if (this.options.loop) {\n      if (index > numSlides - 1) {\n        index -= numSlides;\n      }\n\n      if (index < 0) {\n        index += numSlides;\n      }\n    }\n\n    return clamp(index, 0, numSlides - 1);\n  }\n\n  appendHeavy() {\n    this.mainScroll.itemHolders.forEach(itemHolder => {\n      var _itemHolder$slide;\n\n      (_itemHolder$slide = itemHolder.slide) === null || _itemHolder$slide === void 0 || _itemHolder$slide.appendHeavy();\n    });\n  }\n  /**\r\n   * Change the slide\r\n   * @param {number} index New index\r\n   */\n\n\n  goTo(index) {\n    this.mainScroll.moveIndexBy(this.getLoopedIndex(index) - this.potentialIndex);\n  }\n  /**\r\n   * Go to the next slide.\r\n   */\n\n\n  next() {\n    this.goTo(this.potentialIndex + 1);\n  }\n  /**\r\n   * Go to the previous slide.\r\n   */\n\n\n  prev() {\n    this.goTo(this.potentialIndex - 1);\n  }\n  /**\r\n   * @see slide/slide.js zoomTo\r\n   *\r\n   * @param {Parameters<Slide['zoomTo']>} args\r\n   */\n\n\n  zoomTo(...args) {\n    var _this$currSlide;\n\n    (_this$currSlide = this.currSlide) === null || _this$currSlide === void 0 || _this$currSlide.zoomTo(...args);\n  }\n  /**\r\n   * @see slide/slide.js toggleZoom\r\n   */\n\n\n  toggleZoom() {\n    var _this$currSlide2;\n\n    (_this$currSlide2 = this.currSlide) === null || _this$currSlide2 === void 0 || _this$currSlide2.toggleZoom();\n  }\n  /**\r\n   * Close the gallery.\r\n   * After closing transition ends - destroy it\r\n   */\n\n\n  close() {\n    if (!this.opener.isOpen || this.isDestroying) {\n      return;\n    }\n\n    this.isDestroying = true;\n    this.dispatch('close');\n    this.events.removeAll();\n    this.opener.close();\n  }\n  /**\r\n   * Destroys the gallery:\r\n   * - instantly closes the gallery\r\n   * - unbinds events,\r\n   * - cleans intervals and timeouts\r\n   * - removes elements from DOM\r\n   */\n\n\n  destroy() {\n    var _this$element;\n\n    if (!this.isDestroying) {\n      this.options.showHideAnimationType = 'none';\n      this.close();\n      return;\n    }\n\n    this.dispatch('destroy');\n    this._listeners = {};\n\n    if (this.scrollWrap) {\n      this.scrollWrap.ontouchmove = null;\n      this.scrollWrap.ontouchend = null;\n    }\n\n    (_this$element = this.element) === null || _this$element === void 0 || _this$element.remove();\n    this.mainScroll.itemHolders.forEach(itemHolder => {\n      var _itemHolder$slide2;\n\n      (_itemHolder$slide2 = itemHolder.slide) === null || _itemHolder$slide2 === void 0 || _itemHolder$slide2.destroy();\n    });\n    this.contentLoader.destroy();\n    this.events.removeAll();\n  }\n  /**\r\n   * Refresh/reload content of a slide by its index\r\n   *\r\n   * @param {number} slideIndex\r\n   */\n\n\n  refreshSlideContent(slideIndex) {\n    this.contentLoader.removeByIndex(slideIndex);\n    this.mainScroll.itemHolders.forEach((itemHolder, i) => {\n      var _this$currSlide$index, _this$currSlide3;\n\n      let potentialHolderIndex = ((_this$currSlide$index = (_this$currSlide3 = this.currSlide) === null || _this$currSlide3 === void 0 ? void 0 : _this$currSlide3.index) !== null && _this$currSlide$index !== void 0 ? _this$currSlide$index : 0) - 1 + i;\n\n      if (this.canLoop()) {\n        potentialHolderIndex = this.getLoopedIndex(potentialHolderIndex);\n      }\n\n      if (potentialHolderIndex === slideIndex) {\n        // set the new slide content\n        this.setContent(itemHolder, slideIndex, true); // activate the new slide if it's current\n\n        if (i === 1) {\n          var _itemHolder$slide3;\n\n          this.currSlide = itemHolder.slide;\n          (_itemHolder$slide3 = itemHolder.slide) === null || _itemHolder$slide3 === void 0 || _itemHolder$slide3.setIsActive(true);\n        }\n      }\n    });\n    this.dispatch('change');\n  }\n  /**\r\n   * Set slide content\r\n   *\r\n   * @param {ItemHolder} holder mainScroll.itemHolders array item\r\n   * @param {number} index Slide index\r\n   * @param {boolean} [force] If content should be set even if index wasn't changed\r\n   */\n\n\n  setContent(holder, index, force) {\n    if (this.canLoop()) {\n      index = this.getLoopedIndex(index);\n    }\n\n    if (holder.slide) {\n      if (holder.slide.index === index && !force) {\n        // exit if holder already contains this slide\n        // this could be common when just three slides are used\n        return;\n      } // destroy previous slide\n\n\n      holder.slide.destroy();\n      holder.slide = undefined;\n    } // exit if no loop and index is out of bounds\n\n\n    if (!this.canLoop() && (index < 0 || index >= this.getNumItems())) {\n      return;\n    }\n\n    const itemData = this.getItemData(index);\n    holder.slide = new Slide(itemData, index, this); // set current slide\n\n    if (index === this.currIndex) {\n      this.currSlide = holder.slide;\n    }\n\n    holder.slide.append(holder.el);\n  }\n  /** @returns {Point} */\n\n\n  getViewportCenterPoint() {\n    return {\n      x: this.viewportSize.x / 2,\n      y: this.viewportSize.y / 2\n    };\n  }\n  /**\r\n   * Update size of all elements.\r\n   * Executed on init and on page resize.\r\n   *\r\n   * @param {boolean} [force] Update size even if size of viewport was not changed.\r\n   */\n\n\n  updateSize(force) {\n    // let item;\n    // let itemIndex;\n    if (this.isDestroying) {\n      // exit if PhotoSwipe is closed or closing\n      // (to avoid errors, as resize event might be delayed)\n      return;\n    } //const newWidth = this.scrollWrap.clientWidth;\n    //const newHeight = this.scrollWrap.clientHeight;\n\n\n    const newViewportSize = getViewportSize(this.options, this);\n\n    if (!force && pointsEqual(newViewportSize, this._prevViewportSize)) {\n      // Exit if dimensions were not changed\n      return;\n    } //this._prevViewportSize.x = newWidth;\n    //this._prevViewportSize.y = newHeight;\n\n\n    equalizePoints(this._prevViewportSize, newViewportSize);\n    this.dispatch('beforeResize');\n    equalizePoints(this.viewportSize, this._prevViewportSize);\n\n    this._updatePageScrollOffset();\n\n    this.dispatch('viewportSize'); // Resize slides only after opener animation is finished\n    // and don't re-calculate size on inital size update\n\n    this.mainScroll.resize(this.opener.isOpen);\n\n    if (!this.hasMouse && window.matchMedia('(any-hover: hover)').matches) {\n      this.mouseDetected();\n    }\n\n    this.dispatch('resize');\n  }\n  /**\r\n   * @param {number} opacity\r\n   */\n\n\n  applyBgOpacity(opacity) {\n    this.bgOpacity = Math.max(opacity, 0);\n\n    if (this.bg) {\n      this.bg.style.opacity = String(this.bgOpacity * this.options.bgOpacity);\n    }\n  }\n  /**\r\n   * Whether mouse is detected\r\n   */\n\n\n  mouseDetected() {\n    if (!this.hasMouse) {\n      var _this$element2;\n\n      this.hasMouse = true;\n      (_this$element2 = this.element) === null || _this$element2 === void 0 || _this$element2.classList.add('pswp--has_mouse');\n    }\n  }\n  /**\r\n   * Page resize event handler\r\n   *\r\n   * @private\r\n   */\n\n\n  _handlePageResize() {\n    this.updateSize(); // In iOS webview, if element size depends on document size,\n    // it'll be measured incorrectly in resize event\n    //\n    // https://bugs.webkit.org/show_bug.cgi?id=170595\n    // https://hackernoon.com/onresize-event-broken-in-mobile-safari-d8469027bf4d\n\n    if (/iPhone|iPad|iPod/i.test(window.navigator.userAgent)) {\n      setTimeout(() => {\n        this.updateSize();\n      }, 500);\n    }\n  }\n  /**\r\n   * Page scroll offset is used\r\n   * to get correct coordinates\r\n   * relative to PhotoSwipe viewport.\r\n   *\r\n   * @private\r\n   */\n\n\n  _updatePageScrollOffset() {\n    this.setScrollOffset(0, window.pageYOffset);\n  }\n  /**\r\n   * @param {number} x\r\n   * @param {number} y\r\n   */\n\n\n  setScrollOffset(x, y) {\n    this.offset.x = x;\n    this.offset.y = y;\n    this.dispatch('updateScrollOffset');\n  }\n  /**\r\n   * Create main HTML structure of PhotoSwipe,\r\n   * and add it to DOM\r\n   *\r\n   * @private\r\n   */\n\n\n  _createMainStructure() {\n    // root DOM element of PhotoSwipe (.pswp)\n    this.element = createElement('pswp', 'div');\n    this.element.setAttribute('tabindex', '-1');\n    this.element.setAttribute('role', 'dialog'); // template is legacy prop\n\n    this.template = this.element; // Background is added as a separate element,\n    // as animating opacity is faster than animating rgba()\n\n    this.bg = createElement('pswp__bg', 'div', this.element);\n    this.scrollWrap = createElement('pswp__scroll-wrap', 'section', this.element);\n    this.container = createElement('pswp__container', 'div', this.scrollWrap); // aria pattern: carousel\n\n    this.scrollWrap.setAttribute('aria-roledescription', 'carousel');\n    this.container.setAttribute('aria-live', 'off');\n    this.container.setAttribute('id', 'pswp__items');\n    this.mainScroll.appendHolders();\n    this.ui = new UI(this);\n    this.ui.init(); // append to DOM\n\n    (this.options.appendToEl || document.body).appendChild(this.element);\n  }\n  /**\r\n   * Get position and dimensions of small thumbnail\r\n   *   {x:,y:,w:}\r\n   *\r\n   * Height is optional (calculated based on the large image)\r\n   *\r\n   * @returns {Bounds | undefined}\r\n   */\n\n\n  getThumbBounds() {\n    return getThumbBounds(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);\n  }\n  /**\r\n   * If the PhotoSwipe can have continuous loop\r\n   * @returns Boolean\r\n   */\n\n\n  canLoop() {\n    return this.options.loop && this.getNumItems() > 2;\n  }\n  /**\r\n   * @private\r\n   * @param {PhotoSwipeOptions} options\r\n   * @returns {PreparedPhotoSwipeOptions}\r\n   */\n\n\n  _prepareOptions(options) {\n    if (window.matchMedia('(prefers-reduced-motion), (update: slow)').matches) {\n      options.showHideAnimationType = 'none';\n      options.zoomAnimationDuration = 0;\n    }\n    /** @type {PreparedPhotoSwipeOptions} */\n\n\n    return { ...defaultOptions,\n      ...options\n    };\n  }\n\n}\n\nexport { PhotoSwipe as default };\n//# sourceMappingURL=photoswipe.esm.js.map\n","/*!\n  * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com\n  * (c) 2024 Dmytro Semenov\n  */\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/**\r\n * @template {keyof HTMLElementTagNameMap} T\r\n * @param {string} className\r\n * @param {T} tagName\r\n * @param {Node} [appendToEl]\r\n * @returns {HTMLElementTagNameMap[T]}\r\n */\nfunction createElement(className, tagName, appendToEl) {\n  const el = document.createElement(tagName);\n\n  if (className) {\n    el.className = className;\n  }\n\n  if (appendToEl) {\n    appendToEl.appendChild(el);\n  }\n\n  return el;\n}\n/**\r\n * Get transform string\r\n *\r\n * @param {number} x\r\n * @param {number} [y]\r\n * @param {number} [scale]\r\n * @returns {string}\r\n */\n\nfunction toTransformString(x, y, scale) {\n  let propValue = `translate3d(${x}px,${y || 0}px,0)`;\n\n  if (scale !== undefined) {\n    propValue += ` scale3d(${scale},${scale},1)`;\n  }\n\n  return propValue;\n}\n/**\r\n * Apply width and height CSS properties to element\r\n *\r\n * @param {HTMLElement} el\r\n * @param {string | number} w\r\n * @param {string | number} h\r\n */\n\nfunction setWidthHeight(el, w, h) {\n  el.style.width = typeof w === 'number' ? `${w}px` : w;\n  el.style.height = typeof h === 'number' ? `${h}px` : h;\n}\n/** @typedef {LOAD_STATE[keyof LOAD_STATE]} LoadState */\n\n/** @type {{ IDLE: 'idle'; LOADING: 'loading'; LOADED: 'loaded'; ERROR: 'error' }} */\n\nconst LOAD_STATE = {\n  IDLE: 'idle',\n  LOADING: 'loading',\n  LOADED: 'loaded',\n  ERROR: 'error'\n};\n/**\r\n * Check if click or keydown event was dispatched\r\n * with a special key or via mouse wheel.\r\n *\r\n * @param {MouseEvent | KeyboardEvent} e\r\n * @returns {boolean}\r\n */\n\nfunction specialKeyUsed(e) {\n  return 'button' in e && e.button === 1 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey;\n}\n/**\r\n * Parse `gallery` or `children` options.\r\n *\r\n * @param {import('../photoswipe.js').ElementProvider} [option]\r\n * @param {string} [legacySelector]\r\n * @param {HTMLElement | Document} [parent]\r\n * @returns HTMLElement[]\r\n */\n\nfunction getElementsFromOption(option, legacySelector, parent = document) {\n  /** @type {HTMLElement[]} */\n  let elements = [];\n\n  if (option instanceof Element) {\n    elements = [option];\n  } else if (option instanceof NodeList || Array.isArray(option)) {\n    elements = Array.from(option);\n  } else {\n    const selector = typeof option === 'string' ? option : legacySelector;\n\n    if (selector) {\n      elements = Array.from(parent.querySelectorAll(selector));\n    }\n  }\n\n  return elements;\n}\n/**\r\n * Check if variable is PhotoSwipe class\r\n *\r\n * @param {any} fn\r\n * @returns {boolean}\r\n */\n\nfunction isPswpClass(fn) {\n  return typeof fn === 'function' && fn.prototype && fn.prototype.goTo;\n}\n/**\r\n * Check if browser is Safari\r\n *\r\n * @returns {boolean}\r\n */\n\nfunction isSafari() {\n  return !!(navigator.vendor && navigator.vendor.match(/apple/i));\n}\n\n/** @typedef {import('../lightbox/lightbox.js').default} PhotoSwipeLightbox */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').DataSource} DataSource */\n\n/** @typedef {import('../ui/ui-element.js').UIElementData} UIElementData */\n\n/** @typedef {import('../slide/content.js').default} ContentDefault */\n\n/** @typedef {import('../slide/slide.js').default} Slide */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/** @typedef {import('../slide/zoom-level.js').default} ZoomLevel */\n\n/** @typedef {import('../slide/get-thumb-bounds.js').Bounds} Bounds */\n\n/**\r\n * Allow adding an arbitrary props to the Content\r\n * https://photoswipe.com/custom-content/#using-webp-image-format\r\n * @typedef {ContentDefault & Record<string, any>} Content\r\n */\n\n/** @typedef {{ x?: number; y?: number }} Point */\n\n/**\r\n * @typedef {Object} PhotoSwipeEventsMap https://photoswipe.com/events/\r\n *\r\n *\r\n * https://photoswipe.com/adding-ui-elements/\r\n *\r\n * @prop {undefined} uiRegister\r\n * @prop {{ data: UIElementData }} uiElementCreate\r\n *\r\n *\r\n * https://photoswipe.com/events/#initialization-events\r\n *\r\n * @prop {undefined} beforeOpen\r\n * @prop {undefined} firstUpdate\r\n * @prop {undefined} initialLayout\r\n * @prop {undefined} change\r\n * @prop {undefined} afterInit\r\n * @prop {undefined} bindEvents\r\n *\r\n *\r\n * https://photoswipe.com/events/#opening-or-closing-transition-events\r\n *\r\n * @prop {undefined} openingAnimationStart\r\n * @prop {undefined} openingAnimationEnd\r\n * @prop {undefined} closingAnimationStart\r\n * @prop {undefined} closingAnimationEnd\r\n *\r\n *\r\n * https://photoswipe.com/events/#closing-events\r\n *\r\n * @prop {undefined} close\r\n * @prop {undefined} destroy\r\n *\r\n *\r\n * https://photoswipe.com/events/#pointer-and-gesture-events\r\n *\r\n * @prop {{ originalEvent: PointerEvent }} pointerDown\r\n * @prop {{ originalEvent: PointerEvent }} pointerMove\r\n * @prop {{ originalEvent: PointerEvent }} pointerUp\r\n * @prop {{ bgOpacity: number }} pinchClose can be default prevented\r\n * @prop {{ panY: number }} verticalDrag can be default prevented\r\n *\r\n *\r\n * https://photoswipe.com/events/#slide-content-events\r\n *\r\n * @prop {{ content: Content }} contentInit\r\n * @prop {{ content: Content; isLazy: boolean }} contentLoad can be default prevented\r\n * @prop {{ content: Content; isLazy: boolean }} contentLoadImage can be default prevented\r\n * @prop {{ content: Content; slide: Slide; isError?: boolean }} loadComplete\r\n * @prop {{ content: Content; slide: Slide }} loadError\r\n * @prop {{ content: Content; width: number; height: number }} contentResize can be default prevented\r\n * @prop {{ content: Content; width: number; height: number; slide: Slide }} imageSizeChange\r\n * @prop {{ content: Content }} contentLazyLoad can be default prevented\r\n * @prop {{ content: Content }} contentAppend can be default prevented\r\n * @prop {{ content: Content }} contentActivate can be default prevented\r\n * @prop {{ content: Content }} contentDeactivate can be default prevented\r\n * @prop {{ content: Content }} contentRemove can be default prevented\r\n * @prop {{ content: Content }} contentDestroy can be default prevented\r\n *\r\n *\r\n * undocumented\r\n *\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} imageClickAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} bgClickAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} tapAction can be default prevented\r\n * @prop {{ point: Point; originalEvent: PointerEvent }} doubleTapAction can be default prevented\r\n *\r\n * @prop {{ originalEvent: KeyboardEvent }} keydown can be default prevented\r\n * @prop {{ x: number; dragging: boolean }} moveMainScroll\r\n * @prop {{ slide: Slide }} firstZoomPan\r\n * @prop {{ slide: Slide | undefined, data: SlideData, index: number }} gettingData\r\n * @prop {undefined} beforeResize\r\n * @prop {undefined} resize\r\n * @prop {undefined} viewportSize\r\n * @prop {undefined} updateScrollOffset\r\n * @prop {{ slide: Slide }} slideInit\r\n * @prop {{ slide: Slide }} afterSetContent\r\n * @prop {{ slide: Slide }} slideLoad\r\n * @prop {{ slide: Slide }} appendHeavy can be default prevented\r\n * @prop {{ slide: Slide }} appendHeavyContent\r\n * @prop {{ slide: Slide }} slideActivate\r\n * @prop {{ slide: Slide }} slideDeactivate\r\n * @prop {{ slide: Slide }} slideDestroy\r\n * @prop {{ destZoomLevel: number, centerPoint: Point | undefined, transitionDuration: number | false | undefined }} beforeZoomTo\r\n * @prop {{ slide: Slide }} zoomPanUpdate\r\n * @prop {{ slide: Slide }} initialZoomPan\r\n * @prop {{ slide: Slide }} calcSlideSize\r\n * @prop {undefined} resolutionChanged\r\n * @prop {{ originalEvent: WheelEvent }} wheel can be default prevented\r\n * @prop {{ content: Content }} contentAppendImage can be default prevented\r\n * @prop {{ index: number; itemData: SlideData }} lazyLoadSlide can be default prevented\r\n * @prop {undefined} lazyLoad\r\n * @prop {{ slide: Slide }} calcBounds\r\n * @prop {{ zoomLevels: ZoomLevel, slideData: SlideData }} zoomLevelsUpdate\r\n *\r\n *\r\n * legacy\r\n *\r\n * @prop {undefined} init\r\n * @prop {undefined} initialZoomIn\r\n * @prop {undefined} initialZoomOut\r\n * @prop {undefined} initialZoomInEnd\r\n * @prop {undefined} initialZoomOutEnd\r\n * @prop {{ dataSource: DataSource | undefined, numItems: number }} numItems\r\n * @prop {{ itemData: SlideData; index: number }} itemData\r\n * @prop {{ index: number, itemData: SlideData, instance: PhotoSwipe }} thumbBounds\r\n */\n\n/**\r\n * @typedef {Object} PhotoSwipeFiltersMap https://photoswipe.com/filters/\r\n *\r\n * @prop {(numItems: number, dataSource: DataSource | undefined) => number} numItems\r\n * Modify the total amount of slides. Example on Data sources page.\r\n * https://photoswipe.com/filters/#numitems\r\n *\r\n * @prop {(itemData: SlideData, index: number) => SlideData} itemData\r\n * Modify slide item data. Example on Data sources page.\r\n * https://photoswipe.com/filters/#itemdata\r\n *\r\n * @prop {(itemData: SlideData, element: HTMLElement, linkEl: HTMLAnchorElement) => SlideData} domItemData\r\n * Modify item data when it's parsed from DOM element. Example on Data sources page.\r\n * https://photoswipe.com/filters/#domitemdata\r\n *\r\n * @prop {(clickedIndex: number, e: MouseEvent, instance: PhotoSwipeLightbox) => number} clickedIndex\r\n * Modify clicked gallery item index.\r\n * https://photoswipe.com/filters/#clickedindex\r\n *\r\n * @prop {(placeholderSrc: string | false, content: Content) => string | false} placeholderSrc\r\n * Modify placeholder image source.\r\n * https://photoswipe.com/filters/#placeholdersrc\r\n *\r\n * @prop {(isContentLoading: boolean, content: Content) => boolean} isContentLoading\r\n * Modify if the content is currently loading.\r\n * https://photoswipe.com/filters/#iscontentloading\r\n *\r\n * @prop {(isContentZoomable: boolean, content: Content) => boolean} isContentZoomable\r\n * Modify if the content can be zoomed.\r\n * https://photoswipe.com/filters/#iscontentzoomable\r\n *\r\n * @prop {(useContentPlaceholder: boolean, content: Content) => boolean} useContentPlaceholder\r\n * Modify if the placeholder should be used for the content.\r\n * https://photoswipe.com/filters/#usecontentplaceholder\r\n *\r\n * @prop {(isKeepingPlaceholder: boolean, content: Content) => boolean} isKeepingPlaceholder\r\n * Modify if the placeholder should be kept after the content is loaded.\r\n * https://photoswipe.com/filters/#iskeepingplaceholder\r\n *\r\n *\r\n * @prop {(contentErrorElement: HTMLElement, content: Content) => HTMLElement} contentErrorElement\r\n * Modify an element when the content has error state (for example, if image cannot be loaded).\r\n * https://photoswipe.com/filters/#contenterrorelement\r\n *\r\n * @prop {(element: HTMLElement, data: UIElementData) => HTMLElement} uiElement\r\n * Modify a UI element that's being created.\r\n * https://photoswipe.com/filters/#uielement\r\n *\r\n * @prop {(thumbnail: HTMLElement | null | undefined, itemData: SlideData, index: number) => HTMLElement} thumbEl\r\n * Modify the thumbnail element from which opening zoom animation starts or ends.\r\n * https://photoswipe.com/filters/#thumbel\r\n *\r\n * @prop {(thumbBounds: Bounds | undefined, itemData: SlideData, index: number) => Bounds} thumbBounds\r\n * Modify the thumbnail bounds from which opening zoom animation starts or ends.\r\n * https://photoswipe.com/filters/#thumbbounds\r\n *\r\n * @prop {(srcsetSizesWidth: number, content: Content) => number} srcsetSizesWidth\r\n *\r\n * @prop {(preventPointerEvent: boolean, event: PointerEvent, pointerType: string) => boolean} preventPointerEvent\r\n *\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeFiltersMap} T\r\n * @typedef {{ fn: PhotoSwipeFiltersMap[T], priority: number }} Filter\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {PhotoSwipeEventsMap[T] extends undefined ? PhotoSwipeEvent<T> : PhotoSwipeEvent<T> & PhotoSwipeEventsMap[T]} AugmentedEvent\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {(event: AugmentedEvent<T>) => void} EventCallback\r\n */\n\n/**\r\n * Base PhotoSwipe event object\r\n *\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n */\nclass PhotoSwipeEvent {\n  /**\r\n   * @param {T} type\r\n   * @param {PhotoSwipeEventsMap[T]} [details]\r\n   */\n  constructor(type, details) {\n    this.type = type;\n    this.defaultPrevented = false;\n\n    if (details) {\n      Object.assign(this, details);\n    }\n  }\n\n  preventDefault() {\n    this.defaultPrevented = true;\n  }\n\n}\n/**\r\n * PhotoSwipe base class that can listen and dispatch for events.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox, extended by base.js\r\n */\n\n\nclass Eventable {\n  constructor() {\n    /**\r\n     * @type {{ [T in keyof PhotoSwipeEventsMap]?: ((event: AugmentedEvent<T>) => void)[] }}\r\n     */\n    this._listeners = {};\n    /**\r\n     * @type {{ [T in keyof PhotoSwipeFiltersMap]?: Filter<T>[] }}\r\n     */\n\n    this._filters = {};\n    /** @type {PhotoSwipe | undefined} */\n\n    this.pswp = undefined;\n    /** @type {PhotoSwipeOptions | undefined} */\n\n    this.options = undefined;\n  }\n  /**\r\n   * @template {keyof PhotoSwipeFiltersMap} T\r\n   * @param {T} name\r\n   * @param {PhotoSwipeFiltersMap[T]} fn\r\n   * @param {number} priority\r\n   */\n\n\n  addFilter(name, fn, priority = 100) {\n    var _this$_filters$name, _this$_filters$name2, _this$pswp;\n\n    if (!this._filters[name]) {\n      this._filters[name] = [];\n    }\n\n    (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.push({\n      fn,\n      priority\n    });\n    (_this$_filters$name2 = this._filters[name]) === null || _this$_filters$name2 === void 0 || _this$_filters$name2.sort((f1, f2) => f1.priority - f2.priority);\n    (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.addFilter(name, fn, priority);\n  }\n  /**\r\n   * @template {keyof PhotoSwipeFiltersMap} T\r\n   * @param {T} name\r\n   * @param {PhotoSwipeFiltersMap[T]} fn\r\n   */\n\n\n  removeFilter(name, fn) {\n    if (this._filters[name]) {\n      // @ts-expect-error\n      this._filters[name] = this._filters[name].filter(filter => filter.fn !== fn);\n    }\n\n    if (this.pswp) {\n      this.pswp.removeFilter(name, fn);\n    }\n  }\n  /**\r\n   * @template {keyof PhotoSwipeFiltersMap} T\r\n   * @param {T} name\r\n   * @param {Parameters<PhotoSwipeFiltersMap[T]>} args\r\n   * @returns {Parameters<PhotoSwipeFiltersMap[T]>[0]}\r\n   */\n\n\n  applyFilters(name, ...args) {\n    var _this$_filters$name3;\n\n    (_this$_filters$name3 = this._filters[name]) === null || _this$_filters$name3 === void 0 || _this$_filters$name3.forEach(filter => {\n      // @ts-expect-error\n      args[0] = filter.fn.apply(this, args);\n    });\n    return args[0];\n  }\n  /**\r\n   * @template {keyof PhotoSwipeEventsMap} T\r\n   * @param {T} name\r\n   * @param {EventCallback<T>} fn\r\n   */\n\n\n  on(name, fn) {\n    var _this$_listeners$name, _this$pswp2;\n\n    if (!this._listeners[name]) {\n      this._listeners[name] = [];\n    }\n\n    (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.push(fn); // When binding events to lightbox,\n    // also bind events to PhotoSwipe Core,\n    // if it's open.\n\n    (_this$pswp2 = this.pswp) === null || _this$pswp2 === void 0 || _this$pswp2.on(name, fn);\n  }\n  /**\r\n   * @template {keyof PhotoSwipeEventsMap} T\r\n   * @param {T} name\r\n   * @param {EventCallback<T>} fn\r\n   */\n\n\n  off(name, fn) {\n    var _this$pswp3;\n\n    if (this._listeners[name]) {\n      // @ts-expect-error\n      this._listeners[name] = this._listeners[name].filter(listener => fn !== listener);\n    }\n\n    (_this$pswp3 = this.pswp) === null || _this$pswp3 === void 0 || _this$pswp3.off(name, fn);\n  }\n  /**\r\n   * @template {keyof PhotoSwipeEventsMap} T\r\n   * @param {T} name\r\n   * @param {PhotoSwipeEventsMap[T]} [details]\r\n   * @returns {AugmentedEvent<T>}\r\n   */\n\n\n  dispatch(name, details) {\n    var _this$_listeners$name2;\n\n    if (this.pswp) {\n      return this.pswp.dispatch(name, details);\n    }\n\n    const event =\n    /** @type {AugmentedEvent<T>} */\n    new PhotoSwipeEvent(name, details);\n    (_this$_listeners$name2 = this._listeners[name]) === null || _this$_listeners$name2 === void 0 || _this$_listeners$name2.forEach(listener => {\n      listener.call(this, event);\n    });\n    return event;\n  }\n\n}\n\nclass Placeholder {\n  /**\r\n   * @param {string | false} imageSrc\r\n   * @param {HTMLElement} container\r\n   */\n  constructor(imageSrc, container) {\n    // Create placeholder\n    // (stretched thumbnail or simple div behind the main image)\n\n    /** @type {HTMLImageElement | HTMLDivElement | null} */\n    this.element = createElement('pswp__img pswp__img--placeholder', imageSrc ? 'img' : 'div', container);\n\n    if (imageSrc) {\n      const imgEl =\n      /** @type {HTMLImageElement} */\n      this.element;\n      imgEl.decoding = 'async';\n      imgEl.alt = '';\n      imgEl.src = imageSrc;\n      imgEl.setAttribute('role', 'presentation');\n    }\n\n    this.element.setAttribute('aria-hidden', 'true');\n  }\n  /**\r\n   * @param {number} width\r\n   * @param {number} height\r\n   */\n\n\n  setDisplayedSize(width, height) {\n    if (!this.element) {\n      return;\n    }\n\n    if (this.element.tagName === 'IMG') {\n      // Use transform scale() to modify img placeholder size\n      // (instead of changing width/height directly).\n      // This helps with performance, specifically in iOS15 Safari.\n      setWidthHeight(this.element, 250, 'auto');\n      this.element.style.transformOrigin = '0 0';\n      this.element.style.transform = toTransformString(0, 0, width / 250);\n    } else {\n      setWidthHeight(this.element, width, height);\n    }\n  }\n\n  destroy() {\n    var _this$element;\n\n    if ((_this$element = this.element) !== null && _this$element !== void 0 && _this$element.parentNode) {\n      this.element.remove();\n    }\n\n    this.element = null;\n  }\n\n}\n\n/** @typedef {import('./slide.js').default} Slide */\n\n/** @typedef {import('./slide.js').SlideData} SlideData */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../util/util.js').LoadState} LoadState */\n\nclass Content {\n  /**\r\n   * @param {SlideData} itemData Slide data\r\n   * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance\r\n   * @param {number} index\r\n   */\n  constructor(itemData, instance, index) {\n    this.instance = instance;\n    this.data = itemData;\n    this.index = index;\n    /** @type {HTMLImageElement | HTMLDivElement | undefined} */\n\n    this.element = undefined;\n    /** @type {Placeholder | undefined} */\n\n    this.placeholder = undefined;\n    /** @type {Slide | undefined} */\n\n    this.slide = undefined;\n    this.displayedImageWidth = 0;\n    this.displayedImageHeight = 0;\n    this.width = Number(this.data.w) || Number(this.data.width) || 0;\n    this.height = Number(this.data.h) || Number(this.data.height) || 0;\n    this.isAttached = false;\n    this.hasSlide = false;\n    this.isDecoding = false;\n    /** @type {LoadState} */\n\n    this.state = LOAD_STATE.IDLE;\n\n    if (this.data.type) {\n      this.type = this.data.type;\n    } else if (this.data.src) {\n      this.type = 'image';\n    } else {\n      this.type = 'html';\n    }\n\n    this.instance.dispatch('contentInit', {\n      content: this\n    });\n  }\n\n  removePlaceholder() {\n    if (this.placeholder && !this.keepPlaceholder()) {\n      // With delay, as image might be loaded, but not rendered\n      setTimeout(() => {\n        if (this.placeholder) {\n          this.placeholder.destroy();\n          this.placeholder = undefined;\n        }\n      }, 1000);\n    }\n  }\n  /**\r\n   * Preload content\r\n   *\r\n   * @param {boolean} isLazy\r\n   * @param {boolean} [reload]\r\n   */\n\n\n  load(isLazy, reload) {\n    if (this.slide && this.usePlaceholder()) {\n      if (!this.placeholder) {\n        const placeholderSrc = this.instance.applyFilters('placeholderSrc', // use  image-based placeholder only for the first slide,\n        // as rendering (even small stretched thumbnail) is an expensive operation\n        this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : false, this);\n        this.placeholder = new Placeholder(placeholderSrc, this.slide.container);\n      } else {\n        const placeholderEl = this.placeholder.element; // Add placeholder to DOM if it was already created\n\n        if (placeholderEl && !placeholderEl.parentElement) {\n          this.slide.container.prepend(placeholderEl);\n        }\n      }\n    }\n\n    if (this.element && !reload) {\n      return;\n    }\n\n    if (this.instance.dispatch('contentLoad', {\n      content: this,\n      isLazy\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (this.isImageContent()) {\n      this.element = createElement('pswp__img', 'img'); // Start loading only after width is defined, as sizes might depend on it.\n      // Due to Safari feature, we must define sizes before srcset.\n\n      if (this.displayedImageWidth) {\n        this.loadImage(isLazy);\n      }\n    } else {\n      this.element = createElement('pswp__content', 'div');\n      this.element.innerHTML = this.data.html || '';\n    }\n\n    if (reload && this.slide) {\n      this.slide.updateContentSize(true);\n    }\n  }\n  /**\r\n   * Preload image\r\n   *\r\n   * @param {boolean} isLazy\r\n   */\n\n\n  loadImage(isLazy) {\n    var _this$data$src, _this$data$alt;\n\n    if (!this.isImageContent() || !this.element || this.instance.dispatch('contentLoadImage', {\n      content: this,\n      isLazy\n    }).defaultPrevented) {\n      return;\n    }\n\n    const imageElement =\n    /** @type HTMLImageElement */\n    this.element;\n    this.updateSrcsetSizes();\n\n    if (this.data.srcset) {\n      imageElement.srcset = this.data.srcset;\n    }\n\n    imageElement.src = (_this$data$src = this.data.src) !== null && _this$data$src !== void 0 ? _this$data$src : '';\n    imageElement.alt = (_this$data$alt = this.data.alt) !== null && _this$data$alt !== void 0 ? _this$data$alt : '';\n    this.state = LOAD_STATE.LOADING;\n\n    if (imageElement.complete) {\n      this.onLoaded();\n    } else {\n      imageElement.onload = () => {\n        this.onLoaded();\n      };\n\n      imageElement.onerror = () => {\n        this.onError();\n      };\n    }\n  }\n  /**\r\n   * Assign slide to content\r\n   *\r\n   * @param {Slide} slide\r\n   */\n\n\n  setSlide(slide) {\n    this.slide = slide;\n    this.hasSlide = true;\n    this.instance = slide.pswp; // todo: do we need to unset slide?\n  }\n  /**\r\n   * Content load success handler\r\n   */\n\n\n  onLoaded() {\n    this.state = LOAD_STATE.LOADED;\n\n    if (this.slide && this.element) {\n      this.instance.dispatch('loadComplete', {\n        slide: this.slide,\n        content: this\n      }); // if content is reloaded\n\n      if (this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode) {\n        this.append();\n        this.slide.updateContentSize(true);\n      }\n\n      if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n        this.removePlaceholder();\n      }\n    }\n  }\n  /**\r\n   * Content load error handler\r\n   */\n\n\n  onError() {\n    this.state = LOAD_STATE.ERROR;\n\n    if (this.slide) {\n      this.displayError();\n      this.instance.dispatch('loadComplete', {\n        slide: this.slide,\n        isError: true,\n        content: this\n      });\n      this.instance.dispatch('loadError', {\n        slide: this.slide,\n        content: this\n      });\n    }\n  }\n  /**\r\n   * @returns {Boolean} If the content is currently loading\r\n   */\n\n\n  isLoading() {\n    return this.instance.applyFilters('isContentLoading', this.state === LOAD_STATE.LOADING, this);\n  }\n  /**\r\n   * @returns {Boolean} If the content is in error state\r\n   */\n\n\n  isError() {\n    return this.state === LOAD_STATE.ERROR;\n  }\n  /**\r\n   * @returns {boolean} If the content is image\r\n   */\n\n\n  isImageContent() {\n    return this.type === 'image';\n  }\n  /**\r\n   * Update content size\r\n   *\r\n   * @param {Number} width\r\n   * @param {Number} height\r\n   */\n\n\n  setDisplayedSize(width, height) {\n    if (!this.element) {\n      return;\n    }\n\n    if (this.placeholder) {\n      this.placeholder.setDisplayedSize(width, height);\n    }\n\n    if (this.instance.dispatch('contentResize', {\n      content: this,\n      width,\n      height\n    }).defaultPrevented) {\n      return;\n    }\n\n    setWidthHeight(this.element, width, height);\n\n    if (this.isImageContent() && !this.isError()) {\n      const isInitialSizeUpdate = !this.displayedImageWidth && width;\n      this.displayedImageWidth = width;\n      this.displayedImageHeight = height;\n\n      if (isInitialSizeUpdate) {\n        this.loadImage(false);\n      } else {\n        this.updateSrcsetSizes();\n      }\n\n      if (this.slide) {\n        this.instance.dispatch('imageSizeChange', {\n          slide: this.slide,\n          width,\n          height,\n          content: this\n        });\n      }\n    }\n  }\n  /**\r\n   * @returns {boolean} If the content can be zoomed\r\n   */\n\n\n  isZoomable() {\n    return this.instance.applyFilters('isContentZoomable', this.isImageContent() && this.state !== LOAD_STATE.ERROR, this);\n  }\n  /**\r\n   * Update image srcset sizes attribute based on width and height\r\n   */\n\n\n  updateSrcsetSizes() {\n    // Handle srcset sizes attribute.\n    //\n    // Never lower quality, if it was increased previously.\n    // Chrome does this automatically, Firefox and Safari do not,\n    // so we store largest used size in dataset.\n    if (!this.isImageContent() || !this.element || !this.data.srcset) {\n      return;\n    }\n\n    const image =\n    /** @type HTMLImageElement */\n    this.element;\n    const sizesWidth = this.instance.applyFilters('srcsetSizesWidth', this.displayedImageWidth, this);\n\n    if (!image.dataset.largestUsedSize || sizesWidth > parseInt(image.dataset.largestUsedSize, 10)) {\n      image.sizes = sizesWidth + 'px';\n      image.dataset.largestUsedSize = String(sizesWidth);\n    }\n  }\n  /**\r\n   * @returns {boolean} If content should use a placeholder (from msrc by default)\r\n   */\n\n\n  usePlaceholder() {\n    return this.instance.applyFilters('useContentPlaceholder', this.isImageContent(), this);\n  }\n  /**\r\n   * Preload content with lazy-loading param\r\n   */\n\n\n  lazyLoad() {\n    if (this.instance.dispatch('contentLazyLoad', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    this.load(true);\n  }\n  /**\r\n   * @returns {boolean} If placeholder should be kept after content is loaded\r\n   */\n\n\n  keepPlaceholder() {\n    return this.instance.applyFilters('isKeepingPlaceholder', this.isLoading(), this);\n  }\n  /**\r\n   * Destroy the content\r\n   */\n\n\n  destroy() {\n    this.hasSlide = false;\n    this.slide = undefined;\n\n    if (this.instance.dispatch('contentDestroy', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    this.remove();\n\n    if (this.placeholder) {\n      this.placeholder.destroy();\n      this.placeholder = undefined;\n    }\n\n    if (this.isImageContent() && this.element) {\n      this.element.onload = null;\n      this.element.onerror = null;\n      this.element = undefined;\n    }\n  }\n  /**\r\n   * Display error message\r\n   */\n\n\n  displayError() {\n    if (this.slide) {\n      var _this$instance$option, _this$instance$option2;\n\n      let errorMsgEl = createElement('pswp__error-msg', 'div');\n      errorMsgEl.innerText = (_this$instance$option = (_this$instance$option2 = this.instance.options) === null || _this$instance$option2 === void 0 ? void 0 : _this$instance$option2.errorMsg) !== null && _this$instance$option !== void 0 ? _this$instance$option : '';\n      errorMsgEl =\n      /** @type {HTMLDivElement} */\n      this.instance.applyFilters('contentErrorElement', errorMsgEl, this);\n      this.element = createElement('pswp__content pswp__error-msg-container', 'div');\n      this.element.appendChild(errorMsgEl);\n      this.slide.container.innerText = '';\n      this.slide.container.appendChild(this.element);\n      this.slide.updateContentSize(true);\n      this.removePlaceholder();\n    }\n  }\n  /**\r\n   * Append the content\r\n   */\n\n\n  append() {\n    if (this.isAttached || !this.element) {\n      return;\n    }\n\n    this.isAttached = true;\n\n    if (this.state === LOAD_STATE.ERROR) {\n      this.displayError();\n      return;\n    }\n\n    if (this.instance.dispatch('contentAppend', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    const supportsDecode = ('decode' in this.element);\n\n    if (this.isImageContent()) {\n      // Use decode() on nearby slides\n      //\n      // Nearby slide images are in DOM and not hidden via display:none.\n      // However, they are placed offscreen (to the left and right side).\n      //\n      // Some browsers do not composite the image until it's actually visible,\n      // using decode() helps.\n      //\n      // You might ask \"why dont you just decode() and then append all images\",\n      // that's because I want to show image before it's fully loaded,\n      // as browser can render parts of image while it is loading.\n      // We do not do this in Safari due to partial loading bug.\n      if (supportsDecode && this.slide && (!this.slide.isActive || isSafari())) {\n        this.isDecoding = true; // purposefully using finally instead of then,\n        // as if srcset sizes changes dynamically - it may cause decode error\n\n        /** @type {HTMLImageElement} */\n\n        this.element.decode().catch(() => {}).finally(() => {\n          this.isDecoding = false;\n          this.appendImage();\n        });\n      } else {\n        this.appendImage();\n      }\n    } else if (this.slide && !this.element.parentNode) {\n      this.slide.container.appendChild(this.element);\n    }\n  }\n  /**\r\n   * Activate the slide,\r\n   * active slide is generally the current one,\r\n   * meaning the user can see it.\r\n   */\n\n\n  activate() {\n    if (this.instance.dispatch('contentActivate', {\n      content: this\n    }).defaultPrevented || !this.slide) {\n      return;\n    }\n\n    if (this.isImageContent() && this.isDecoding && !isSafari()) {\n      // add image to slide when it becomes active,\n      // even if it's not finished decoding\n      this.appendImage();\n    } else if (this.isError()) {\n      this.load(false, true); // try to reload\n    }\n\n    if (this.slide.holderElement) {\n      this.slide.holderElement.setAttribute('aria-hidden', 'false');\n    }\n  }\n  /**\r\n   * Deactivate the content\r\n   */\n\n\n  deactivate() {\n    this.instance.dispatch('contentDeactivate', {\n      content: this\n    });\n\n    if (this.slide && this.slide.holderElement) {\n      this.slide.holderElement.setAttribute('aria-hidden', 'true');\n    }\n  }\n  /**\r\n   * Remove the content from DOM\r\n   */\n\n\n  remove() {\n    this.isAttached = false;\n\n    if (this.instance.dispatch('contentRemove', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    }\n\n    if (this.element && this.element.parentNode) {\n      this.element.remove();\n    }\n\n    if (this.placeholder && this.placeholder.element) {\n      this.placeholder.element.remove();\n    }\n  }\n  /**\r\n   * Append the image content to slide container\r\n   */\n\n\n  appendImage() {\n    if (!this.isAttached) {\n      return;\n    }\n\n    if (this.instance.dispatch('contentAppendImage', {\n      content: this\n    }).defaultPrevented) {\n      return;\n    } // ensure that element exists and is not already appended\n\n\n    if (this.slide && this.element && !this.element.parentNode) {\n      this.slide.container.appendChild(this.element);\n    }\n\n    if (this.state === LOAD_STATE.LOADED || this.state === LOAD_STATE.ERROR) {\n      this.removePlaceholder();\n    }\n  }\n\n}\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../core/base.js').default} PhotoSwipeBase */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/**\r\n * @param {PhotoSwipeOptions} options\r\n * @param {PhotoSwipeBase} pswp\r\n * @returns {Point}\r\n */\nfunction getViewportSize(options, pswp) {\n  if (options.getViewportSizeFn) {\n    const newViewportSize = options.getViewportSizeFn(options, pswp);\n\n    if (newViewportSize) {\n      return newViewportSize;\n    }\n  }\n\n  return {\n    x: document.documentElement.clientWidth,\n    // TODO: height on mobile is very incosistent due to toolbar\n    // find a way to improve this\n    //\n    // document.documentElement.clientHeight - doesn't seem to work well\n    y: window.innerHeight\n  };\n}\n/**\r\n * Parses padding option.\r\n * Supported formats:\r\n *\r\n * // Object\r\n * padding: {\r\n *  top: 0,\r\n *  bottom: 0,\r\n *  left: 0,\r\n *  right: 0\r\n * }\r\n *\r\n * // A function that returns the object\r\n * paddingFn: (viewportSize, itemData, index) => {\r\n *  return {\r\n *    top: 0,\r\n *    bottom: 0,\r\n *    left: 0,\r\n *    right: 0\r\n *  };\r\n * }\r\n *\r\n * // Legacy variant\r\n * paddingLeft: 0,\r\n * paddingRight: 0,\r\n * paddingTop: 0,\r\n * paddingBottom: 0,\r\n *\r\n * @param {'left' | 'top' | 'bottom' | 'right'} prop\r\n * @param {PhotoSwipeOptions} options PhotoSwipe options\r\n * @param {Point} viewportSize PhotoSwipe viewport size, for example: { x:800, y:600 }\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {number} index Slide index\r\n * @returns {number}\r\n */\n\nfunction parsePaddingOption(prop, options, viewportSize, itemData, index) {\n  let paddingValue = 0;\n\n  if (options.paddingFn) {\n    paddingValue = options.paddingFn(viewportSize, itemData, index)[prop];\n  } else if (options.padding) {\n    paddingValue = options.padding[prop];\n  } else {\n    const legacyPropName = 'padding' + prop[0].toUpperCase() + prop.slice(1); // @ts-expect-error\n\n    if (options[legacyPropName]) {\n      // @ts-expect-error\n      paddingValue = options[legacyPropName];\n    }\n  }\n\n  return Number(paddingValue) || 0;\n}\n/**\r\n * @param {PhotoSwipeOptions} options\r\n * @param {Point} viewportSize\r\n * @param {SlideData} itemData\r\n * @param {number} index\r\n * @returns {Point}\r\n */\n\nfunction getPanAreaSize(options, viewportSize, itemData, index) {\n  return {\n    x: viewportSize.x - parsePaddingOption('left', options, viewportSize, itemData, index) - parsePaddingOption('right', options, viewportSize, itemData, index),\n    y: viewportSize.y - parsePaddingOption('top', options, viewportSize, itemData, index) - parsePaddingOption('bottom', options, viewportSize, itemData, index)\n  };\n}\n\nconst MAX_IMAGE_WIDTH = 4000;\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/slide.js').SlideData} SlideData */\n\n/** @typedef {'fit' | 'fill' | number | ((zoomLevelObject: ZoomLevel) => number)} ZoomLevelOption */\n\n/**\r\n * Calculates zoom levels for specific slide.\r\n * Depends on viewport size and image size.\r\n */\n\nclass ZoomLevel {\n  /**\r\n   * @param {PhotoSwipeOptions} options PhotoSwipe options\r\n   * @param {SlideData} itemData Slide data\r\n   * @param {number} index Slide index\r\n   * @param {PhotoSwipe} [pswp] PhotoSwipe instance, can be undefined if not initialized yet\r\n   */\n  constructor(options, itemData, index, pswp) {\n    this.pswp = pswp;\n    this.options = options;\n    this.itemData = itemData;\n    this.index = index;\n    /** @type { Point | null } */\n\n    this.panAreaSize = null;\n    /** @type { Point | null } */\n\n    this.elementSize = null;\n    this.fit = 1;\n    this.fill = 1;\n    this.vFill = 1;\n    this.initial = 1;\n    this.secondary = 1;\n    this.max = 1;\n    this.min = 1;\n  }\n  /**\r\n   * Calculate initial, secondary and maximum zoom level for the specified slide.\r\n   *\r\n   * It should be called when either image or viewport size changes.\r\n   *\r\n   * @param {number} maxWidth\r\n   * @param {number} maxHeight\r\n   * @param {Point} panAreaSize\r\n   */\n\n\n  update(maxWidth, maxHeight, panAreaSize) {\n    /** @type {Point} */\n    const elementSize = {\n      x: maxWidth,\n      y: maxHeight\n    };\n    this.elementSize = elementSize;\n    this.panAreaSize = panAreaSize;\n    const hRatio = panAreaSize.x / elementSize.x;\n    const vRatio = panAreaSize.y / elementSize.y;\n    this.fit = Math.min(1, hRatio < vRatio ? hRatio : vRatio);\n    this.fill = Math.min(1, hRatio > vRatio ? hRatio : vRatio); // zoom.vFill defines zoom level of the image\n    // when it has 100% of viewport vertical space (height)\n\n    this.vFill = Math.min(1, vRatio);\n    this.initial = this._getInitial();\n    this.secondary = this._getSecondary();\n    this.max = Math.max(this.initial, this.secondary, this._getMax());\n    this.min = Math.min(this.fit, this.initial, this.secondary);\n\n    if (this.pswp) {\n      this.pswp.dispatch('zoomLevelsUpdate', {\n        zoomLevels: this,\n        slideData: this.itemData\n      });\n    }\n  }\n  /**\r\n   * Parses user-defined zoom option.\r\n   *\r\n   * @private\r\n   * @param {'initial' | 'secondary' | 'max'} optionPrefix Zoom level option prefix (initial, secondary, max)\r\n   * @returns { number | undefined }\r\n   */\n\n\n  _parseZoomLevelOption(optionPrefix) {\n    const optionName =\n    /** @type {'initialZoomLevel' | 'secondaryZoomLevel' | 'maxZoomLevel'} */\n    optionPrefix + 'ZoomLevel';\n    const optionValue = this.options[optionName];\n\n    if (!optionValue) {\n      return;\n    }\n\n    if (typeof optionValue === 'function') {\n      return optionValue(this);\n    }\n\n    if (optionValue === 'fill') {\n      return this.fill;\n    }\n\n    if (optionValue === 'fit') {\n      return this.fit;\n    }\n\n    return Number(optionValue);\n  }\n  /**\r\n   * Get zoom level to which image will be zoomed after double-tap gesture,\r\n   * or when user clicks on zoom icon,\r\n   * or mouse-click on image itself.\r\n   * If you return 1 image will be zoomed to its original size.\r\n   *\r\n   * @private\r\n   * @return {number}\r\n   */\n\n\n  _getSecondary() {\n    let currZoomLevel = this._parseZoomLevelOption('secondary');\n\n    if (currZoomLevel) {\n      return currZoomLevel;\n    } // 3x of \"fit\" state, but not larger than original\n\n\n    currZoomLevel = Math.min(1, this.fit * 3);\n\n    if (this.elementSize && currZoomLevel * this.elementSize.x > MAX_IMAGE_WIDTH) {\n      currZoomLevel = MAX_IMAGE_WIDTH / this.elementSize.x;\n    }\n\n    return currZoomLevel;\n  }\n  /**\r\n   * Get initial image zoom level.\r\n   *\r\n   * @private\r\n   * @return {number}\r\n   */\n\n\n  _getInitial() {\n    return this._parseZoomLevelOption('initial') || this.fit;\n  }\n  /**\r\n   * Maximum zoom level when user zooms\r\n   * via zoom/pinch gesture,\r\n   * via cmd/ctrl-wheel or via trackpad.\r\n   *\r\n   * @private\r\n   * @return {number}\r\n   */\n\n\n  _getMax() {\n    // max zoom level is x4 from \"fit state\",\n    // used for zoom gesture and ctrl/trackpad zoom\n    return this._parseZoomLevelOption('max') || Math.max(1, this.fit * 4);\n  }\n\n}\n\n/**\r\n * Lazy-load an image\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * @param {SlideData} itemData Data about the slide\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance\r\n * @param {number} index\r\n * @returns {Content} Image that is being decoded or false.\r\n */\n\nfunction lazyLoadData(itemData, instance, index) {\n  const content = instance.createContentFromData(itemData, index);\n  /** @type {ZoomLevel | undefined} */\n\n  let zoomLevel;\n  const {\n    options\n  } = instance; // We need to know dimensions of the image to preload it,\n  // as it might use srcset, and we need to define sizes\n\n  if (options) {\n    zoomLevel = new ZoomLevel(options, itemData, -1);\n    let viewportSize;\n\n    if (instance.pswp) {\n      viewportSize = instance.pswp.viewportSize;\n    } else {\n      viewportSize = getViewportSize(options, instance);\n    }\n\n    const panAreaSize = getPanAreaSize(options, viewportSize, itemData, index);\n    zoomLevel.update(content.width, content.height, panAreaSize);\n  }\n\n  content.lazyLoad();\n\n  if (zoomLevel) {\n    content.setDisplayedSize(Math.ceil(content.width * zoomLevel.initial), Math.ceil(content.height * zoomLevel.initial));\n  }\n\n  return content;\n}\n/**\r\n * Lazy-loads specific slide.\r\n * This function is used both by Lightbox and PhotoSwipe core,\r\n * thus it can be called before dialog is opened.\r\n *\r\n * By default, it loads image based on viewport size and initial zoom level.\r\n *\r\n * @param {number} index Slide index\r\n * @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox eventable instance\r\n * @returns {Content | undefined}\r\n */\n\nfunction lazyLoadSlide(index, instance) {\n  const itemData = instance.getItemData(index);\n\n  if (instance.dispatch('lazyLoadSlide', {\n    index,\n    itemData\n  }).defaultPrevented) {\n    return;\n  }\n\n  return lazyLoadData(itemData, instance, index);\n}\n\n/** @typedef {import(\"../photoswipe.js\").default} PhotoSwipe */\n\n/** @typedef {import(\"../slide/slide.js\").SlideData} SlideData */\n\n/**\r\n * PhotoSwipe base class that can retrieve data about every slide.\r\n * Shared by PhotoSwipe Core and PhotoSwipe Lightbox\r\n */\n\nclass PhotoSwipeBase extends Eventable {\n  /**\r\n   * Get total number of slides\r\n   *\r\n   * @returns {number}\r\n   */\n  getNumItems() {\n    var _this$options;\n\n    let numItems = 0;\n    const dataSource = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.dataSource;\n\n    if (dataSource && 'length' in dataSource) {\n      // may be an array or just object with length property\n      numItems = dataSource.length;\n    } else if (dataSource && 'gallery' in dataSource) {\n      // query DOM elements\n      if (!dataSource.items) {\n        dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\n      }\n\n      if (dataSource.items) {\n        numItems = dataSource.items.length;\n      }\n    } // legacy event, before filters were introduced\n\n\n    const event = this.dispatch('numItems', {\n      dataSource,\n      numItems\n    });\n    return this.applyFilters('numItems', event.numItems, dataSource);\n  }\n  /**\r\n   * @param {SlideData} slideData\r\n   * @param {number} index\r\n   * @returns {Content}\r\n   */\n\n\n  createContentFromData(slideData, index) {\n    return new Content(slideData, this, index);\n  }\n  /**\r\n   * Get item data by index.\r\n   *\r\n   * \"item data\" should contain normalized information that PhotoSwipe needs to generate a slide.\r\n   * For example, it may contain properties like\r\n   * `src`, `srcset`, `w`, `h`, which will be used to generate a slide with image.\r\n   *\r\n   * @param {number} index\r\n   * @returns {SlideData}\r\n   */\n\n\n  getItemData(index) {\n    var _this$options2;\n\n    const dataSource = (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.dataSource;\n    /** @type {SlideData | HTMLElement} */\n\n    let dataSourceItem = {};\n\n    if (Array.isArray(dataSource)) {\n      // Datasource is an array of elements\n      dataSourceItem = dataSource[index];\n    } else if (dataSource && 'gallery' in dataSource) {\n      // dataSource has gallery property,\n      // thus it was created by Lightbox, based on\n      // gallery and children options\n      // query DOM elements\n      if (!dataSource.items) {\n        dataSource.items = this._getGalleryDOMElements(dataSource.gallery);\n      }\n\n      dataSourceItem = dataSource.items[index];\n    }\n\n    let itemData = dataSourceItem;\n\n    if (itemData instanceof Element) {\n      itemData = this._domElementToItemData(itemData);\n    } // Dispatching the itemData event,\n    // it's a legacy verion before filters were introduced\n\n\n    const event = this.dispatch('itemData', {\n      itemData: itemData || {},\n      index\n    });\n    return this.applyFilters('itemData', event.itemData, index);\n  }\n  /**\r\n   * Get array of gallery DOM elements,\r\n   * based on childSelector and gallery element.\r\n   *\r\n   * @param {HTMLElement} galleryElement\r\n   * @returns {HTMLElement[]}\r\n   */\n\n\n  _getGalleryDOMElements(galleryElement) {\n    var _this$options3, _this$options4;\n\n    if ((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.children || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.childSelector) {\n      return getElementsFromOption(this.options.children, this.options.childSelector, galleryElement) || [];\n    }\n\n    return [galleryElement];\n  }\n  /**\r\n   * Converts DOM element to item data object.\r\n   *\r\n   * @param {HTMLElement} element DOM element\r\n   * @returns {SlideData}\r\n   */\n\n\n  _domElementToItemData(element) {\n    /** @type {SlideData} */\n    const itemData = {\n      element\n    };\n    const linkEl =\n    /** @type {HTMLAnchorElement} */\n    element.tagName === 'A' ? element : element.querySelector('a');\n\n    if (linkEl) {\n      // src comes from data-pswp-src attribute,\n      // if it's empty link href is used\n      itemData.src = linkEl.dataset.pswpSrc || linkEl.href;\n\n      if (linkEl.dataset.pswpSrcset) {\n        itemData.srcset = linkEl.dataset.pswpSrcset;\n      }\n\n      itemData.width = linkEl.dataset.pswpWidth ? parseInt(linkEl.dataset.pswpWidth, 10) : 0;\n      itemData.height = linkEl.dataset.pswpHeight ? parseInt(linkEl.dataset.pswpHeight, 10) : 0; // support legacy w & h properties\n\n      itemData.w = itemData.width;\n      itemData.h = itemData.height;\n\n      if (linkEl.dataset.pswpType) {\n        itemData.type = linkEl.dataset.pswpType;\n      }\n\n      const thumbnailEl = element.querySelector('img');\n\n      if (thumbnailEl) {\n        var _thumbnailEl$getAttri;\n\n        // msrc is URL to placeholder image that's displayed before large image is loaded\n        // by default it's displayed only for the first slide\n        itemData.msrc = thumbnailEl.currentSrc || thumbnailEl.src;\n        itemData.alt = (_thumbnailEl$getAttri = thumbnailEl.getAttribute('alt')) !== null && _thumbnailEl$getAttri !== void 0 ? _thumbnailEl$getAttri : '';\n      }\n\n      if (linkEl.dataset.pswpCropped || linkEl.dataset.cropped) {\n        itemData.thumbCropped = true;\n      }\n    }\n\n    return this.applyFilters('domItemData', itemData, element, linkEl);\n  }\n  /**\r\n   * Lazy-load by slide data\r\n   *\r\n   * @param {SlideData} itemData Data about the slide\r\n   * @param {number} index\r\n   * @returns {Content} Image that is being decoded or false.\r\n   */\n\n\n  lazyLoadData(itemData, index) {\n    return lazyLoadData(itemData, this, index);\n  }\n\n}\n\n/**\r\n * @template T\r\n * @typedef {import('../types.js').Type<T>} Type<T>\r\n */\n\n/** @typedef {import('../photoswipe.js').default} PhotoSwipe */\n\n/** @typedef {import('../photoswipe.js').PhotoSwipeOptions} PhotoSwipeOptions */\n\n/** @typedef {import('../photoswipe.js').DataSource} DataSource */\n\n/** @typedef {import('../photoswipe.js').Point} Point */\n\n/** @typedef {import('../slide/content.js').default} Content */\n\n/** @typedef {import('../core/eventable.js').PhotoSwipeEventsMap} PhotoSwipeEventsMap */\n\n/** @typedef {import('../core/eventable.js').PhotoSwipeFiltersMap} PhotoSwipeFiltersMap */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {import('../core/eventable.js').EventCallback<T>} EventCallback<T>\r\n */\n\n/**\r\n * PhotoSwipe Lightbox\r\n *\r\n * - If user has unsupported browser it falls back to default browser action (just opens URL)\r\n * - Binds click event to links that should open PhotoSwipe\r\n * - parses DOM strcture for PhotoSwipe (retrieves large image URLs and sizes)\r\n * - Initializes PhotoSwipe\r\n *\r\n *\r\n * Loader options use the same object as PhotoSwipe, and supports such options:\r\n *\r\n * gallery - Element | Element[] | NodeList | string selector for the gallery element\r\n * children - Element | Element[] | NodeList | string selector for the gallery children\r\n *\r\n */\n\nclass PhotoSwipeLightbox extends PhotoSwipeBase {\n  /**\r\n   * @param {PhotoSwipeOptions} [options]\r\n   */\n  constructor(options) {\n    super();\n    /** @type {PhotoSwipeOptions} */\n\n    this.options = options || {};\n    this._uid = 0;\n    this.shouldOpen = false;\n    /**\r\n     * @private\r\n     * @type {Content | undefined}\r\n     */\n\n    this._preloadedContent = undefined;\n    this.onThumbnailsClick = this.onThumbnailsClick.bind(this);\n  }\n  /**\r\n   * Initialize lightbox, should be called only once.\r\n   * It's not included in the main constructor, so you may bind events before it.\r\n   */\n\n\n  init() {\n    // Bind click events to each gallery\n    getElementsFromOption(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {\n      galleryElement.addEventListener('click', this.onThumbnailsClick, false);\n    });\n  }\n  /**\r\n   * @param {MouseEvent} e\r\n   */\n\n\n  onThumbnailsClick(e) {\n    // Exit and allow default browser action if:\n    if (specialKeyUsed(e) // ... if clicked with a special key (ctrl/cmd...)\n    || window.pswp) {\n      // ... if PhotoSwipe is already open\n      return;\n    } // If both clientX and clientY are 0 or not defined,\n    // the event is likely triggered by keyboard,\n    // so we do not pass the initialPoint\n    //\n    // Note that some screen readers emulate the mouse position,\n    // so it's not the ideal way to detect them.\n    //\n\n    /** @type {Point | null} */\n\n\n    let initialPoint = {\n      x: e.clientX,\n      y: e.clientY\n    };\n\n    if (!initialPoint.x && !initialPoint.y) {\n      initialPoint = null;\n    }\n\n    let clickedIndex = this.getClickedIndex(e);\n    clickedIndex = this.applyFilters('clickedIndex', clickedIndex, e, this);\n    /** @type {DataSource} */\n\n    const dataSource = {\n      gallery:\n      /** @type {HTMLElement} */\n      e.currentTarget\n    };\n\n    if (clickedIndex >= 0) {\n      e.preventDefault();\n      this.loadAndOpen(clickedIndex, dataSource, initialPoint);\n    }\n  }\n  /**\r\n   * Get index of gallery item that was clicked.\r\n   *\r\n   * @param {MouseEvent} e click event\r\n   * @returns {number}\r\n   */\n\n\n  getClickedIndex(e) {\n    // legacy option\n    if (this.options.getClickedIndexFn) {\n      return this.options.getClickedIndexFn.call(this, e);\n    }\n\n    const clickedTarget =\n    /** @type {HTMLElement} */\n    e.target;\n    const childElements = getElementsFromOption(this.options.children, this.options.childSelector,\n    /** @type {HTMLElement} */\n    e.currentTarget);\n    const clickedChildIndex = childElements.findIndex(child => child === clickedTarget || child.contains(clickedTarget));\n\n    if (clickedChildIndex !== -1) {\n      return clickedChildIndex;\n    } else if (this.options.children || this.options.childSelector) {\n      // click wasn't on a child element\n      return -1;\n    } // There is only one item (which is the gallery)\n\n\n    return 0;\n  }\n  /**\r\n   * Load and open PhotoSwipe\r\n   *\r\n   * @param {number} index\r\n   * @param {DataSource} [dataSource]\r\n   * @param {Point | null} [initialPoint]\r\n   * @returns {boolean}\r\n   */\n\n\n  loadAndOpen(index, dataSource, initialPoint) {\n    // Check if the gallery is already open\n    if (window.pswp || !this.options) {\n      return false;\n    } // Use the first gallery element if dataSource is not provided\n\n\n    if (!dataSource && this.options.gallery && this.options.children) {\n      const galleryElements = getElementsFromOption(this.options.gallery);\n\n      if (galleryElements[0]) {\n        dataSource = {\n          gallery: galleryElements[0]\n        };\n      }\n    } // set initial index\n\n\n    this.options.index = index; // define options for PhotoSwipe constructor\n\n    this.options.initialPointerPos = initialPoint;\n    this.shouldOpen = true;\n    this.preload(index, dataSource);\n    return true;\n  }\n  /**\r\n   * Load the main module and the slide content by index\r\n   *\r\n   * @param {number} index\r\n   * @param {DataSource} [dataSource]\r\n   */\n\n\n  preload(index, dataSource) {\n    const {\n      options\n    } = this;\n\n    if (dataSource) {\n      options.dataSource = dataSource;\n    } // Add the main module\n\n    /** @type {Promise<Type<PhotoSwipe>>[]} */\n\n\n    const promiseArray = [];\n    const pswpModuleType = typeof options.pswpModule;\n\n    if (isPswpClass(options.pswpModule)) {\n      promiseArray.push(Promise.resolve(\n      /** @type {Type<PhotoSwipe>} */\n      options.pswpModule));\n    } else if (pswpModuleType === 'string') {\n      throw new Error('pswpModule as string is no longer supported');\n    } else if (pswpModuleType === 'function') {\n      promiseArray.push(\n      /** @type {() => Promise<Type<PhotoSwipe>>} */\n      options.pswpModule());\n    } else {\n      throw new Error('pswpModule is not valid');\n    } // Add custom-defined promise, if any\n\n\n    if (typeof options.openPromise === 'function') {\n      // allow developers to perform some task before opening\n      promiseArray.push(options.openPromise());\n    }\n\n    if (options.preloadFirstSlide !== false && index >= 0) {\n      this._preloadedContent = lazyLoadSlide(index, this);\n    } // Wait till all promises resolve and open PhotoSwipe\n\n\n    const uid = ++this._uid;\n    Promise.all(promiseArray).then(iterableModules => {\n      if (this.shouldOpen) {\n        const mainModule = iterableModules[0];\n\n        this._openPhotoswipe(mainModule, uid);\n      }\n    });\n  }\n  /**\r\n   * @private\r\n   * @param {Type<PhotoSwipe> | { default: Type<PhotoSwipe> }} module\r\n   * @param {number} uid\r\n   */\n\n\n  _openPhotoswipe(module, uid) {\n    // Cancel opening if UID doesn't match the current one\n    // (if user clicked on another gallery item before current was loaded).\n    //\n    // Or if shouldOpen flag is set to false\n    // (developer may modify it via public API)\n    if (uid !== this._uid && this.shouldOpen) {\n      return;\n    }\n\n    this.shouldOpen = false; // PhotoSwipe is already open\n\n    if (window.pswp) {\n      return;\n    }\n    /**\r\n     * Pass data to PhotoSwipe and open init\r\n     *\r\n     * @type {PhotoSwipe}\r\n     */\n\n\n    const pswp = typeof module === 'object' ? new module.default(this.options) // eslint-disable-line\n    : new module(this.options); // eslint-disable-line\n\n    this.pswp = pswp;\n    window.pswp = pswp; // map listeners from Lightbox to PhotoSwipe Core\n\n    /** @type {(keyof PhotoSwipeEventsMap)[]} */\n\n    Object.keys(this._listeners).forEach(name => {\n      var _this$_listeners$name;\n\n      (_this$_listeners$name = this._listeners[name]) === null || _this$_listeners$name === void 0 || _this$_listeners$name.forEach(fn => {\n        pswp.on(name,\n        /** @type {EventCallback<typeof name>} */\n        fn);\n      });\n    }); // same with filters\n\n    /** @type {(keyof PhotoSwipeFiltersMap)[]} */\n\n    Object.keys(this._filters).forEach(name => {\n      var _this$_filters$name;\n\n      (_this$_filters$name = this._filters[name]) === null || _this$_filters$name === void 0 || _this$_filters$name.forEach(filter => {\n        pswp.addFilter(name, filter.fn, filter.priority);\n      });\n    });\n\n    if (this._preloadedContent) {\n      pswp.contentLoader.addToCache(this._preloadedContent);\n      this._preloadedContent = undefined;\n    }\n\n    pswp.on('destroy', () => {\n      // clean up public variables\n      this.pswp = undefined;\n      delete window.pswp;\n    });\n    pswp.init();\n  }\n  /**\r\n   * Unbinds all events, closes PhotoSwipe if it's open.\r\n   */\n\n\n  destroy() {\n    var _this$pswp;\n\n    (_this$pswp = this.pswp) === null || _this$pswp === void 0 || _this$pswp.destroy();\n    this.shouldOpen = false;\n    this._listeners = {};\n    getElementsFromOption(this.options.gallery, this.options.gallerySelector).forEach(galleryElement => {\n      galleryElement.removeEventListener('click', this.onThumbnailsClick, false);\n    });\n  }\n\n}\n\nexport { PhotoSwipeLightbox as default };\n//# sourceMappingURL=photoswipe-lightbox.esm.js.map\n","/**\r\n * PhotoSwipe Dynamic Caption plugin v1.2.7\r\n * https://github.com/dimsemenov/photoswipe-dynamic-caption-plugin\r\n * \r\n * By https://dimsemenov.com\r\n */\r\n\r\nconst defaultOptions = {\r\n  captionContent: '.pswp-caption-content',\r\n  type: 'auto',\r\n  horizontalEdgeThreshold: 20,\r\n  mobileCaptionOverlapRatio: 0.3,\r\n  mobileLayoutBreakpoint: 600,\r\n  verticallyCenterImage: false\r\n};\r\n\r\nclass PhotoSwipeDynamicCaption {\r\n  constructor(lightbox, options) {\r\n    this.options = {\r\n      ...defaultOptions,\r\n      ...options\r\n    };\r\n\r\n    this.lightbox = lightbox;\r\n\r\n    this.lightbox.on('init', () => {\r\n      this.pswp = this.lightbox.pswp;\r\n      this.initCaption();\r\n    });\r\n  }\r\n\r\n  initCaption() {\r\n    const { pswp } = this;\r\n\r\n    pswp.on('change', () => {\r\n      // make sure caption is displayed after slides are switched\r\n      this.showCaption(this.pswp.currSlide);\r\n    });\r\n\r\n    pswp.on('calcSlideSize', (e) => this.onCalcSlideSize(e));\r\n\r\n    pswp.on('slideDestroy', (e) => {\r\n      if (e.slide.dynamicCaption) {\r\n        if (e.slide.dynamicCaption.element) {\r\n          e.slide.dynamicCaption.element.remove();\r\n        }\r\n        delete e.slide.dynamicCaption;\r\n      }\r\n    });\r\n\r\n    // hide caption if zoomed\r\n    pswp.on('zoomPanUpdate', ({ slide }) => {\r\n      if (pswp.opener.isOpen && slide.dynamicCaption) {\r\n        if (slide.currZoomLevel > slide.zoomLevels.initial) {\r\n          this.hideCaption(slide);\r\n        } else {\r\n          this.showCaption(slide);\r\n        }\r\n  \r\n        // move caption on vertical drag\r\n        if (slide.dynamicCaption.element) {\r\n          let captionYOffset = 0;\r\n          if (slide.currZoomLevel <= slide.zoomLevels.initial) {\r\n            const shiftedAmount = slide.pan.y - slide.bounds.center.y;\r\n            if (Math.abs(shiftedAmount) > 1) {\r\n              captionYOffset = shiftedAmount;\r\n            }\r\n          }\r\n\r\n          this.setCaptionYOffset(slide.dynamicCaption.element, captionYOffset);\r\n        }\r\n\r\n        this.adjustPanArea(slide, slide.currZoomLevel);\r\n      }\r\n    });\r\n\r\n    pswp.on('beforeZoomTo', (e) => {\r\n      this.adjustPanArea(pswp.currSlide, e.destZoomLevel);\r\n    });\r\n\r\n    // Stop default action of tap when tapping on the caption\r\n    pswp.on('tapAction', (e) => {\r\n      if (e.originalEvent.target.closest('.pswp__dynamic-caption')) {\r\n        e.preventDefault();\r\n      }\r\n    });\r\n  }\r\n\r\n  adjustPanArea(slide, zoomLevel) {\r\n    if (slide.dynamicCaption && slide.dynamicCaption.adjustedPanAreaSize) {\r\n      if (zoomLevel > slide.zoomLevels.initial) {\r\n        slide.panAreaSize.x = slide.dynamicCaption.originalPanAreaSize.x;\r\n        slide.panAreaSize.y = slide.dynamicCaption.originalPanAreaSize.y;\r\n      } else {\r\n        // Restore panAreaSize after we zoom back to initial position\r\n        slide.panAreaSize.x = slide.dynamicCaption.adjustedPanAreaSize.x;\r\n        slide.panAreaSize.y = slide.dynamicCaption.adjustedPanAreaSize.y;\r\n      }\r\n    }\r\n  }\r\n\r\n  useMobileLayout() {\r\n    const { mobileLayoutBreakpoint } = this.options;\r\n\r\n    if (typeof mobileLayoutBreakpoint === 'function') {\r\n      return mobileLayoutBreakpoint.call(this);\r\n    } else if (typeof mobileLayoutBreakpoint === 'number') {\r\n      if (window.innerWidth < mobileLayoutBreakpoint) {\r\n        return true;\r\n      }\r\n    }\r\n    \r\n    return false;\r\n  }\r\n\r\n  hideCaption(slide) {\r\n    if (slide.dynamicCaption && !slide.dynamicCaption.hidden) {\r\n      const captionElement = slide.dynamicCaption.element;\r\n\r\n      if (!captionElement) {\r\n        return;\r\n      }\r\n\r\n      slide.dynamicCaption.hidden = true;\r\n      captionElement.classList.add('pswp__dynamic-caption--faded');\r\n\r\n      // Disable caption visibility with the delay, so it's not interactable \r\n      if (slide.captionFadeTimeout) {\r\n        clearTimeout(slide.captionFadeTimeout);\r\n      }\r\n      slide.captionFadeTimeout = setTimeout(() => {\r\n        captionElement.style.visibility = 'hidden';\r\n        delete slide.captionFadeTimeout;\r\n      }, 400);\r\n    }\r\n  }\r\n\r\n  setCaptionYOffset(el, y) {\r\n    el.style.transform = `translateY(${y}px)`;\r\n  }\r\n\r\n  showCaption(slide) {\r\n    if (slide.dynamicCaption && slide.dynamicCaption.hidden) {\r\n      const captionElement = slide.dynamicCaption.element;\r\n\r\n      if (!captionElement) {\r\n        return;\r\n      }\r\n\r\n      slide.dynamicCaption.hidden = false;\r\n      captionElement.style.visibility = 'visible';\r\n      \r\n      clearTimeout(slide.captionFadeTimeout);\r\n      slide.captionFadeTimeout = setTimeout(() => {\r\n        captionElement.classList.remove('pswp__dynamic-caption--faded');\r\n        delete slide.captionFadeTimeout;;\r\n      }, 50);\r\n    }\r\n  }\r\n\r\n  setCaptionPosition(captionEl, x, y) {\r\n    const isOnHorizontalEdge = (x <= this.options.horizontalEdgeThreshold);\r\n    captionEl.classList[\r\n      isOnHorizontalEdge ? 'add' : 'remove'\r\n    ]('pswp__dynamic-caption--on-hor-edge');\r\n\r\n    captionEl.style.left = x + 'px';\r\n    captionEl.style.top = y + 'px';\r\n  }\r\n\r\n  setCaptionWidth(captionEl, width) {\r\n    if (!width) {\r\n      captionEl.style.removeProperty('width');\r\n    } else {\r\n      captionEl.style.width = width + 'px';\r\n    }\r\n  }\r\n\r\n  setCaptionType(captionEl, type) {\r\n    const prevType = captionEl.dataset.pswpCaptionType;\r\n    if (type !== prevType) {\r\n      captionEl.classList.add('pswp__dynamic-caption--' + type);\r\n      captionEl.classList.remove('pswp__dynamic-caption--' + prevType);\r\n      captionEl.dataset.pswpCaptionType = type;\r\n    }\r\n  }\r\n\r\n  updateCaptionPosition(slide) {\r\n    if (!slide.dynamicCaption || !slide.dynamicCaption.type || !slide.dynamicCaption.element) {\r\n      return;\r\n    }\r\n\r\n    if (slide.dynamicCaption.type === 'mobile') {\r\n      this.setCaptionType(\r\n        slide.dynamicCaption.element, \r\n        slide.dynamicCaption.type\r\n      );\r\n      \r\n      slide.dynamicCaption.element.style.removeProperty('left');\r\n      slide.dynamicCaption.element.style.removeProperty('top');\r\n      this.setCaptionWidth(slide.dynamicCaption.element, false);\r\n      return;\r\n    }\r\n\r\n    const zoomLevel = slide.zoomLevels.initial;\r\n    const imageWidth = Math.ceil(slide.width * zoomLevel);\r\n    const imageHeight = Math.ceil(slide.height * zoomLevel);\r\n    \r\n    this.setCaptionType(slide.dynamicCaption.element, slide.dynamicCaption.type);\r\n    if (slide.dynamicCaption.type === 'aside') {\r\n      this.setCaptionPosition(\r\n        slide.dynamicCaption.element,\r\n        slide.bounds.center.x + imageWidth,\r\n        slide.bounds.center.y\r\n      );\r\n      this.setCaptionWidth(slide.dynamicCaption.element, false);\r\n    } else if (slide.dynamicCaption.type === 'below') {\r\n      this.setCaptionPosition(\r\n        slide.dynamicCaption.element,\r\n        slide.bounds.center.x,\r\n        slide.bounds.center.y + imageHeight\r\n      );\r\n      this.setCaptionWidth(slide.dynamicCaption.element, imageWidth);\r\n    }\r\n  }\r\n\r\n  onCalcSlideSize(e) {\r\n    const { slide } = e;\r\n    let captionSize;\r\n    let useMobileVersion;\r\n\r\n    if (!slide.dynamicCaption) {\r\n      slide.dynamicCaption = {\r\n        element: undefined,\r\n        type: false,\r\n        hidden: false\r\n      };\r\n\r\n      const captionHTML = this.getCaptionHTML(slide);\r\n\r\n      if (!captionHTML) {\r\n        return;\r\n      }\r\n\r\n      slide.dynamicCaption.element = document.createElement('div');\r\n      slide.dynamicCaption.element.className = 'pswp__dynamic-caption pswp__hide-on-close';\r\n      slide.dynamicCaption.element.innerHTML = captionHTML;\r\n\r\n      this.pswp.dispatch('dynamicCaptionUpdateHTML', { \r\n        captionElement: slide.dynamicCaption.element,\r\n        slide\r\n      });\r\n\r\n      slide.holderElement.appendChild(slide.dynamicCaption.element);\r\n    }\r\n\r\n    if (!slide.dynamicCaption.element) {\r\n      return;\r\n    }\r\n\r\n    this.storeOriginalPanAreaSize(slide);\r\n\r\n    slide.bounds.update(slide.zoomLevels.initial);\r\n    \r\n    if (this.useMobileLayout()) {\r\n      slide.dynamicCaption.type = 'mobile';\r\n      useMobileVersion = true;\r\n    } else {\r\n      if (this.options.type === 'auto') {\r\n        if (slide.bounds.center.x > slide.bounds.center.y) {\r\n          slide.dynamicCaption.type = 'aside';\r\n        } else {\r\n          slide.dynamicCaption.type = 'below';\r\n        }\r\n      } else {\r\n        slide.dynamicCaption.type = this.options.type;\r\n      }\r\n    } \r\n\r\n    const imageWidth = Math.ceil(slide.width * slide.zoomLevels.initial);\r\n    const imageHeight = Math.ceil(slide.height * slide.zoomLevels.initial);\r\n\r\n    this.setCaptionType(\r\n      slide.dynamicCaption.element, \r\n      slide.dynamicCaption.type\r\n    );\r\n\r\n    if (slide.dynamicCaption.type === 'aside') {\r\n      this.setCaptionWidth(slide.dynamicCaption.element, false);\r\n      captionSize = this.measureCaptionSize(slide.dynamicCaption.element, e.slide);\r\n\r\n      const captionWidth = captionSize.x;      \r\n\r\n      const horizontalEnding = imageWidth + slide.bounds.center.x;\r\n      const horizontalLeftover = (slide.panAreaSize.x - horizontalEnding);\r\n\r\n      if (horizontalLeftover <= captionWidth) {\r\n        slide.panAreaSize.x -= captionWidth;\r\n        this.recalculateZoomLevelAndBounds(slide);\r\n      } else {\r\n        // do nothing, caption will fit aside without any adjustments\r\n      }\r\n    } else if (slide.dynamicCaption.type === 'below' || useMobileVersion) {\r\n      this.setCaptionWidth(\r\n        slide.dynamicCaption.element, \r\n        useMobileVersion ? this.pswp.viewportSize.x : imageWidth\r\n      );\r\n\r\n      captionSize = this.measureCaptionSize(slide.dynamicCaption.element, e.slide);\r\n      const captionHeight = captionSize.y;\r\n\r\n      if (this.options.verticallyCenterImage) {\r\n        slide.panAreaSize.y -= captionHeight;\r\n        this.recalculateZoomLevelAndBounds(slide);\r\n      } else {\r\n        // Lift up the image only by caption height\r\n\r\n        // vertical ending of the image\r\n        const verticalEnding = imageHeight + slide.bounds.center.y;\r\n\r\n        // height between bottom of the screen and ending of the image\r\n        // (before any adjustments applied) \r\n        const verticalLeftover = slide.panAreaSize.y - verticalEnding;\r\n        const initialPanAreaHeight = slide.panAreaSize.y;\r\n\r\n        if (verticalLeftover <= captionHeight) {\r\n          // lift up the image to give more space for caption\r\n          slide.panAreaSize.y -= Math.min((captionHeight - verticalLeftover) * 2, captionHeight);\r\n\r\n          // we reduce viewport size, thus we need to update zoom level and pan bounds\r\n          this.recalculateZoomLevelAndBounds(slide);\r\n\r\n          const maxPositionX = slide.panAreaSize.x * this.options.mobileCaptionOverlapRatio / 2;\r\n\r\n          // Do not reduce viewport height if too few space available\r\n          if (useMobileVersion \r\n              && slide.bounds.center.x > maxPositionX) {\r\n            // Restore the default position\r\n            slide.panAreaSize.y = initialPanAreaHeight;\r\n            this.recalculateZoomLevelAndBounds(slide);\r\n          }\r\n        }\r\n      }\r\n    } else {\r\n      // mobile\r\n    }\r\n\r\n    this.storeAdjustedPanAreaSize(slide);\r\n    this.updateCaptionPosition(slide);\r\n  }\r\n\r\n  measureCaptionSize(captionEl, slide) {\r\n    const rect = captionEl.getBoundingClientRect();\r\n    const event = this.pswp.dispatch('dynamicCaptionMeasureSize', {\r\n      captionEl,\r\n      slide,\r\n      captionSize: {\r\n        x: rect.width,\r\n        y: rect.height\r\n      }\r\n    });\r\n    return event.captionSize;\r\n  }\r\n\r\n  recalculateZoomLevelAndBounds(slide) {\r\n    slide.zoomLevels.update(slide.width, slide.height, slide.panAreaSize);\r\n    slide.bounds.update(slide.zoomLevels.initial);\r\n  }\r\n\r\n  storeAdjustedPanAreaSize(slide) {\r\n    if (slide.dynamicCaption) {\r\n      if (!slide.dynamicCaption.adjustedPanAreaSize) {\r\n        slide.dynamicCaption.adjustedPanAreaSize = {};\r\n      }\r\n      slide.dynamicCaption.adjustedPanAreaSize.x = slide.panAreaSize.x;\r\n      slide.dynamicCaption.adjustedPanAreaSize.y = slide.panAreaSize.y;\r\n    }\r\n  }\r\n\r\n  storeOriginalPanAreaSize(slide) {\r\n    if (slide.dynamicCaption) {\r\n      if (!slide.dynamicCaption.originalPanAreaSize) {\r\n        slide.dynamicCaption.originalPanAreaSize = {};\r\n      }\r\n      slide.dynamicCaption.originalPanAreaSize.x = slide.panAreaSize.x;\r\n      slide.dynamicCaption.originalPanAreaSize.y = slide.panAreaSize.y;\r\n    }\r\n  }\r\n\r\n  getCaptionHTML(slide) {\r\n    if (typeof this.options.captionContent === 'function') {\r\n      return this.options.captionContent.call(this, slide);\r\n    }\r\n\r\n    const currSlideElement = slide.data.element;\r\n    let captionHTML = '';\r\n    if (currSlideElement) {\r\n      const hiddenCaption = currSlideElement.querySelector(this.options.captionContent);\r\n      if (hiddenCaption) {\r\n        // get caption from element with class pswp-caption-content\r\n        captionHTML = hiddenCaption.innerHTML;\r\n      } else {\r\n        const img = currSlideElement.querySelector('img');\r\n        if (img) {\r\n          // get caption from alt attribute\r\n          captionHTML = img.getAttribute('alt');\r\n        }\r\n      }\r\n    }\r\n    return captionHTML;\r\n  }\r\n}\r\n\r\nexport default PhotoSwipeDynamicCaption;\r\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";import PhotoSwipe from\"https://unpkg.com/photoswipe\";import PhotoSwipeLightbox from\"https://unpkg.com/photoswipe/dist/photoswipe-lightbox.esm.js\";import PhotoSwipeDynamicCaption from\"https://unpkg.com/photoswipe-dynamic-caption-plugin/photoswipe-dynamic-caption-plugin.esm.js\";export default function WorksGallery(props){const[works,setWorks]=useState([]);const style={objectFit:\"contain\",height:\"auto\",width:\"100%\"};useEffect(()=>{let lightbox=new PhotoSwipeLightbox({gallery:\"#my-gallery\",children:\"a\",pswpModule:PhotoSwipe,paddingFn:viewportSize=>{return{top:0,bottom:0,left:0,right:0};},captionContent:slide=>{return slide.data.element.querySelector(\"img\").getAttribute(\"alt\");},preload:[20,20],preloaderDelay:0,initialZoomLevel:\"fit\",secondaryZoomLevel:1.5,maxZoomLevel:1});const captionPlugin=new PhotoSwipeDynamicCaption(lightbox,{// Plugins options, for example:\ntype:\"aside\"});lightbox.init();return()=>{lightbox.destroy();lightbox=null;};},[]);useEffect(()=>{var _props_image1,_props_image2,_props_image3,_props_image4,_props_image5,_props_image6,_props_image7,_props_image8,_props_image9,_props_image10,_props_image11,_props_image12,_props_image13,_props_image14,_props_image15,_props_image16,_props_image17,_props_image18,_props_image19,_props_image20,_props_image21,_props_image22,_props_image23,_props_image24,_props_image25,_props_image26,_props_image27,_props_image28,_props_image29,_props_image30,_props_image31,_props_image32,_props_image33,_props_image34,_props_image35,_props_image36,_props_image37,_props_image38,_props_image39,_props_image40,_props_image41,_props_image42,_props_image43,_props_image44,_props_image45,_props_image46,_props_image47,_props_image48,_props_image49,_props_image50;setWorks([{image:((_props_image1=props.image1)===null||_props_image1===void 0?void 0:_props_image1.src)||\"\",description:props.description1||\"\"},{image:((_props_image2=props.image2)===null||_props_image2===void 0?void 0:_props_image2.src)||\"\",description:props.description2||\"\"},{image:((_props_image3=props.image3)===null||_props_image3===void 0?void 0:_props_image3.src)||\"\",description:props.description3||\"\"},{image:((_props_image4=props.image4)===null||_props_image4===void 0?void 0:_props_image4.src)||\"\",description:props.description4||\"\"},{image:((_props_image5=props.image5)===null||_props_image5===void 0?void 0:_props_image5.src)||\"\",description:props.description5||\"\"},{image:((_props_image6=props.image6)===null||_props_image6===void 0?void 0:_props_image6.src)||\"\",description:props.description6||\"\"},{image:((_props_image7=props.image7)===null||_props_image7===void 0?void 0:_props_image7.src)||\"\",description:props.description7||\"\"},{image:((_props_image8=props.image8)===null||_props_image8===void 0?void 0:_props_image8.src)||\"\",description:props.description8||\"\"},{image:((_props_image9=props.image9)===null||_props_image9===void 0?void 0:_props_image9.src)||\"\",description:props.description9||\"\"},{image:((_props_image10=props.image10)===null||_props_image10===void 0?void 0:_props_image10.src)||\"\",description:props.description10||\"\"},{image:((_props_image11=props.image11)===null||_props_image11===void 0?void 0:_props_image11.src)||\"\",description:props.description11||\"\"},{image:((_props_image12=props.image12)===null||_props_image12===void 0?void 0:_props_image12.src)||\"\",description:props.description12||\"\"},{image:((_props_image13=props.image13)===null||_props_image13===void 0?void 0:_props_image13.src)||\"\",description:props.description13||\"\"},{image:((_props_image14=props.image14)===null||_props_image14===void 0?void 0:_props_image14.src)||\"\",description:props.description14||\"\"},{image:((_props_image15=props.image15)===null||_props_image15===void 0?void 0:_props_image15.src)||\"\",description:props.description15||\"\"},{image:((_props_image16=props.image16)===null||_props_image16===void 0?void 0:_props_image16.src)||\"\",description:props.description16||\"\"},{image:((_props_image17=props.image17)===null||_props_image17===void 0?void 0:_props_image17.src)||\"\",description:props.description17||\"\"},{image:((_props_image18=props.image18)===null||_props_image18===void 0?void 0:_props_image18.src)||\"\",description:props.description18||\"\"},{image:((_props_image19=props.image19)===null||_props_image19===void 0?void 0:_props_image19.src)||\"\",description:props.description19||\"\"},{image:((_props_image20=props.image20)===null||_props_image20===void 0?void 0:_props_image20.src)||\"\",description:props.description20||\"\"},{image:((_props_image21=props.image21)===null||_props_image21===void 0?void 0:_props_image21.src)||\"\",description:props.description21||\"\"},{image:((_props_image22=props.image22)===null||_props_image22===void 0?void 0:_props_image22.src)||\"\",description:props.description22||\"\"},{image:((_props_image23=props.image23)===null||_props_image23===void 0?void 0:_props_image23.src)||\"\",description:props.description23||\"\"},{image:((_props_image24=props.image24)===null||_props_image24===void 0?void 0:_props_image24.src)||\"\",description:props.description24||\"\"},{image:((_props_image25=props.image25)===null||_props_image25===void 0?void 0:_props_image25.src)||\"\",description:props.description25||\"\"},{image:((_props_image26=props.image26)===null||_props_image26===void 0?void 0:_props_image26.src)||\"\",description:props.description26||\"\"},{image:((_props_image27=props.image27)===null||_props_image27===void 0?void 0:_props_image27.src)||\"\",description:props.description27||\"\"},{image:((_props_image28=props.image28)===null||_props_image28===void 0?void 0:_props_image28.src)||\"\",description:props.description28||\"\"},{image:((_props_image29=props.image29)===null||_props_image29===void 0?void 0:_props_image29.src)||\"\",description:props.description29||\"\"},{image:((_props_image30=props.image30)===null||_props_image30===void 0?void 0:_props_image30.src)||\"\",description:props.description30||\"\"},{image:((_props_image31=props.image31)===null||_props_image31===void 0?void 0:_props_image31.src)||\"\",description:props.description31||\"\"},{image:((_props_image32=props.image32)===null||_props_image32===void 0?void 0:_props_image32.src)||\"\",description:props.description32||\"\"},{image:((_props_image33=props.image33)===null||_props_image33===void 0?void 0:_props_image33.src)||\"\",description:props.description33||\"\"},{image:((_props_image34=props.image34)===null||_props_image34===void 0?void 0:_props_image34.src)||\"\",description:props.description34||\"\"},{image:((_props_image35=props.image35)===null||_props_image35===void 0?void 0:_props_image35.src)||\"\",description:props.description35||\"\"},{image:((_props_image36=props.image36)===null||_props_image36===void 0?void 0:_props_image36.src)||\"\",description:props.description36||\"\"},{image:((_props_image37=props.image37)===null||_props_image37===void 0?void 0:_props_image37.src)||\"\",description:props.description37||\"\"},{image:((_props_image38=props.image38)===null||_props_image38===void 0?void 0:_props_image38.src)||\"\",description:props.description38||\"\"},{image:((_props_image39=props.image39)===null||_props_image39===void 0?void 0:_props_image39.src)||\"\",description:props.description39||\"\"},{image:((_props_image40=props.image40)===null||_props_image40===void 0?void 0:_props_image40.src)||\"\",description:props.description40||\"\"},{image:((_props_image41=props.image41)===null||_props_image41===void 0?void 0:_props_image41.src)||\"\",description:props.description41||\"\"},{image:((_props_image42=props.image42)===null||_props_image42===void 0?void 0:_props_image42.src)||\"\",description:props.description42||\"\"},{image:((_props_image43=props.image43)===null||_props_image43===void 0?void 0:_props_image43.src)||\"\",description:props.description43||\"\"},{image:((_props_image44=props.image44)===null||_props_image44===void 0?void 0:_props_image44.src)||\"\",description:props.description44||\"\"},{image:((_props_image45=props.image45)===null||_props_image45===void 0?void 0:_props_image45.src)||\"\",description:props.description45||\"\"},{image:((_props_image46=props.image46)===null||_props_image46===void 0?void 0:_props_image46.src)||\"\",description:props.description46||\"\"},{image:((_props_image47=props.image47)===null||_props_image47===void 0?void 0:_props_image47.src)||\"\",description:props.description47||\"\"},{image:((_props_image48=props.image48)===null||_props_image48===void 0?void 0:_props_image48.src)||\"\",description:props.description48||\"\"},{image:((_props_image49=props.image49)===null||_props_image49===void 0?void 0:_props_image49.src)||\"\",description:props.description49||\"\"},{image:((_props_image50=props.image50)===null||_props_image50===void 0?void 0:_props_image50.src)||\"\",description:props.description50||\"\"}].filter(w=>{return!!w.image;}));},[props]);return /*#__PURE__*/_jsx(\"div\",{className:\"pswp-gallery\",id:\"my-gallery\",style:{marginTop:\"0.5rem\",display:\"grid\",gridTemplateColumns:\"repeat(12, minmax(0, 1fr))\",gap:\"1rem\"},children:works.map(w=>{return /*#__PURE__*/_jsx(\"a\",{href:w.image,\"data-pswp-width\":\"1024\",\"data-pswp-height\":\"768\",target:\"_blank\",style:{gridColumn:window.innerWidth<768?\"span 4\":\"span 3\",display:\"flex\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"img\",{src:w.image,alt:w.description,style:{objectFit:\"contain\",width:\"100%\"}})});})});}addPropertyControls(WorksGallery,{image1:{type:ControlType.ResponsiveImage},description1:{type:ControlType.String},image2:{type:ControlType.ResponsiveImage},description2:{type:ControlType.String},image3:{type:ControlType.ResponsiveImage},description3:{type:ControlType.String},image4:{type:ControlType.ResponsiveImage},description4:{type:ControlType.String},image5:{type:ControlType.ResponsiveImage},description5:{type:ControlType.String},image6:{type:ControlType.ResponsiveImage},description6:{type:ControlType.String},image7:{type:ControlType.ResponsiveImage},description7:{type:ControlType.String},image8:{type:ControlType.ResponsiveImage},description8:{type:ControlType.String},image9:{type:ControlType.ResponsiveImage},description9:{type:ControlType.String},image10:{type:ControlType.ResponsiveImage},description10:{type:ControlType.String},image11:{type:ControlType.ResponsiveImage},description11:{type:ControlType.String},image12:{type:ControlType.ResponsiveImage},description12:{type:ControlType.String},image13:{type:ControlType.ResponsiveImage},description13:{type:ControlType.String},image14:{type:ControlType.ResponsiveImage},description14:{type:ControlType.String},image15:{type:ControlType.ResponsiveImage},description15:{type:ControlType.String},image16:{type:ControlType.ResponsiveImage},description16:{type:ControlType.String},image17:{type:ControlType.ResponsiveImage},description17:{type:ControlType.String},image18:{type:ControlType.ResponsiveImage},description18:{type:ControlType.String},image19:{type:ControlType.ResponsiveImage},description19:{type:ControlType.String},image20:{type:ControlType.ResponsiveImage},description20:{type:ControlType.String},image21:{type:ControlType.ResponsiveImage},description21:{type:ControlType.String},image22:{type:ControlType.ResponsiveImage},description22:{type:ControlType.String},image23:{type:ControlType.ResponsiveImage},description23:{type:ControlType.String},image24:{type:ControlType.ResponsiveImage},description24:{type:ControlType.String},image25:{type:ControlType.ResponsiveImage},description25:{type:ControlType.String},image26:{type:ControlType.ResponsiveImage},description26:{type:ControlType.String},image27:{type:ControlType.ResponsiveImage},description27:{type:ControlType.String},image28:{type:ControlType.ResponsiveImage},description28:{type:ControlType.String},image29:{type:ControlType.ResponsiveImage},description29:{type:ControlType.String},image30:{type:ControlType.ResponsiveImage},description30:{type:ControlType.String},image31:{type:ControlType.ResponsiveImage},description31:{type:ControlType.String},image32:{type:ControlType.ResponsiveImage},description32:{type:ControlType.String},image33:{type:ControlType.ResponsiveImage},description33:{type:ControlType.String},image34:{type:ControlType.ResponsiveImage},description34:{type:ControlType.String},image35:{type:ControlType.ResponsiveImage},description35:{type:ControlType.String},image36:{type:ControlType.ResponsiveImage},description36:{type:ControlType.String},image37:{type:ControlType.ResponsiveImage},description37:{type:ControlType.String},image38:{type:ControlType.ResponsiveImage},description38:{type:ControlType.String},image39:{type:ControlType.ResponsiveImage},description39:{type:ControlType.String},image40:{type:ControlType.ResponsiveImage},description40:{type:ControlType.String},image41:{type:ControlType.ResponsiveImage},description41:{type:ControlType.String},image42:{type:ControlType.ResponsiveImage},description42:{type:ControlType.String},image43:{type:ControlType.ResponsiveImage},description43:{type:ControlType.String},image44:{type:ControlType.ResponsiveImage},description44:{type:ControlType.String},image45:{type:ControlType.ResponsiveImage},description45:{type:ControlType.String},image46:{type:ControlType.ResponsiveImage},description46:{type:ControlType.String},image47:{type:ControlType.ResponsiveImage},description47:{type:ControlType.String},image48:{type:ControlType.ResponsiveImage},description48:{type:ControlType.String},image49:{type:ControlType.ResponsiveImage},description49:{type:ControlType.String},image50:{type:ControlType.ResponsiveImage},description50:{type:ControlType.String}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WorksGallery\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WorksGallery.map"],"mappings":";;;;;AAaA,SAASA,EAAc,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