From 1cf80054b0ac80d104c3a8d600ca798bbec9a984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E6=99=93=E9=94=8B?= Date: Wed, 18 Dec 2024 22:41:27 +0800 Subject: [PATCH] =?UTF-8?q?docs=F0=9F=93=9D:=20=E5=9B=BE=E7=89=87=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/cache/deps/_metadata.json | 26 +- .vitepress/cache/deps/medium-zoom.js | 470 --- .vitepress/cache/deps/medium-zoom.js.map | 7 - .../deps/vitepress-plugin-image-viewer.js | 2866 +++++++++++++++++ .../deps/vitepress-plugin-image-viewer.js.map | 7 + .vitepress/theme/index.ts | 15 +- .vitepress/theme/style.css | 8 +- package.json | 2 + pnpm-lock.yaml | 18 + 9 files changed, 2922 insertions(+), 497 deletions(-) delete mode 100644 .vitepress/cache/deps/medium-zoom.js delete mode 100644 .vitepress/cache/deps/medium-zoom.js.map create mode 100644 .vitepress/cache/deps/vitepress-plugin-image-viewer.js create mode 100644 .vitepress/cache/deps/vitepress-plugin-image-viewer.js.map diff --git a/.vitepress/cache/deps/_metadata.json b/.vitepress/cache/deps/_metadata.json index cc8e804..f530673 100644 --- a/.vitepress/cache/deps/_metadata.json +++ b/.vitepress/cache/deps/_metadata.json @@ -1,49 +1,49 @@ { - "hash": "5c2a1719", + "hash": "ea30a133", "configHash": "282d8f75", - "lockfileHash": "63259aaa", - "browserHash": "fb1f13a0", + "lockfileHash": "0d0dbcf9", + "browserHash": "1ba29454", "optimized": { "vue": { "src": "../../../node_modules/.pnpm/vue@3.4.15/node_modules/vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "c632d780", + "fileHash": "7f0dabd0", "needsInterop": false }, "vitepress > @vue/devtools-api": { "src": "../../../node_modules/.pnpm/@vue+devtools-api@7.0.14/node_modules/@vue/devtools-api/dist/index.js", "file": "vitepress___@vue_devtools-api.js", - "fileHash": "659ffa50", + "fileHash": "575bfd37", "needsInterop": false }, "vitepress > @vueuse/core": { "src": "../../../node_modules/.pnpm/@vueuse+core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.mjs", "file": "vitepress___@vueuse_core.js", - "fileHash": "f1b1b8e5", + "fileHash": "0216e36b", "needsInterop": false }, "vitepress > @vueuse/integrations/useFocusTrap": { "src": "../../../node_modules/.pnpm/@vueuse+integrations@10.7.2_focus-trap@7.5.4_vue@3.4.21/node_modules/@vueuse/integrations/useFocusTrap.mjs", "file": "vitepress___@vueuse_integrations_useFocusTrap.js", - "fileHash": "4334978c", + "fileHash": "93f0a871", "needsInterop": false }, "vitepress > mark.js/src/vanilla.js": { "src": "../../../node_modules/.pnpm/mark.js@8.11.1/node_modules/mark.js/src/vanilla.js", "file": "vitepress___mark__js_src_vanilla__js.js", - "fileHash": "6fddd50a", + "fileHash": "bbe98b48", "needsInterop": false }, "vitepress > minisearch": { "src": "../../../node_modules/.pnpm/minisearch@6.3.0/node_modules/minisearch/dist/es/index.js", "file": "vitepress___minisearch.js", - "fileHash": "645e4d73", + "fileHash": "e60f38ca", "needsInterop": false }, - "medium-zoom": { - "src": "../../../node_modules/.pnpm/medium-zoom@1.1.0/node_modules/medium-zoom/dist/medium-zoom.esm.js", - "file": "medium-zoom.js", - "fileHash": "e1283fcb", + "vitepress-plugin-image-viewer": { + "src": "../../../node_modules/.pnpm/vitepress-plugin-image-viewer@1.1.5/node_modules/vitepress-plugin-image-viewer/lib/viewer.js", + "file": "vitepress-plugin-image-viewer.js", + "fileHash": "601fd5ac", "needsInterop": false } }, diff --git a/.vitepress/cache/deps/medium-zoom.js b/.vitepress/cache/deps/medium-zoom.js deleted file mode 100644 index 99d36d6..0000000 --- a/.vitepress/cache/deps/medium-zoom.js +++ /dev/null @@ -1,470 +0,0 @@ -// node_modules/.pnpm/medium-zoom@1.1.0/node_modules/medium-zoom/dist/medium-zoom.esm.js -var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - return target; -}; -var isSupported = function isSupported2(node) { - return node.tagName === "IMG"; -}; -var isNodeList = function isNodeList2(selector) { - return NodeList.prototype.isPrototypeOf(selector); -}; -var isNode = function isNode2(selector) { - return selector && selector.nodeType === 1; -}; -var isSvg = function isSvg2(image) { - var source = image.currentSrc || image.src; - return source.substr(-4).toLowerCase() === ".svg"; -}; -var getImagesFromSelector = function getImagesFromSelector2(selector) { - try { - if (Array.isArray(selector)) { - return selector.filter(isSupported); - } - if (isNodeList(selector)) { - return [].slice.call(selector).filter(isSupported); - } - if (isNode(selector)) { - return [selector].filter(isSupported); - } - if (typeof selector === "string") { - return [].slice.call(document.querySelectorAll(selector)).filter(isSupported); - } - return []; - } catch (err) { - throw new TypeError("The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom"); - } -}; -var createOverlay = function createOverlay2(background) { - var overlay = document.createElement("div"); - overlay.classList.add("medium-zoom-overlay"); - overlay.style.background = background; - return overlay; -}; -var cloneTarget = function cloneTarget2(template) { - var _template$getBounding = template.getBoundingClientRect(), top = _template$getBounding.top, left = _template$getBounding.left, width = _template$getBounding.width, height = _template$getBounding.height; - var clone = template.cloneNode(); - var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; - var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; - clone.removeAttribute("id"); - clone.style.position = "absolute"; - clone.style.top = top + scrollTop + "px"; - clone.style.left = left + scrollLeft + "px"; - clone.style.width = width + "px"; - clone.style.height = height + "px"; - clone.style.transform = ""; - return clone; -}; -var createCustomEvent = function createCustomEvent2(type, params) { - var eventParams = _extends({ - bubbles: false, - cancelable: false, - detail: void 0 - }, params); - if (typeof window.CustomEvent === "function") { - return new CustomEvent(type, eventParams); - } - var customEvent = document.createEvent("CustomEvent"); - customEvent.initCustomEvent(type, eventParams.bubbles, eventParams.cancelable, eventParams.detail); - return customEvent; -}; -var mediumZoom = function mediumZoom2(selector) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var Promise2 = window.Promise || function Promise3(fn) { - function noop() { - } - fn(noop, noop); - }; - var _handleClick = function _handleClick2(event) { - var target = event.target; - if (target === overlay) { - close(); - return; - } - if (images.indexOf(target) === -1) { - return; - } - toggle({ target }); - }; - var _handleScroll = function _handleScroll2() { - if (isAnimating || !active.original) { - return; - } - var currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; - if (Math.abs(scrollTop - currentScroll) > zoomOptions.scrollOffset) { - setTimeout(close, 150); - } - }; - var _handleKeyUp = function _handleKeyUp2(event) { - var key = event.key || event.keyCode; - if (key === "Escape" || key === "Esc" || key === 27) { - close(); - } - }; - var update = function update2() { - var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var newOptions = options2; - if (options2.background) { - overlay.style.background = options2.background; - } - if (options2.container && options2.container instanceof Object) { - newOptions.container = _extends({}, zoomOptions.container, options2.container); - } - if (options2.template) { - var template = isNode(options2.template) ? options2.template : document.querySelector(options2.template); - newOptions.template = template; - } - zoomOptions = _extends({}, zoomOptions, newOptions); - images.forEach(function(image) { - image.dispatchEvent(createCustomEvent("medium-zoom:update", { - detail: { zoom } - })); - }); - return zoom; - }; - var clone = function clone2() { - var options2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - return mediumZoom2(_extends({}, zoomOptions, options2)); - }; - var attach = function attach2() { - for (var _len = arguments.length, selectors = Array(_len), _key = 0; _key < _len; _key++) { - selectors[_key] = arguments[_key]; - } - var newImages = selectors.reduce(function(imagesAccumulator, currentSelector) { - return [].concat(imagesAccumulator, getImagesFromSelector(currentSelector)); - }, []); - newImages.filter(function(newImage) { - return images.indexOf(newImage) === -1; - }).forEach(function(newImage) { - images.push(newImage); - newImage.classList.add("medium-zoom-image"); - }); - eventListeners.forEach(function(_ref) { - var type = _ref.type, listener = _ref.listener, options2 = _ref.options; - newImages.forEach(function(image) { - image.addEventListener(type, listener, options2); - }); - }); - return zoom; - }; - var detach = function detach2() { - for (var _len2 = arguments.length, selectors = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - selectors[_key2] = arguments[_key2]; - } - if (active.zoomed) { - close(); - } - var imagesToDetach = selectors.length > 0 ? selectors.reduce(function(imagesAccumulator, currentSelector) { - return [].concat(imagesAccumulator, getImagesFromSelector(currentSelector)); - }, []) : images; - imagesToDetach.forEach(function(image) { - image.classList.remove("medium-zoom-image"); - image.dispatchEvent(createCustomEvent("medium-zoom:detach", { - detail: { zoom } - })); - }); - images = images.filter(function(image) { - return imagesToDetach.indexOf(image) === -1; - }); - return zoom; - }; - var on = function on2(type, listener) { - var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - images.forEach(function(image) { - image.addEventListener("medium-zoom:" + type, listener, options2); - }); - eventListeners.push({ type: "medium-zoom:" + type, listener, options: options2 }); - return zoom; - }; - var off = function off2(type, listener) { - var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - images.forEach(function(image) { - image.removeEventListener("medium-zoom:" + type, listener, options2); - }); - eventListeners = eventListeners.filter(function(eventListener) { - return !(eventListener.type === "medium-zoom:" + type && eventListener.listener.toString() === listener.toString()); - }); - return zoom; - }; - var open = function open2() { - var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, target = _ref2.target; - var _animate = function _animate2() { - var container = { - width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight, - left: 0, - top: 0, - right: 0, - bottom: 0 - }; - var viewportWidth = void 0; - var viewportHeight = void 0; - if (zoomOptions.container) { - if (zoomOptions.container instanceof Object) { - container = _extends({}, container, zoomOptions.container); - viewportWidth = container.width - container.left - container.right - zoomOptions.margin * 2; - viewportHeight = container.height - container.top - container.bottom - zoomOptions.margin * 2; - } else { - var zoomContainer = isNode(zoomOptions.container) ? zoomOptions.container : document.querySelector(zoomOptions.container); - var _zoomContainer$getBou = zoomContainer.getBoundingClientRect(), _width = _zoomContainer$getBou.width, _height = _zoomContainer$getBou.height, _left = _zoomContainer$getBou.left, _top = _zoomContainer$getBou.top; - container = _extends({}, container, { - width: _width, - height: _height, - left: _left, - top: _top - }); - } - } - viewportWidth = viewportWidth || container.width - zoomOptions.margin * 2; - viewportHeight = viewportHeight || container.height - zoomOptions.margin * 2; - var zoomTarget = active.zoomedHd || active.original; - var naturalWidth = isSvg(zoomTarget) ? viewportWidth : zoomTarget.naturalWidth || viewportWidth; - var naturalHeight = isSvg(zoomTarget) ? viewportHeight : zoomTarget.naturalHeight || viewportHeight; - var _zoomTarget$getBoundi = zoomTarget.getBoundingClientRect(), top = _zoomTarget$getBoundi.top, left = _zoomTarget$getBoundi.left, width = _zoomTarget$getBoundi.width, height = _zoomTarget$getBoundi.height; - var scaleX = Math.min(Math.max(width, naturalWidth), viewportWidth) / width; - var scaleY = Math.min(Math.max(height, naturalHeight), viewportHeight) / height; - var scale = Math.min(scaleX, scaleY); - var translateX = (-left + (viewportWidth - width) / 2 + zoomOptions.margin + container.left) / scale; - var translateY = (-top + (viewportHeight - height) / 2 + zoomOptions.margin + container.top) / scale; - var transform = "scale(" + scale + ") translate3d(" + translateX + "px, " + translateY + "px, 0)"; - active.zoomed.style.transform = transform; - if (active.zoomedHd) { - active.zoomedHd.style.transform = transform; - } - }; - return new Promise2(function(resolve) { - if (target && images.indexOf(target) === -1) { - resolve(zoom); - return; - } - var _handleOpenEnd = function _handleOpenEnd2() { - isAnimating = false; - active.zoomed.removeEventListener("transitionend", _handleOpenEnd2); - active.original.dispatchEvent(createCustomEvent("medium-zoom:opened", { - detail: { zoom } - })); - resolve(zoom); - }; - if (active.zoomed) { - resolve(zoom); - return; - } - if (target) { - active.original = target; - } else if (images.length > 0) { - var _images = images; - active.original = _images[0]; - } else { - resolve(zoom); - return; - } - active.original.dispatchEvent(createCustomEvent("medium-zoom:open", { - detail: { zoom } - })); - scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; - isAnimating = true; - active.zoomed = cloneTarget(active.original); - document.body.appendChild(overlay); - if (zoomOptions.template) { - var template = isNode(zoomOptions.template) ? zoomOptions.template : document.querySelector(zoomOptions.template); - active.template = document.createElement("div"); - active.template.appendChild(template.content.cloneNode(true)); - document.body.appendChild(active.template); - } - if (active.original.parentElement && active.original.parentElement.tagName === "PICTURE" && active.original.currentSrc) { - active.zoomed.src = active.original.currentSrc; - } - document.body.appendChild(active.zoomed); - window.requestAnimationFrame(function() { - document.body.classList.add("medium-zoom--opened"); - }); - active.original.classList.add("medium-zoom-image--hidden"); - active.zoomed.classList.add("medium-zoom-image--opened"); - active.zoomed.addEventListener("click", close); - active.zoomed.addEventListener("transitionend", _handleOpenEnd); - if (active.original.getAttribute("data-zoom-src")) { - active.zoomedHd = active.zoomed.cloneNode(); - active.zoomedHd.removeAttribute("srcset"); - active.zoomedHd.removeAttribute("sizes"); - active.zoomedHd.removeAttribute("loading"); - active.zoomedHd.src = active.zoomed.getAttribute("data-zoom-src"); - active.zoomedHd.onerror = function() { - clearInterval(getZoomTargetSize); - console.warn("Unable to reach the zoom image target " + active.zoomedHd.src); - active.zoomedHd = null; - _animate(); - }; - var getZoomTargetSize = setInterval(function() { - if (active.zoomedHd.complete) { - clearInterval(getZoomTargetSize); - active.zoomedHd.classList.add("medium-zoom-image--opened"); - active.zoomedHd.addEventListener("click", close); - document.body.appendChild(active.zoomedHd); - _animate(); - } - }, 10); - } else if (active.original.hasAttribute("srcset")) { - active.zoomedHd = active.zoomed.cloneNode(); - active.zoomedHd.removeAttribute("sizes"); - active.zoomedHd.removeAttribute("loading"); - var loadEventListener = active.zoomedHd.addEventListener("load", function() { - active.zoomedHd.removeEventListener("load", loadEventListener); - active.zoomedHd.classList.add("medium-zoom-image--opened"); - active.zoomedHd.addEventListener("click", close); - document.body.appendChild(active.zoomedHd); - _animate(); - }); - } else { - _animate(); - } - }); - }; - var close = function close2() { - return new Promise2(function(resolve) { - if (isAnimating || !active.original) { - resolve(zoom); - return; - } - var _handleCloseEnd = function _handleCloseEnd2() { - active.original.classList.remove("medium-zoom-image--hidden"); - document.body.removeChild(active.zoomed); - if (active.zoomedHd) { - document.body.removeChild(active.zoomedHd); - } - document.body.removeChild(overlay); - active.zoomed.classList.remove("medium-zoom-image--opened"); - if (active.template) { - document.body.removeChild(active.template); - } - isAnimating = false; - active.zoomed.removeEventListener("transitionend", _handleCloseEnd2); - active.original.dispatchEvent(createCustomEvent("medium-zoom:closed", { - detail: { zoom } - })); - active.original = null; - active.zoomed = null; - active.zoomedHd = null; - active.template = null; - resolve(zoom); - }; - isAnimating = true; - document.body.classList.remove("medium-zoom--opened"); - active.zoomed.style.transform = ""; - if (active.zoomedHd) { - active.zoomedHd.style.transform = ""; - } - if (active.template) { - active.template.style.transition = "opacity 150ms"; - active.template.style.opacity = 0; - } - active.original.dispatchEvent(createCustomEvent("medium-zoom:close", { - detail: { zoom } - })); - active.zoomed.addEventListener("transitionend", _handleCloseEnd); - }); - }; - var toggle = function toggle2() { - var _ref3 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, target = _ref3.target; - if (active.original) { - return close(); - } - return open({ target }); - }; - var getOptions = function getOptions2() { - return zoomOptions; - }; - var getImages = function getImages2() { - return images; - }; - var getZoomedImage = function getZoomedImage2() { - return active.original; - }; - var images = []; - var eventListeners = []; - var isAnimating = false; - var scrollTop = 0; - var zoomOptions = options; - var active = { - original: null, - zoomed: null, - zoomedHd: null, - template: null - // If the selector is omitted, it's replaced by the options - }; - if (Object.prototype.toString.call(selector) === "[object Object]") { - zoomOptions = selector; - } else if (selector || typeof selector === "string") { - attach(selector); - } - zoomOptions = _extends({ - margin: 0, - background: "#fff", - scrollOffset: 40, - container: null, - template: null - }, zoomOptions); - var overlay = createOverlay(zoomOptions.background); - document.addEventListener("click", _handleClick); - document.addEventListener("keyup", _handleKeyUp); - document.addEventListener("scroll", _handleScroll); - window.addEventListener("resize", close); - var zoom = { - open, - close, - toggle, - update, - clone, - attach, - detach, - on, - off, - getOptions, - getImages, - getZoomedImage - }; - return zoom; -}; -function styleInject(css2, ref) { - if (ref === void 0) - ref = {}; - var insertAt = ref.insertAt; - if (!css2 || typeof document === "undefined") { - return; - } - var head = document.head || document.getElementsByTagName("head")[0]; - var style = document.createElement("style"); - style.type = "text/css"; - if (insertAt === "top") { - if (head.firstChild) { - head.insertBefore(style, head.firstChild); - } else { - head.appendChild(style); - } - } else { - head.appendChild(style); - } - if (style.styleSheet) { - style.styleSheet.cssText = css2; - } else { - style.appendChild(document.createTextNode(css2)); - } -} -var css = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}"; -styleInject(css); -var medium_zoom_esm_default = mediumZoom; -export { - medium_zoom_esm_default as default -}; -/*! Bundled license information: - -medium-zoom/dist/medium-zoom.esm.js: - (*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom *) -*/ -//# sourceMappingURL=medium-zoom.js.map diff --git a/.vitepress/cache/deps/medium-zoom.js.map b/.vitepress/cache/deps/medium-zoom.js.map deleted file mode 100644 index 82e1ec9..0000000 --- a/.vitepress/cache/deps/medium-zoom.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../node_modules/.pnpm/medium-zoom@1.1.0/node_modules/medium-zoom/dist/medium-zoom.esm.js"], - "sourcesContent": ["/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar isSupported = function isSupported(node) {\n return node.tagName === 'IMG';\n};\n\n/* eslint-disable-next-line no-prototype-builtins */\nvar isNodeList = function isNodeList(selector) {\n return NodeList.prototype.isPrototypeOf(selector);\n};\n\nvar isNode = function isNode(selector) {\n return selector && selector.nodeType === 1;\n};\n\nvar isSvg = function isSvg(image) {\n var source = image.currentSrc || image.src;\n return source.substr(-4).toLowerCase() === '.svg';\n};\n\nvar getImagesFromSelector = function getImagesFromSelector(selector) {\n try {\n if (Array.isArray(selector)) {\n return selector.filter(isSupported);\n }\n\n if (isNodeList(selector)) {\n // Do not use spread operator or Array.from() for IE support\n return [].slice.call(selector).filter(isSupported);\n }\n\n if (isNode(selector)) {\n return [selector].filter(isSupported);\n }\n\n if (typeof selector === 'string') {\n // Do not use spread operator or Array.from() for IE support\n return [].slice.call(document.querySelectorAll(selector)).filter(isSupported);\n }\n\n return [];\n } catch (err) {\n throw new TypeError('The provided selector is invalid.\\n' + 'Expects a CSS selector, a Node element, a NodeList or an array.\\n' + 'See: https://github.com/francoischalifour/medium-zoom');\n }\n};\n\nvar createOverlay = function createOverlay(background) {\n var overlay = document.createElement('div');\n overlay.classList.add('medium-zoom-overlay');\n overlay.style.background = background;\n\n return overlay;\n};\n\nvar cloneTarget = function cloneTarget(template) {\n var _template$getBounding = template.getBoundingClientRect(),\n top = _template$getBounding.top,\n left = _template$getBounding.left,\n width = _template$getBounding.width,\n height = _template$getBounding.height;\n\n var clone = template.cloneNode();\n var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;\n var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;\n\n clone.removeAttribute('id');\n clone.style.position = 'absolute';\n clone.style.top = top + scrollTop + 'px';\n clone.style.left = left + scrollLeft + 'px';\n clone.style.width = width + 'px';\n clone.style.height = height + 'px';\n clone.style.transform = '';\n\n return clone;\n};\n\nvar createCustomEvent = function createCustomEvent(type, params) {\n var eventParams = _extends({\n bubbles: false,\n cancelable: false,\n detail: undefined\n }, params);\n\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(type, eventParams);\n }\n\n var customEvent = document.createEvent('CustomEvent');\n customEvent.initCustomEvent(type, eventParams.bubbles, eventParams.cancelable, eventParams.detail);\n\n return customEvent;\n};\n\nvar mediumZoom = function mediumZoom(selector) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n /**\n * Ensure the compatibility with IE11 if no Promise polyfill are used.\n */\n var Promise = window.Promise || function Promise(fn) {\n function noop() {}\n fn(noop, noop);\n };\n\n var _handleClick = function _handleClick(event) {\n var target = event.target;\n\n\n if (target === overlay) {\n close();\n return;\n }\n\n if (images.indexOf(target) === -1) {\n return;\n }\n\n toggle({ target: target });\n };\n\n var _handleScroll = function _handleScroll() {\n if (isAnimating || !active.original) {\n return;\n }\n\n var currentScroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;\n\n if (Math.abs(scrollTop - currentScroll) > zoomOptions.scrollOffset) {\n setTimeout(close, 150);\n }\n };\n\n var _handleKeyUp = function _handleKeyUp(event) {\n var key = event.key || event.keyCode;\n\n // Close if escape key is pressed\n if (key === 'Escape' || key === 'Esc' || key === 27) {\n close();\n }\n };\n\n var update = function update() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var newOptions = options;\n\n if (options.background) {\n overlay.style.background = options.background;\n }\n\n if (options.container && options.container instanceof Object) {\n newOptions.container = _extends({}, zoomOptions.container, options.container);\n }\n\n if (options.template) {\n var template = isNode(options.template) ? options.template : document.querySelector(options.template);\n\n newOptions.template = template;\n }\n\n zoomOptions = _extends({}, zoomOptions, newOptions);\n\n images.forEach(function (image) {\n image.dispatchEvent(createCustomEvent('medium-zoom:update', {\n detail: { zoom: zoom }\n }));\n });\n\n return zoom;\n };\n\n var clone = function clone() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return mediumZoom(_extends({}, zoomOptions, options));\n };\n\n var attach = function attach() {\n for (var _len = arguments.length, selectors = Array(_len), _key = 0; _key < _len; _key++) {\n selectors[_key] = arguments[_key];\n }\n\n var newImages = selectors.reduce(function (imagesAccumulator, currentSelector) {\n return [].concat(imagesAccumulator, getImagesFromSelector(currentSelector));\n }, []);\n\n newImages.filter(function (newImage) {\n return images.indexOf(newImage) === -1;\n }).forEach(function (newImage) {\n images.push(newImage);\n newImage.classList.add('medium-zoom-image');\n });\n\n eventListeners.forEach(function (_ref) {\n var type = _ref.type,\n listener = _ref.listener,\n options = _ref.options;\n\n newImages.forEach(function (image) {\n image.addEventListener(type, listener, options);\n });\n });\n\n return zoom;\n };\n\n var detach = function detach() {\n for (var _len2 = arguments.length, selectors = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n selectors[_key2] = arguments[_key2];\n }\n\n if (active.zoomed) {\n close();\n }\n\n var imagesToDetach = selectors.length > 0 ? selectors.reduce(function (imagesAccumulator, currentSelector) {\n return [].concat(imagesAccumulator, getImagesFromSelector(currentSelector));\n }, []) : images;\n\n imagesToDetach.forEach(function (image) {\n image.classList.remove('medium-zoom-image');\n image.dispatchEvent(createCustomEvent('medium-zoom:detach', {\n detail: { zoom: zoom }\n }));\n });\n\n images = images.filter(function (image) {\n return imagesToDetach.indexOf(image) === -1;\n });\n\n return zoom;\n };\n\n var on = function on(type, listener) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n images.forEach(function (image) {\n image.addEventListener('medium-zoom:' + type, listener, options);\n });\n\n eventListeners.push({ type: 'medium-zoom:' + type, listener: listener, options: options });\n\n return zoom;\n };\n\n var off = function off(type, listener) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n images.forEach(function (image) {\n image.removeEventListener('medium-zoom:' + type, listener, options);\n });\n\n eventListeners = eventListeners.filter(function (eventListener) {\n return !(eventListener.type === 'medium-zoom:' + type && eventListener.listener.toString() === listener.toString());\n });\n\n return zoom;\n };\n\n var open = function open() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n target = _ref2.target;\n\n var _animate = function _animate() {\n var container = {\n width: document.documentElement.clientWidth,\n height: document.documentElement.clientHeight,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0\n };\n var viewportWidth = void 0;\n var viewportHeight = void 0;\n\n if (zoomOptions.container) {\n if (zoomOptions.container instanceof Object) {\n // The container is given as an object with properties like width, height, left, top\n container = _extends({}, container, zoomOptions.container);\n\n // We need to adjust custom options like container.right or container.bottom\n viewportWidth = container.width - container.left - container.right - zoomOptions.margin * 2;\n viewportHeight = container.height - container.top - container.bottom - zoomOptions.margin * 2;\n } else {\n // The container is given as an element\n var zoomContainer = isNode(zoomOptions.container) ? zoomOptions.container : document.querySelector(zoomOptions.container);\n\n var _zoomContainer$getBou = zoomContainer.getBoundingClientRect(),\n _width = _zoomContainer$getBou.width,\n _height = _zoomContainer$getBou.height,\n _left = _zoomContainer$getBou.left,\n _top = _zoomContainer$getBou.top;\n\n container = _extends({}, container, {\n width: _width,\n height: _height,\n left: _left,\n top: _top\n });\n }\n }\n\n viewportWidth = viewportWidth || container.width - zoomOptions.margin * 2;\n viewportHeight = viewportHeight || container.height - zoomOptions.margin * 2;\n\n var zoomTarget = active.zoomedHd || active.original;\n var naturalWidth = isSvg(zoomTarget) ? viewportWidth : zoomTarget.naturalWidth || viewportWidth;\n var naturalHeight = isSvg(zoomTarget) ? viewportHeight : zoomTarget.naturalHeight || viewportHeight;\n\n var _zoomTarget$getBoundi = zoomTarget.getBoundingClientRect(),\n top = _zoomTarget$getBoundi.top,\n left = _zoomTarget$getBoundi.left,\n width = _zoomTarget$getBoundi.width,\n height = _zoomTarget$getBoundi.height;\n\n var scaleX = Math.min(Math.max(width, naturalWidth), viewportWidth) / width;\n var scaleY = Math.min(Math.max(height, naturalHeight), viewportHeight) / height;\n var scale = Math.min(scaleX, scaleY);\n var translateX = (-left + (viewportWidth - width) / 2 + zoomOptions.margin + container.left) / scale;\n var translateY = (-top + (viewportHeight - height) / 2 + zoomOptions.margin + container.top) / scale;\n var transform = 'scale(' + scale + ') translate3d(' + translateX + 'px, ' + translateY + 'px, 0)';\n\n active.zoomed.style.transform = transform;\n\n if (active.zoomedHd) {\n active.zoomedHd.style.transform = transform;\n }\n };\n\n return new Promise(function (resolve) {\n if (target && images.indexOf(target) === -1) {\n resolve(zoom);\n return;\n }\n\n var _handleOpenEnd = function _handleOpenEnd() {\n isAnimating = false;\n active.zoomed.removeEventListener('transitionend', _handleOpenEnd);\n active.original.dispatchEvent(createCustomEvent('medium-zoom:opened', {\n detail: { zoom: zoom }\n }));\n\n resolve(zoom);\n };\n\n if (active.zoomed) {\n resolve(zoom);\n return;\n }\n\n if (target) {\n // The zoom was triggered manually via a click\n active.original = target;\n } else if (images.length > 0) {\nvar _images = images;\n active.original = _images[0];\n } else {\n resolve(zoom);\n return;\n }\n\n active.original.dispatchEvent(createCustomEvent('medium-zoom:open', {\n detail: { zoom: zoom }\n }));\n\n scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;\n isAnimating = true;\n active.zoomed = cloneTarget(active.original);\n\n document.body.appendChild(overlay);\n\n if (zoomOptions.template) {\n var template = isNode(zoomOptions.template) ? zoomOptions.template : document.querySelector(zoomOptions.template);\n active.template = document.createElement('div');\n active.template.appendChild(template.content.cloneNode(true));\n\n document.body.appendChild(active.template);\n }\n\n // If the selected tag is inside a tag, set the\n // currently-applied source as the cloned `src=` attribute.\n // (as these might differ, or src= might be unset in some cases)\n if (active.original.parentElement && active.original.parentElement.tagName === 'PICTURE' && active.original.currentSrc) {\n active.zoomed.src = active.original.currentSrc;\n }\n\n document.body.appendChild(active.zoomed);\n\n window.requestAnimationFrame(function () {\n document.body.classList.add('medium-zoom--opened');\n });\n\n active.original.classList.add('medium-zoom-image--hidden');\n active.zoomed.classList.add('medium-zoom-image--opened');\n\n active.zoomed.addEventListener('click', close);\n active.zoomed.addEventListener('transitionend', _handleOpenEnd);\n\n if (active.original.getAttribute('data-zoom-src')) {\n active.zoomedHd = active.zoomed.cloneNode();\n\n // Reset the `scrset` property or the HD image won't load.\n active.zoomedHd.removeAttribute('srcset');\n active.zoomedHd.removeAttribute('sizes');\n // Remove loading attribute so the browser can load the image normally\n active.zoomedHd.removeAttribute('loading');\n\n active.zoomedHd.src = active.zoomed.getAttribute('data-zoom-src');\n\n active.zoomedHd.onerror = function () {\n clearInterval(getZoomTargetSize);\n console.warn('Unable to reach the zoom image target ' + active.zoomedHd.src);\n active.zoomedHd = null;\n _animate();\n };\n\n // We need to access the natural size of the full HD\n // target as fast as possible to compute the animation.\n var getZoomTargetSize = setInterval(function () {\n if ( active.zoomedHd.complete) {\n clearInterval(getZoomTargetSize);\n active.zoomedHd.classList.add('medium-zoom-image--opened');\n active.zoomedHd.addEventListener('click', close);\n document.body.appendChild(active.zoomedHd);\n _animate();\n }\n }, 10);\n } else if (active.original.hasAttribute('srcset')) {\n // If an image has a `srcset` attribuet, we don't know the dimensions of the\n // zoomed (HD) image (like when `data-zoom-src` is specified).\n // Therefore the approach is quite similar.\n active.zoomedHd = active.zoomed.cloneNode();\n\n // Resetting the sizes attribute tells the browser to load the\n // image best fitting the current viewport size, respecting the `srcset`.\n active.zoomedHd.removeAttribute('sizes');\n\n // In Firefox, the `loading` attribute needs to be set to `eager` (default\n // value) for the load event to be fired.\n active.zoomedHd.removeAttribute('loading');\n\n // Wait for the load event of the hd image. This will fire if the image\n // is already cached.\n var loadEventListener = active.zoomedHd.addEventListener('load', function () {\n active.zoomedHd.removeEventListener('load', loadEventListener);\n active.zoomedHd.classList.add('medium-zoom-image--opened');\n active.zoomedHd.addEventListener('click', close);\n document.body.appendChild(active.zoomedHd);\n _animate();\n });\n } else {\n _animate();\n }\n });\n };\n\n var close = function close() {\n return new Promise(function (resolve) {\n if (isAnimating || !active.original) {\n resolve(zoom);\n return;\n }\n\n var _handleCloseEnd = function _handleCloseEnd() {\n active.original.classList.remove('medium-zoom-image--hidden');\n document.body.removeChild(active.zoomed);\n if (active.zoomedHd) {\n document.body.removeChild(active.zoomedHd);\n }\n document.body.removeChild(overlay);\n active.zoomed.classList.remove('medium-zoom-image--opened');\n if (active.template) {\n document.body.removeChild(active.template);\n }\n\n isAnimating = false;\n active.zoomed.removeEventListener('transitionend', _handleCloseEnd);\n\n active.original.dispatchEvent(createCustomEvent('medium-zoom:closed', {\n detail: { zoom: zoom }\n }));\n\n active.original = null;\n active.zoomed = null;\n active.zoomedHd = null;\n active.template = null;\n\n resolve(zoom);\n };\n\n isAnimating = true;\n document.body.classList.remove('medium-zoom--opened');\n active.zoomed.style.transform = '';\n\n if (active.zoomedHd) {\n active.zoomedHd.style.transform = '';\n }\n\n // Fade out the template so it's not too abrupt\n if (active.template) {\n active.template.style.transition = 'opacity 150ms';\n active.template.style.opacity = 0;\n }\n\n active.original.dispatchEvent(createCustomEvent('medium-zoom:close', {\n detail: { zoom: zoom }\n }));\n\n active.zoomed.addEventListener('transitionend', _handleCloseEnd);\n });\n };\n\n var toggle = function toggle() {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n target = _ref3.target;\n\n if (active.original) {\n return close();\n }\n\n return open({ target: target });\n };\n\n var getOptions = function getOptions() {\n return zoomOptions;\n };\n\n var getImages = function getImages() {\n return images;\n };\n\n var getZoomedImage = function getZoomedImage() {\n return active.original;\n };\n\n var images = [];\n var eventListeners = [];\n var isAnimating = false;\n var scrollTop = 0;\n var zoomOptions = options;\n var active = {\n original: null,\n zoomed: null,\n zoomedHd: null,\n template: null\n\n // If the selector is omitted, it's replaced by the options\n };if (Object.prototype.toString.call(selector) === '[object Object]') {\n zoomOptions = selector;\n } else if (selector || typeof selector === 'string' // to process empty string as a selector\n ) {\n attach(selector);\n }\n\n // Apply the default option values\n zoomOptions = _extends({\n margin: 0,\n background: '#fff',\n scrollOffset: 40,\n container: null,\n template: null\n }, zoomOptions);\n\n var overlay = createOverlay(zoomOptions.background);\n\n document.addEventListener('click', _handleClick);\n document.addEventListener('keyup', _handleKeyUp);\n document.addEventListener('scroll', _handleScroll);\n window.addEventListener('resize', close);\n\n var zoom = {\n open: open,\n close: close,\n toggle: toggle,\n update: update,\n clone: clone,\n attach: attach,\n detach: detach,\n on: on,\n off: off,\n getOptions: getOptions,\n getImages: getImages,\n getZoomedImage: getZoomedImage\n };\n\n return zoom;\n};\n\nfunction styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar css = \".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}\";\nstyleInject(css);\n\nexport default mediumZoom;\n"], - "mappings": ";AACA,IAAI,WAAW,OAAO,UAAU,SAAU,QAAQ;AAChD,WAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,QAAI,SAAS,UAAU,CAAC;AAExB,aAAS,OAAO,QAAQ;AACtB,UAAI,OAAO,UAAU,eAAe,KAAK,QAAQ,GAAG,GAAG;AACrD,eAAO,G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AA,IACZ,cAAc;AAAA,IACd,WAAW;AAAA,IACX,UAAU;AAAA,EACZ,GAAG,WAAW;AAEd,MAAI,UAAU,cAAc,YAAY,UAAU;AAElD,WAAS,iBAAiB,SAAS,YAAY;AAC/C,WAAS,iBAAiB,SAAS,YAAY;AAC/C,WAAS,iBAAiB,UAAU,aAAa;AACjD,SAAO,iBAAiB,UAAU,KAAK;AAEvC,MAAI,OAAO;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AACT;AAEA,SAAS,YAAYC,MAAK,KAAK;AAC7B,MAAK,QAAQ;AAAS,UAAM,CAAC;AAC7B,MAAI,WAAW,IAAI;AAEnB,MAAI,CAACA,QAAO,OAAO,aAAa,aAAa;AAAE;AAAA,EAAQ;AAEvD,MAAI,OAAO,SAAS,QAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC;AACnE,MAAI,QAAQ,SAAS,cAAc,OAAO;AAC1C,QAAM,OAAO;AAEb,MAAI,aAAa,OAAO;AACtB,QAAI,KAAK,YAAY;AACnB,WAAK,aAAa,OAAO,KAAK,UAAU;AAAA,IAC1C,OAAO;AACL,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF,OAAO;AACL,SAAK,YAAY,KAAK;AAAA,EACxB;AAEA,MAAI,MAAM,YAAY;AACpB,UAAM,WAAW,UAAUA;AAAA,EAC7B,OAAO;AACL,UAAM,YAAY,SAAS,eAAeA,IAAG,CAAC;AAAA,EAChD;AACF;AAEA,IAAI,MAAM;AACV,YAAY,GAAG;AAEf,IAAO,0BAAQ;", - "names": ["isSupported", "isNodeList", "isNode", "isSvg", "getImagesFromSelector", "createOverlay", "cloneTarget", "createCustomEvent", "mediumZoom", "Promise", "_handleClick", "_handleScroll", "_handleKeyUp", "update", "options", "clone", "attach", "detach", "on", "off", "open", "_animate", "_handleOpenEnd", "close", "_handleCloseEnd", "toggle", "getOptions", "getImages", "getZoomedImage", "css"] -} diff --git a/.vitepress/cache/deps/vitepress-plugin-image-viewer.js b/.vitepress/cache/deps/vitepress-plugin-image-viewer.js new file mode 100644 index 0000000..f944f62 --- /dev/null +++ b/.vitepress/cache/deps/vitepress-plugin-image-viewer.js @@ -0,0 +1,2866 @@ +import { + nextTick, + onMounted, + watch +} from "./chunk-X4OMJE4A.js"; + +// node_modules/.pnpm/viewerjs@1.11.7/node_modules/viewerjs/dist/viewer.esm.js +function _classCallCheck(a, n) { + if (!(a instanceof n)) + throw new TypeError("Cannot call a class as a function"); +} +function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o); + } +} +function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: false + }), e; +} +function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: true, + configurable: true, + writable: true + }) : e[r] = t, e; +} +function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function(r2) { + return Object.getOwnPropertyDescriptor(e, r2).enumerable; + })), t.push.apply(t, o); + } + return t; +} +function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { + _defineProperty(e, r2, t[r2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { + Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); + }); + } + return e; +} +function _toPrimitive(t, r) { + if ("object" != typeof t || !t) + return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) + return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); +} +function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; +} +function _typeof(o) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) { + return typeof o2; + } : function(o2) { + return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2; + }, _typeof(o); +} +var DEFAULTS = { + /** + * Enable a modal backdrop, specify `static` for a backdrop + * which doesn't close the modal on click. + * @type {boolean} + */ + backdrop: true, + /** + * Show the button on the top-right of the viewer. + * @type {boolean} + */ + button: true, + /** + * Show the navbar. + * @type {boolean | number} + */ + navbar: true, + /** + * Specify the visibility and the content of the title. + * @type {boolean | number | Function | Array} + */ + title: true, + /** + * Show the toolbar. + * @type {boolean | number | Object} + */ + toolbar: true, + /** + * Custom class name(s) to add to the viewer's root element. + * @type {string} + */ + className: "", + /** + * Define where to put the viewer in modal mode. + * @type {string | Element} + */ + container: "body", + /** + * Filter the images for viewing. Return true if the image is viewable. + * @type {Function} + */ + filter: null, + /** + * Enable to request fullscreen when play. + * {@link https://developer.mozilla.org/en-US/docs/Web/API/FullscreenOptions} + * @type {boolean|FullscreenOptions} + */ + fullscreen: true, + /** + * Define the extra attributes to inherit from the original image. + * @type {Array} + */ + inheritedAttributes: ["crossOrigin", "decoding", "isMap", "loading", "referrerPolicy", "sizes", "srcset", "useMap"], + /** + * Define the initial coverage of the viewing image. + * @type {number} + */ + initialCoverage: 0.9, + /** + * Define the initial index of the image for viewing. + * @type {number} + */ + initialViewIndex: 0, + /** + * Enable inline mode. + * @type {boolean} + */ + inline: false, + /** + * The amount of time to delay between automatically cycling an image when playing. + * @type {number} + */ + interval: 5e3, + /** + * Enable keyboard support. + * @type {boolean} + */ + keyboard: true, + /** + * Focus the viewer when initialized. + * @type {boolean} + */ + focus: true, + /** + * Indicate if show a loading spinner when load image or not. + * @type {boolean} + */ + loading: true, + /** + * Indicate if enable loop viewing or not. + * @type {boolean} + */ + loop: true, + /** + * Min width of the viewer in inline mode. + * @type {number} + */ + minWidth: 200, + /** + * Min height of the viewer in inline mode. + * @type {number} + */ + minHeight: 100, + /** + * Enable to move the image. + * @type {boolean} + */ + movable: true, + /** + * Enable to rotate the image. + * @type {boolean} + */ + rotatable: true, + /** + * Enable to scale the image. + * @type {boolean} + */ + scalable: true, + /** + * Enable to zoom the image. + * @type {boolean} + */ + zoomable: true, + /** + * Enable to zoom the current image by dragging on the touch screen. + * @type {boolean} + */ + zoomOnTouch: true, + /** + * Enable to zoom the image by wheeling mouse. + * @type {boolean} + */ + zoomOnWheel: true, + /** + * Enable to slide to the next or previous image by swiping on the touch screen. + * @type {boolean} + */ + slideOnTouch: true, + /** + * Indicate if toggle the image size between its natural size + * and initial size when double click on the image or not. + * @type {boolean} + */ + toggleOnDblclick: true, + /** + * Show the tooltip with image ratio (percentage) when zoom in or zoom out. + * @type {boolean} + */ + tooltip: true, + /** + * Enable CSS3 Transition for some special elements. + * @type {boolean} + */ + transition: true, + /** + * Define the CSS `z-index` value of viewer in modal mode. + * @type {number} + */ + zIndex: 2015, + /** + * Define the CSS `z-index` value of viewer in inline mode. + * @type {number} + */ + zIndexInline: 0, + /** + * Define the ratio when zoom the image by wheeling mouse. + * @type {number} + */ + zoomRatio: 0.1, + /** + * Define the min ratio of the image when zoom out. + * @type {number} + */ + minZoomRatio: 0.01, + /** + * Define the max ratio of the image when zoom in. + * @type {number} + */ + maxZoomRatio: 100, + /** + * Define where to get the original image URL for viewing. + * @type {string | Function} + */ + url: "src", + /** + * Event shortcuts. + * @type {Function} + */ + ready: null, + show: null, + shown: null, + hide: null, + hidden: null, + view: null, + viewed: null, + move: null, + moved: null, + rotate: null, + rotated: null, + scale: null, + scaled: null, + zoom: null, + zoomed: null, + play: null, + stop: null +}; +var TEMPLATE = '
'; +var IS_BROWSER = typeof window !== "undefined" && typeof window.document !== "undefined"; +var WINDOW = IS_BROWSER ? window : {}; +var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? "ontouchstart" in WINDOW.document.documentElement : false; +var HAS_POINTER_EVENT = IS_BROWSER ? "PointerEvent" in WINDOW : false; +var NAMESPACE = "viewer"; +var ACTION_MOVE = "move"; +var ACTION_SWITCH = "switch"; +var ACTION_ZOOM = "zoom"; +var CLASS_ACTIVE = "".concat(NAMESPACE, "-active"); +var CLASS_CLOSE = "".concat(NAMESPACE, "-close"); +var CLASS_FADE = "".concat(NAMESPACE, "-fade"); +var CLASS_FIXED = "".concat(NAMESPACE, "-fixed"); +var CLASS_FULLSCREEN = "".concat(NAMESPACE, "-fullscreen"); +var CLASS_FULLSCREEN_EXIT = "".concat(NAMESPACE, "-fullscreen-exit"); +var CLASS_HIDE = "".concat(NAMESPACE, "-hide"); +var CLASS_HIDE_MD_DOWN = "".concat(NAMESPACE, "-hide-md-down"); +var CLASS_HIDE_SM_DOWN = "".concat(NAMESPACE, "-hide-sm-down"); +var CLASS_HIDE_XS_DOWN = "".concat(NAMESPACE, "-hide-xs-down"); +var CLASS_IN = "".concat(NAMESPACE, "-in"); +var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible"); +var CLASS_LOADING = "".concat(NAMESPACE, "-loading"); +var CLASS_MOVE = "".concat(NAMESPACE, "-move"); +var CLASS_OPEN = "".concat(NAMESPACE, "-open"); +var CLASS_SHOW = "".concat(NAMESPACE, "-show"); +var CLASS_TRANSITION = "".concat(NAMESPACE, "-transition"); +var EVENT_CLICK = "click"; +var EVENT_DBLCLICK = "dblclick"; +var EVENT_DRAG_START = "dragstart"; +var EVENT_FOCUSIN = "focusin"; +var EVENT_KEY_DOWN = "keydown"; +var EVENT_LOAD = "load"; +var EVENT_ERROR = "error"; +var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? "touchend touchcancel" : "mouseup"; +var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? "touchmove" : "mousemove"; +var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? "touchstart" : "mousedown"; +var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? "pointerdown" : EVENT_TOUCH_START; +var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? "pointermove" : EVENT_TOUCH_MOVE; +var EVENT_POINTER_UP = HAS_POINTER_EVENT ? "pointerup pointercancel" : EVENT_TOUCH_END; +var EVENT_RESIZE = "resize"; +var EVENT_TRANSITION_END = "transitionend"; +var EVENT_WHEEL = "wheel"; +var EVENT_READY = "ready"; +var EVENT_SHOW = "show"; +var EVENT_SHOWN = "shown"; +var EVENT_HIDE = "hide"; +var EVENT_HIDDEN = "hidden"; +var EVENT_VIEW = "view"; +var EVENT_VIEWED = "viewed"; +var EVENT_MOVE = "move"; +var EVENT_MOVED = "moved"; +var EVENT_ROTATE = "rotate"; +var EVENT_ROTATED = "rotated"; +var EVENT_SCALE = "scale"; +var EVENT_SCALED = "scaled"; +var EVENT_ZOOM = "zoom"; +var EVENT_ZOOMED = "zoomed"; +var EVENT_PLAY = "play"; +var EVENT_STOP = "stop"; +var DATA_ACTION = "".concat(NAMESPACE, "Action"); +var REGEXP_SPACES = /\s\s*/; +var BUTTONS = ["zoom-in", "zoom-out", "one-to-one", "reset", "prev", "play", "next", "rotate-left", "rotate-right", "flip-horizontal", "flip-vertical"]; +function isString(value) { + return typeof value === "string"; +} +var isNaN = Number.isNaN || WINDOW.isNaN; +function isNumber(value) { + return typeof value === "number" && !isNaN(value); +} +function isUndefined(value) { + return typeof value === "undefined"; +} +function isObject(value) { + return _typeof(value) === "object" && value !== null; +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function isPlainObject(value) { + if (!isObject(value)) { + return false; + } + try { + var _constructor = value.constructor; + var prototype = _constructor.prototype; + return _constructor && prototype && hasOwnProperty.call(prototype, "isPrototypeOf"); + } catch (error) { + return false; + } +} +function isFunction(value) { + return typeof value === "function"; +} +function forEach(data, callback) { + if (data && isFunction(callback)) { + if (Array.isArray(data) || isNumber(data.length)) { + var length = data.length; + var i; + for (i = 0; i < length; i += 1) { + if (callback.call(data, data[i], i, data) === false) { + break; + } + } + } else if (isObject(data)) { + Object.keys(data).forEach(function(key) { + callback.call(data, data[key], key, data); + }); + } + } + return data; +} +var assign = Object.assign || function assign2(obj) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + if (isObject(obj) && args.length > 0) { + args.forEach(function(arg) { + if (isObject(arg)) { + Object.keys(arg).forEach(function(key) { + obj[key] = arg[key]; + }); + } + }); + } + return obj; +}; +var REGEXP_SUFFIX = /^(?:width|height|left|top|marginLeft|marginTop)$/; +function setStyle(element, styles) { + var style = element.style; + forEach(styles, function(value, property) { + if (REGEXP_SUFFIX.test(property) && isNumber(value)) { + value += "px"; + } + style[property] = value; + }); +} +function escapeHTMLEntities(value) { + return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(//g, ">") : value; +} +function hasClass(element, value) { + if (!element || !value) { + return false; + } + return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1; +} +function addClass(element, value) { + if (!element || !value) { + return; + } + if (isNumber(element.length)) { + forEach(element, function(elem) { + addClass(elem, value); + }); + return; + } + if (element.classList) { + element.classList.add(value); + return; + } + var className = element.className.trim(); + if (!className) { + element.className = value; + } else if (className.indexOf(value) < 0) { + element.className = "".concat(className, " ").concat(value); + } +} +function removeClass(element, value) { + if (!element || !value) { + return; + } + if (isNumber(element.length)) { + forEach(element, function(elem) { + removeClass(elem, value); + }); + return; + } + if (element.classList) { + element.classList.remove(value); + return; + } + if (element.className.indexOf(value) >= 0) { + element.className = element.className.replace(value, ""); + } +} +function toggleClass(element, value, added) { + if (!value) { + return; + } + if (isNumber(element.length)) { + forEach(element, function(elem) { + toggleClass(elem, value, added); + }); + return; + } + if (added) { + addClass(element, value); + } else { + removeClass(element, value); + } +} +var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g; +function hyphenate(value) { + return value.replace(REGEXP_HYPHENATE, "$1-$2").toLowerCase(); +} +function getData(element, name) { + if (isObject(element[name])) { + return element[name]; + } + if (element.dataset) { + return element.dataset[name]; + } + return element.getAttribute("data-".concat(hyphenate(name))); +} +function setData(element, name, data) { + if (isObject(data)) { + element[name] = data; + } else if (element.dataset) { + element.dataset[name] = data; + } else { + element.setAttribute("data-".concat(hyphenate(name)), data); + } +} +var onceSupported = function() { + var supported = false; + if (IS_BROWSER) { + var once = false; + var listener = function listener2() { + }; + var options = Object.defineProperty({}, "once", { + get: function get() { + supported = true; + return once; + }, + /** + * This setter can fix a `TypeError` in strict mode + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only} + * @param {boolean} value - The value to set + */ + set: function set(value) { + once = value; + } + }); + WINDOW.addEventListener("test", listener, options); + WINDOW.removeEventListener("test", listener, options); + } + return supported; +}(); +function removeListener(element, type, listener) { + var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; + var handler = listener; + type.trim().split(REGEXP_SPACES).forEach(function(event) { + if (!onceSupported) { + var listeners = element.listeners; + if (listeners && listeners[event] && listeners[event][listener]) { + handler = listeners[event][listener]; + delete listeners[event][listener]; + if (Object.keys(listeners[event]).length === 0) { + delete listeners[event]; + } + if (Object.keys(listeners).length === 0) { + delete element.listeners; + } + } + } + element.removeEventListener(event, handler, options); + }); +} +function addListener(element, type, listener) { + var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; + var _handler = listener; + type.trim().split(REGEXP_SPACES).forEach(function(event) { + if (options.once && !onceSupported) { + var _element$listeners = element.listeners, listeners = _element$listeners === void 0 ? {} : _element$listeners; + _handler = function handler() { + delete listeners[event][listener]; + element.removeEventListener(event, _handler, options); + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + listener.apply(element, args); + }; + if (!listeners[event]) { + listeners[event] = {}; + } + if (listeners[event][listener]) { + element.removeEventListener(event, listeners[event][listener], options); + } + listeners[event][listener] = _handler; + element.listeners = listeners; + } + element.addEventListener(event, _handler, options); + }); +} +function dispatchEvent(element, type, data, options) { + var event; + if (isFunction(Event) && isFunction(CustomEvent)) { + event = new CustomEvent(type, _objectSpread2({ + bubbles: true, + cancelable: true, + detail: data + }, options)); + } else { + event = document.createEvent("CustomEvent"); + event.initCustomEvent(type, true, true, data); + } + return element.dispatchEvent(event); +} +function getOffset(element) { + var box = element.getBoundingClientRect(); + return { + left: box.left + (window.pageXOffset - document.documentElement.clientLeft), + top: box.top + (window.pageYOffset - document.documentElement.clientTop) + }; +} +function getTransforms(_ref) { + var rotate2 = _ref.rotate, scaleX2 = _ref.scaleX, scaleY2 = _ref.scaleY, translateX = _ref.translateX, translateY = _ref.translateY; + var values = []; + if (isNumber(translateX) && translateX !== 0) { + values.push("translateX(".concat(translateX, "px)")); + } + if (isNumber(translateY) && translateY !== 0) { + values.push("translateY(".concat(translateY, "px)")); + } + if (isNumber(rotate2) && rotate2 !== 0) { + values.push("rotate(".concat(rotate2, "deg)")); + } + if (isNumber(scaleX2) && scaleX2 !== 1) { + values.push("scaleX(".concat(scaleX2, ")")); + } + if (isNumber(scaleY2) && scaleY2 !== 1) { + values.push("scaleY(".concat(scaleY2, ")")); + } + var transform = values.length ? values.join(" ") : "none"; + return { + WebkitTransform: transform, + msTransform: transform, + transform + }; +} +function getImageNameFromURL(url) { + return isString(url) ? decodeURIComponent(url.replace(/^.*\//, "").replace(/[?&#].*$/, "")) : ""; +} +var IS_SAFARI = WINDOW.navigator && /Version\/\d+(\.\d+)+?\s+Safari/i.test(WINDOW.navigator.userAgent); +function getImageNaturalSizes(image, options, callback) { + var newImage = document.createElement("img"); + if (image.naturalWidth && !IS_SAFARI) { + callback(image.naturalWidth, image.naturalHeight); + return newImage; + } + var body = document.body || document.documentElement; + newImage.onload = function() { + callback(newImage.width, newImage.height); + if (!IS_SAFARI) { + body.removeChild(newImage); + } + }; + forEach(options.inheritedAttributes, function(name) { + var value = image.getAttribute(name); + if (value !== null) { + newImage.setAttribute(name, value); + } + }); + newImage.src = image.src; + if (!IS_SAFARI) { + newImage.style.cssText = "left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;"; + body.appendChild(newImage); + } + return newImage; +} +function getResponsiveClass(type) { + switch (type) { + case 2: + return CLASS_HIDE_XS_DOWN; + case 3: + return CLASS_HIDE_SM_DOWN; + case 4: + return CLASS_HIDE_MD_DOWN; + default: + return ""; + } +} +function getMaxZoomRatio(pointers) { + var pointers2 = _objectSpread2({}, pointers); + var ratios = []; + forEach(pointers, function(pointer, pointerId) { + delete pointers2[pointerId]; + forEach(pointers2, function(pointer2) { + var x1 = Math.abs(pointer.startX - pointer2.startX); + var y1 = Math.abs(pointer.startY - pointer2.startY); + var x2 = Math.abs(pointer.endX - pointer2.endX); + var y2 = Math.abs(pointer.endY - pointer2.endY); + var z1 = Math.sqrt(x1 * x1 + y1 * y1); + var z2 = Math.sqrt(x2 * x2 + y2 * y2); + var ratio = (z2 - z1) / z1; + ratios.push(ratio); + }); + }); + ratios.sort(function(a, b) { + return Math.abs(a) < Math.abs(b); + }); + return ratios[0]; +} +function getPointer(_ref2, endOnly) { + var pageX = _ref2.pageX, pageY = _ref2.pageY; + var end = { + endX: pageX, + endY: pageY + }; + return endOnly ? end : _objectSpread2({ + timeStamp: Date.now(), + startX: pageX, + startY: pageY + }, end); +} +function getPointersCenter(pointers) { + var pageX = 0; + var pageY = 0; + var count = 0; + forEach(pointers, function(_ref3) { + var startX = _ref3.startX, startY = _ref3.startY; + pageX += startX; + pageY += startY; + count += 1; + }); + pageX /= count; + pageY /= count; + return { + pageX, + pageY + }; +} +var render = { + render: function render2() { + this.initContainer(); + this.initViewer(); + this.initList(); + this.renderViewer(); + }, + initBody: function initBody() { + var ownerDocument = this.element.ownerDocument; + var body = ownerDocument.body || ownerDocument.documentElement; + this.body = body; + this.scrollbarWidth = window.innerWidth - ownerDocument.documentElement.clientWidth; + this.initialBodyPaddingRight = body.style.paddingRight; + this.initialBodyComputedPaddingRight = window.getComputedStyle(body).paddingRight; + }, + initContainer: function initContainer() { + this.containerData = { + width: window.innerWidth, + height: window.innerHeight + }; + }, + initViewer: function initViewer() { + var options = this.options, parent = this.parent; + var viewerData; + if (options.inline) { + viewerData = { + width: Math.max(parent.offsetWidth, options.minWidth), + height: Math.max(parent.offsetHeight, options.minHeight) + }; + this.parentData = viewerData; + } + if (this.fulled || !viewerData) { + viewerData = this.containerData; + } + this.viewerData = assign({}, viewerData); + }, + renderViewer: function renderViewer() { + if (this.options.inline && !this.fulled) { + setStyle(this.viewer, this.viewerData); + } + }, + initList: function initList() { + var _this = this; + var element = this.element, options = this.options, list = this.list; + var items = []; + list.innerHTML = ""; + forEach(this.images, function(image, index) { + var src = image.src; + var alt = image.alt || getImageNameFromURL(src); + var url = _this.getImageURL(image); + if (src || url) { + var item = document.createElement("li"); + var img = document.createElement("img"); + forEach(options.inheritedAttributes, function(name) { + var value = image.getAttribute(name); + if (value !== null) { + img.setAttribute(name, value); + } + }); + if (options.navbar) { + img.src = src || url; + } + img.alt = alt; + img.setAttribute("data-original-url", url || src); + item.setAttribute("data-index", index); + item.setAttribute("data-viewer-action", "view"); + item.setAttribute("role", "button"); + if (options.keyboard) { + item.setAttribute("tabindex", 0); + } + item.appendChild(img); + list.appendChild(item); + items.push(item); + } + }); + this.items = items; + forEach(items, function(item) { + var image = item.firstElementChild; + var onLoad; + var onError; + setData(image, "filled", true); + if (options.loading) { + addClass(item, CLASS_LOADING); + } + addListener(image, EVENT_LOAD, onLoad = function onLoad2(event) { + removeListener(image, EVENT_ERROR, onError); + if (options.loading) { + removeClass(item, CLASS_LOADING); + } + _this.loadImage(event); + }, { + once: true + }); + addListener(image, EVENT_ERROR, onError = function onError2() { + removeListener(image, EVENT_LOAD, onLoad); + if (options.loading) { + removeClass(item, CLASS_LOADING); + } + }, { + once: true + }); + }); + if (options.transition) { + addListener(element, EVENT_VIEWED, function() { + addClass(list, CLASS_TRANSITION); + }, { + once: true + }); + } + }, + renderList: function renderList() { + var index = this.index; + var item = this.items[index]; + if (!item) { + return; + } + var next2 = item.nextElementSibling; + var gutter = parseInt(window.getComputedStyle(next2 || item).marginLeft, 10); + var offsetWidth = item.offsetWidth; + var outerWidth = offsetWidth + gutter; + setStyle(this.list, assign({ + width: outerWidth * this.length - gutter + }, getTransforms({ + translateX: (this.viewerData.width - offsetWidth) / 2 - outerWidth * index + }))); + }, + resetList: function resetList() { + var list = this.list; + list.innerHTML = ""; + removeClass(list, CLASS_TRANSITION); + setStyle(list, getTransforms({ + translateX: 0 + })); + }, + initImage: function initImage(done) { + var _this2 = this; + var options = this.options, image = this.image, viewerData = this.viewerData; + var footerHeight = this.footer.offsetHeight; + var viewerWidth = viewerData.width; + var viewerHeight = Math.max(viewerData.height - footerHeight, footerHeight); + var oldImageData = this.imageData || {}; + var sizingImage; + this.imageInitializing = { + abort: function abort() { + sizingImage.onload = null; + } + }; + sizingImage = getImageNaturalSizes(image, options, function(naturalWidth, naturalHeight) { + var aspectRatio = naturalWidth / naturalHeight; + var initialCoverage = Math.max(0, Math.min(1, options.initialCoverage)); + var width = viewerWidth; + var height = viewerHeight; + _this2.imageInitializing = false; + if (viewerHeight * aspectRatio > viewerWidth) { + height = viewerWidth / aspectRatio; + } else { + width = viewerHeight * aspectRatio; + } + initialCoverage = isNumber(initialCoverage) ? initialCoverage : 0.9; + width = Math.min(width * initialCoverage, naturalWidth); + height = Math.min(height * initialCoverage, naturalHeight); + var left = (viewerWidth - width) / 2; + var top = (viewerHeight - height) / 2; + var imageData = { + left, + top, + x: left, + y: top, + width, + height, + oldRatio: 1, + ratio: width / naturalWidth, + aspectRatio, + naturalWidth, + naturalHeight + }; + var initialImageData = assign({}, imageData); + if (options.rotatable) { + imageData.rotate = oldImageData.rotate || 0; + initialImageData.rotate = 0; + } + if (options.scalable) { + imageData.scaleX = oldImageData.scaleX || 1; + imageData.scaleY = oldImageData.scaleY || 1; + initialImageData.scaleX = 1; + initialImageData.scaleY = 1; + } + _this2.imageData = imageData; + _this2.initialImageData = initialImageData; + if (done) { + done(); + } + }); + }, + renderImage: function renderImage(done) { + var _this3 = this; + var image = this.image, imageData = this.imageData; + setStyle(image, assign({ + width: imageData.width, + height: imageData.height, + // XXX: Not to use translateX/Y to avoid image shaking when zooming + marginLeft: imageData.x, + marginTop: imageData.y + }, getTransforms(imageData))); + if (done) { + if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && hasClass(image, CLASS_TRANSITION)) { + var onTransitionEnd = function onTransitionEnd2() { + _this3.imageRendering = false; + done(); + }; + this.imageRendering = { + abort: function abort() { + removeListener(image, EVENT_TRANSITION_END, onTransitionEnd); + } + }; + addListener(image, EVENT_TRANSITION_END, onTransitionEnd, { + once: true + }); + } else { + done(); + } + } + }, + resetImage: function resetImage() { + var image = this.image; + if (image) { + if (this.viewing) { + this.viewing.abort(); + } + image.parentNode.removeChild(image); + this.image = null; + this.title.innerHTML = ""; + } + } +}; +var events = { + bind: function bind() { + var options = this.options, viewer2 = this.viewer, canvas = this.canvas; + var document2 = this.element.ownerDocument; + addListener(viewer2, EVENT_CLICK, this.onClick = this.click.bind(this)); + addListener(viewer2, EVENT_DRAG_START, this.onDragStart = this.dragstart.bind(this)); + addListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown = this.pointerdown.bind(this)); + addListener(document2, EVENT_POINTER_MOVE, this.onPointerMove = this.pointermove.bind(this)); + addListener(document2, EVENT_POINTER_UP, this.onPointerUp = this.pointerup.bind(this)); + addListener(document2, EVENT_KEY_DOWN, this.onKeyDown = this.keydown.bind(this)); + addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this)); + if (options.zoomable && options.zoomOnWheel) { + addListener(viewer2, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), { + passive: false, + capture: true + }); + } + if (options.toggleOnDblclick) { + addListener(canvas, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this)); + } + }, + unbind: function unbind() { + var options = this.options, viewer2 = this.viewer, canvas = this.canvas; + var document2 = this.element.ownerDocument; + removeListener(viewer2, EVENT_CLICK, this.onClick); + removeListener(viewer2, EVENT_DRAG_START, this.onDragStart); + removeListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown); + removeListener(document2, EVENT_POINTER_MOVE, this.onPointerMove); + removeListener(document2, EVENT_POINTER_UP, this.onPointerUp); + removeListener(document2, EVENT_KEY_DOWN, this.onKeyDown); + removeListener(window, EVENT_RESIZE, this.onResize); + if (options.zoomable && options.zoomOnWheel) { + removeListener(viewer2, EVENT_WHEEL, this.onWheel, { + passive: false, + capture: true + }); + } + if (options.toggleOnDblclick) { + removeListener(canvas, EVENT_DBLCLICK, this.onDblclick); + } + } +}; +var handlers = { + click: function click(event) { + var options = this.options, imageData = this.imageData; + var target = event.target; + var action = getData(target, DATA_ACTION); + if (!action && target.localName === "img" && target.parentElement.localName === "li") { + target = target.parentElement; + action = getData(target, DATA_ACTION); + } + if (IS_TOUCH_DEVICE && event.isTrusted && target === this.canvas) { + clearTimeout(this.clickCanvasTimeout); + } + switch (action) { + case "mix": + if (this.played) { + this.stop(); + } else if (options.inline) { + if (this.fulled) { + this.exit(); + } else { + this.full(); + } + } else { + this.hide(); + } + break; + case "hide": + if (!this.pointerMoved) { + this.hide(); + } + break; + case "view": + this.view(getData(target, "index")); + break; + case "zoom-in": + this.zoom(0.1, true); + break; + case "zoom-out": + this.zoom(-0.1, true); + break; + case "one-to-one": + this.toggle(); + break; + case "reset": + this.reset(); + break; + case "prev": + this.prev(options.loop); + break; + case "play": + this.play(options.fullscreen); + break; + case "next": + this.next(options.loop); + break; + case "rotate-left": + this.rotate(-90); + break; + case "rotate-right": + this.rotate(90); + break; + case "flip-horizontal": + this.scaleX(-imageData.scaleX || -1); + break; + case "flip-vertical": + this.scaleY(-imageData.scaleY || -1); + break; + default: + if (this.played) { + this.stop(); + } + } + }, + dblclick: function dblclick(event) { + event.preventDefault(); + if (this.viewed && event.target === this.image) { + if (IS_TOUCH_DEVICE && event.isTrusted) { + clearTimeout(this.doubleClickImageTimeout); + } + this.toggle(event.isTrusted ? event : event.detail && event.detail.originalEvent); + } + }, + load: function load() { + var _this = this; + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = false; + } + var element = this.element, options = this.options, image = this.image, index = this.index, viewerData = this.viewerData; + removeClass(image, CLASS_INVISIBLE); + if (options.loading) { + removeClass(this.canvas, CLASS_LOADING); + } + image.style.cssText = "height:0;" + "margin-left:".concat(viewerData.width / 2, "px;") + "margin-top:".concat(viewerData.height / 2, "px;") + "max-width:none!important;position:relative;width:0;"; + this.initImage(function() { + toggleClass(image, CLASS_MOVE, options.movable); + toggleClass(image, CLASS_TRANSITION, options.transition); + _this.renderImage(function() { + _this.viewed = true; + _this.viewing = false; + if (isFunction(options.viewed)) { + addListener(element, EVENT_VIEWED, options.viewed, { + once: true + }); + } + dispatchEvent(element, EVENT_VIEWED, { + originalImage: _this.images[index], + index, + image + }, { + cancelable: false + }); + }); + }); + }, + loadImage: function loadImage(event) { + var image = event.target; + var parent = image.parentNode; + var parentWidth = parent.offsetWidth || 30; + var parentHeight = parent.offsetHeight || 50; + var filled = !!getData(image, "filled"); + getImageNaturalSizes(image, this.options, function(naturalWidth, naturalHeight) { + var aspectRatio = naturalWidth / naturalHeight; + var width = parentWidth; + var height = parentHeight; + if (parentHeight * aspectRatio > parentWidth) { + if (filled) { + width = parentHeight * aspectRatio; + } else { + height = parentWidth / aspectRatio; + } + } else if (filled) { + height = parentWidth / aspectRatio; + } else { + width = parentHeight * aspectRatio; + } + setStyle(image, assign({ + width, + height + }, getTransforms({ + translateX: (parentWidth - width) / 2, + translateY: (parentHeight - height) / 2 + }))); + }); + }, + keydown: function keydown(event) { + var options = this.options; + if (!options.keyboard) { + return; + } + var keyCode = event.keyCode || event.which || event.charCode; + switch (keyCode) { + case 13: + if (this.viewer.contains(event.target)) { + this.click(event); + } + break; + } + if (!this.fulled) { + return; + } + switch (keyCode) { + case 27: + if (this.played) { + this.stop(); + } else if (options.inline) { + if (this.fulled) { + this.exit(); + } + } else { + this.hide(); + } + break; + case 32: + if (this.played) { + this.stop(); + } + break; + case 37: + if (this.played && this.playing) { + this.playing.prev(); + } else { + this.prev(options.loop); + } + break; + case 38: + event.preventDefault(); + this.zoom(options.zoomRatio, true); + break; + case 39: + if (this.played && this.playing) { + this.playing.next(); + } else { + this.next(options.loop); + } + break; + case 40: + event.preventDefault(); + this.zoom(-options.zoomRatio, true); + break; + case 48: + case 49: + if (event.ctrlKey) { + event.preventDefault(); + this.toggle(); + } + break; + } + }, + dragstart: function dragstart(event) { + if (event.target.localName === "img") { + event.preventDefault(); + } + }, + pointerdown: function pointerdown(event) { + var options = this.options, pointers = this.pointers; + var buttons = event.buttons, button = event.button; + this.pointerMoved = false; + if (!this.viewed || this.showing || this.viewing || this.hiding || (event.type === "mousedown" || event.type === "pointerdown" && event.pointerType === "mouse") && // No primary button (Usually the left button) + (isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 || event.ctrlKey)) { + return; + } + event.preventDefault(); + if (event.changedTouches) { + forEach(event.changedTouches, function(touch) { + pointers[touch.identifier] = getPointer(touch); + }); + } else { + pointers[event.pointerId || 0] = getPointer(event); + } + var action = options.movable ? ACTION_MOVE : false; + if (options.zoomOnTouch && options.zoomable && Object.keys(pointers).length > 1) { + action = ACTION_ZOOM; + } else if (options.slideOnTouch && (event.pointerType === "touch" || event.type === "touchstart") && this.isSwitchable()) { + action = ACTION_SWITCH; + } + if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) { + removeClass(this.image, CLASS_TRANSITION); + } + this.action = action; + }, + pointermove: function pointermove(event) { + var pointers = this.pointers, action = this.action; + if (!this.viewed || !action) { + return; + } + event.preventDefault(); + if (event.changedTouches) { + forEach(event.changedTouches, function(touch) { + assign(pointers[touch.identifier] || {}, getPointer(touch, true)); + }); + } else { + assign(pointers[event.pointerId || 0] || {}, getPointer(event, true)); + } + this.change(event); + }, + pointerup: function pointerup(event) { + var _this2 = this; + var options = this.options, action = this.action, pointers = this.pointers; + var pointer; + if (event.changedTouches) { + forEach(event.changedTouches, function(touch) { + pointer = pointers[touch.identifier]; + delete pointers[touch.identifier]; + }); + } else { + pointer = pointers[event.pointerId || 0]; + delete pointers[event.pointerId || 0]; + } + if (!action) { + return; + } + event.preventDefault(); + if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) { + addClass(this.image, CLASS_TRANSITION); + } + this.action = false; + if (IS_TOUCH_DEVICE && action !== ACTION_ZOOM && pointer && Date.now() - pointer.timeStamp < 500) { + clearTimeout(this.clickCanvasTimeout); + clearTimeout(this.doubleClickImageTimeout); + if (options.toggleOnDblclick && this.viewed && event.target === this.image) { + if (this.imageClicked) { + this.imageClicked = false; + this.doubleClickImageTimeout = setTimeout(function() { + dispatchEvent(_this2.image, EVENT_DBLCLICK, { + originalEvent: event + }); + }, 50); + } else { + this.imageClicked = true; + this.doubleClickImageTimeout = setTimeout(function() { + _this2.imageClicked = false; + }, 500); + } + } else { + this.imageClicked = false; + if (options.backdrop && options.backdrop !== "static" && event.target === this.canvas) { + this.clickCanvasTimeout = setTimeout(function() { + dispatchEvent(_this2.canvas, EVENT_CLICK, { + originalEvent: event + }); + }, 50); + } + } + } + }, + resize: function resize() { + var _this3 = this; + if (!this.isShown || this.hiding) { + return; + } + if (this.fulled) { + this.close(); + this.initBody(); + this.open(); + } + this.initContainer(); + this.initViewer(); + this.renderViewer(); + this.renderList(); + if (this.viewed) { + this.initImage(function() { + _this3.renderImage(); + }); + } + if (this.played) { + if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) { + this.stop(); + return; + } + forEach(this.player.getElementsByTagName("img"), function(image) { + addListener(image, EVENT_LOAD, _this3.loadImage.bind(_this3), { + once: true + }); + dispatchEvent(image, EVENT_LOAD); + }); + } + }, + wheel: function wheel(event) { + var _this4 = this; + if (!this.viewed) { + return; + } + event.preventDefault(); + if (this.wheeling) { + return; + } + this.wheeling = true; + setTimeout(function() { + _this4.wheeling = false; + }, 50); + var ratio = Number(this.options.zoomRatio) || 0.1; + var delta = 1; + if (event.deltaY) { + delta = event.deltaY > 0 ? 1 : -1; + } else if (event.wheelDelta) { + delta = -event.wheelDelta / 120; + } else if (event.detail) { + delta = event.detail > 0 ? 1 : -1; + } + this.zoom(-delta * ratio, true, null, event); + } +}; +var methods = { + /** Show the viewer (only available in modal mode) + * @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not. + * @returns {Viewer} this + */ + show: function show() { + var immediate = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var element = this.element, options = this.options; + if (options.inline || this.showing || this.isShown || this.showing) { + return this; + } + if (!this.ready) { + this.build(); + if (this.ready) { + this.show(immediate); + } + return this; + } + if (isFunction(options.show)) { + addListener(element, EVENT_SHOW, options.show, { + once: true + }); + } + if (dispatchEvent(element, EVENT_SHOW) === false || !this.ready) { + return this; + } + if (this.hiding) { + this.transitioning.abort(); + } + this.showing = true; + this.open(); + var viewer2 = this.viewer; + removeClass(viewer2, CLASS_HIDE); + viewer2.setAttribute("role", "dialog"); + viewer2.setAttribute("aria-labelledby", this.title.id); + viewer2.setAttribute("aria-modal", true); + viewer2.removeAttribute("aria-hidden"); + if (options.transition && !immediate) { + var shown2 = this.shown.bind(this); + this.transitioning = { + abort: function abort() { + removeListener(viewer2, EVENT_TRANSITION_END, shown2); + removeClass(viewer2, CLASS_IN); + } + }; + addClass(viewer2, CLASS_TRANSITION); + viewer2.initialOffsetWidth = viewer2.offsetWidth; + addListener(viewer2, EVENT_TRANSITION_END, shown2, { + once: true + }); + addClass(viewer2, CLASS_IN); + } else { + addClass(viewer2, CLASS_IN); + this.shown(); + } + return this; + }, + /** + * Hide the viewer (only available in modal mode) + * @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not. + * @returns {Viewer} this + */ + hide: function hide() { + var _this = this; + var immediate = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var element = this.element, options = this.options; + if (options.inline || this.hiding || !(this.isShown || this.showing)) { + return this; + } + if (isFunction(options.hide)) { + addListener(element, EVENT_HIDE, options.hide, { + once: true + }); + } + if (dispatchEvent(element, EVENT_HIDE) === false) { + return this; + } + if (this.showing) { + this.transitioning.abort(); + } + this.hiding = true; + if (this.played) { + this.stop(); + } else if (this.viewing) { + this.viewing.abort(); + } + var viewer2 = this.viewer, image = this.image; + var hideImmediately = function hideImmediately2() { + removeClass(viewer2, CLASS_IN); + _this.hidden(); + }; + if (options.transition && !immediate) { + var _onViewerTransitionEnd = function onViewerTransitionEnd(event) { + if (event && event.target === viewer2) { + removeListener(viewer2, EVENT_TRANSITION_END, _onViewerTransitionEnd); + _this.hidden(); + } + }; + var onImageTransitionEnd = function onImageTransitionEnd2() { + if (hasClass(viewer2, CLASS_TRANSITION)) { + addListener(viewer2, EVENT_TRANSITION_END, _onViewerTransitionEnd); + removeClass(viewer2, CLASS_IN); + } else { + hideImmediately(); + } + }; + this.transitioning = { + abort: function abort() { + if (_this.viewed && hasClass(image, CLASS_TRANSITION)) { + removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd); + } else if (hasClass(viewer2, CLASS_TRANSITION)) { + removeListener(viewer2, EVENT_TRANSITION_END, _onViewerTransitionEnd); + } + } + }; + if (this.viewed && hasClass(image, CLASS_TRANSITION)) { + addListener(image, EVENT_TRANSITION_END, onImageTransitionEnd, { + once: true + }); + this.zoomTo(0, false, null, null, true); + } else { + onImageTransitionEnd(); + } + } else { + hideImmediately(); + } + return this; + }, + /** + * View one of the images with image's index + * @param {number} index - The index of the image to view. + * @returns {Viewer} this + */ + view: function view() { + var _this2 = this; + var index = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.initialViewIndex; + index = Number(index) || 0; + if (this.hiding || this.played || index < 0 || index >= this.length || this.viewed && index === this.index) { + return this; + } + if (!this.isShown) { + this.index = index; + return this.show(); + } + if (this.viewing) { + this.viewing.abort(); + } + var element = this.element, options = this.options, title = this.title, canvas = this.canvas; + var item = this.items[index]; + var img = item.querySelector("img"); + var url = getData(img, "originalUrl"); + var alt = img.getAttribute("alt"); + var image = document.createElement("img"); + forEach(options.inheritedAttributes, function(name) { + var value = img.getAttribute(name); + if (value !== null) { + image.setAttribute(name, value); + } + }); + image.src = url; + image.alt = alt; + if (isFunction(options.view)) { + addListener(element, EVENT_VIEW, options.view, { + once: true + }); + } + if (dispatchEvent(element, EVENT_VIEW, { + originalImage: this.images[index], + index, + image + }) === false || !this.isShown || this.hiding || this.played) { + return this; + } + var activeItem = this.items[this.index]; + if (activeItem) { + removeClass(activeItem, CLASS_ACTIVE); + activeItem.removeAttribute("aria-selected"); + } + addClass(item, CLASS_ACTIVE); + item.setAttribute("aria-selected", true); + if (options.focus) { + item.focus(); + } + this.image = image; + this.viewed = false; + this.index = index; + this.imageData = {}; + addClass(image, CLASS_INVISIBLE); + if (options.loading) { + addClass(canvas, CLASS_LOADING); + } + canvas.innerHTML = ""; + canvas.appendChild(image); + this.renderList(); + title.innerHTML = ""; + var onViewed = function onViewed2() { + var imageData = _this2.imageData; + var render3 = Array.isArray(options.title) ? options.title[1] : options.title; + title.innerHTML = escapeHTMLEntities(isFunction(render3) ? render3.call(_this2, image, imageData) : "".concat(alt, " (").concat(imageData.naturalWidth, " × ").concat(imageData.naturalHeight, ")")); + }; + var onLoad; + var onError; + addListener(element, EVENT_VIEWED, onViewed, { + once: true + }); + this.viewing = { + abort: function abort() { + removeListener(element, EVENT_VIEWED, onViewed); + if (image.complete) { + if (_this2.imageRendering) { + _this2.imageRendering.abort(); + } else if (_this2.imageInitializing) { + _this2.imageInitializing.abort(); + } + } else { + image.src = ""; + removeListener(image, EVENT_LOAD, onLoad); + if (_this2.timeout) { + clearTimeout(_this2.timeout); + } + } + } + }; + if (image.complete) { + this.load(); + } else { + addListener(image, EVENT_LOAD, onLoad = function onLoad2() { + removeListener(image, EVENT_ERROR, onError); + _this2.load(); + }, { + once: true + }); + addListener(image, EVENT_ERROR, onError = function onError2() { + removeListener(image, EVENT_LOAD, onLoad); + if (_this2.timeout) { + clearTimeout(_this2.timeout); + _this2.timeout = false; + } + removeClass(image, CLASS_INVISIBLE); + if (options.loading) { + removeClass(_this2.canvas, CLASS_LOADING); + } + }, { + once: true + }); + if (this.timeout) { + clearTimeout(this.timeout); + } + this.timeout = setTimeout(function() { + removeClass(image, CLASS_INVISIBLE); + _this2.timeout = false; + }, 1e3); + } + return this; + }, + /** + * View the previous image + * @param {boolean} [loop=false] - Indicate if view the last one + * when it is the first one at present. + * @returns {Viewer} this + */ + prev: function prev() { + var loop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var index = this.index - 1; + if (index < 0) { + index = loop ? this.length - 1 : 0; + } + this.view(index); + return this; + }, + /** + * View the next image + * @param {boolean} [loop=false] - Indicate if view the first one + * when it is the last one at present. + * @returns {Viewer} this + */ + next: function next() { + var loop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var maxIndex = this.length - 1; + var index = this.index + 1; + if (index > maxIndex) { + index = loop ? 0 : maxIndex; + } + this.view(index); + return this; + }, + /** + * Move the image with relative offsets. + * @param {number} x - The moving distance in the horizontal direction. + * @param {number} [y=x] The moving distance in the vertical direction. + * @returns {Viewer} this + */ + move: function move(x) { + var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x; + var imageData = this.imageData; + this.moveTo(isUndefined(x) ? x : imageData.x + Number(x), isUndefined(y) ? y : imageData.y + Number(y)); + return this; + }, + /** + * Move the image to an absolute point. + * @param {number} x - The new position in the horizontal direction. + * @param {number} [y=x] - The new position in the vertical direction. + * @param {Event} [_originalEvent=null] - The original event if any. + * @returns {Viewer} this + */ + moveTo: function moveTo(x) { + var _this3 = this; + var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x; + var _originalEvent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; + var element = this.element, options = this.options, imageData = this.imageData; + x = Number(x); + y = Number(y); + if (this.viewed && !this.played && options.movable) { + var oldX = imageData.x; + var oldY = imageData.y; + var changed = false; + if (isNumber(x)) { + changed = true; + } else { + x = oldX; + } + if (isNumber(y)) { + changed = true; + } else { + y = oldY; + } + if (changed) { + if (isFunction(options.move)) { + addListener(element, EVENT_MOVE, options.move, { + once: true + }); + } + if (dispatchEvent(element, EVENT_MOVE, { + x, + y, + oldX, + oldY, + originalEvent: _originalEvent + }) === false) { + return this; + } + imageData.x = x; + imageData.y = y; + imageData.left = x; + imageData.top = y; + this.moving = true; + this.renderImage(function() { + _this3.moving = false; + if (isFunction(options.moved)) { + addListener(element, EVENT_MOVED, options.moved, { + once: true + }); + } + dispatchEvent(element, EVENT_MOVED, { + x, + y, + oldX, + oldY, + originalEvent: _originalEvent + }, { + cancelable: false + }); + }); + } + } + return this; + }, + /** + * Rotate the image with a relative degree. + * @param {number} degree - The rotate degree. + * @returns {Viewer} this + */ + rotate: function rotate(degree) { + this.rotateTo((this.imageData.rotate || 0) + Number(degree)); + return this; + }, + /** + * Rotate the image to an absolute degree. + * @param {number} degree - The rotate degree. + * @returns {Viewer} this + */ + rotateTo: function rotateTo(degree) { + var _this4 = this; + var element = this.element, options = this.options, imageData = this.imageData; + degree = Number(degree); + if (isNumber(degree) && this.viewed && !this.played && options.rotatable) { + var oldDegree = imageData.rotate; + if (isFunction(options.rotate)) { + addListener(element, EVENT_ROTATE, options.rotate, { + once: true + }); + } + if (dispatchEvent(element, EVENT_ROTATE, { + degree, + oldDegree + }) === false) { + return this; + } + imageData.rotate = degree; + this.rotating = true; + this.renderImage(function() { + _this4.rotating = false; + if (isFunction(options.rotated)) { + addListener(element, EVENT_ROTATED, options.rotated, { + once: true + }); + } + dispatchEvent(element, EVENT_ROTATED, { + degree, + oldDegree + }, { + cancelable: false + }); + }); + } + return this; + }, + /** + * Scale the image on the x-axis. + * @param {number} scaleX - The scale ratio on the x-axis. + * @returns {Viewer} this + */ + scaleX: function scaleX(_scaleX) { + this.scale(_scaleX, this.imageData.scaleY); + return this; + }, + /** + * Scale the image on the y-axis. + * @param {number} scaleY - The scale ratio on the y-axis. + * @returns {Viewer} this + */ + scaleY: function scaleY(_scaleY) { + this.scale(this.imageData.scaleX, _scaleY); + return this; + }, + /** + * Scale the image. + * @param {number} scaleX - The scale ratio on the x-axis. + * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis. + * @returns {Viewer} this + */ + scale: function scale(scaleX2) { + var _this5 = this; + var scaleY2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scaleX2; + var element = this.element, options = this.options, imageData = this.imageData; + scaleX2 = Number(scaleX2); + scaleY2 = Number(scaleY2); + if (this.viewed && !this.played && options.scalable) { + var oldScaleX = imageData.scaleX; + var oldScaleY = imageData.scaleY; + var changed = false; + if (isNumber(scaleX2)) { + changed = true; + } else { + scaleX2 = oldScaleX; + } + if (isNumber(scaleY2)) { + changed = true; + } else { + scaleY2 = oldScaleY; + } + if (changed) { + if (isFunction(options.scale)) { + addListener(element, EVENT_SCALE, options.scale, { + once: true + }); + } + if (dispatchEvent(element, EVENT_SCALE, { + scaleX: scaleX2, + scaleY: scaleY2, + oldScaleX, + oldScaleY + }) === false) { + return this; + } + imageData.scaleX = scaleX2; + imageData.scaleY = scaleY2; + this.scaling = true; + this.renderImage(function() { + _this5.scaling = false; + if (isFunction(options.scaled)) { + addListener(element, EVENT_SCALED, options.scaled, { + once: true + }); + } + dispatchEvent(element, EVENT_SCALED, { + scaleX: scaleX2, + scaleY: scaleY2, + oldScaleX, + oldScaleY + }, { + cancelable: false + }); + }); + } + } + return this; + }, + /** + * Zoom the image with a relative ratio. + * @param {number} ratio - The target ratio. + * @param {boolean} [showTooltip=false] - Indicates whether to show the tooltip. + * @param {Object} [pivot] - The pivot point coordinate for zooming. + * @param {Event} [_originalEvent=null] - The original event if any. + * @returns {Viewer} this + */ + zoom: function zoom(ratio) { + var showTooltip = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var pivot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; + var _originalEvent = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; + var imageData = this.imageData; + ratio = Number(ratio); + if (ratio < 0) { + ratio = 1 / (1 - ratio); + } else { + ratio = 1 + ratio; + } + this.zoomTo(imageData.width * ratio / imageData.naturalWidth, showTooltip, pivot, _originalEvent); + return this; + }, + /** + * Zoom the image to an absolute ratio. + * @param {number} ratio - The target ratio. + * @param {boolean} [showTooltip] - Indicates whether to show the tooltip. + * @param {Object} [pivot] - The pivot point coordinate for zooming. + * @param {Event} [_originalEvent=null] - The original event if any. + * @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not. + * @returns {Viewer} this + */ + zoomTo: function zoomTo(ratio) { + var _this6 = this; + var showTooltip = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var pivot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; + var _originalEvent = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; + var _zoomable = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false; + var element = this.element, options = this.options, pointers = this.pointers, imageData = this.imageData; + var x = imageData.x, y = imageData.y, width = imageData.width, height = imageData.height, naturalWidth = imageData.naturalWidth, naturalHeight = imageData.naturalHeight; + ratio = Math.max(0, ratio); + if (isNumber(ratio) && this.viewed && !this.played && (_zoomable || options.zoomable)) { + if (!_zoomable) { + var minZoomRatio = Math.max(0.01, options.minZoomRatio); + var maxZoomRatio = Math.min(100, options.maxZoomRatio); + ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio); + } + if (_originalEvent) { + switch (_originalEvent.type) { + case "wheel": + if (options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) { + ratio = 1; + } + break; + case "pointermove": + case "touchmove": + case "mousemove": + if (ratio > 0.99 && ratio < 1.01) { + ratio = 1; + } + break; + } + } + var newWidth = naturalWidth * ratio; + var newHeight = naturalHeight * ratio; + var offsetWidth = newWidth - width; + var offsetHeight = newHeight - height; + var oldRatio = imageData.ratio; + if (isFunction(options.zoom)) { + addListener(element, EVENT_ZOOM, options.zoom, { + once: true + }); + } + if (dispatchEvent(element, EVENT_ZOOM, { + ratio, + oldRatio, + originalEvent: _originalEvent + }) === false) { + return this; + } + this.zooming = true; + if (_originalEvent) { + var offset = getOffset(this.viewer); + var center = pointers && Object.keys(pointers).length > 0 ? getPointersCenter(pointers) : { + pageX: _originalEvent.pageX, + pageY: _originalEvent.pageY + }; + imageData.x -= offsetWidth * ((center.pageX - offset.left - x) / width); + imageData.y -= offsetHeight * ((center.pageY - offset.top - y) / height); + } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) { + imageData.x -= offsetWidth * ((pivot.x - x) / width); + imageData.y -= offsetHeight * ((pivot.y - y) / height); + } else { + imageData.x -= offsetWidth / 2; + imageData.y -= offsetHeight / 2; + } + imageData.left = imageData.x; + imageData.top = imageData.y; + imageData.width = newWidth; + imageData.height = newHeight; + imageData.oldRatio = oldRatio; + imageData.ratio = ratio; + this.renderImage(function() { + _this6.zooming = false; + if (isFunction(options.zoomed)) { + addListener(element, EVENT_ZOOMED, options.zoomed, { + once: true + }); + } + dispatchEvent(element, EVENT_ZOOMED, { + ratio, + oldRatio, + originalEvent: _originalEvent + }, { + cancelable: false + }); + }); + if (showTooltip) { + this.tooltip(); + } + } + return this; + }, + /** + * Play the images + * @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not. + * @returns {Viewer} this + */ + play: function play() { + var _this7 = this; + var fullscreen = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + if (!this.isShown || this.played) { + return this; + } + var element = this.element, options = this.options; + if (isFunction(options.play)) { + addListener(element, EVENT_PLAY, options.play, { + once: true + }); + } + if (dispatchEvent(element, EVENT_PLAY) === false) { + return this; + } + var player = this.player; + var onLoad = this.loadImage.bind(this); + var list = []; + var total = 0; + var index = 0; + this.played = true; + this.onLoadWhenPlay = onLoad; + if (fullscreen) { + this.requestFullscreen(fullscreen); + } + addClass(player, CLASS_SHOW); + forEach(this.items, function(item, i) { + var img = item.querySelector("img"); + var image = document.createElement("img"); + image.src = getData(img, "originalUrl"); + image.alt = img.getAttribute("alt"); + image.referrerPolicy = img.referrerPolicy; + total += 1; + addClass(image, CLASS_FADE); + toggleClass(image, CLASS_TRANSITION, options.transition); + if (hasClass(item, CLASS_ACTIVE)) { + addClass(image, CLASS_IN); + index = i; + } + list.push(image); + addListener(image, EVENT_LOAD, onLoad, { + once: true + }); + player.appendChild(image); + }); + if (isNumber(options.interval) && options.interval > 0) { + var _prev = function prev2() { + clearTimeout(_this7.playing.timeout); + removeClass(list[index], CLASS_IN); + index -= 1; + index = index >= 0 ? index : total - 1; + addClass(list[index], CLASS_IN); + _this7.playing.timeout = setTimeout(_prev, options.interval); + }; + var _next = function next2() { + clearTimeout(_this7.playing.timeout); + removeClass(list[index], CLASS_IN); + index += 1; + index = index < total ? index : 0; + addClass(list[index], CLASS_IN); + _this7.playing.timeout = setTimeout(_next, options.interval); + }; + if (total > 1) { + this.playing = { + prev: _prev, + next: _next, + timeout: setTimeout(_next, options.interval) + }; + } + } + return this; + }, + // Stop play + stop: function stop() { + var _this8 = this; + if (!this.played) { + return this; + } + var element = this.element, options = this.options; + if (isFunction(options.stop)) { + addListener(element, EVENT_STOP, options.stop, { + once: true + }); + } + if (dispatchEvent(element, EVENT_STOP) === false) { + return this; + } + var player = this.player; + clearTimeout(this.playing.timeout); + this.playing = false; + this.played = false; + forEach(player.getElementsByTagName("img"), function(image) { + removeListener(image, EVENT_LOAD, _this8.onLoadWhenPlay); + }); + removeClass(player, CLASS_SHOW); + player.innerHTML = ""; + this.exitFullscreen(); + return this; + }, + // Enter modal mode (only available in inline mode) + full: function full() { + var _this9 = this; + var options = this.options, viewer2 = this.viewer, image = this.image, list = this.list; + if (!this.isShown || this.played || this.fulled || !options.inline) { + return this; + } + this.fulled = true; + this.open(); + addClass(this.button, CLASS_FULLSCREEN_EXIT); + if (options.transition) { + removeClass(list, CLASS_TRANSITION); + if (this.viewed) { + removeClass(image, CLASS_TRANSITION); + } + } + addClass(viewer2, CLASS_FIXED); + viewer2.setAttribute("role", "dialog"); + viewer2.setAttribute("aria-labelledby", this.title.id); + viewer2.setAttribute("aria-modal", true); + viewer2.removeAttribute("style"); + setStyle(viewer2, { + zIndex: options.zIndex + }); + if (options.focus) { + this.enforceFocus(); + } + this.initContainer(); + this.viewerData = assign({}, this.containerData); + this.renderList(); + if (this.viewed) { + this.initImage(function() { + _this9.renderImage(function() { + if (options.transition) { + setTimeout(function() { + addClass(image, CLASS_TRANSITION); + addClass(list, CLASS_TRANSITION); + }, 0); + } + }); + }); + } + return this; + }, + // Exit modal mode (only available in inline mode) + exit: function exit() { + var _this10 = this; + var options = this.options, viewer2 = this.viewer, image = this.image, list = this.list; + if (!this.isShown || this.played || !this.fulled || !options.inline) { + return this; + } + this.fulled = false; + this.close(); + removeClass(this.button, CLASS_FULLSCREEN_EXIT); + if (options.transition) { + removeClass(list, CLASS_TRANSITION); + if (this.viewed) { + removeClass(image, CLASS_TRANSITION); + } + } + if (options.focus) { + this.clearEnforceFocus(); + } + viewer2.removeAttribute("role"); + viewer2.removeAttribute("aria-labelledby"); + viewer2.removeAttribute("aria-modal"); + removeClass(viewer2, CLASS_FIXED); + setStyle(viewer2, { + zIndex: options.zIndexInline + }); + this.viewerData = assign({}, this.parentData); + this.renderViewer(); + this.renderList(); + if (this.viewed) { + this.initImage(function() { + _this10.renderImage(function() { + if (options.transition) { + setTimeout(function() { + addClass(image, CLASS_TRANSITION); + addClass(list, CLASS_TRANSITION); + }, 0); + } + }); + }); + } + return this; + }, + // Show the current ratio of the image with percentage + tooltip: function tooltip() { + var _this11 = this; + var options = this.options, tooltipBox = this.tooltipBox, imageData = this.imageData; + if (!this.viewed || this.played || !options.tooltip) { + return this; + } + tooltipBox.textContent = "".concat(Math.round(imageData.ratio * 100), "%"); + if (!this.tooltipping) { + if (options.transition) { + if (this.fading) { + dispatchEvent(tooltipBox, EVENT_TRANSITION_END); + } + addClass(tooltipBox, CLASS_SHOW); + addClass(tooltipBox, CLASS_FADE); + addClass(tooltipBox, CLASS_TRANSITION); + tooltipBox.removeAttribute("aria-hidden"); + tooltipBox.initialOffsetWidth = tooltipBox.offsetWidth; + addClass(tooltipBox, CLASS_IN); + } else { + addClass(tooltipBox, CLASS_SHOW); + tooltipBox.removeAttribute("aria-hidden"); + } + } else { + clearTimeout(this.tooltipping); + } + this.tooltipping = setTimeout(function() { + if (options.transition) { + addListener(tooltipBox, EVENT_TRANSITION_END, function() { + removeClass(tooltipBox, CLASS_SHOW); + removeClass(tooltipBox, CLASS_FADE); + removeClass(tooltipBox, CLASS_TRANSITION); + tooltipBox.setAttribute("aria-hidden", true); + _this11.fading = false; + }, { + once: true + }); + removeClass(tooltipBox, CLASS_IN); + _this11.fading = true; + } else { + removeClass(tooltipBox, CLASS_SHOW); + tooltipBox.setAttribute("aria-hidden", true); + } + _this11.tooltipping = false; + }, 1e3); + return this; + }, + /** + * Toggle the image size between its current size and natural size + * @param {Event} [_originalEvent=null] - The original event if any. + * @returns {Viewer} this + */ + toggle: function toggle() { + var _originalEvent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; + if (this.imageData.ratio === 1) { + this.zoomTo(this.imageData.oldRatio, true, null, _originalEvent); + } else { + this.zoomTo(1, true, null, _originalEvent); + } + return this; + }, + // Reset the image to its initial state + reset: function reset() { + if (this.viewed && !this.played) { + this.imageData = assign({}, this.initialImageData); + this.renderImage(); + } + return this; + }, + // Update viewer when images changed + update: function update() { + var _this12 = this; + var element = this.element, options = this.options, isImg = this.isImg; + if (isImg && !element.parentNode) { + return this.destroy(); + } + var images = []; + forEach(isImg ? [element] : element.querySelectorAll("img"), function(image) { + if (isFunction(options.filter)) { + if (options.filter.call(_this12, image)) { + images.push(image); + } + } else if (_this12.getImageURL(image)) { + images.push(image); + } + }); + if (!images.length) { + return this; + } + this.images = images; + this.length = images.length; + if (this.ready) { + var changedIndexes = []; + forEach(this.items, function(item, i) { + var img = item.querySelector("img"); + var image = images[i]; + if (image && img) { + if (image.src !== img.src || image.alt !== img.alt) { + changedIndexes.push(i); + } + } else { + changedIndexes.push(i); + } + }); + setStyle(this.list, { + width: "auto" + }); + this.initList(); + if (this.isShown) { + if (this.length) { + if (this.viewed) { + var changedIndex = changedIndexes.indexOf(this.index); + if (changedIndex >= 0) { + this.viewed = false; + this.view(Math.max(Math.min(this.index - changedIndex, this.length - 1), 0)); + } else { + var activeItem = this.items[this.index]; + addClass(activeItem, CLASS_ACTIVE); + activeItem.setAttribute("aria-selected", true); + } + } + } else { + this.image = null; + this.viewed = false; + this.index = 0; + this.imageData = {}; + this.canvas.innerHTML = ""; + this.title.innerHTML = ""; + } + } + } else { + this.build(); + } + return this; + }, + // Destroy the viewer + destroy: function destroy() { + var element = this.element, options = this.options; + if (!element[NAMESPACE]) { + return this; + } + this.destroyed = true; + if (this.ready) { + if (this.played) { + this.stop(); + } + if (options.inline) { + if (this.fulled) { + this.exit(); + } + this.unbind(); + } else if (this.isShown) { + if (this.viewing) { + if (this.imageRendering) { + this.imageRendering.abort(); + } else if (this.imageInitializing) { + this.imageInitializing.abort(); + } + } + if (this.hiding) { + this.transitioning.abort(); + } + this.hidden(); + } else if (this.showing) { + this.transitioning.abort(); + this.hidden(); + } + this.ready = false; + this.viewer.parentNode.removeChild(this.viewer); + } else if (options.inline) { + if (this.delaying) { + this.delaying.abort(); + } else if (this.initializing) { + this.initializing.abort(); + } + } + if (!options.inline) { + removeListener(element, EVENT_CLICK, this.onStart); + } + element[NAMESPACE] = void 0; + return this; + } +}; +var others = { + getImageURL: function getImageURL(image) { + var url = this.options.url; + if (isString(url)) { + url = image.getAttribute(url); + } else if (isFunction(url)) { + url = url.call(this, image); + } else { + url = ""; + } + return url; + }, + enforceFocus: function enforceFocus() { + var _this = this; + this.clearEnforceFocus(); + addListener(document, EVENT_FOCUSIN, this.onFocusin = function(event) { + var viewer2 = _this.viewer; + var target = event.target; + if (target === document || target === viewer2 || viewer2.contains(target)) { + return; + } + while (target) { + if (target.getAttribute("tabindex") !== null || target.getAttribute("aria-modal") === "true") { + return; + } + target = target.parentElement; + } + viewer2.focus(); + }); + }, + clearEnforceFocus: function clearEnforceFocus() { + if (this.onFocusin) { + removeListener(document, EVENT_FOCUSIN, this.onFocusin); + this.onFocusin = null; + } + }, + open: function open() { + var body = this.body; + addClass(body, CLASS_OPEN); + if (this.scrollbarWidth > 0) { + body.style.paddingRight = "".concat(this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0), "px"); + } + }, + close: function close() { + var body = this.body; + removeClass(body, CLASS_OPEN); + if (this.scrollbarWidth > 0) { + body.style.paddingRight = this.initialBodyPaddingRight; + } + }, + shown: function shown() { + var element = this.element, options = this.options, viewer2 = this.viewer; + this.fulled = true; + this.isShown = true; + this.render(); + this.bind(); + this.showing = false; + if (options.focus) { + viewer2.focus(); + this.enforceFocus(); + } + if (isFunction(options.shown)) { + addListener(element, EVENT_SHOWN, options.shown, { + once: true + }); + } + if (dispatchEvent(element, EVENT_SHOWN) === false) { + return; + } + if (this.ready && this.isShown && !this.hiding) { + this.view(this.index); + } + }, + hidden: function hidden() { + var element = this.element, options = this.options, viewer2 = this.viewer; + if (options.fucus) { + this.clearEnforceFocus(); + } + this.close(); + this.unbind(); + addClass(viewer2, CLASS_HIDE); + viewer2.removeAttribute("role"); + viewer2.removeAttribute("aria-labelledby"); + viewer2.removeAttribute("aria-modal"); + viewer2.setAttribute("aria-hidden", true); + this.resetList(); + this.resetImage(); + this.fulled = false; + this.viewed = false; + this.isShown = false; + this.hiding = false; + if (!this.destroyed) { + if (isFunction(options.hidden)) { + addListener(element, EVENT_HIDDEN, options.hidden, { + once: true + }); + } + dispatchEvent(element, EVENT_HIDDEN, null, { + cancelable: false + }); + } + }, + requestFullscreen: function requestFullscreen(options) { + var document2 = this.element.ownerDocument; + if (this.fulled && !(document2.fullscreenElement || document2.webkitFullscreenElement || document2.mozFullScreenElement || document2.msFullscreenElement)) { + var documentElement = document2.documentElement; + if (documentElement.requestFullscreen) { + if (isPlainObject(options)) { + documentElement.requestFullscreen(options); + } else { + documentElement.requestFullscreen(); + } + } else if (documentElement.webkitRequestFullscreen) { + documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } else if (documentElement.mozRequestFullScreen) { + documentElement.mozRequestFullScreen(); + } else if (documentElement.msRequestFullscreen) { + documentElement.msRequestFullscreen(); + } + } + }, + exitFullscreen: function exitFullscreen() { + var document2 = this.element.ownerDocument; + if (this.fulled && (document2.fullscreenElement || document2.webkitFullscreenElement || document2.mozFullScreenElement || document2.msFullscreenElement)) { + if (document2.exitFullscreen) { + document2.exitFullscreen(); + } else if (document2.webkitExitFullscreen) { + document2.webkitExitFullscreen(); + } else if (document2.mozCancelFullScreen) { + document2.mozCancelFullScreen(); + } else if (document2.msExitFullscreen) { + document2.msExitFullscreen(); + } + } + }, + change: function change(event) { + var options = this.options, pointers = this.pointers; + var pointer = pointers[Object.keys(pointers)[0]]; + if (!pointer) { + return; + } + var offsetX = pointer.endX - pointer.startX; + var offsetY = pointer.endY - pointer.startY; + switch (this.action) { + case ACTION_MOVE: + if (offsetX !== 0 || offsetY !== 0) { + this.pointerMoved = true; + this.move(offsetX, offsetY, event); + } + break; + case ACTION_ZOOM: + this.zoom(getMaxZoomRatio(pointers), false, null, event); + break; + case ACTION_SWITCH: { + this.action = "switched"; + var absoluteOffsetX = Math.abs(offsetX); + if (absoluteOffsetX > 1 && absoluteOffsetX > Math.abs(offsetY)) { + this.pointers = {}; + if (offsetX > 1) { + this.prev(options.loop); + } else if (offsetX < -1) { + this.next(options.loop); + } + } + break; + } + } + forEach(pointers, function(p) { + p.startX = p.endX; + p.startY = p.endY; + }); + }, + isSwitchable: function isSwitchable() { + var imageData = this.imageData, viewerData = this.viewerData; + return this.length > 1 && imageData.x >= 0 && imageData.y >= 0 && imageData.width <= viewerData.width && imageData.height <= viewerData.height; + } +}; +var AnotherViewer = WINDOW.Viewer; +var getUniqueID = /* @__PURE__ */ function(id) { + return function() { + id += 1; + return id; + }; +}(-1); +var Viewer = function() { + function Viewer2(element) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + _classCallCheck(this, Viewer2); + if (!element || element.nodeType !== 1) { + throw new Error("The first argument is required and must be an element."); + } + this.element = element; + this.options = assign({}, DEFAULTS, isPlainObject(options) && options); + this.action = false; + this.fading = false; + this.fulled = false; + this.hiding = false; + this.imageClicked = false; + this.imageData = {}; + this.index = this.options.initialViewIndex; + this.isImg = false; + this.isShown = false; + this.length = 0; + this.moving = false; + this.played = false; + this.playing = false; + this.pointers = {}; + this.ready = false; + this.rotating = false; + this.scaling = false; + this.showing = false; + this.timeout = false; + this.tooltipping = false; + this.viewed = false; + this.viewing = false; + this.wheeling = false; + this.zooming = false; + this.pointerMoved = false; + this.id = getUniqueID(); + this.init(); + } + return _createClass(Viewer2, [{ + key: "init", + value: function init() { + var _this = this; + var element = this.element, options = this.options; + if (element[NAMESPACE]) { + return; + } + element[NAMESPACE] = this; + if (options.focus && !options.keyboard) { + options.focus = false; + } + var isImg = element.localName === "img"; + var images = []; + forEach(isImg ? [element] : element.querySelectorAll("img"), function(image) { + if (isFunction(options.filter)) { + if (options.filter.call(_this, image)) { + images.push(image); + } + } else if (_this.getImageURL(image)) { + images.push(image); + } + }); + this.isImg = isImg; + this.length = images.length; + this.images = images; + this.initBody(); + if (isUndefined(document.createElement(NAMESPACE).style.transition)) { + options.transition = false; + } + if (options.inline) { + var count = 0; + var progress = function progress2() { + count += 1; + if (count === _this.length) { + var timeout; + _this.initializing = false; + _this.delaying = { + abort: function abort() { + clearTimeout(timeout); + } + }; + timeout = setTimeout(function() { + _this.delaying = false; + _this.build(); + }, 0); + } + }; + this.initializing = { + abort: function abort() { + forEach(images, function(image) { + if (!image.complete) { + removeListener(image, EVENT_LOAD, progress); + removeListener(image, EVENT_ERROR, progress); + } + }); + } + }; + forEach(images, function(image) { + if (image.complete) { + progress(); + } else { + var onLoad; + var onError; + addListener(image, EVENT_LOAD, onLoad = function onLoad2() { + removeListener(image, EVENT_ERROR, onError); + progress(); + }, { + once: true + }); + addListener(image, EVENT_ERROR, onError = function onError2() { + removeListener(image, EVENT_LOAD, onLoad); + progress(); + }, { + once: true + }); + } + }); + } else { + addListener(element, EVENT_CLICK, this.onStart = function(_ref) { + var target = _ref.target; + if (target.localName === "img" && (!isFunction(options.filter) || options.filter.call(_this, target))) { + _this.view(_this.images.indexOf(target)); + } + }); + } + } + }, { + key: "build", + value: function build() { + if (this.ready) { + return; + } + var element = this.element, options = this.options; + var parent = element.parentNode; + var template = document.createElement("div"); + template.innerHTML = TEMPLATE; + var viewer2 = template.querySelector(".".concat(NAMESPACE, "-container")); + var title = viewer2.querySelector(".".concat(NAMESPACE, "-title")); + var toolbar = viewer2.querySelector(".".concat(NAMESPACE, "-toolbar")); + var navbar = viewer2.querySelector(".".concat(NAMESPACE, "-navbar")); + var button = viewer2.querySelector(".".concat(NAMESPACE, "-button")); + var canvas = viewer2.querySelector(".".concat(NAMESPACE, "-canvas")); + this.parent = parent; + this.viewer = viewer2; + this.title = title; + this.toolbar = toolbar; + this.navbar = navbar; + this.button = button; + this.canvas = canvas; + this.footer = viewer2.querySelector(".".concat(NAMESPACE, "-footer")); + this.tooltipBox = viewer2.querySelector(".".concat(NAMESPACE, "-tooltip")); + this.player = viewer2.querySelector(".".concat(NAMESPACE, "-player")); + this.list = viewer2.querySelector(".".concat(NAMESPACE, "-list")); + viewer2.id = "".concat(NAMESPACE).concat(this.id); + title.id = "".concat(NAMESPACE, "Title").concat(this.id); + addClass(title, !options.title ? CLASS_HIDE : getResponsiveClass(Array.isArray(options.title) ? options.title[0] : options.title)); + addClass(navbar, !options.navbar ? CLASS_HIDE : getResponsiveClass(options.navbar)); + toggleClass(button, CLASS_HIDE, !options.button); + if (options.keyboard) { + button.setAttribute("tabindex", 0); + } + if (options.backdrop) { + addClass(viewer2, "".concat(NAMESPACE, "-backdrop")); + if (!options.inline && options.backdrop !== "static") { + setData(canvas, DATA_ACTION, "hide"); + } + } + if (isString(options.className) && options.className) { + options.className.split(REGEXP_SPACES).forEach(function(className) { + addClass(viewer2, className); + }); + } + if (options.toolbar) { + var list = document.createElement("ul"); + var custom = isPlainObject(options.toolbar); + var zoomButtons = BUTTONS.slice(0, 3); + var rotateButtons = BUTTONS.slice(7, 9); + var scaleButtons = BUTTONS.slice(9); + if (!custom) { + addClass(toolbar, getResponsiveClass(options.toolbar)); + } + forEach(custom ? options.toolbar : BUTTONS, function(value, index) { + var deep = custom && isPlainObject(value); + var name = custom ? hyphenate(index) : value; + var show2 = deep && !isUndefined(value.show) ? value.show : value; + if (!show2 || !options.zoomable && zoomButtons.indexOf(name) !== -1 || !options.rotatable && rotateButtons.indexOf(name) !== -1 || !options.scalable && scaleButtons.indexOf(name) !== -1) { + return; + } + var size = deep && !isUndefined(value.size) ? value.size : value; + var click2 = deep && !isUndefined(value.click) ? value.click : value; + var item = document.createElement("li"); + if (options.keyboard) { + item.setAttribute("tabindex", 0); + } + item.setAttribute("role", "button"); + addClass(item, "".concat(NAMESPACE, "-").concat(name)); + if (!isFunction(click2)) { + setData(item, DATA_ACTION, name); + } + if (isNumber(show2)) { + addClass(item, getResponsiveClass(show2)); + } + if (["small", "large"].indexOf(size) !== -1) { + addClass(item, "".concat(NAMESPACE, "-").concat(size)); + } else if (name === "play") { + addClass(item, "".concat(NAMESPACE, "-large")); + } + if (isFunction(click2)) { + addListener(item, EVENT_CLICK, click2); + } + list.appendChild(item); + }); + toolbar.appendChild(list); + } else { + addClass(toolbar, CLASS_HIDE); + } + if (!options.rotatable) { + var rotates = toolbar.querySelectorAll('li[class*="rotate"]'); + addClass(rotates, CLASS_INVISIBLE); + forEach(rotates, function(rotate2) { + toolbar.appendChild(rotate2); + }); + } + if (options.inline) { + addClass(button, CLASS_FULLSCREEN); + setStyle(viewer2, { + zIndex: options.zIndexInline + }); + if (window.getComputedStyle(parent).position === "static") { + setStyle(parent, { + position: "relative" + }); + } + parent.insertBefore(viewer2, element.nextSibling); + } else { + addClass(button, CLASS_CLOSE); + addClass(viewer2, CLASS_FIXED); + addClass(viewer2, CLASS_FADE); + addClass(viewer2, CLASS_HIDE); + setStyle(viewer2, { + zIndex: options.zIndex + }); + var container = options.container; + if (isString(container)) { + container = element.ownerDocument.querySelector(container); + } + if (!container) { + container = this.body; + } + container.appendChild(viewer2); + } + if (options.inline) { + this.render(); + this.bind(); + this.isShown = true; + } + this.ready = true; + if (isFunction(options.ready)) { + addListener(element, EVENT_READY, options.ready, { + once: true + }); + } + if (dispatchEvent(element, EVENT_READY) === false) { + this.ready = false; + return; + } + if (this.ready && options.inline) { + this.view(this.index); + } + } + /** + * Get the no conflict viewer class. + * @returns {Viewer} The viewer class. + */ + }], [{ + key: "noConflict", + value: function noConflict() { + window.Viewer = AnotherViewer; + return Viewer2; + } + /** + * Change the default options. + * @param {Object} options - The new default options. + */ + }, { + key: "setDefaults", + value: function setDefaults(options) { + assign(DEFAULTS, isPlainObject(options) && options); + } + }]); +}(); +assign(Viewer.prototype, render, events, handlers, methods, others); + +// node_modules/.pnpm/vitepress-plugin-image-viewer@1.1.5/node_modules/vitepress-plugin-image-viewer/lib/viewer.js +var viewer = null; +var setViewer = (el = ".vp-doc", option) => { + const defaultBaseOption = { + navbar: false, + title: false, + toolbar: { + zoomIn: 4, + zoomOut: 4, + prev: 4, + next: 4, + reset: 4, + oneToOne: 4 + } + }; + viewer = new Viewer(document.querySelector(el), { + ...defaultBaseOption, + ...option + }); +}; +var imageViewer = (route, el, option) => { + onMounted(() => { + setViewer(el, option); + }); + watch(() => route.path, () => nextTick(() => { + viewer == null ? void 0 : viewer.destroy(); + setViewer(el, option); + })); +}; +var viewer_default = imageViewer; +export { + viewer_default as default +}; +/*! Bundled license information: + +viewerjs/dist/viewer.esm.js: + (*! + * Viewer.js v1.11.7 + * https://fengyuanchen.github.io/viewerjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2024-11-24T04:32:19.116Z + *) +*/ +//# sourceMappingURL=vitepress-plugin-image-viewer.js.map diff --git a/.vitepress/cache/deps/vitepress-plugin-image-viewer.js.map b/.vitepress/cache/deps/vitepress-plugin-image-viewer.js.map new file mode 100644 index 0000000..8c3b761 --- /dev/null +++ b/.vitepress/cache/deps/vitepress-plugin-image-viewer.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../node_modules/.pnpm/viewerjs@1.11.7/node_modules/viewerjs/dist/viewer.esm.js", "../../../node_modules/.pnpm/vitepress-plugin-image-viewer@1.1.5/node_modules/vitepress-plugin-image-viewer/lib/viewer.js"], + "sourcesContent": ["/*!\n * Viewer.js v1.11.7\n * https://fengyuanchen.github.io/viewerjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2024-11-24T04:32:19.116Z\n */\n\nfunction _classCallCheck(a, n) {\n if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\n\nvar DEFAULTS = {\n /**\n * Enable a modal backdrop, specify `static` for a backdrop\n * which doesn't close the modal on click.\n * @type {boolean}\n */\n backdrop: true,\n /**\n * Show the button on the top-right of the viewer.\n * @type {boolean}\n */\n button: true,\n /**\n * Show the navbar.\n * @type {boolean | number}\n */\n navbar: true,\n /**\n * Specify the visibility and the content of the title.\n * @type {boolean | number | Function | Array}\n */\n title: true,\n /**\n * Show the toolbar.\n * @type {boolean | number | Object}\n */\n toolbar: true,\n /**\n * Custom class name(s) to add to the viewer's root element.\n * @type {string}\n */\n className: '',\n /**\n * Define where to put the viewer in modal mode.\n * @type {string | Element}\n */\n container: 'body',\n /**\n * Filter the images for viewing. Return true if the image is viewable.\n * @type {Function}\n */\n filter: null,\n /**\n * Enable to request fullscreen when play.\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/FullscreenOptions}\n * @type {boolean|FullscreenOptions}\n */\n fullscreen: true,\n /**\n * Define the extra attributes to inherit from the original image.\n * @type {Array}\n */\n inheritedAttributes: ['crossOrigin', 'decoding', 'isMap', 'loading', 'referrerPolicy', 'sizes', 'srcset', 'useMap'],\n /**\n * Define the initial coverage of the viewing image.\n * @type {number}\n */\n initialCoverage: 0.9,\n /**\n * Define the initial index of the image for viewing.\n * @type {number}\n */\n initialViewIndex: 0,\n /**\n * Enable inline mode.\n * @type {boolean}\n */\n inline: false,\n /**\n * The amount of time to delay between automatically cycling an image when playing.\n * @type {number}\n */\n interval: 5000,\n /**\n * Enable keyboard support.\n * @type {boolean}\n */\n keyboard: true,\n /**\n * Focus the viewer when initialized.\n * @type {boolean}\n */\n focus: true,\n /**\n * Indicate if show a loading spinner when load image or not.\n * @type {boolean}\n */\n loading: true,\n /**\n * Indicate if enable loop viewing or not.\n * @type {boolean}\n */\n loop: true,\n /**\n * Min width of the viewer in inline mode.\n * @type {number}\n */\n minWidth: 200,\n /**\n * Min height of the viewer in inline mode.\n * @type {number}\n */\n minHeight: 100,\n /**\n * Enable to move the image.\n * @type {boolean}\n */\n movable: true,\n /**\n * Enable to rotate the image.\n * @type {boolean}\n */\n rotatable: true,\n /**\n * Enable to scale the image.\n * @type {boolean}\n */\n scalable: true,\n /**\n * Enable to zoom the image.\n * @type {boolean}\n */\n zoomable: true,\n /**\n * Enable to zoom the current image by dragging on the touch screen.\n * @type {boolean}\n */\n zoomOnTouch: true,\n /**\n * Enable to zoom the image by wheeling mouse.\n * @type {boolean}\n */\n zoomOnWheel: true,\n /**\n * Enable to slide to the next or previous image by swiping on the touch screen.\n * @type {boolean}\n */\n slideOnTouch: true,\n /**\n * Indicate if toggle the image size between its natural size\n * and initial size when double click on the image or not.\n * @type {boolean}\n */\n toggleOnDblclick: true,\n /**\n * Show the tooltip with image ratio (percentage) when zoom in or zoom out.\n * @type {boolean}\n */\n tooltip: true,\n /**\n * Enable CSS3 Transition for some special elements.\n * @type {boolean}\n */\n transition: true,\n /**\n * Define the CSS `z-index` value of viewer in modal mode.\n * @type {number}\n */\n zIndex: 2015,\n /**\n * Define the CSS `z-index` value of viewer in inline mode.\n * @type {number}\n */\n zIndexInline: 0,\n /**\n * Define the ratio when zoom the image by wheeling mouse.\n * @type {number}\n */\n zoomRatio: 0.1,\n /**\n * Define the min ratio of the image when zoom out.\n * @type {number}\n */\n minZoomRatio: 0.01,\n /**\n * Define the max ratio of the image when zoom in.\n * @type {number}\n */\n maxZoomRatio: 100,\n /**\n * Define where to get the original image URL for viewing.\n * @type {string | Function}\n */\n url: 'src',\n /**\n * Event shortcuts.\n * @type {Function}\n */\n ready: null,\n show: null,\n shown: null,\n hide: null,\n hidden: null,\n view: null,\n viewed: null,\n move: null,\n moved: null,\n rotate: null,\n rotated: null,\n scale: null,\n scaled: null,\n zoom: null,\n zoomed: null,\n play: null,\n stop: null\n};\n\nvar TEMPLATE = '
' + '
' + '
' + '
' + '
' + '
' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ' + '
    ';\n\nvar IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nvar WINDOW = IS_BROWSER ? window : {};\nvar IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false;\nvar HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;\nvar NAMESPACE = 'viewer';\n\n// Actions\nvar ACTION_MOVE = 'move';\nvar ACTION_SWITCH = 'switch';\nvar ACTION_ZOOM = 'zoom';\n\n// Classes\nvar CLASS_ACTIVE = \"\".concat(NAMESPACE, \"-active\");\nvar CLASS_CLOSE = \"\".concat(NAMESPACE, \"-close\");\nvar CLASS_FADE = \"\".concat(NAMESPACE, \"-fade\");\nvar CLASS_FIXED = \"\".concat(NAMESPACE, \"-fixed\");\nvar CLASS_FULLSCREEN = \"\".concat(NAMESPACE, \"-fullscreen\");\nvar CLASS_FULLSCREEN_EXIT = \"\".concat(NAMESPACE, \"-fullscreen-exit\");\nvar CLASS_HIDE = \"\".concat(NAMESPACE, \"-hide\");\nvar CLASS_HIDE_MD_DOWN = \"\".concat(NAMESPACE, \"-hide-md-down\");\nvar CLASS_HIDE_SM_DOWN = \"\".concat(NAMESPACE, \"-hide-sm-down\");\nvar CLASS_HIDE_XS_DOWN = \"\".concat(NAMESPACE, \"-hide-xs-down\");\nvar CLASS_IN = \"\".concat(NAMESPACE, \"-in\");\nvar CLASS_INVISIBLE = \"\".concat(NAMESPACE, \"-invisible\");\nvar CLASS_LOADING = \"\".concat(NAMESPACE, \"-loading\");\nvar CLASS_MOVE = \"\".concat(NAMESPACE, \"-move\");\nvar CLASS_OPEN = \"\".concat(NAMESPACE, \"-open\");\nvar CLASS_SHOW = \"\".concat(NAMESPACE, \"-show\");\nvar CLASS_TRANSITION = \"\".concat(NAMESPACE, \"-transition\");\n\n// Native events\nvar EVENT_CLICK = 'click';\nvar EVENT_DBLCLICK = 'dblclick';\nvar EVENT_DRAG_START = 'dragstart';\nvar EVENT_FOCUSIN = 'focusin';\nvar EVENT_KEY_DOWN = 'keydown';\nvar EVENT_LOAD = 'load';\nvar EVENT_ERROR = 'error';\nvar EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';\nvar EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';\nvar EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';\nvar EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;\nvar EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;\nvar EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;\nvar EVENT_RESIZE = 'resize';\nvar EVENT_TRANSITION_END = 'transitionend';\nvar EVENT_WHEEL = 'wheel';\n\n// Custom events\nvar EVENT_READY = 'ready';\nvar EVENT_SHOW = 'show';\nvar EVENT_SHOWN = 'shown';\nvar EVENT_HIDE = 'hide';\nvar EVENT_HIDDEN = 'hidden';\nvar EVENT_VIEW = 'view';\nvar EVENT_VIEWED = 'viewed';\nvar EVENT_MOVE = 'move';\nvar EVENT_MOVED = 'moved';\nvar EVENT_ROTATE = 'rotate';\nvar EVENT_ROTATED = 'rotated';\nvar EVENT_SCALE = 'scale';\nvar EVENT_SCALED = 'scaled';\nvar EVENT_ZOOM = 'zoom';\nvar EVENT_ZOOMED = 'zoomed';\nvar EVENT_PLAY = 'play';\nvar EVENT_STOP = 'stop';\n\n// Data keys\nvar DATA_ACTION = \"\".concat(NAMESPACE, \"Action\");\n\n// RegExps\nvar REGEXP_SPACES = /\\s\\s*/;\n\n// Misc\nvar BUTTONS = ['zoom-in', 'zoom-out', 'one-to-one', 'reset', 'prev', 'play', 'next', 'rotate-left', 'rotate-right', 'flip-horizontal', 'flip-vertical'];\n\n/**\n * Check if the given value is a string.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a string, else `false`.\n */\nfunction isString(value) {\n return typeof value === 'string';\n}\n\n/**\n * Check if the given value is not a number.\n */\nvar isNaN = Number.isNaN || WINDOW.isNaN;\n\n/**\n * Check if the given value is a number.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a number, else `false`.\n */\nfunction isNumber(value) {\n return typeof value === 'number' && !isNaN(value);\n}\n\n/**\n * Check if the given value is undefined.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is undefined, else `false`.\n */\nfunction isUndefined(value) {\n return typeof value === 'undefined';\n}\n\n/**\n * Check if the given value is an object.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is an object, else `false`.\n */\nfunction isObject(value) {\n return _typeof(value) === 'object' && value !== null;\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Check if the given value is a plain object.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.\n */\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n try {\n var _constructor = value.constructor;\n var prototype = _constructor.prototype;\n return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');\n } catch (error) {\n return false;\n }\n}\n\n/**\n * Check if the given value is a function.\n * @param {*} value - The value to check.\n * @returns {boolean} Returns `true` if the given value is a function, else `false`.\n */\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\n/**\n * Iterate the given data.\n * @param {*} data - The data to iterate.\n * @param {Function} callback - The process function for each element.\n * @returns {*} The original data.\n */\nfunction forEach(data, callback) {\n if (data && isFunction(callback)) {\n if (Array.isArray(data) || isNumber(data.length) /* array-like */) {\n var length = data.length;\n var i;\n for (i = 0; i < length; i += 1) {\n if (callback.call(data, data[i], i, data) === false) {\n break;\n }\n }\n } else if (isObject(data)) {\n Object.keys(data).forEach(function (key) {\n callback.call(data, data[key], key, data);\n });\n }\n }\n return data;\n}\n\n/**\n * Extend the given object.\n * @param {*} obj - The object to be extended.\n * @param {*} args - The rest objects which will be merged to the first object.\n * @returns {Object} The extended object.\n */\nvar assign = Object.assign || function assign(obj) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (isObject(obj) && args.length > 0) {\n args.forEach(function (arg) {\n if (isObject(arg)) {\n Object.keys(arg).forEach(function (key) {\n obj[key] = arg[key];\n });\n }\n });\n }\n return obj;\n};\nvar REGEXP_SUFFIX = /^(?:width|height|left|top|marginLeft|marginTop)$/;\n\n/**\n * Apply styles to the given element.\n * @param {Element} element - The target element.\n * @param {Object} styles - The styles for applying.\n */\nfunction setStyle(element, styles) {\n var style = element.style;\n forEach(styles, function (value, property) {\n if (REGEXP_SUFFIX.test(property) && isNumber(value)) {\n value += 'px';\n }\n style[property] = value;\n });\n}\n\n/**\n * Escape a string for using in HTML.\n * @param {String} value - The string to escape.\n * @returns {String} Returns the escaped string.\n */\nfunction escapeHTMLEntities(value) {\n return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&').replace(/\"/g, '"').replace(/'/g, ''').replace(//g, '>') : value;\n}\n\n/**\n * Check if the given element has a special class.\n * @param {Element} element - The element to check.\n * @param {string} value - The class to search.\n * @returns {boolean} Returns `true` if the special class was found.\n */\nfunction hasClass(element, value) {\n if (!element || !value) {\n return false;\n }\n return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;\n}\n\n/**\n * Add classes to the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be added.\n */\nfunction addClass(element, value) {\n if (!element || !value) {\n return;\n }\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n addClass(elem, value);\n });\n return;\n }\n if (element.classList) {\n element.classList.add(value);\n return;\n }\n var className = element.className.trim();\n if (!className) {\n element.className = value;\n } else if (className.indexOf(value) < 0) {\n element.className = \"\".concat(className, \" \").concat(value);\n }\n}\n\n/**\n * Remove classes from the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be removed.\n */\nfunction removeClass(element, value) {\n if (!element || !value) {\n return;\n }\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n removeClass(elem, value);\n });\n return;\n }\n if (element.classList) {\n element.classList.remove(value);\n return;\n }\n if (element.className.indexOf(value) >= 0) {\n element.className = element.className.replace(value, '');\n }\n}\n\n/**\n * Add or remove classes from the given element.\n * @param {Element} element - The target element.\n * @param {string} value - The classes to be toggled.\n * @param {boolean} added - Add only.\n */\nfunction toggleClass(element, value, added) {\n if (!value) {\n return;\n }\n if (isNumber(element.length)) {\n forEach(element, function (elem) {\n toggleClass(elem, value, added);\n });\n return;\n }\n\n // IE10-11 doesn't support the second parameter of `classList.toggle`\n if (added) {\n addClass(element, value);\n } else {\n removeClass(element, value);\n }\n}\nvar REGEXP_HYPHENATE = /([a-z\\d])([A-Z])/g;\n\n/**\n * Transform the given string from camelCase to kebab-case\n * @param {string} value - The value to transform.\n * @returns {string} The transformed value.\n */\nfunction hyphenate(value) {\n return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();\n}\n\n/**\n * Get data from the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to get.\n * @returns {string} The data value.\n */\nfunction getData(element, name) {\n if (isObject(element[name])) {\n return element[name];\n }\n if (element.dataset) {\n return element.dataset[name];\n }\n return element.getAttribute(\"data-\".concat(hyphenate(name)));\n}\n\n/**\n * Set data to the given element.\n * @param {Element} element - The target element.\n * @param {string} name - The data key to set.\n * @param {string} data - The data value.\n */\nfunction setData(element, name, data) {\n if (isObject(data)) {\n element[name] = data;\n } else if (element.dataset) {\n element.dataset[name] = data;\n } else {\n element.setAttribute(\"data-\".concat(hyphenate(name)), data);\n }\n}\nvar onceSupported = function () {\n var supported = false;\n if (IS_BROWSER) {\n var once = false;\n var listener = function listener() {};\n var options = Object.defineProperty({}, 'once', {\n get: function get() {\n supported = true;\n return once;\n },\n /**\n * This setter can fix a `TypeError` in strict mode\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}\n * @param {boolean} value - The value to set\n */\n set: function set(value) {\n once = value;\n }\n });\n WINDOW.addEventListener('test', listener, options);\n WINDOW.removeEventListener('test', listener, options);\n }\n return supported;\n}();\n\n/**\n * Remove event listener from the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Function} listener - The event listener.\n * @param {Object} options - The event options.\n */\nfunction removeListener(element, type, listener) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var handler = listener;\n type.trim().split(REGEXP_SPACES).forEach(function (event) {\n if (!onceSupported) {\n var listeners = element.listeners;\n if (listeners && listeners[event] && listeners[event][listener]) {\n handler = listeners[event][listener];\n delete listeners[event][listener];\n if (Object.keys(listeners[event]).length === 0) {\n delete listeners[event];\n }\n if (Object.keys(listeners).length === 0) {\n delete element.listeners;\n }\n }\n }\n element.removeEventListener(event, handler, options);\n });\n}\n\n/**\n * Add event listener to the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Function} listener - The event listener.\n * @param {Object} options - The event options.\n */\nfunction addListener(element, type, listener) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var _handler = listener;\n type.trim().split(REGEXP_SPACES).forEach(function (event) {\n if (options.once && !onceSupported) {\n var _element$listeners = element.listeners,\n listeners = _element$listeners === void 0 ? {} : _element$listeners;\n _handler = function handler() {\n delete listeners[event][listener];\n element.removeEventListener(event, _handler, options);\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n listener.apply(element, args);\n };\n if (!listeners[event]) {\n listeners[event] = {};\n }\n if (listeners[event][listener]) {\n element.removeEventListener(event, listeners[event][listener], options);\n }\n listeners[event][listener] = _handler;\n element.listeners = listeners;\n }\n element.addEventListener(event, _handler, options);\n });\n}\n\n/**\n * Dispatch event on the target element.\n * @param {Element} element - The event target.\n * @param {string} type - The event type(s).\n * @param {Object} data - The additional event data.\n * @param {Object} options - The additional event options.\n * @returns {boolean} Indicate if the event is default prevented or not.\n */\nfunction dispatchEvent(element, type, data, options) {\n var event;\n\n // Event and CustomEvent on IE9-11 are global objects, not constructors\n if (isFunction(Event) && isFunction(CustomEvent)) {\n event = new CustomEvent(type, _objectSpread2({\n bubbles: true,\n cancelable: true,\n detail: data\n }, options));\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(type, true, true, data);\n }\n return element.dispatchEvent(event);\n}\n\n/**\n * Get the offset base on the document.\n * @param {Element} element - The target element.\n * @returns {Object} The offset data.\n */\nfunction getOffset(element) {\n var box = element.getBoundingClientRect();\n return {\n left: box.left + (window.pageXOffset - document.documentElement.clientLeft),\n top: box.top + (window.pageYOffset - document.documentElement.clientTop)\n };\n}\n\n/**\n * Get transforms base on the given object.\n * @param {Object} obj - The target object.\n * @returns {string} A string contains transform values.\n */\nfunction getTransforms(_ref) {\n var rotate = _ref.rotate,\n scaleX = _ref.scaleX,\n scaleY = _ref.scaleY,\n translateX = _ref.translateX,\n translateY = _ref.translateY;\n var values = [];\n if (isNumber(translateX) && translateX !== 0) {\n values.push(\"translateX(\".concat(translateX, \"px)\"));\n }\n if (isNumber(translateY) && translateY !== 0) {\n values.push(\"translateY(\".concat(translateY, \"px)\"));\n }\n\n // Rotate should come first before scale to match orientation transform\n if (isNumber(rotate) && rotate !== 0) {\n values.push(\"rotate(\".concat(rotate, \"deg)\"));\n }\n if (isNumber(scaleX) && scaleX !== 1) {\n values.push(\"scaleX(\".concat(scaleX, \")\"));\n }\n if (isNumber(scaleY) && scaleY !== 1) {\n values.push(\"scaleY(\".concat(scaleY, \")\"));\n }\n var transform = values.length ? values.join(' ') : 'none';\n return {\n WebkitTransform: transform,\n msTransform: transform,\n transform: transform\n };\n}\n\n/**\n * Get an image name from an image url.\n * @param {string} url - The target url.\n * @example\n * // picture.jpg\n * getImageNameFromURL('https://domain.com/path/to/picture.jpg?size=1280×960')\n * @returns {string} A string contains the image name.\n */\nfunction getImageNameFromURL(url) {\n return isString(url) ? decodeURIComponent(url.replace(/^.*\\//, '').replace(/[?&#].*$/, '')) : '';\n}\nvar IS_SAFARI = WINDOW.navigator && /Version\\/\\d+(\\.\\d+)+?\\s+Safari/i.test(WINDOW.navigator.userAgent);\n\n/**\n * Get an image's natural sizes.\n * @param {string} image - The target image.\n * @param {Object} options - The viewer options.\n * @param {Function} callback - The callback function.\n * @returns {HTMLImageElement} The new image.\n */\nfunction getImageNaturalSizes(image, options, callback) {\n var newImage = document.createElement('img');\n\n // Modern browsers (except Safari)\n if (image.naturalWidth && !IS_SAFARI) {\n callback(image.naturalWidth, image.naturalHeight);\n return newImage;\n }\n var body = document.body || document.documentElement;\n newImage.onload = function () {\n callback(newImage.width, newImage.height);\n if (!IS_SAFARI) {\n body.removeChild(newImage);\n }\n };\n forEach(options.inheritedAttributes, function (name) {\n var value = image.getAttribute(name);\n if (value !== null) {\n newImage.setAttribute(name, value);\n }\n });\n newImage.src = image.src;\n\n // iOS Safari will convert the image automatically\n // with its orientation once append it into DOM\n if (!IS_SAFARI) {\n newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';\n body.appendChild(newImage);\n }\n return newImage;\n}\n\n/**\n * Get the related class name of a responsive type number.\n * @param {string} type - The responsive type.\n * @returns {string} The related class name.\n */\nfunction getResponsiveClass(type) {\n switch (type) {\n case 2:\n return CLASS_HIDE_XS_DOWN;\n case 3:\n return CLASS_HIDE_SM_DOWN;\n case 4:\n return CLASS_HIDE_MD_DOWN;\n default:\n return '';\n }\n}\n\n/**\n * Get the max ratio of a group of pointers.\n * @param {string} pointers - The target pointers.\n * @returns {number} The result ratio.\n */\nfunction getMaxZoomRatio(pointers) {\n var pointers2 = _objectSpread2({}, pointers);\n var ratios = [];\n forEach(pointers, function (pointer, pointerId) {\n delete pointers2[pointerId];\n forEach(pointers2, function (pointer2) {\n var x1 = Math.abs(pointer.startX - pointer2.startX);\n var y1 = Math.abs(pointer.startY - pointer2.startY);\n var x2 = Math.abs(pointer.endX - pointer2.endX);\n var y2 = Math.abs(pointer.endY - pointer2.endY);\n var z1 = Math.sqrt(x1 * x1 + y1 * y1);\n var z2 = Math.sqrt(x2 * x2 + y2 * y2);\n var ratio = (z2 - z1) / z1;\n ratios.push(ratio);\n });\n });\n ratios.sort(function (a, b) {\n return Math.abs(a) < Math.abs(b);\n });\n return ratios[0];\n}\n\n/**\n * Get a pointer from an event object.\n * @param {Object} event - The target event object.\n * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.\n * @returns {Object} The result pointer contains start and/or end point coordinates.\n */\nfunction getPointer(_ref2, endOnly) {\n var pageX = _ref2.pageX,\n pageY = _ref2.pageY;\n var end = {\n endX: pageX,\n endY: pageY\n };\n return endOnly ? end : _objectSpread2({\n timeStamp: Date.now(),\n startX: pageX,\n startY: pageY\n }, end);\n}\n\n/**\n * Get the center point coordinate of a group of pointers.\n * @param {Object} pointers - The target pointers.\n * @returns {Object} The center point coordinate.\n */\nfunction getPointersCenter(pointers) {\n var pageX = 0;\n var pageY = 0;\n var count = 0;\n forEach(pointers, function (_ref3) {\n var startX = _ref3.startX,\n startY = _ref3.startY;\n pageX += startX;\n pageY += startY;\n count += 1;\n });\n pageX /= count;\n pageY /= count;\n return {\n pageX: pageX,\n pageY: pageY\n };\n}\n\nvar render = {\n render: function render() {\n this.initContainer();\n this.initViewer();\n this.initList();\n this.renderViewer();\n },\n initBody: function initBody() {\n var ownerDocument = this.element.ownerDocument;\n var body = ownerDocument.body || ownerDocument.documentElement;\n this.body = body;\n this.scrollbarWidth = window.innerWidth - ownerDocument.documentElement.clientWidth;\n this.initialBodyPaddingRight = body.style.paddingRight;\n this.initialBodyComputedPaddingRight = window.getComputedStyle(body).paddingRight;\n },\n initContainer: function initContainer() {\n this.containerData = {\n width: window.innerWidth,\n height: window.innerHeight\n };\n },\n initViewer: function initViewer() {\n var options = this.options,\n parent = this.parent;\n var viewerData;\n if (options.inline) {\n viewerData = {\n width: Math.max(parent.offsetWidth, options.minWidth),\n height: Math.max(parent.offsetHeight, options.minHeight)\n };\n this.parentData = viewerData;\n }\n if (this.fulled || !viewerData) {\n viewerData = this.containerData;\n }\n this.viewerData = assign({}, viewerData);\n },\n renderViewer: function renderViewer() {\n if (this.options.inline && !this.fulled) {\n setStyle(this.viewer, this.viewerData);\n }\n },\n initList: function initList() {\n var _this = this;\n var element = this.element,\n options = this.options,\n list = this.list;\n var items = [];\n\n // initList may be called in this.update, so should keep idempotent\n list.innerHTML = '';\n forEach(this.images, function (image, index) {\n var src = image.src;\n var alt = image.alt || getImageNameFromURL(src);\n var url = _this.getImageURL(image);\n if (src || url) {\n var item = document.createElement('li');\n var img = document.createElement('img');\n forEach(options.inheritedAttributes, function (name) {\n var value = image.getAttribute(name);\n if (value !== null) {\n img.setAttribute(name, value);\n }\n });\n if (options.navbar) {\n img.src = src || url;\n }\n img.alt = alt;\n img.setAttribute('data-original-url', url || src);\n item.setAttribute('data-index', index);\n item.setAttribute('data-viewer-action', 'view');\n item.setAttribute('role', 'button');\n if (options.keyboard) {\n item.setAttribute('tabindex', 0);\n }\n item.appendChild(img);\n list.appendChild(item);\n items.push(item);\n }\n });\n this.items = items;\n forEach(items, function (item) {\n var image = item.firstElementChild;\n var onLoad;\n var onError;\n setData(image, 'filled', true);\n if (options.loading) {\n addClass(item, CLASS_LOADING);\n }\n addListener(image, EVENT_LOAD, onLoad = function onLoad(event) {\n removeListener(image, EVENT_ERROR, onError);\n if (options.loading) {\n removeClass(item, CLASS_LOADING);\n }\n _this.loadImage(event);\n }, {\n once: true\n });\n addListener(image, EVENT_ERROR, onError = function onError() {\n removeListener(image, EVENT_LOAD, onLoad);\n if (options.loading) {\n removeClass(item, CLASS_LOADING);\n }\n }, {\n once: true\n });\n });\n if (options.transition) {\n addListener(element, EVENT_VIEWED, function () {\n addClass(list, CLASS_TRANSITION);\n }, {\n once: true\n });\n }\n },\n renderList: function renderList() {\n var index = this.index;\n var item = this.items[index];\n if (!item) {\n return;\n }\n var next = item.nextElementSibling;\n var gutter = parseInt(window.getComputedStyle(next || item).marginLeft, 10);\n var offsetWidth = item.offsetWidth;\n var outerWidth = offsetWidth + gutter;\n\n // Place the active item in the center of the screen\n setStyle(this.list, assign({\n width: outerWidth * this.length - gutter\n }, getTransforms({\n translateX: (this.viewerData.width - offsetWidth) / 2 - outerWidth * index\n })));\n },\n resetList: function resetList() {\n var list = this.list;\n list.innerHTML = '';\n removeClass(list, CLASS_TRANSITION);\n setStyle(list, getTransforms({\n translateX: 0\n }));\n },\n initImage: function initImage(done) {\n var _this2 = this;\n var options = this.options,\n image = this.image,\n viewerData = this.viewerData;\n var footerHeight = this.footer.offsetHeight;\n var viewerWidth = viewerData.width;\n var viewerHeight = Math.max(viewerData.height - footerHeight, footerHeight);\n var oldImageData = this.imageData || {};\n var sizingImage;\n this.imageInitializing = {\n abort: function abort() {\n sizingImage.onload = null;\n }\n };\n sizingImage = getImageNaturalSizes(image, options, function (naturalWidth, naturalHeight) {\n var aspectRatio = naturalWidth / naturalHeight;\n var initialCoverage = Math.max(0, Math.min(1, options.initialCoverage));\n var width = viewerWidth;\n var height = viewerHeight;\n _this2.imageInitializing = false;\n if (viewerHeight * aspectRatio > viewerWidth) {\n height = viewerWidth / aspectRatio;\n } else {\n width = viewerHeight * aspectRatio;\n }\n initialCoverage = isNumber(initialCoverage) ? initialCoverage : 0.9;\n width = Math.min(width * initialCoverage, naturalWidth);\n height = Math.min(height * initialCoverage, naturalHeight);\n var left = (viewerWidth - width) / 2;\n var top = (viewerHeight - height) / 2;\n var imageData = {\n left: left,\n top: top,\n x: left,\n y: top,\n width: width,\n height: height,\n oldRatio: 1,\n ratio: width / naturalWidth,\n aspectRatio: aspectRatio,\n naturalWidth: naturalWidth,\n naturalHeight: naturalHeight\n };\n var initialImageData = assign({}, imageData);\n if (options.rotatable) {\n imageData.rotate = oldImageData.rotate || 0;\n initialImageData.rotate = 0;\n }\n if (options.scalable) {\n imageData.scaleX = oldImageData.scaleX || 1;\n imageData.scaleY = oldImageData.scaleY || 1;\n initialImageData.scaleX = 1;\n initialImageData.scaleY = 1;\n }\n _this2.imageData = imageData;\n _this2.initialImageData = initialImageData;\n if (done) {\n done();\n }\n });\n },\n renderImage: function renderImage(done) {\n var _this3 = this;\n var image = this.image,\n imageData = this.imageData;\n setStyle(image, assign({\n width: imageData.width,\n height: imageData.height,\n // XXX: Not to use translateX/Y to avoid image shaking when zooming\n marginLeft: imageData.x,\n marginTop: imageData.y\n }, getTransforms(imageData)));\n if (done) {\n if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && hasClass(image, CLASS_TRANSITION)) {\n var onTransitionEnd = function onTransitionEnd() {\n _this3.imageRendering = false;\n done();\n };\n this.imageRendering = {\n abort: function abort() {\n removeListener(image, EVENT_TRANSITION_END, onTransitionEnd);\n }\n };\n addListener(image, EVENT_TRANSITION_END, onTransitionEnd, {\n once: true\n });\n } else {\n done();\n }\n }\n },\n resetImage: function resetImage() {\n var image = this.image;\n if (image) {\n if (this.viewing) {\n this.viewing.abort();\n }\n image.parentNode.removeChild(image);\n this.image = null;\n this.title.innerHTML = '';\n }\n }\n};\n\nvar events = {\n bind: function bind() {\n var options = this.options,\n viewer = this.viewer,\n canvas = this.canvas;\n var document = this.element.ownerDocument;\n addListener(viewer, EVENT_CLICK, this.onClick = this.click.bind(this));\n addListener(viewer, EVENT_DRAG_START, this.onDragStart = this.dragstart.bind(this));\n addListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown = this.pointerdown.bind(this));\n addListener(document, EVENT_POINTER_MOVE, this.onPointerMove = this.pointermove.bind(this));\n addListener(document, EVENT_POINTER_UP, this.onPointerUp = this.pointerup.bind(this));\n addListener(document, EVENT_KEY_DOWN, this.onKeyDown = this.keydown.bind(this));\n addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));\n if (options.zoomable && options.zoomOnWheel) {\n addListener(viewer, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {\n passive: false,\n capture: true\n });\n }\n if (options.toggleOnDblclick) {\n addListener(canvas, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));\n }\n },\n unbind: function unbind() {\n var options = this.options,\n viewer = this.viewer,\n canvas = this.canvas;\n var document = this.element.ownerDocument;\n removeListener(viewer, EVENT_CLICK, this.onClick);\n removeListener(viewer, EVENT_DRAG_START, this.onDragStart);\n removeListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown);\n removeListener(document, EVENT_POINTER_MOVE, this.onPointerMove);\n removeListener(document, EVENT_POINTER_UP, this.onPointerUp);\n removeListener(document, EVENT_KEY_DOWN, this.onKeyDown);\n removeListener(window, EVENT_RESIZE, this.onResize);\n if (options.zoomable && options.zoomOnWheel) {\n removeListener(viewer, EVENT_WHEEL, this.onWheel, {\n passive: false,\n capture: true\n });\n }\n if (options.toggleOnDblclick) {\n removeListener(canvas, EVENT_DBLCLICK, this.onDblclick);\n }\n }\n};\n\nvar handlers = {\n click: function click(event) {\n var options = this.options,\n imageData = this.imageData;\n var target = event.target;\n var action = getData(target, DATA_ACTION);\n if (!action && target.localName === 'img' && target.parentElement.localName === 'li') {\n target = target.parentElement;\n action = getData(target, DATA_ACTION);\n }\n\n // Cancel the emulated click when the native click event was triggered.\n if (IS_TOUCH_DEVICE && event.isTrusted && target === this.canvas) {\n clearTimeout(this.clickCanvasTimeout);\n }\n switch (action) {\n case 'mix':\n if (this.played) {\n this.stop();\n } else if (options.inline) {\n if (this.fulled) {\n this.exit();\n } else {\n this.full();\n }\n } else {\n this.hide();\n }\n break;\n case 'hide':\n if (!this.pointerMoved) {\n this.hide();\n }\n break;\n case 'view':\n this.view(getData(target, 'index'));\n break;\n case 'zoom-in':\n this.zoom(0.1, true);\n break;\n case 'zoom-out':\n this.zoom(-0.1, true);\n break;\n case 'one-to-one':\n this.toggle();\n break;\n case 'reset':\n this.reset();\n break;\n case 'prev':\n this.prev(options.loop);\n break;\n case 'play':\n this.play(options.fullscreen);\n break;\n case 'next':\n this.next(options.loop);\n break;\n case 'rotate-left':\n this.rotate(-90);\n break;\n case 'rotate-right':\n this.rotate(90);\n break;\n case 'flip-horizontal':\n this.scaleX(-imageData.scaleX || -1);\n break;\n case 'flip-vertical':\n this.scaleY(-imageData.scaleY || -1);\n break;\n default:\n if (this.played) {\n this.stop();\n }\n }\n },\n dblclick: function dblclick(event) {\n event.preventDefault();\n if (this.viewed && event.target === this.image) {\n // Cancel the emulated double click when the native dblclick event was triggered.\n if (IS_TOUCH_DEVICE && event.isTrusted) {\n clearTimeout(this.doubleClickImageTimeout);\n }\n\n // XXX: No pageX/Y properties in custom event, fallback to the original event.\n this.toggle(event.isTrusted ? event : event.detail && event.detail.originalEvent);\n }\n },\n load: function load() {\n var _this = this;\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = false;\n }\n var element = this.element,\n options = this.options,\n image = this.image,\n index = this.index,\n viewerData = this.viewerData;\n removeClass(image, CLASS_INVISIBLE);\n if (options.loading) {\n removeClass(this.canvas, CLASS_LOADING);\n }\n image.style.cssText = 'height:0;' + \"margin-left:\".concat(viewerData.width / 2, \"px;\") + \"margin-top:\".concat(viewerData.height / 2, \"px;\") + 'max-width:none!important;' + 'position:relative;' + 'width:0;';\n this.initImage(function () {\n toggleClass(image, CLASS_MOVE, options.movable);\n toggleClass(image, CLASS_TRANSITION, options.transition);\n _this.renderImage(function () {\n _this.viewed = true;\n _this.viewing = false;\n if (isFunction(options.viewed)) {\n addListener(element, EVENT_VIEWED, options.viewed, {\n once: true\n });\n }\n dispatchEvent(element, EVENT_VIEWED, {\n originalImage: _this.images[index],\n index: index,\n image: image\n }, {\n cancelable: false\n });\n });\n });\n },\n loadImage: function loadImage(event) {\n var image = event.target;\n var parent = image.parentNode;\n var parentWidth = parent.offsetWidth || 30;\n var parentHeight = parent.offsetHeight || 50;\n var filled = !!getData(image, 'filled');\n getImageNaturalSizes(image, this.options, function (naturalWidth, naturalHeight) {\n var aspectRatio = naturalWidth / naturalHeight;\n var width = parentWidth;\n var height = parentHeight;\n if (parentHeight * aspectRatio > parentWidth) {\n if (filled) {\n width = parentHeight * aspectRatio;\n } else {\n height = parentWidth / aspectRatio;\n }\n } else if (filled) {\n height = parentWidth / aspectRatio;\n } else {\n width = parentHeight * aspectRatio;\n }\n setStyle(image, assign({\n width: width,\n height: height\n }, getTransforms({\n translateX: (parentWidth - width) / 2,\n translateY: (parentHeight - height) / 2\n })));\n });\n },\n keydown: function keydown(event) {\n var options = this.options;\n if (!options.keyboard) {\n return;\n }\n var keyCode = event.keyCode || event.which || event.charCode;\n switch (keyCode) {\n // Enter\n case 13:\n if (this.viewer.contains(event.target)) {\n this.click(event);\n }\n break;\n }\n if (!this.fulled) {\n return;\n }\n switch (keyCode) {\n // Escape\n case 27:\n if (this.played) {\n this.stop();\n } else if (options.inline) {\n if (this.fulled) {\n this.exit();\n }\n } else {\n this.hide();\n }\n break;\n\n // Space\n case 32:\n if (this.played) {\n this.stop();\n }\n break;\n\n // ArrowLeft\n case 37:\n if (this.played && this.playing) {\n this.playing.prev();\n } else {\n this.prev(options.loop);\n }\n break;\n\n // ArrowUp\n case 38:\n // Prevent scroll on Firefox\n event.preventDefault();\n\n // Zoom in\n this.zoom(options.zoomRatio, true);\n break;\n\n // ArrowRight\n case 39:\n if (this.played && this.playing) {\n this.playing.next();\n } else {\n this.next(options.loop);\n }\n break;\n\n // ArrowDown\n case 40:\n // Prevent scroll on Firefox\n event.preventDefault();\n\n // Zoom out\n this.zoom(-options.zoomRatio, true);\n break;\n\n // Ctrl + 0\n case 48:\n // Fall through\n\n // Ctrl + 1\n // eslint-disable-next-line no-fallthrough\n case 49:\n if (event.ctrlKey) {\n event.preventDefault();\n this.toggle();\n }\n break;\n }\n },\n dragstart: function dragstart(event) {\n if (event.target.localName === 'img') {\n event.preventDefault();\n }\n },\n pointerdown: function pointerdown(event) {\n var options = this.options,\n pointers = this.pointers;\n var buttons = event.buttons,\n button = event.button;\n this.pointerMoved = false;\n if (!this.viewed || this.showing || this.viewing || this.hiding\n\n // Handle mouse event and pointer event and ignore touch event\n || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && (\n // No primary button (Usually the left button)\n isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0\n\n // Open context menu\n || event.ctrlKey)) {\n return;\n }\n\n // Prevent default behaviours as page zooming in touch devices.\n event.preventDefault();\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n pointers[touch.identifier] = getPointer(touch);\n });\n } else {\n pointers[event.pointerId || 0] = getPointer(event);\n }\n var action = options.movable ? ACTION_MOVE : false;\n if (options.zoomOnTouch && options.zoomable && Object.keys(pointers).length > 1) {\n action = ACTION_ZOOM;\n } else if (options.slideOnTouch && (event.pointerType === 'touch' || event.type === 'touchstart') && this.isSwitchable()) {\n action = ACTION_SWITCH;\n }\n if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) {\n removeClass(this.image, CLASS_TRANSITION);\n }\n this.action = action;\n },\n pointermove: function pointermove(event) {\n var pointers = this.pointers,\n action = this.action;\n if (!this.viewed || !action) {\n return;\n }\n event.preventDefault();\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n assign(pointers[touch.identifier] || {}, getPointer(touch, true));\n });\n } else {\n assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));\n }\n this.change(event);\n },\n pointerup: function pointerup(event) {\n var _this2 = this;\n var options = this.options,\n action = this.action,\n pointers = this.pointers;\n var pointer;\n if (event.changedTouches) {\n forEach(event.changedTouches, function (touch) {\n pointer = pointers[touch.identifier];\n delete pointers[touch.identifier];\n });\n } else {\n pointer = pointers[event.pointerId || 0];\n delete pointers[event.pointerId || 0];\n }\n if (!action) {\n return;\n }\n event.preventDefault();\n if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) {\n addClass(this.image, CLASS_TRANSITION);\n }\n this.action = false;\n\n // Emulate click and double click in touch devices to support backdrop and image zooming (#210).\n if (IS_TOUCH_DEVICE && action !== ACTION_ZOOM && pointer && Date.now() - pointer.timeStamp < 500) {\n clearTimeout(this.clickCanvasTimeout);\n clearTimeout(this.doubleClickImageTimeout);\n if (options.toggleOnDblclick && this.viewed && event.target === this.image) {\n if (this.imageClicked) {\n this.imageClicked = false;\n\n // This timeout will be cleared later when a native dblclick event is triggering\n this.doubleClickImageTimeout = setTimeout(function () {\n dispatchEvent(_this2.image, EVENT_DBLCLICK, {\n originalEvent: event\n });\n }, 50);\n } else {\n this.imageClicked = true;\n\n // The default timing of a double click in Windows is 500 ms\n this.doubleClickImageTimeout = setTimeout(function () {\n _this2.imageClicked = false;\n }, 500);\n }\n } else {\n this.imageClicked = false;\n if (options.backdrop && options.backdrop !== 'static' && event.target === this.canvas) {\n // This timeout will be cleared later when a native click event is triggering\n this.clickCanvasTimeout = setTimeout(function () {\n dispatchEvent(_this2.canvas, EVENT_CLICK, {\n originalEvent: event\n });\n }, 50);\n }\n }\n }\n },\n resize: function resize() {\n var _this3 = this;\n if (!this.isShown || this.hiding) {\n return;\n }\n if (this.fulled) {\n this.close();\n this.initBody();\n this.open();\n }\n this.initContainer();\n this.initViewer();\n this.renderViewer();\n this.renderList();\n if (this.viewed) {\n this.initImage(function () {\n _this3.renderImage();\n });\n }\n if (this.played) {\n if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {\n this.stop();\n return;\n }\n forEach(this.player.getElementsByTagName('img'), function (image) {\n addListener(image, EVENT_LOAD, _this3.loadImage.bind(_this3), {\n once: true\n });\n dispatchEvent(image, EVENT_LOAD);\n });\n }\n },\n wheel: function wheel(event) {\n var _this4 = this;\n if (!this.viewed) {\n return;\n }\n event.preventDefault();\n\n // Limit wheel speed to prevent zoom too fast\n if (this.wheeling) {\n return;\n }\n this.wheeling = true;\n setTimeout(function () {\n _this4.wheeling = false;\n }, 50);\n var ratio = Number(this.options.zoomRatio) || 0.1;\n var delta = 1;\n if (event.deltaY) {\n delta = event.deltaY > 0 ? 1 : -1;\n } else if (event.wheelDelta) {\n delta = -event.wheelDelta / 120;\n } else if (event.detail) {\n delta = event.detail > 0 ? 1 : -1;\n }\n this.zoom(-delta * ratio, true, null, event);\n }\n};\n\nvar methods = {\n /** Show the viewer (only available in modal mode)\n * @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.\n * @returns {Viewer} this\n */\n show: function show() {\n var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var element = this.element,\n options = this.options;\n if (options.inline || this.showing || this.isShown || this.showing) {\n return this;\n }\n if (!this.ready) {\n this.build();\n if (this.ready) {\n this.show(immediate);\n }\n return this;\n }\n if (isFunction(options.show)) {\n addListener(element, EVENT_SHOW, options.show, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_SHOW) === false || !this.ready) {\n return this;\n }\n if (this.hiding) {\n this.transitioning.abort();\n }\n this.showing = true;\n this.open();\n var viewer = this.viewer;\n removeClass(viewer, CLASS_HIDE);\n viewer.setAttribute('role', 'dialog');\n viewer.setAttribute('aria-labelledby', this.title.id);\n viewer.setAttribute('aria-modal', true);\n viewer.removeAttribute('aria-hidden');\n if (options.transition && !immediate) {\n var shown = this.shown.bind(this);\n this.transitioning = {\n abort: function abort() {\n removeListener(viewer, EVENT_TRANSITION_END, shown);\n removeClass(viewer, CLASS_IN);\n }\n };\n addClass(viewer, CLASS_TRANSITION);\n\n // Force reflow to enable CSS3 transition\n viewer.initialOffsetWidth = viewer.offsetWidth;\n addListener(viewer, EVENT_TRANSITION_END, shown, {\n once: true\n });\n addClass(viewer, CLASS_IN);\n } else {\n addClass(viewer, CLASS_IN);\n this.shown();\n }\n return this;\n },\n /**\n * Hide the viewer (only available in modal mode)\n * @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.\n * @returns {Viewer} this\n */\n hide: function hide() {\n var _this = this;\n var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var element = this.element,\n options = this.options;\n if (options.inline || this.hiding || !(this.isShown || this.showing)) {\n return this;\n }\n if (isFunction(options.hide)) {\n addListener(element, EVENT_HIDE, options.hide, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_HIDE) === false) {\n return this;\n }\n if (this.showing) {\n this.transitioning.abort();\n }\n this.hiding = true;\n if (this.played) {\n this.stop();\n } else if (this.viewing) {\n this.viewing.abort();\n }\n var viewer = this.viewer,\n image = this.image;\n var hideImmediately = function hideImmediately() {\n removeClass(viewer, CLASS_IN);\n _this.hidden();\n };\n if (options.transition && !immediate) {\n var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {\n // Ignore all propagating `transitionend` events (#275).\n if (event && event.target === viewer) {\n removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);\n _this.hidden();\n }\n };\n var onImageTransitionEnd = function onImageTransitionEnd() {\n // In case of show the viewer by `viewer.show(true)` previously (#407).\n if (hasClass(viewer, CLASS_TRANSITION)) {\n addListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);\n removeClass(viewer, CLASS_IN);\n } else {\n hideImmediately();\n }\n };\n this.transitioning = {\n abort: function abort() {\n if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {\n removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);\n } else if (hasClass(viewer, CLASS_TRANSITION)) {\n removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);\n }\n }\n };\n\n // In case of hiding the viewer when holding on the image (#255),\n // note that the `CLASS_TRANSITION` class will be removed on pointer down.\n if (this.viewed && hasClass(image, CLASS_TRANSITION)) {\n addListener(image, EVENT_TRANSITION_END, onImageTransitionEnd, {\n once: true\n });\n this.zoomTo(0, false, null, null, true);\n } else {\n onImageTransitionEnd();\n }\n } else {\n hideImmediately();\n }\n return this;\n },\n /**\n * View one of the images with image's index\n * @param {number} index - The index of the image to view.\n * @returns {Viewer} this\n */\n view: function view() {\n var _this2 = this;\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.initialViewIndex;\n index = Number(index) || 0;\n if (this.hiding || this.played || index < 0 || index >= this.length || this.viewed && index === this.index) {\n return this;\n }\n if (!this.isShown) {\n this.index = index;\n return this.show();\n }\n if (this.viewing) {\n this.viewing.abort();\n }\n var element = this.element,\n options = this.options,\n title = this.title,\n canvas = this.canvas;\n var item = this.items[index];\n var img = item.querySelector('img');\n var url = getData(img, 'originalUrl');\n var alt = img.getAttribute('alt');\n var image = document.createElement('img');\n forEach(options.inheritedAttributes, function (name) {\n var value = img.getAttribute(name);\n if (value !== null) {\n image.setAttribute(name, value);\n }\n });\n image.src = url;\n image.alt = alt;\n if (isFunction(options.view)) {\n addListener(element, EVENT_VIEW, options.view, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_VIEW, {\n originalImage: this.images[index],\n index: index,\n image: image\n }) === false || !this.isShown || this.hiding || this.played) {\n return this;\n }\n var activeItem = this.items[this.index];\n if (activeItem) {\n removeClass(activeItem, CLASS_ACTIVE);\n activeItem.removeAttribute('aria-selected');\n }\n addClass(item, CLASS_ACTIVE);\n item.setAttribute('aria-selected', true);\n if (options.focus) {\n item.focus();\n }\n this.image = image;\n this.viewed = false;\n this.index = index;\n this.imageData = {};\n addClass(image, CLASS_INVISIBLE);\n if (options.loading) {\n addClass(canvas, CLASS_LOADING);\n }\n canvas.innerHTML = '';\n canvas.appendChild(image);\n\n // Center current item\n this.renderList();\n\n // Clear title\n title.innerHTML = '';\n\n // Generate title after viewed\n var onViewed = function onViewed() {\n var imageData = _this2.imageData;\n var render = Array.isArray(options.title) ? options.title[1] : options.title;\n title.innerHTML = escapeHTMLEntities(isFunction(render) ? render.call(_this2, image, imageData) : \"\".concat(alt, \" (\").concat(imageData.naturalWidth, \" \\xD7 \").concat(imageData.naturalHeight, \")\"));\n };\n var onLoad;\n var onError;\n addListener(element, EVENT_VIEWED, onViewed, {\n once: true\n });\n this.viewing = {\n abort: function abort() {\n removeListener(element, EVENT_VIEWED, onViewed);\n if (image.complete) {\n if (_this2.imageRendering) {\n _this2.imageRendering.abort();\n } else if (_this2.imageInitializing) {\n _this2.imageInitializing.abort();\n }\n } else {\n // Cancel download to save bandwidth.\n image.src = '';\n removeListener(image, EVENT_LOAD, onLoad);\n if (_this2.timeout) {\n clearTimeout(_this2.timeout);\n }\n }\n }\n };\n if (image.complete) {\n this.load();\n } else {\n addListener(image, EVENT_LOAD, onLoad = function onLoad() {\n removeListener(image, EVENT_ERROR, onError);\n _this2.load();\n }, {\n once: true\n });\n addListener(image, EVENT_ERROR, onError = function onError() {\n removeListener(image, EVENT_LOAD, onLoad);\n if (_this2.timeout) {\n clearTimeout(_this2.timeout);\n _this2.timeout = false;\n }\n removeClass(image, CLASS_INVISIBLE);\n if (options.loading) {\n removeClass(_this2.canvas, CLASS_LOADING);\n }\n }, {\n once: true\n });\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n\n // Make the image visible if it fails to load within 1s\n this.timeout = setTimeout(function () {\n removeClass(image, CLASS_INVISIBLE);\n _this2.timeout = false;\n }, 1000);\n }\n return this;\n },\n /**\n * View the previous image\n * @param {boolean} [loop=false] - Indicate if view the last one\n * when it is the first one at present.\n * @returns {Viewer} this\n */\n prev: function prev() {\n var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var index = this.index - 1;\n if (index < 0) {\n index = loop ? this.length - 1 : 0;\n }\n this.view(index);\n return this;\n },\n /**\n * View the next image\n * @param {boolean} [loop=false] - Indicate if view the first one\n * when it is the last one at present.\n * @returns {Viewer} this\n */\n next: function next() {\n var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var maxIndex = this.length - 1;\n var index = this.index + 1;\n if (index > maxIndex) {\n index = loop ? 0 : maxIndex;\n }\n this.view(index);\n return this;\n },\n /**\n * Move the image with relative offsets.\n * @param {number} x - The moving distance in the horizontal direction.\n * @param {number} [y=x] The moving distance in the vertical direction.\n * @returns {Viewer} this\n */\n move: function move(x) {\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;\n var imageData = this.imageData;\n this.moveTo(isUndefined(x) ? x : imageData.x + Number(x), isUndefined(y) ? y : imageData.y + Number(y));\n return this;\n },\n /**\n * Move the image to an absolute point.\n * @param {number} x - The new position in the horizontal direction.\n * @param {number} [y=x] - The new position in the vertical direction.\n * @param {Event} [_originalEvent=null] - The original event if any.\n * @returns {Viewer} this\n */\n moveTo: function moveTo(x) {\n var _this3 = this;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;\n var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var element = this.element,\n options = this.options,\n imageData = this.imageData;\n x = Number(x);\n y = Number(y);\n if (this.viewed && !this.played && options.movable) {\n var oldX = imageData.x;\n var oldY = imageData.y;\n var changed = false;\n if (isNumber(x)) {\n changed = true;\n } else {\n x = oldX;\n }\n if (isNumber(y)) {\n changed = true;\n } else {\n y = oldY;\n }\n if (changed) {\n if (isFunction(options.move)) {\n addListener(element, EVENT_MOVE, options.move, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_MOVE, {\n x: x,\n y: y,\n oldX: oldX,\n oldY: oldY,\n originalEvent: _originalEvent\n }) === false) {\n return this;\n }\n imageData.x = x;\n imageData.y = y;\n imageData.left = x;\n imageData.top = y;\n this.moving = true;\n this.renderImage(function () {\n _this3.moving = false;\n if (isFunction(options.moved)) {\n addListener(element, EVENT_MOVED, options.moved, {\n once: true\n });\n }\n dispatchEvent(element, EVENT_MOVED, {\n x: x,\n y: y,\n oldX: oldX,\n oldY: oldY,\n originalEvent: _originalEvent\n }, {\n cancelable: false\n });\n });\n }\n }\n return this;\n },\n /**\n * Rotate the image with a relative degree.\n * @param {number} degree - The rotate degree.\n * @returns {Viewer} this\n */\n rotate: function rotate(degree) {\n this.rotateTo((this.imageData.rotate || 0) + Number(degree));\n return this;\n },\n /**\n * Rotate the image to an absolute degree.\n * @param {number} degree - The rotate degree.\n * @returns {Viewer} this\n */\n rotateTo: function rotateTo(degree) {\n var _this4 = this;\n var element = this.element,\n options = this.options,\n imageData = this.imageData;\n degree = Number(degree);\n if (isNumber(degree) && this.viewed && !this.played && options.rotatable) {\n var oldDegree = imageData.rotate;\n if (isFunction(options.rotate)) {\n addListener(element, EVENT_ROTATE, options.rotate, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_ROTATE, {\n degree: degree,\n oldDegree: oldDegree\n }) === false) {\n return this;\n }\n imageData.rotate = degree;\n this.rotating = true;\n this.renderImage(function () {\n _this4.rotating = false;\n if (isFunction(options.rotated)) {\n addListener(element, EVENT_ROTATED, options.rotated, {\n once: true\n });\n }\n dispatchEvent(element, EVENT_ROTATED, {\n degree: degree,\n oldDegree: oldDegree\n }, {\n cancelable: false\n });\n });\n }\n return this;\n },\n /**\n * Scale the image on the x-axis.\n * @param {number} scaleX - The scale ratio on the x-axis.\n * @returns {Viewer} this\n */\n scaleX: function scaleX(_scaleX) {\n this.scale(_scaleX, this.imageData.scaleY);\n return this;\n },\n /**\n * Scale the image on the y-axis.\n * @param {number} scaleY - The scale ratio on the y-axis.\n * @returns {Viewer} this\n */\n scaleY: function scaleY(_scaleY) {\n this.scale(this.imageData.scaleX, _scaleY);\n return this;\n },\n /**\n * Scale the image.\n * @param {number} scaleX - The scale ratio on the x-axis.\n * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.\n * @returns {Viewer} this\n */\n scale: function scale(scaleX) {\n var _this5 = this;\n var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;\n var element = this.element,\n options = this.options,\n imageData = this.imageData;\n scaleX = Number(scaleX);\n scaleY = Number(scaleY);\n if (this.viewed && !this.played && options.scalable) {\n var oldScaleX = imageData.scaleX;\n var oldScaleY = imageData.scaleY;\n var changed = false;\n if (isNumber(scaleX)) {\n changed = true;\n } else {\n scaleX = oldScaleX;\n }\n if (isNumber(scaleY)) {\n changed = true;\n } else {\n scaleY = oldScaleY;\n }\n if (changed) {\n if (isFunction(options.scale)) {\n addListener(element, EVENT_SCALE, options.scale, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_SCALE, {\n scaleX: scaleX,\n scaleY: scaleY,\n oldScaleX: oldScaleX,\n oldScaleY: oldScaleY\n }) === false) {\n return this;\n }\n imageData.scaleX = scaleX;\n imageData.scaleY = scaleY;\n this.scaling = true;\n this.renderImage(function () {\n _this5.scaling = false;\n if (isFunction(options.scaled)) {\n addListener(element, EVENT_SCALED, options.scaled, {\n once: true\n });\n }\n dispatchEvent(element, EVENT_SCALED, {\n scaleX: scaleX,\n scaleY: scaleY,\n oldScaleX: oldScaleX,\n oldScaleY: oldScaleY\n }, {\n cancelable: false\n });\n });\n }\n }\n return this;\n },\n /**\n * Zoom the image with a relative ratio.\n * @param {number} ratio - The target ratio.\n * @param {boolean} [showTooltip=false] - Indicates whether to show the tooltip.\n * @param {Object} [pivot] - The pivot point coordinate for zooming.\n * @param {Event} [_originalEvent=null] - The original event if any.\n * @returns {Viewer} this\n */\n zoom: function zoom(ratio) {\n var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var _originalEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var imageData = this.imageData;\n ratio = Number(ratio);\n if (ratio < 0) {\n ratio = 1 / (1 - ratio);\n } else {\n ratio = 1 + ratio;\n }\n this.zoomTo(imageData.width * ratio / imageData.naturalWidth, showTooltip, pivot, _originalEvent);\n return this;\n },\n /**\n * Zoom the image to an absolute ratio.\n * @param {number} ratio - The target ratio.\n * @param {boolean} [showTooltip] - Indicates whether to show the tooltip.\n * @param {Object} [pivot] - The pivot point coordinate for zooming.\n * @param {Event} [_originalEvent=null] - The original event if any.\n * @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.\n * @returns {Viewer} this\n */\n zoomTo: function zoomTo(ratio) {\n var _this6 = this;\n var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var _originalEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var _zoomable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n var element = this.element,\n options = this.options,\n pointers = this.pointers,\n imageData = this.imageData;\n var x = imageData.x,\n y = imageData.y,\n width = imageData.width,\n height = imageData.height,\n naturalWidth = imageData.naturalWidth,\n naturalHeight = imageData.naturalHeight;\n ratio = Math.max(0, ratio);\n if (isNumber(ratio) && this.viewed && !this.played && (_zoomable || options.zoomable)) {\n if (!_zoomable) {\n var minZoomRatio = Math.max(0.01, options.minZoomRatio);\n var maxZoomRatio = Math.min(100, options.maxZoomRatio);\n ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio);\n }\n if (_originalEvent) {\n switch (_originalEvent.type) {\n case 'wheel':\n if (options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {\n ratio = 1;\n }\n break;\n case 'pointermove':\n case 'touchmove':\n case 'mousemove':\n if (ratio > 0.99 && ratio < 1.01) {\n ratio = 1;\n }\n break;\n }\n }\n var newWidth = naturalWidth * ratio;\n var newHeight = naturalHeight * ratio;\n var offsetWidth = newWidth - width;\n var offsetHeight = newHeight - height;\n var oldRatio = imageData.ratio;\n if (isFunction(options.zoom)) {\n addListener(element, EVENT_ZOOM, options.zoom, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_ZOOM, {\n ratio: ratio,\n oldRatio: oldRatio,\n originalEvent: _originalEvent\n }) === false) {\n return this;\n }\n this.zooming = true;\n if (_originalEvent) {\n var offset = getOffset(this.viewer);\n var center = pointers && Object.keys(pointers).length > 0 ? getPointersCenter(pointers) : {\n pageX: _originalEvent.pageX,\n pageY: _originalEvent.pageY\n };\n\n // Zoom from the triggering point of the event\n imageData.x -= offsetWidth * ((center.pageX - offset.left - x) / width);\n imageData.y -= offsetHeight * ((center.pageY - offset.top - y) / height);\n } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {\n imageData.x -= offsetWidth * ((pivot.x - x) / width);\n imageData.y -= offsetHeight * ((pivot.y - y) / height);\n } else {\n // Zoom from the center of the image\n imageData.x -= offsetWidth / 2;\n imageData.y -= offsetHeight / 2;\n }\n imageData.left = imageData.x;\n imageData.top = imageData.y;\n imageData.width = newWidth;\n imageData.height = newHeight;\n imageData.oldRatio = oldRatio;\n imageData.ratio = ratio;\n this.renderImage(function () {\n _this6.zooming = false;\n if (isFunction(options.zoomed)) {\n addListener(element, EVENT_ZOOMED, options.zoomed, {\n once: true\n });\n }\n dispatchEvent(element, EVENT_ZOOMED, {\n ratio: ratio,\n oldRatio: oldRatio,\n originalEvent: _originalEvent\n }, {\n cancelable: false\n });\n });\n if (showTooltip) {\n this.tooltip();\n }\n }\n return this;\n },\n /**\n * Play the images\n * @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.\n * @returns {Viewer} this\n */\n play: function play() {\n var _this7 = this;\n var fullscreen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (!this.isShown || this.played) {\n return this;\n }\n var element = this.element,\n options = this.options;\n if (isFunction(options.play)) {\n addListener(element, EVENT_PLAY, options.play, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_PLAY) === false) {\n return this;\n }\n var player = this.player;\n var onLoad = this.loadImage.bind(this);\n var list = [];\n var total = 0;\n var index = 0;\n this.played = true;\n this.onLoadWhenPlay = onLoad;\n if (fullscreen) {\n this.requestFullscreen(fullscreen);\n }\n addClass(player, CLASS_SHOW);\n forEach(this.items, function (item, i) {\n var img = item.querySelector('img');\n var image = document.createElement('img');\n image.src = getData(img, 'originalUrl');\n image.alt = img.getAttribute('alt');\n image.referrerPolicy = img.referrerPolicy;\n total += 1;\n addClass(image, CLASS_FADE);\n toggleClass(image, CLASS_TRANSITION, options.transition);\n if (hasClass(item, CLASS_ACTIVE)) {\n addClass(image, CLASS_IN);\n index = i;\n }\n list.push(image);\n addListener(image, EVENT_LOAD, onLoad, {\n once: true\n });\n player.appendChild(image);\n });\n if (isNumber(options.interval) && options.interval > 0) {\n var _prev = function prev() {\n clearTimeout(_this7.playing.timeout);\n removeClass(list[index], CLASS_IN);\n index -= 1;\n index = index >= 0 ? index : total - 1;\n addClass(list[index], CLASS_IN);\n _this7.playing.timeout = setTimeout(_prev, options.interval);\n };\n var _next = function next() {\n clearTimeout(_this7.playing.timeout);\n removeClass(list[index], CLASS_IN);\n index += 1;\n index = index < total ? index : 0;\n addClass(list[index], CLASS_IN);\n _this7.playing.timeout = setTimeout(_next, options.interval);\n };\n if (total > 1) {\n this.playing = {\n prev: _prev,\n next: _next,\n timeout: setTimeout(_next, options.interval)\n };\n }\n }\n return this;\n },\n // Stop play\n stop: function stop() {\n var _this8 = this;\n if (!this.played) {\n return this;\n }\n var element = this.element,\n options = this.options;\n if (isFunction(options.stop)) {\n addListener(element, EVENT_STOP, options.stop, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_STOP) === false) {\n return this;\n }\n var player = this.player;\n clearTimeout(this.playing.timeout);\n this.playing = false;\n this.played = false;\n forEach(player.getElementsByTagName('img'), function (image) {\n removeListener(image, EVENT_LOAD, _this8.onLoadWhenPlay);\n });\n removeClass(player, CLASS_SHOW);\n player.innerHTML = '';\n this.exitFullscreen();\n return this;\n },\n // Enter modal mode (only available in inline mode)\n full: function full() {\n var _this9 = this;\n var options = this.options,\n viewer = this.viewer,\n image = this.image,\n list = this.list;\n if (!this.isShown || this.played || this.fulled || !options.inline) {\n return this;\n }\n this.fulled = true;\n this.open();\n addClass(this.button, CLASS_FULLSCREEN_EXIT);\n if (options.transition) {\n removeClass(list, CLASS_TRANSITION);\n if (this.viewed) {\n removeClass(image, CLASS_TRANSITION);\n }\n }\n addClass(viewer, CLASS_FIXED);\n viewer.setAttribute('role', 'dialog');\n viewer.setAttribute('aria-labelledby', this.title.id);\n viewer.setAttribute('aria-modal', true);\n viewer.removeAttribute('style');\n setStyle(viewer, {\n zIndex: options.zIndex\n });\n if (options.focus) {\n this.enforceFocus();\n }\n this.initContainer();\n this.viewerData = assign({}, this.containerData);\n this.renderList();\n if (this.viewed) {\n this.initImage(function () {\n _this9.renderImage(function () {\n if (options.transition) {\n setTimeout(function () {\n addClass(image, CLASS_TRANSITION);\n addClass(list, CLASS_TRANSITION);\n }, 0);\n }\n });\n });\n }\n return this;\n },\n // Exit modal mode (only available in inline mode)\n exit: function exit() {\n var _this10 = this;\n var options = this.options,\n viewer = this.viewer,\n image = this.image,\n list = this.list;\n if (!this.isShown || this.played || !this.fulled || !options.inline) {\n return this;\n }\n this.fulled = false;\n this.close();\n removeClass(this.button, CLASS_FULLSCREEN_EXIT);\n if (options.transition) {\n removeClass(list, CLASS_TRANSITION);\n if (this.viewed) {\n removeClass(image, CLASS_TRANSITION);\n }\n }\n if (options.focus) {\n this.clearEnforceFocus();\n }\n viewer.removeAttribute('role');\n viewer.removeAttribute('aria-labelledby');\n viewer.removeAttribute('aria-modal');\n removeClass(viewer, CLASS_FIXED);\n setStyle(viewer, {\n zIndex: options.zIndexInline\n });\n this.viewerData = assign({}, this.parentData);\n this.renderViewer();\n this.renderList();\n if (this.viewed) {\n this.initImage(function () {\n _this10.renderImage(function () {\n if (options.transition) {\n setTimeout(function () {\n addClass(image, CLASS_TRANSITION);\n addClass(list, CLASS_TRANSITION);\n }, 0);\n }\n });\n });\n }\n return this;\n },\n // Show the current ratio of the image with percentage\n tooltip: function tooltip() {\n var _this11 = this;\n var options = this.options,\n tooltipBox = this.tooltipBox,\n imageData = this.imageData;\n if (!this.viewed || this.played || !options.tooltip) {\n return this;\n }\n tooltipBox.textContent = \"\".concat(Math.round(imageData.ratio * 100), \"%\");\n if (!this.tooltipping) {\n if (options.transition) {\n if (this.fading) {\n dispatchEvent(tooltipBox, EVENT_TRANSITION_END);\n }\n addClass(tooltipBox, CLASS_SHOW);\n addClass(tooltipBox, CLASS_FADE);\n addClass(tooltipBox, CLASS_TRANSITION);\n tooltipBox.removeAttribute('aria-hidden');\n\n // Force reflow to enable CSS3 transition\n tooltipBox.initialOffsetWidth = tooltipBox.offsetWidth;\n addClass(tooltipBox, CLASS_IN);\n } else {\n addClass(tooltipBox, CLASS_SHOW);\n tooltipBox.removeAttribute('aria-hidden');\n }\n } else {\n clearTimeout(this.tooltipping);\n }\n this.tooltipping = setTimeout(function () {\n if (options.transition) {\n addListener(tooltipBox, EVENT_TRANSITION_END, function () {\n removeClass(tooltipBox, CLASS_SHOW);\n removeClass(tooltipBox, CLASS_FADE);\n removeClass(tooltipBox, CLASS_TRANSITION);\n tooltipBox.setAttribute('aria-hidden', true);\n _this11.fading = false;\n }, {\n once: true\n });\n removeClass(tooltipBox, CLASS_IN);\n _this11.fading = true;\n } else {\n removeClass(tooltipBox, CLASS_SHOW);\n tooltipBox.setAttribute('aria-hidden', true);\n }\n _this11.tooltipping = false;\n }, 1000);\n return this;\n },\n /**\n * Toggle the image size between its current size and natural size\n * @param {Event} [_originalEvent=null] - The original event if any.\n * @returns {Viewer} this\n */\n toggle: function toggle() {\n var _originalEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n if (this.imageData.ratio === 1) {\n this.zoomTo(this.imageData.oldRatio, true, null, _originalEvent);\n } else {\n this.zoomTo(1, true, null, _originalEvent);\n }\n return this;\n },\n // Reset the image to its initial state\n reset: function reset() {\n if (this.viewed && !this.played) {\n this.imageData = assign({}, this.initialImageData);\n this.renderImage();\n }\n return this;\n },\n // Update viewer when images changed\n update: function update() {\n var _this12 = this;\n var element = this.element,\n options = this.options,\n isImg = this.isImg;\n\n // Destroy viewer if the target image was deleted\n if (isImg && !element.parentNode) {\n return this.destroy();\n }\n var images = [];\n forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {\n if (isFunction(options.filter)) {\n if (options.filter.call(_this12, image)) {\n images.push(image);\n }\n } else if (_this12.getImageURL(image)) {\n images.push(image);\n }\n });\n if (!images.length) {\n return this;\n }\n this.images = images;\n this.length = images.length;\n if (this.ready) {\n var changedIndexes = [];\n forEach(this.items, function (item, i) {\n var img = item.querySelector('img');\n var image = images[i];\n if (image && img) {\n if (image.src !== img.src\n\n // Title changed (#408)\n || image.alt !== img.alt) {\n changedIndexes.push(i);\n }\n } else {\n changedIndexes.push(i);\n }\n });\n setStyle(this.list, {\n width: 'auto'\n });\n this.initList();\n if (this.isShown) {\n if (this.length) {\n if (this.viewed) {\n var changedIndex = changedIndexes.indexOf(this.index);\n if (changedIndex >= 0) {\n this.viewed = false;\n this.view(Math.max(Math.min(this.index - changedIndex, this.length - 1), 0));\n } else {\n var activeItem = this.items[this.index];\n\n // Reactivate the current viewing item after reset the list.\n addClass(activeItem, CLASS_ACTIVE);\n activeItem.setAttribute('aria-selected', true);\n }\n }\n } else {\n this.image = null;\n this.viewed = false;\n this.index = 0;\n this.imageData = {};\n this.canvas.innerHTML = '';\n this.title.innerHTML = '';\n }\n }\n } else {\n this.build();\n }\n return this;\n },\n // Destroy the viewer\n destroy: function destroy() {\n var element = this.element,\n options = this.options;\n if (!element[NAMESPACE]) {\n return this;\n }\n this.destroyed = true;\n if (this.ready) {\n if (this.played) {\n this.stop();\n }\n if (options.inline) {\n if (this.fulled) {\n this.exit();\n }\n this.unbind();\n } else if (this.isShown) {\n if (this.viewing) {\n if (this.imageRendering) {\n this.imageRendering.abort();\n } else if (this.imageInitializing) {\n this.imageInitializing.abort();\n }\n }\n if (this.hiding) {\n this.transitioning.abort();\n }\n this.hidden();\n } else if (this.showing) {\n this.transitioning.abort();\n this.hidden();\n }\n this.ready = false;\n this.viewer.parentNode.removeChild(this.viewer);\n } else if (options.inline) {\n if (this.delaying) {\n this.delaying.abort();\n } else if (this.initializing) {\n this.initializing.abort();\n }\n }\n if (!options.inline) {\n removeListener(element, EVENT_CLICK, this.onStart);\n }\n element[NAMESPACE] = undefined;\n return this;\n }\n};\n\nvar others = {\n getImageURL: function getImageURL(image) {\n var url = this.options.url;\n if (isString(url)) {\n url = image.getAttribute(url);\n } else if (isFunction(url)) {\n url = url.call(this, image);\n } else {\n url = '';\n }\n return url;\n },\n enforceFocus: function enforceFocus() {\n var _this = this;\n this.clearEnforceFocus();\n addListener(document, EVENT_FOCUSIN, this.onFocusin = function (event) {\n var viewer = _this.viewer;\n var target = event.target;\n if (target === document || target === viewer || viewer.contains(target)) {\n return;\n }\n while (target) {\n // Avoid conflicts with other modals (#474, #540)\n if (target.getAttribute('tabindex') !== null || target.getAttribute('aria-modal') === 'true') {\n return;\n }\n target = target.parentElement;\n }\n viewer.focus();\n });\n },\n clearEnforceFocus: function clearEnforceFocus() {\n if (this.onFocusin) {\n removeListener(document, EVENT_FOCUSIN, this.onFocusin);\n this.onFocusin = null;\n }\n },\n open: function open() {\n var body = this.body;\n addClass(body, CLASS_OPEN);\n if (this.scrollbarWidth > 0) {\n body.style.paddingRight = \"\".concat(this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0), \"px\");\n }\n },\n close: function close() {\n var body = this.body;\n removeClass(body, CLASS_OPEN);\n if (this.scrollbarWidth > 0) {\n body.style.paddingRight = this.initialBodyPaddingRight;\n }\n },\n shown: function shown() {\n var element = this.element,\n options = this.options,\n viewer = this.viewer;\n this.fulled = true;\n this.isShown = true;\n this.render();\n this.bind();\n this.showing = false;\n if (options.focus) {\n viewer.focus();\n this.enforceFocus();\n }\n if (isFunction(options.shown)) {\n addListener(element, EVENT_SHOWN, options.shown, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_SHOWN) === false) {\n return;\n }\n if (this.ready && this.isShown && !this.hiding) {\n this.view(this.index);\n }\n },\n hidden: function hidden() {\n var element = this.element,\n options = this.options,\n viewer = this.viewer;\n if (options.fucus) {\n this.clearEnforceFocus();\n }\n this.close();\n this.unbind();\n addClass(viewer, CLASS_HIDE);\n viewer.removeAttribute('role');\n viewer.removeAttribute('aria-labelledby');\n viewer.removeAttribute('aria-modal');\n viewer.setAttribute('aria-hidden', true);\n this.resetList();\n this.resetImage();\n this.fulled = false;\n this.viewed = false;\n this.isShown = false;\n this.hiding = false;\n if (!this.destroyed) {\n if (isFunction(options.hidden)) {\n addListener(element, EVENT_HIDDEN, options.hidden, {\n once: true\n });\n }\n dispatchEvent(element, EVENT_HIDDEN, null, {\n cancelable: false\n });\n }\n },\n requestFullscreen: function requestFullscreen(options) {\n var document = this.element.ownerDocument;\n if (this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {\n var documentElement = document.documentElement;\n\n // Element.requestFullscreen()\n if (documentElement.requestFullscreen) {\n // Avoid TypeError when convert `options` to dictionary\n if (isPlainObject(options)) {\n documentElement.requestFullscreen(options);\n } else {\n documentElement.requestFullscreen();\n }\n } else if (documentElement.webkitRequestFullscreen) {\n documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\n } else if (documentElement.mozRequestFullScreen) {\n documentElement.mozRequestFullScreen();\n } else if (documentElement.msRequestFullscreen) {\n documentElement.msRequestFullscreen();\n }\n }\n },\n exitFullscreen: function exitFullscreen() {\n var document = this.element.ownerDocument;\n if (this.fulled && (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {\n // Document.exitFullscreen()\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n }\n }\n },\n change: function change(event) {\n var options = this.options,\n pointers = this.pointers;\n var pointer = pointers[Object.keys(pointers)[0]];\n\n // In the case of the `pointers` object is empty (#421)\n if (!pointer) {\n return;\n }\n var offsetX = pointer.endX - pointer.startX;\n var offsetY = pointer.endY - pointer.startY;\n switch (this.action) {\n // Move the current image\n case ACTION_MOVE:\n if (offsetX !== 0 || offsetY !== 0) {\n this.pointerMoved = true;\n this.move(offsetX, offsetY, event);\n }\n break;\n\n // Zoom the current image\n case ACTION_ZOOM:\n this.zoom(getMaxZoomRatio(pointers), false, null, event);\n break;\n case ACTION_SWITCH:\n {\n this.action = 'switched';\n var absoluteOffsetX = Math.abs(offsetX);\n if (absoluteOffsetX > 1 && absoluteOffsetX > Math.abs(offsetY)) {\n // Empty `pointers` as `touchend` event will not be fired after swiped in iOS browsers.\n this.pointers = {};\n if (offsetX > 1) {\n this.prev(options.loop);\n } else if (offsetX < -1) {\n this.next(options.loop);\n }\n }\n break;\n }\n }\n\n // Override\n forEach(pointers, function (p) {\n p.startX = p.endX;\n p.startY = p.endY;\n });\n },\n isSwitchable: function isSwitchable() {\n var imageData = this.imageData,\n viewerData = this.viewerData;\n return this.length > 1 && imageData.x >= 0 && imageData.y >= 0 && imageData.width <= viewerData.width && imageData.height <= viewerData.height;\n }\n};\n\nvar AnotherViewer = WINDOW.Viewer;\nvar getUniqueID = function (id) {\n return function () {\n id += 1;\n return id;\n };\n}(-1);\nvar Viewer = /*#__PURE__*/function () {\n /**\n * Create a new Viewer.\n * @param {Element} element - The target element for viewing.\n * @param {Object} [options={}] - The configuration options.\n */\n function Viewer(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Viewer);\n if (!element || element.nodeType !== 1) {\n throw new Error('The first argument is required and must be an element.');\n }\n this.element = element;\n this.options = assign({}, DEFAULTS, isPlainObject(options) && options);\n this.action = false;\n this.fading = false;\n this.fulled = false;\n this.hiding = false;\n this.imageClicked = false;\n this.imageData = {};\n this.index = this.options.initialViewIndex;\n this.isImg = false;\n this.isShown = false;\n this.length = 0;\n this.moving = false;\n this.played = false;\n this.playing = false;\n this.pointers = {};\n this.ready = false;\n this.rotating = false;\n this.scaling = false;\n this.showing = false;\n this.timeout = false;\n this.tooltipping = false;\n this.viewed = false;\n this.viewing = false;\n this.wheeling = false;\n this.zooming = false;\n this.pointerMoved = false;\n this.id = getUniqueID();\n this.init();\n }\n return _createClass(Viewer, [{\n key: \"init\",\n value: function init() {\n var _this = this;\n var element = this.element,\n options = this.options;\n if (element[NAMESPACE]) {\n return;\n }\n element[NAMESPACE] = this;\n\n // The `focus` option requires the `keyboard` option set to `true`.\n if (options.focus && !options.keyboard) {\n options.focus = false;\n }\n var isImg = element.localName === 'img';\n var images = [];\n forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {\n if (isFunction(options.filter)) {\n if (options.filter.call(_this, image)) {\n images.push(image);\n }\n } else if (_this.getImageURL(image)) {\n images.push(image);\n }\n });\n this.isImg = isImg;\n this.length = images.length;\n this.images = images;\n this.initBody();\n\n // Override `transition` option if it is not supported\n if (isUndefined(document.createElement(NAMESPACE).style.transition)) {\n options.transition = false;\n }\n if (options.inline) {\n var count = 0;\n var progress = function progress() {\n count += 1;\n if (count === _this.length) {\n var timeout;\n _this.initializing = false;\n _this.delaying = {\n abort: function abort() {\n clearTimeout(timeout);\n }\n };\n\n // build asynchronously to keep `this.viewer` is accessible in `ready` event handler.\n timeout = setTimeout(function () {\n _this.delaying = false;\n _this.build();\n }, 0);\n }\n };\n this.initializing = {\n abort: function abort() {\n forEach(images, function (image) {\n if (!image.complete) {\n removeListener(image, EVENT_LOAD, progress);\n removeListener(image, EVENT_ERROR, progress);\n }\n });\n }\n };\n forEach(images, function (image) {\n if (image.complete) {\n progress();\n } else {\n var onLoad;\n var onError;\n addListener(image, EVENT_LOAD, onLoad = function onLoad() {\n removeListener(image, EVENT_ERROR, onError);\n progress();\n }, {\n once: true\n });\n addListener(image, EVENT_ERROR, onError = function onError() {\n removeListener(image, EVENT_LOAD, onLoad);\n progress();\n }, {\n once: true\n });\n }\n });\n } else {\n addListener(element, EVENT_CLICK, this.onStart = function (_ref) {\n var target = _ref.target;\n if (target.localName === 'img' && (!isFunction(options.filter) || options.filter.call(_this, target))) {\n _this.view(_this.images.indexOf(target));\n }\n });\n }\n }\n }, {\n key: \"build\",\n value: function build() {\n if (this.ready) {\n return;\n }\n var element = this.element,\n options = this.options;\n var parent = element.parentNode;\n var template = document.createElement('div');\n template.innerHTML = TEMPLATE;\n var viewer = template.querySelector(\".\".concat(NAMESPACE, \"-container\"));\n var title = viewer.querySelector(\".\".concat(NAMESPACE, \"-title\"));\n var toolbar = viewer.querySelector(\".\".concat(NAMESPACE, \"-toolbar\"));\n var navbar = viewer.querySelector(\".\".concat(NAMESPACE, \"-navbar\"));\n var button = viewer.querySelector(\".\".concat(NAMESPACE, \"-button\"));\n var canvas = viewer.querySelector(\".\".concat(NAMESPACE, \"-canvas\"));\n this.parent = parent;\n this.viewer = viewer;\n this.title = title;\n this.toolbar = toolbar;\n this.navbar = navbar;\n this.button = button;\n this.canvas = canvas;\n this.footer = viewer.querySelector(\".\".concat(NAMESPACE, \"-footer\"));\n this.tooltipBox = viewer.querySelector(\".\".concat(NAMESPACE, \"-tooltip\"));\n this.player = viewer.querySelector(\".\".concat(NAMESPACE, \"-player\"));\n this.list = viewer.querySelector(\".\".concat(NAMESPACE, \"-list\"));\n viewer.id = \"\".concat(NAMESPACE).concat(this.id);\n title.id = \"\".concat(NAMESPACE, \"Title\").concat(this.id);\n addClass(title, !options.title ? CLASS_HIDE : getResponsiveClass(Array.isArray(options.title) ? options.title[0] : options.title));\n addClass(navbar, !options.navbar ? CLASS_HIDE : getResponsiveClass(options.navbar));\n toggleClass(button, CLASS_HIDE, !options.button);\n if (options.keyboard) {\n button.setAttribute('tabindex', 0);\n }\n if (options.backdrop) {\n addClass(viewer, \"\".concat(NAMESPACE, \"-backdrop\"));\n if (!options.inline && options.backdrop !== 'static') {\n setData(canvas, DATA_ACTION, 'hide');\n }\n }\n if (isString(options.className) && options.className) {\n // In case there are multiple class names\n options.className.split(REGEXP_SPACES).forEach(function (className) {\n addClass(viewer, className);\n });\n }\n if (options.toolbar) {\n var list = document.createElement('ul');\n var custom = isPlainObject(options.toolbar);\n var zoomButtons = BUTTONS.slice(0, 3);\n var rotateButtons = BUTTONS.slice(7, 9);\n var scaleButtons = BUTTONS.slice(9);\n if (!custom) {\n addClass(toolbar, getResponsiveClass(options.toolbar));\n }\n forEach(custom ? options.toolbar : BUTTONS, function (value, index) {\n var deep = custom && isPlainObject(value);\n var name = custom ? hyphenate(index) : value;\n var show = deep && !isUndefined(value.show) ? value.show : value;\n if (!show || !options.zoomable && zoomButtons.indexOf(name) !== -1 || !options.rotatable && rotateButtons.indexOf(name) !== -1 || !options.scalable && scaleButtons.indexOf(name) !== -1) {\n return;\n }\n var size = deep && !isUndefined(value.size) ? value.size : value;\n var click = deep && !isUndefined(value.click) ? value.click : value;\n var item = document.createElement('li');\n if (options.keyboard) {\n item.setAttribute('tabindex', 0);\n }\n item.setAttribute('role', 'button');\n addClass(item, \"\".concat(NAMESPACE, \"-\").concat(name));\n if (!isFunction(click)) {\n setData(item, DATA_ACTION, name);\n }\n if (isNumber(show)) {\n addClass(item, getResponsiveClass(show));\n }\n if (['small', 'large'].indexOf(size) !== -1) {\n addClass(item, \"\".concat(NAMESPACE, \"-\").concat(size));\n } else if (name === 'play') {\n addClass(item, \"\".concat(NAMESPACE, \"-large\"));\n }\n if (isFunction(click)) {\n addListener(item, EVENT_CLICK, click);\n }\n list.appendChild(item);\n });\n toolbar.appendChild(list);\n } else {\n addClass(toolbar, CLASS_HIDE);\n }\n if (!options.rotatable) {\n var rotates = toolbar.querySelectorAll('li[class*=\"rotate\"]');\n addClass(rotates, CLASS_INVISIBLE);\n forEach(rotates, function (rotate) {\n toolbar.appendChild(rotate);\n });\n }\n if (options.inline) {\n addClass(button, CLASS_FULLSCREEN);\n setStyle(viewer, {\n zIndex: options.zIndexInline\n });\n if (window.getComputedStyle(parent).position === 'static') {\n setStyle(parent, {\n position: 'relative'\n });\n }\n parent.insertBefore(viewer, element.nextSibling);\n } else {\n addClass(button, CLASS_CLOSE);\n addClass(viewer, CLASS_FIXED);\n addClass(viewer, CLASS_FADE);\n addClass(viewer, CLASS_HIDE);\n setStyle(viewer, {\n zIndex: options.zIndex\n });\n var container = options.container;\n if (isString(container)) {\n container = element.ownerDocument.querySelector(container);\n }\n if (!container) {\n container = this.body;\n }\n container.appendChild(viewer);\n }\n if (options.inline) {\n this.render();\n this.bind();\n this.isShown = true;\n }\n this.ready = true;\n if (isFunction(options.ready)) {\n addListener(element, EVENT_READY, options.ready, {\n once: true\n });\n }\n if (dispatchEvent(element, EVENT_READY) === false) {\n this.ready = false;\n return;\n }\n if (this.ready && options.inline) {\n this.view(this.index);\n }\n }\n\n /**\n * Get the no conflict viewer class.\n * @returns {Viewer} The viewer class.\n */\n }], [{\n key: \"noConflict\",\n value: function noConflict() {\n window.Viewer = AnotherViewer;\n return Viewer;\n }\n\n /**\n * Change the default options.\n * @param {Object} options - The new default options.\n */\n }, {\n key: \"setDefaults\",\n value: function setDefaults(options) {\n assign(DEFAULTS, isPlainObject(options) && options);\n }\n }]);\n}();\nassign(Viewer.prototype, render, events, handlers, methods, others);\n\nexport { Viewer as default };\n", "import Viewer from 'viewerjs';\nimport { nextTick, onMounted, watch } from 'vue';\nlet viewer = null;\n/**\n * 给图片添加预览功能\n */\nconst setViewer = (el = '.vp-doc', option) => {\n // 默认配置\n const defaultBaseOption = {\n navbar: false,\n title: false,\n toolbar: {\n zoomIn: 4,\n zoomOut: 4,\n prev: 4,\n next: 4,\n reset: 4,\n oneToOne: 4\n }\n };\n viewer = new Viewer(document.querySelector(el), {\n ...defaultBaseOption,\n ...option\n });\n};\n/**\n * set imageViewer\n * 设置图片查看器\n * @param route 路由\n * @param el The string corresponding to the CSS selector, the default is \".vp-doc img\".\n *
    CSS选择器对应的字符串,默认为 \".vp-doc img\"\n * @param option viewerjs options\n *
    viewerjs 设置选项\n */\nconst imageViewer = (route, el, option) => {\n onMounted(() => {\n setViewer(el, option);\n });\n watch(() => route.path, () => nextTick(() => {\n viewer?.destroy();\n setViewer(el, option);\n }));\n};\nexport default imageViewer;\n"], + "mappings": ";;;;;;;AAUA,SAAS,gBAAgB,GAAG,GAAG;AAC7B,MAAI,EAAE,aAAa;AAAI,UAAM,IAAI,UAAU,mCAAmC;AAChF;AACA,SAAS,kBAAkB,GAAG,GAAG;AAC/B,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,QAAI,IAAI,EAAE,CAAC;AACX,MAAE,aAAa,EAAE,cAAc,OAAI,EAAE,eAAe,MAAI,WAAW,MAAM,EAAE,WAAW,OAAK,OAAO,eAAe,GAAG,eAAe,EAAE,GAAG,GAAG,CAAC;AAAA,EAC9I;AACF;AACA,SAAS,aAAa,GAAG,GAAG,GAAG;AAC7B,SAAO,KAAK,kBAAkB,EAAE,WAAW,CAAC,GAAG,KAAK,kBAAkB,GAAG,CAAC,GAAG,OAAO,eAAe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AU,SAAS,MAAM;;;AC/oGlE,IAAI,SAAS;AAIb,IAAM,YAAY,CAAC,KAAK,WAAW,WAAW;AAE1C,QAAM,oBAAoB;AAAA,IACtB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,MACL,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,IACd;AAAA,EACJ;AACA,WAAS,IAAI,OAAO,SAAS,cAAc,EAAE,GAAG;AAAA,IAC5C,GAAG;AAAA,IACH,GAAG;AAAA,EACP,CAAC;AACL;AAUA,IAAM,cAAc,CAAC,OAAO,IAAI,WAAW;AACvC,YAAU,MAAM;AACZ,cAAU,IAAI,MAAM;AAAA,EACxB,CAAC;AACD,QAAM,MAAM,MAAM,MAAM,MAAM,SAAS,MAAM;AACzC,qCAAQ;AACR,cAAU,IAAI,MAAM;AAAA,EACxB,CAAC,CAAC;AACN;AACA,IAAO,iBAAQ;", + "names": ["r", "o", "assign", "listener", "rotate", "scaleX", "scaleY", "render", "onLoad", "onError", "next", "onTransitionEnd", "viewer", "document", "shown", "hideImmediately", "onImageTransitionEnd", "onViewed", "prev", "Viewer", "progress", "show", "click"] +} diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index f127dda..88f8ef4 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -3,7 +3,11 @@ import { h } from "vue"; import type { Theme } from "vitepress"; import DefaultTheme from "vitepress/theme"; import { onMounted } from "vue"; -import mediumZoom from "medium-zoom"; +// import mediumZoom from "medium-zoom"; +import "viewerjs/dist/viewer.min.css"; +import imageViewer from "vitepress-plugin-image-viewer"; +import vImageViewer from "vitepress-plugin-image-viewer/lib/vImageViewer.vue"; +import { useRoute } from "vitepress"; import "./style.css"; export default { @@ -14,12 +18,19 @@ export default { }); }, enhanceApp({ app, router, siteData }) { + // 注册全局组件,如果你不想使用也可以不添加 + app.component("vImageViewer", vImageViewer); + // ... // ... }, setup() { onMounted(() => { // mediumZoom("[data-zoomable]", { background: "var(--vp-c-bg)" }); - mediumZoom(".main img", { background: "var(--vp-c-bg)" }); + // mediumZoom(".main img", { background: "var(--vp-c-bg)" }); + // 获取路由 + const route = useRoute(); + // 使用 + imageViewer(route); }); }, } satisfies Theme; diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index a68a04f..6140ed4 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -5,12 +5,10 @@ /* .vitepress/theme/index.css */ -.medium-zoom-overlay { - z-index: 20; -} -.medium-zoom-image { - z-index: 21; +img { + background: var(--vp-c-bg); + border-radius: 4px; } .dark img { diff --git a/package.json b/package.json index 66a166e..e81c59d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "medium-zoom": "^1.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", + "viewerjs": "^1.11.7", + "vitepress-plugin-image-viewer": "^1.1.5", "vue": "^3.4.15" }, "volta": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d015e09..db24324 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,12 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + viewerjs: + specifier: ^1.11.7 + version: 1.11.7 + vitepress-plugin-image-viewer: + specifier: ^1.1.5 + version: 1.1.5 vue: specifier: ^3.4.15 version: 3.4.15 @@ -1480,6 +1486,9 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + viewerjs@1.11.7: + resolution: {integrity: sha512-0JuVqOmL5v1jmEAlG5EBDR3XquxY8DWFQbFMprOXgaBB0F7Q/X9xWdEaQc59D8xzwkdUgXEMSSknTpriq95igg==} + vite@5.1.5: resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1508,6 +1517,9 @@ packages: terser: optional: true + vitepress-plugin-image-viewer@1.1.5: + resolution: {integrity: sha512-XnAb7bhqRCJB3JsKmah6oTDMTQNUQmLID+SME9Zwg/IWbYT+zySt2HuHHeTJlfHMmYpFBhvu8ayvBM0Fu3hdVQ==} + vitepress@1.0.0-rc.45: resolution: {integrity: sha512-/OiYsu5UKpQKA2c0BAZkfyywjfauDjvXyv6Mo4Ra57m5n4Bxg1HgUGoth1CLH2vwUbR/BHvDA9zOM0RDvgeSVQ==} hasBin: true @@ -2997,6 +3009,8 @@ snapshots: vary@1.1.2: {} + viewerjs@1.11.7: {} + vite@5.1.5(@types/node@20.11.30)(terser@5.31.1): dependencies: esbuild: 0.19.12 @@ -3007,6 +3021,10 @@ snapshots: fsevents: 2.3.3 terser: 5.31.1 + vitepress-plugin-image-viewer@1.1.5: + dependencies: + viewerjs: 1.11.7 + vitepress@1.0.0-rc.45(@algolia/client-search@4.22.1)(@types/node@20.11.30)(@types/react@18.3.3)(postcss@8.4.35)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.15.0)(terser@5.31.1): dependencies: '@docsearch/css': 3.5.2