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,CAqmFWwoB,CAAevqB,KAAK4E,UAAW5E,KAAKkJ,UAAYlJ,KAAKkJ,UAAUhG,KAAOlD,KAAK2sB,iBAAkB3sB,KACtG,CAOA,OAAAyV,GACE,OAAOzV,KAAKqB,QAAQoc,MAAQzd,KAAKmV,cAAgB,CACnD,CAQA,eAAAoX,CAAgBlrB,GAQd,OAPI7B,OAAO2uB,WAAW,4CAA4CC,UAChE/sB,EAAQ+oB,sBAAwB,OAChC/oB,EAAQoH,sBAAwB,GAK3B,IAAKyjB,MACP7qB,EAEP","sources":["webpack://jumpstart-app/./node_modules/photoswipe/dist/photoswipe.esm.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}\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} 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} AddPostfix\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} */\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} Methods\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 | 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} Methods\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 | ((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 // \n // \n // \n // \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 = ''; // 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 += '';\n }\n\n out += svgData.inner;\n out += '';\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: '',\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: '',\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: '',\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: '' + '' + '',\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: '',\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} 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 : PhotoSwipeEvent & PhotoSwipeEventsMap[T]} AugmentedEvent\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {(event: AugmentedEvent) => 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) => void)[] }}\r\n */\n this._listeners = {};\n /**\r\n * @type {{ [T in keyof PhotoSwipeFiltersMap]?: Filter[] }}\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} args\r\n * @returns {Parameters[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} 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} 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}\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} */\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} Type\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} EventCallback\r\n */\n\n/**\r\n * @template {keyof PhotoSwipeEventsMap} T\r\n * @typedef {import('./core/eventable.js').AugmentedEvent} AugmentedEvent\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 | { default: Type }} PhotoSwipeModule */\n\n/** @typedef {PhotoSwipeModule | Promise | (() => Promise)} PhotoSwipeModuleOption */\n\n/**\r\n * @typedef {string | NodeListOf | HTMLElement[] | HTMLElement} ElementProvider\r\n */\n\n/** @typedef {Partial} 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} [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} 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"],"names":["createElement","className","tagName","appendToEl","el","document","appendChild","equalizePoints","p1","p2","x","y","undefined","id","roundPoint","p","Math","round","getDistanceBetween","abs","sqrt","pointsEqual","clamp","val","min","max","toTransformString","scale","propValue","setTransform","style","transform","setTransitionStyle","prop","duration","ease","transition","setWidthHeight","w","h","width","height","LOAD_STATE","isSafari","navigator","vendor","match","supportsPassive","window","addEventListener","Object","defineProperty","get","e","DOMEvents","constructor","this","_pool","add","target","type","listener","passive","_toggleListener","remove","removeAll","forEach","poolItem","unbind","skipPool","methodName","split","eType","filter","push","eventOptions","getViewportSize","options","pswp","getViewportSizeFn","newViewportSize","documentElement","clientWidth","innerHeight","parsePaddingOption","viewportSize","itemData","index","paddingValue","paddingFn","padding","legacyPropName","toUpperCase","slice","Number","getPanAreaSize","PanBounds","slide","currZoomLevel","center","update","_updateAxis","dispatch","reset","axis","elSize","data","panAreaSize","correctPan","panOffset","ZoomLevel","elementSize","fit","fill","vFill","initial","secondary","maxWidth","maxHeight","hRatio","vRatio","_getInitial","_getSecondary","_getMax","zoomLevels","slideData","_parseZoomLevelOption","optionPrefix","optionName","optionValue","Slide","isActive","currIndex","currentResolution","pan","isFirstSlide","opener","isOpen","content","contentLoader","getContentBySlide","container","holderElement","heavyAppended","bounds","prevDisplayedWidth","prevDisplayedHeight","setIsActive","activate","deactivate","append","transformOrigin","calculateSize","load","updateContentSize","appendHeavy","zoomAndPanToInitial","applyCurrentZoomPan","mainScroll","isShifted","defaultPrevented","destroy","hasSlide","resize","panTo","force","scaleMultiplier","sizeChanged","setDisplayedSize","getPlaceholderElement","_this$content$placeho","placeholder","element","zoomTo","destZoomLevel","centerPoint","transitionDuration","ignoreBounds","isZoomable","animations","stopAllPan","prevZoomLevel","setZoomLevel","calculateZoomToPanOffset","finishTransition","_setResolution","startTransition","isPan","name","getCurrentTransform","onComplete","easing","toggleZoom","zoomAnimationDuration","point","getViewportCenterPoint","zoomFactor","panX","panY","isPannable","Boolean","_applyZoomTransform","currSlide","zoom","newResolution","DragHandler","gestures","startPan","start","stopAll","change","prevP1","dragAxis","closeOnVerticalDrag","isMultitouch","_setPanWithFriction","bgOpacity","_getVerticalDragRatio","applyBgOpacity","_panOrMoveMainScroll","end","velocity","indexDiff","currentSlideVisibilityRatio","getCurrSlideX","moveIndexBy","correctZoomPan","_finishPanGestureForAxis","panPos","restoreBgOpacity","projectedPosition","vDragRatio","projectedVDragRatio","close","correctedPanPosition","dampingRatio","initialBgOpacity","totalPanDist","startSpring","onUpdate","pos","animationProgressRatio","floor","delta","newMainScrollX","moveTo","newPan","allowPanToNext","currSlideMainScrollX","mainScrollShiftDiff","isLeftToRight","isRightToLeft","_this$pswp$currSlide$","_this$pswp$currSlide","potentialPan","customFriction","getZoomPointsCenter","ZoomHandler","_startPan","_startZoomPoint","_zoomPoint","_wasOverFitZoomLevel","_startZoomLevel","startP1","startP2","minZoomLevel","maxZoomLevel","pinchToClose","_calculatePanForZoomLevel","ignoreGesture","destinationZoomLevel","currZoomLevelNeedsChange","initialPan","destinationPan","panNeedsChange","naturalFrequency","now","newZoomLevel","didTapOnMainContent","event","closest","TapHandler","click","originalEvent","targetClassList","classList","isImageClick","contains","isBackgroundClick","_doClickOrTapAction","tap","doubleTap","actionName","_this$gestures$pswp$e","actionFullName","clickToCloseNonZoomable","toggle","call","Gestures","prevP2","_lastStartP1","_intervalP1","_numActivePoints","_ongoingPointers","_touchEventEnabled","_pointerEventEnabled","PointerEvent","supportsTouch","maxTouchPoints","_intervalTime","_velocityCalculated","isDragging","isZooming","raf","_tapTimer","drag","tapHandler","on","events","scrollWrap","_onClick","bind","_bindEvents","ontouchmove","ontouchend","pref","down","up","cancel","cancelEvent","onPointerDown","onPointerMove","onPointerUp","isMousePointer","pointerType","button","mouseDetected","_preventPointerEventBehaviour","_updatePoints","_clearTapTimer","preventDefault","_finishDrag","_updateStartPoints","_rafStopLoop","_rafRenderLoop","_calculateDragDirection","Date","_updateVelocity","_finishTap","_updatePrevPoints","requestAnimationFrame","time","_getVelocity","indexOf","tapDelay","doubleTapAction","setTimeout","clearTimeout","displacement","cancelAnimationFrame","applyFilters","pointerEvent","pointerIndex","findIndex","ongoingPointer","pointerId","splice","_convertEventPosToPoint","length","touchEvent","touches","diff","axisToCheck","pageX","offset","pageY","identifier","stopPropagation","MainScroll","slideWidth","_currPositionIndex","_prevPositionIndex","_containerShiftIndex","itemHolders","resizeSlides","newSlideWidth","spacing","slideWidthChanged","itemHolder","resetPosition","appendHolders","i","setAttribute","display","canBeSwiped","getNumItems","animate","velocityX","newIndex","potentialIndex","numSlides","canLoop","getLoopedIndex","distance","stopMainScroll","destinationX","isMainScroll","updateCurrItem","currDiff","currDistance","_this$itemHolders$","positionDifference","tempHolder","diffAbs","_itemHolder$slide","shift","setContent","pop","unshift","updateLazy","dragging","newSlideIndexOffset","KeyboardKeyCodesMap","Escape","z","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Tab","getKeyboardEventKey","key","isKeySupported","Keyboard","_wasFocused","trapFocus","initialPointerPos","_focusRoot","_onFocusIn","_onKeyDown","lastActiveElement","activeElement","returnFocus","focus","ctrlKey","metaKey","altKey","shiftKey","specialKeyUsed","keydownAction","isForward","keyCode","escKey","arrowKeys","template","DEFAULT_EASING","CSSAnimation","props","_props$prop","onFinish","_target","_onComplete","_finished","_onTransitionEnd","_helperTimeout","_finalizeAnimation","removeEventListener","SpringEaser","initialVelocity","_dampingRatio","_naturalFrequency","_dampedFrequency","easeFrame","deltaPosition","deltaTime","coeff","naturalDumpingPow","E","dumpedFCos","cos","dumpedFSin","sin","SpringAnimation","_raf","easer","prevTime","animationLoop","Animations","activeAnimations","_start","isSpring","animation","stop","isPanRunning","some","ScrollWheel","_onWheel","deltaX","deltaY","wheelToZoom","deltaMode","clientX","clientY","UIElement","_container","elementHTML","html","isButton","toLowerCase","title","ariaLabel","ariaText","innerHTML","htmlData","isCustomSVG","svgData","out","join","size","outlineID","inner","addElementHTML","onInit","onClick","onclick","appendTo","topBar","initArrowButton","isNextButton","loop","disabled","arrowPrev","order","arrowNext","closeButton","zoomButton","loadingIndicator","indicatorElement","isVisible","delayTimeout","setIndicatorVisibility","visible","updatePreloaderVisibility","_pswp$currSlide","isLoading","_pswp$currSlide2","preloaderDelay","ui","counterIndicator","counterElement","innerText","indexIndicatorSep","setZoomedIn","isZoomedIn","UI","isRegistered","uiElementsData","items","_lastUpdatedZoomLevel","init","sort","a","b","uiElementData","registerElement","_pswp$element","_onZoomPanUpdate","elementData","isClosing","currZoomLevelDiff","imageClickAction","PhotoSwipeEvent","details","assign","Eventable","_listeners","_filters","addFilter","fn","priority","_this$_filters$name","_this$_filters$name2","_this$pswp","f1","f2","removeFilter","args","_this$_filters$name3","apply","_this$_listeners$name","_this$pswp2","off","_this$pswp3","_this$_listeners$name2","Placeholder","imageSrc","imgEl","decoding","alt","src","_this$element","parentNode","Content","instance","displayedImageWidth","displayedImageHeight","isAttached","isDecoding","state","removePlaceholder","keepPlaceholder","isLazy","reload","usePlaceholder","placeholderEl","parentElement","prepend","placeholderSrc","msrc","isImageContent","loadImage","_this$data$src","_this$data$alt","imageElement","updateSrcsetSizes","srcset","complete","onLoaded","onload","onerror","onError","setSlide","displayError","isError","isInitialSizeUpdate","image","sizesWidth","dataset","largestUsedSize","parseInt","sizes","String","lazyLoad","_this$instance$option","_this$instance$option2","errorMsgEl","errorMsg","supportsDecode","decode","catch","finally","appendImage","lazyLoadData","createContentFromData","zoomLevel","ceil","ContentLoader","limit","preload","_cachedItems","loadSlideByIndex","initialIndex","getContentByIndex","getItemData","lazyLoadSlide","addToCache","removeByIndex","indexToRemove","item","find","PhotoSwipeBase","_this$options","numItems","dataSource","_getGalleryDOMElements","gallery","_this$options2","dataSourceItem","Array","isArray","Element","_domElementToItemData","galleryElement","_this$options3","_this$options4","children","childSelector","option","legacySelector","parent","elements","NodeList","from","selector","querySelectorAll","getElementsFromOption","linkEl","querySelector","pswpSrc","href","pswpSrcset","pswpWidth","pswpHeight","pswpType","thumbnailEl","_thumbnailEl$getAttri","currentSrc","getAttribute","pswpCropped","cropped","thumbCropped","MIN_OPACITY","Opener","isClosed","isOpening","_duration","_useAnimation","_croppedZoom","_animateRootOpacity","_animateBgOpacity","_placeholder","_opacityElement","_cropContainer1","_cropContainer2","_thumbBounds","_prepareOpen","open","hideAnimationDuration","maxWidthToAnimate","_applyStartProps","showAnimationDuration","_options$showHideOpac","showHideAnimationType","showHideOpacity","_initialThumbBounds","getThumbBounds","_animateZoom","bg","opacity","innerRect","overflow","_setClosedStateZoomPan","willChange","Promise","resolve","decoded","isDelaying","img","reject","_initiate","_this$pswp$element","_this$pswp$element2","setProperty","_animateToOpenState","_animateToClosedState","_onAnimationComplete","_animateTo","containerOnePanX","containerOnePanY","containerTwoPanX","containerTwoPanY","animProps","defaultOptions","bgClickAction","tapAction","PhotoSwipe","super","_prepareOptions","_prevViewportSize","isDestroying","hasMouse","_initialItemData","keyboard","_createMainStructure","rootClasses","mainClass","scrollWheel","isNaN","updateSize","pageYOffset","_handlePageResize","_updatePageScrollOffset","goTo","next","prev","_this$currSlide","_this$currSlide2","_itemHolder$slide2","refreshSlideContent","slideIndex","_this$currSlide$index","_this$currSlide3","potentialHolderIndex","_itemHolder$slide3","holder","matchMedia","matches","_this$element2","test","userAgent","setScrollOffset","body","thumbBounds","thumbnail","thumbSelector","imageWidth","imageHeight","thumbAreaRect","getBoundingClientRect","fillZoomLevel","offsetX","offsetY","left","top","getCroppedBoundsByElement","getBoundsByElement"],"sourceRoot":""}