v-viewer-legacy.3c62f2f7.js 57 KB

123456789101112131415161718192021
  1. !function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return e};var e={},i=Object.prototype,n=i.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(A){c=function(t,e,i){return t[e]=i}}function l(t,e,i,n){var r=e&&e.prototype instanceof d?e:d,o=Object.create(r.prototype),a=new j(n||[]);return o._invoke=function(t,e,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return T()}for(i.method=r,i.arg=o;;){var a=i.delegate;if(a){var s=x(a,i);if(s){if(s===h)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var c=u(t,e,i);if("normal"===c.type){if(n=i.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n="completed",i.method="throw",i.arg=c.arg)}}}(t,i,a),o}function u(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(A){return{type:"throw",arg:A}}}e.wrap=l;var h={};function d(){}function f(){}function v(){}var m={};c(m,o,(function(){return this}));var p=Object.getPrototypeOf,g=p&&p(p(k([])));g&&g!==i&&n.call(g,o)&&(m=g);var b=v.prototype=d.prototype=Object.create(m);function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function x(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=u(i,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var r=n.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=v,c(b,"constructor",v),c(v,"constructor",f),f.displayName=c(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},y(w.prototype),c(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var a=new w(l(t,i,n,r),o);return e.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(b),c(b,s,"Generator"),c(b,o,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var n=e.pop();if(n in t)return i.value=n,i.done=!1,i}return i.done=!0,i}},e.values=k,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(i,n){return a.type="throw",a.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),E(i),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;E(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:k(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),h}},e}function e(t,e,i,n,r,o,a){try{var s=t[o](a),c=s.value}catch(l){return void i(l)}s.done?e(c):Promise.resolve(c).then(n,r)}function i(t){return function(){var i=this,n=arguments;return new Promise((function(r,o){var a=t.apply(i,n);function s(t){e(a,r,o,s,c,"next",t)}function c(t){e(a,r,o,s,c,"throw",t)}s(void 0)}))}}function n(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return r(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==i.return||i.return()}finally{if(c)throw a}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}System.register(["./@vueup/vue-quill-legacy.bd9421f3.js"],(function(e){"use strict";var r,o,a,s,c,l,u,h,d,f,v;return{setters:[function(t){r=t.J,o=t.p,a=t.Q,s=t.K,c=t.b,l=t.d,u=t.h,h=t.G,d=t.ah,f=t.ax,v=t.n}],execute:function(){
  2. /*!
  3. * Viewer.js v1.10.5
  4. * https://fengyuanchen.github.io/viewerjs
  5. *
  6. * Copyright 2015-present Chen Fengyuan
  7. * Released under the MIT license
  8. *
  9. * Date: 2022-04-05T08:21:02.491Z
  10. */
  11. function m(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function p(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?m(Object(i),!0).forEach((function(e){w(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):m(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function w(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var x={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",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},O="undefined"!=typeof window&&void 0!==window.document,E=O?window:{},j=!(!O||!E.document.documentElement)&&"ontouchstart"in E.document.documentElement,k=!!O&&"PointerEvent"in E,T="viewer",A="move",S="switch",I="zoom",D="".concat(T,"-active"),z="".concat(T,"-close"),L="".concat(T,"-fade"),C="".concat(T,"-fixed"),F="".concat(T,"-fullscreen"),P="".concat(T,"-fullscreen-exit"),N="".concat(T,"-hide"),M="".concat(T,"-hide-md-down"),_="".concat(T,"-hide-sm-down"),R="".concat(T,"-hide-xs-down"),Y="".concat(T,"-in"),X="".concat(T,"-invisible"),W="".concat(T,"-loading"),q="".concat(T,"-move"),$="".concat(T,"-open"),V="".concat(T,"-show"),H="".concat(T,"-transition"),U="click",B="dblclick",G="dragstart",K="focusin",Z="keydown",J="load",Q="error",tt=k?"pointerdown":j?"touchstart":"mousedown",et=k?"pointermove":j?"touchmove":"mousemove",it=k?"pointerup pointercancel":j?"touchend touchcancel":"mouseup",nt="resize",rt="transitionend",ot="wheel",at="ready",st="show",ct="shown",lt="hide",ut="hidden",ht="view",dt="viewed",ft="move",vt="moved",mt="rotate",pt="rotated",gt="scale",bt="scaled",yt="zoom",wt="zoomed",xt="play",Ot="stop",Et="".concat(T,"Action"),jt=/\s\s*/,kt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function Tt(t){return"string"==typeof t}var At=Number.isNaN||E.isNaN;function St(t){return"number"==typeof t&&!At(t)}function It(t){return void 0===t}function Dt(t){return"object"===g(t)&&null!==t}var zt=Object.prototype.hasOwnProperty;function Lt(t){if(!Dt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&zt.call(i,"isPrototypeOf")}catch(n){return!1}}function Ct(t){return"function"==typeof t}function Ft(t,e){if(t&&Ct(e))if(Array.isArray(t)||St(t.length)){var i,n=t.length;for(i=0;i<n&&!1!==e.call(t,t[i],i,t);i+=1);}else Dt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}));return t}var Pt=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Dt(t)&&i.length>0&&i.forEach((function(e){Dt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},Nt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function Mt(t,e){var i=t.style;Ft(e,(function(t,e){Nt.test(e)&&St(t)&&(t+="px"),i[e]=t}))}function _t(t){return Tt(t)?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):t}function Rt(t,e){return!(!t||!e)&&(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)}function Yt(t,e){if(t&&e)if(St(t.length))Ft(t,(function(t){Yt(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function Xt(t,e){t&&e&&(St(t.length)?Ft(t,(function(t){Xt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Wt(t,e,i){e&&(St(t.length)?Ft(t,(function(t){Wt(t,e,i)})):i?Yt(t,e):Xt(t,e))}var qt=/([a-z\d])([A-Z])/g;function $t(t){return t.replace(qt,"$1-$2").toLowerCase()}function Vt(t,e){return Dt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat($t(e)))}function Ht(t,e,i){Dt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat($t(e)),i)}var Ut=function(){var t=!1;if(O){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});E.addEventListener("test",i,n),E.removeEventListener("test",i,n)}return t}();function Bt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i;e.trim().split(jt).forEach((function(e){if(!Ut){var o=t.listeners;o&&o[e]&&o[e][i]&&(r=o[e][i],delete o[e][i],0===Object.keys(o[e]).length&&delete o[e],0===Object.keys(o).length&&delete t.listeners)}t.removeEventListener(e,r,n)}))}function Gt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i;e.trim().split(jt).forEach((function(e){if(n.once&&!Ut){var o=t.listeners,a=void 0===o?{}:o;r=function(){delete a[e][i],t.removeEventListener(e,r,n);for(var o=arguments.length,s=new Array(o),c=0;c<o;c++)s[c]=arguments[c];i.apply(t,s)},a[e]||(a[e]={}),a[e][i]&&t.removeEventListener(e,a[e][i],n),a[e][i]=r,t.listeners=a}t.addEventListener(e,r,n)}))}function Kt(t,e,i,n){var r;return Ct(Event)&&Ct(CustomEvent)?r=new CustomEvent(e,p({bubbles:!0,cancelable:!0,detail:i},n)):(r=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(r)}function Zt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}function Jt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,r=t.translateX,o=t.translateY,a=[];St(r)&&0!==r&&a.push("translateX(".concat(r,"px)")),St(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),St(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),St(i)&&1!==i&&a.push("scaleX(".concat(i,")")),St(n)&&1!==n&&a.push("scaleY(".concat(n,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}var Qt=E.navigator&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(E.navigator.userAgent);function te(t,e,i){var n=document.createElement("img");if(t.naturalWidth&&!Qt)return i(t.naturalWidth,t.naturalHeight),n;var r=document.body||document.documentElement;return n.onload=function(){i(n.width,n.height),Qt||r.removeChild(n)},Ft(e.inheritedAttributes,(function(e){var i=t.getAttribute(e);null!==i&&n.setAttribute(e,i)})),n.src=t.src,Qt||(n.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;",r.appendChild(n)),n}function ee(t){switch(t){case 2:return R;case 3:return _;case 4:return M;default:return""}}function ie(t,e){var i=t.pageX,n=t.pageY,r={endX:i,endY:n};return e?r:p({timeStamp:Date.now(),startX:i,startY:n},r)}function ne(t){var e=0,i=0,n=0;return Ft(t,(function(t){var r=t.startX,o=t.startY;e+=r,i+=o,n+=1})),{pageX:e/=n,pageY:i/=n}}var re,oe={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.element.ownerDocument,e=t.body||t.documentElement;this.body=e,this.scrollbarWidth=window.innerWidth-t.documentElement.clientWidth,this.initialBodyPaddingRight=e.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(e).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,e=this.options,i=this.parent;e.inline&&(t={width:Math.max(i.offsetWidth,e.minWidth),height:Math.max(i.offsetHeight,e.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=Pt({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&Mt(this.viewer,this.viewerData)},initList:function(){var t=this,e=this.element,i=this.options,n=this.list,r=[];n.innerHTML="",Ft(this.images,(function(e,o){var a=e.src,s=e.alt||function(t){return Tt(t)?decodeURIComponent(t.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}(a),c=t.getImageURL(e);if(a||c){var l=document.createElement("li"),u=document.createElement("img");Ft(i.inheritedAttributes,(function(t){var i=e.getAttribute(t);null!==i&&u.setAttribute(t,i)})),u.src=a||c,u.alt=s,u.setAttribute("data-original-url",c||a),l.setAttribute("data-index",o),l.setAttribute("data-viewer-action","view"),l.setAttribute("role","button"),i.keyboard&&l.setAttribute("tabindex",0),l.appendChild(u),n.appendChild(l),r.push(l)}})),this.items=r,Ft(r,(function(e){var n,r,o=e.firstElementChild;Ht(o,"filled",!0),i.loading&&Yt(e,W),Gt(o,J,n=function(n){Bt(o,Q,r),i.loading&&Xt(e,W),t.loadImage(n)},{once:!0}),Gt(o,Q,r=function(){Bt(o,J,n),i.loading&&Xt(e,W)},{once:!0})})),i.transition&&Gt(e,dt,(function(){Yt(n,H)}),{once:!0})},renderList:function(){var t=this.index,e=this.items[t];if(e){var i=e.nextElementSibling,n=parseInt(window.getComputedStyle(i||e).marginLeft,10),r=e.offsetWidth,o=r+n;Mt(this.list,Pt({width:o*this.length-n},Jt({translateX:(this.viewerData.width-r)/2-o*t})))}},resetList:function(){var t=this.list;t.innerHTML="",Xt(t,H),Mt(t,Jt({translateX:0}))},initImage:function(t){var e,i=this,n=this.options,r=this.image,o=this.viewerData,a=this.footer.offsetHeight,s=o.width,c=Math.max(o.height-a,a),l=this.imageData||{};this.imageInitializing={abort:function(){e.onload=null}},e=te(r,n,(function(e,r){var o=e/r,a=s,u=c;i.imageInitializing=!1,c*o>s?u=s/o:a=c*o,a=Math.min(.9*a,e),u=Math.min(.9*u,r);var h=(s-a)/2,d=(c-u)/2,f={left:h,top:d,x:h,y:d,width:a,height:u,oldRatio:1,ratio:a/e,aspectRatio:o,naturalWidth:e,naturalHeight:r},v=Pt({},f);n.rotatable&&(f.rotate=l.rotate||0,v.rotate=0),n.scalable&&(f.scaleX=l.scaleX||1,f.scaleY=l.scaleY||1,v.scaleX=1,v.scaleY=1),i.imageData=f,i.initialImageData=v,t&&t()}))},renderImage:function(t){var e=this,i=this.image,n=this.imageData;if(Mt(i,Pt({width:n.width,height:n.height,marginLeft:n.x,marginTop:n.y},Jt(n))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&Rt(i,H)){var r=function(){e.imageRendering=!1,t()};this.imageRendering={abort:function(){Bt(i,rt,r)}},Gt(i,rt,r,{once:!0})}else t()},resetImage:function(){if(this.viewing||this.viewed){var t=this.image;this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null}}},ae={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Gt(e,U,this.onClick=this.click.bind(this)),Gt(e,G,this.onDragStart=this.dragstart.bind(this)),Gt(i,tt,this.onPointerDown=this.pointerdown.bind(this)),Gt(n,et,this.onPointerMove=this.pointermove.bind(this)),Gt(n,it,this.onPointerUp=this.pointerup.bind(this)),Gt(n,Z,this.onKeyDown=this.keydown.bind(this)),Gt(window,nt,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&Gt(e,ot,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&Gt(i,B,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Bt(e,U,this.onClick),Bt(e,G,this.onDragStart),Bt(i,tt,this.onPointerDown),Bt(n,et,this.onPointerMove),Bt(n,it,this.onPointerUp),Bt(n,Z,this.onKeyDown),Bt(window,nt,this.onResize),t.zoomable&&t.zoomOnWheel&&Bt(e,ot,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&Bt(i,B,this.onDblclick)}},se={click:function(t){var e=this.options,i=this.imageData,n=t.target,r=Vt(n,Et);switch(r||"img"!==n.localName||"li"!==n.parentElement.localName||(r=Vt(n=n.parentElement,Et)),j&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),r){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.hide();break;case"view":this.view(Vt(n,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(e.loop);break;case"play":this.play(e.fullscreen);break;case"next":this.next(e.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-i.scaleX||-1);break;case"flip-vertical":this.scaleY(-i.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(j&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t.isTrusted?t:t.detail&&t.detail.originalEvent))},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var e=this.element,i=this.options,n=this.image,r=this.index,o=this.viewerData;Xt(n,X),i.loading&&Xt(this.canvas,W),n.style.cssText="height:0;"+"margin-left:".concat(o.width/2,"px;")+"margin-top:".concat(o.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage((function(){Wt(n,q,i.movable),Wt(n,H,i.transition),t.renderImage((function(){t.viewed=!0,t.viewing=!1,Ct(i.viewed)&&Gt(e,dt,i.viewed,{once:!0}),Kt(e,dt,{originalImage:t.images[r],index:r,image:n},{cancelable:!1})}))}))},loadImage:function(t){var e=t.target,i=e.parentNode,n=i.offsetWidth||30,r=i.offsetHeight||50,o=!!Vt(e,"filled");te(e,this.options,(function(t,i){var a=t/i,s=n,c=r;r*a>n?o?s=r*a:c=n/a:o?c=n/a:s=r*a,Mt(e,Pt({width:s,height:c},Jt({translateX:(n-s)/2,translateY:(r-c)/2})))}))},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;if(13===i)this.viewer.contains(t.target)&&this.click(t);if(this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,r=t.button;if(!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(St(n)&&1!==n||St(r)&&0!==r||t.ctrlKey))){t.preventDefault(),t.changedTouches?Ft(t.changedTouches,(function(t){i[t.identifier]=ie(t)})):i[t.pointerId||0]=ie(t);var o=!!e.movable&&A;e.zoomOnTouch&&e.zoomable&&Object.keys(i).length>1?o=I:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(o=S),!e.transition||o!==A&&o!==I||Xt(this.image,H),this.action=o}},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?Ft(t.changedTouches,(function(t){Pt(e[t.identifier]||{},ie(t,!0))})):Pt(e[t.pointerId||0]||{},ie(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,r=this.action,o=this.pointers;t.changedTouches?Ft(t.changedTouches,(function(t){e=o[t.identifier],delete o[t.identifier]})):(e=o[t.pointerId||0],delete o[t.pointerId||0]),r&&(t.preventDefault(),!n.transition||r!==A&&r!==I||Yt(this.image,H),this.action=!1,j&&r!==I&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout((function(){Kt(i.image,B,{originalEvent:t})}),50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout((function(){i.imageClicked=!1}),500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout((function(){Kt(i.canvas,U,{originalEvent:t})}),50)))))},resize:function(){var t=this;if(this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage()})),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement))return void this.stop();Ft(this.player.getElementsByTagName("img"),(function(e){Gt(e,J,t.loadImage.bind(t),{once:!0}),Kt(e,J)}))}},wheel:function(t){var e=this;if(this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50);var i=Number(this.options.zoomRatio)||.1,n=1;t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*i,!0,t)}}},ce={show:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.element,i=this.options;if(i.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(Ct(i.show)&&Gt(e,st,i.show,{once:!0}),!1===Kt(e,st)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(Xt(n,N),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("aria-hidden"),i.transition&&!t){var r=this.shown.bind(this);this.transitioning={abort:function(){Bt(n,rt,r),Xt(n,Y)}},Yt(n,H),n.initialOffsetWidth=n.offsetWidth,Gt(n,rt,r,{once:!0}),Yt(n,Y)}else Yt(n,Y),this.shown();return this},hide:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.element,n=this.options;if(n.inline||this.hiding||!this.isShown&&!this.showing)return this;if(Ct(n.hide)&&Gt(i,lt,n.hide,{once:!0}),!1===Kt(i,lt))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var r=this.viewer,o=this.image,a=function(){Xt(r,Y),t.hidden()};if(n.transition&&!e){var s=function e(i){i&&i.target===r&&(Bt(r,rt,e),t.hidden())},c=function(){Rt(r,H)?(Gt(r,rt,s),Xt(r,Y)):a()};this.transitioning={abort:function(){t.viewed&&Rt(o,H)?Bt(o,rt,c):Rt(r,H)&&Bt(r,rt,s)}},this.viewed&&Rt(o,H)?(Gt(o,rt,c,{once:!0}),this.zoomTo(0,!1,null,!0)):c()}else a();return this},view:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex;if(e=Number(e)||0,this.hiding||this.played||e<0||e>=this.length||this.viewed&&e===this.index)return this;if(!this.isShown)return this.index=e,this.show();this.viewing&&this.viewing.abort();var i=this.element,n=this.options,r=this.title,o=this.canvas,a=this.items[e],s=a.querySelector("img"),c=Vt(s,"originalUrl"),l=s.getAttribute("alt"),u=document.createElement("img");if(Ft(n.inheritedAttributes,(function(t){var e=s.getAttribute(t);null!==e&&u.setAttribute(t,e)})),u.src=c,u.alt=l,Ct(n.view)&&Gt(i,ht,n.view,{once:!0}),!1===Kt(i,ht,{originalImage:this.images[e],index:e,image:u})||!this.isShown||this.hiding||this.played)return this;var h=this.items[this.index];h&&(Xt(h,D),h.removeAttribute("aria-selected")),Yt(a,D),a.setAttribute("aria-selected",!0),n.focus&&a.focus(),this.image=u,this.viewed=!1,this.index=e,this.imageData={},Yt(u,X),n.loading&&Yt(o,W),o.innerHTML="",o.appendChild(u),this.renderList(),r.innerHTML="";var d,f,v=function(){var e=t.imageData,i=Array.isArray(n.title)?n.title[1]:n.title;r.innerHTML=_t(Ct(i)?i.call(t,u,e):"".concat(l," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")"))};return Gt(i,dt,v,{once:!0}),this.viewing={abort:function(){Bt(i,dt,v),u.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(u.src="",Bt(u,J,d),t.timeout&&clearTimeout(t.timeout))}},u.complete?this.load():(Gt(u,J,d=function(){Bt(u,Q,f),t.load()},{once:!0}),Gt(u,Q,f=function(){Bt(u,J,d),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),Xt(u,X),n.loading&&Xt(t.canvas,W)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){Xt(u,X),t.timeout=!1}),1e3)),this},prev:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.index-1;return e<0&&(e=t?this.length-1:0),this.view(e),this},next:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.length-1,i=this.index+1;return i>e&&(i=t?0:e),this.view(i),this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(It(t)?t:i.x+Number(t),It(e)?e:i.y+Number(e)),this},moveTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.element,o=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.movable){var s=a.x,c=a.y,l=!1;if(St(t)?l=!0:t=s,St(i)?l=!0:i=c,l){if(Ct(o.move)&&Gt(r,ft,o.move,{once:!0}),!1===Kt(r,ft,{x:t,y:i,oldX:s,oldY:c,originalEvent:n}))return this;a.x=t,a.y=i,a.left=t,a.top=i,this.moving=!0,this.renderImage((function(){e.moving=!1,Ct(o.moved)&&Gt(r,vt,o.moved,{once:!0}),Kt(r,vt,{x:t,y:i,oldX:s,oldY:c,originalEvent:n},{cancelable:!1})}))}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var e=this,i=this.element,n=this.options,r=this.imageData;if(St(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var o=r.rotate;if(Ct(n.rotate)&&Gt(i,mt,n.rotate,{once:!0}),!1===Kt(i,mt,{degree:t,oldDegree:o}))return this;r.rotate=t,this.rotating=!0,this.renderImage((function(){e.rotating=!1,Ct(n.rotated)&&Gt(i,pt,n.rotated,{once:!0}),Kt(i,pt,{degree:t,oldDegree:o},{cancelable:!1})}))}return this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.element,r=this.options,o=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&r.scalable){var a=o.scaleX,s=o.scaleY,c=!1;if(St(t)?c=!0:t=a,St(i)?c=!0:i=s,c){if(Ct(r.scale)&&Gt(n,gt,r.scale,{once:!0}),!1===Kt(n,gt,{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:s}))return this;o.scaleX=t,o.scaleY=i,this.scaling=!0,this.renderImage((function(){e.scaling=!1,Ct(r.scaled)&&Gt(n,bt,r.scaled,{once:!0}),Kt(n,bt,{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:s},{cancelable:!1})}))}}return this},zoom:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.imageData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,e,i),this},zoomTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.element,a=this.options,s=this.pointers,c=this.imageData,l=c.x,u=c.y,h=c.width,d=c.height,f=c.naturalWidth,v=c.naturalHeight;if(St(t=Math.max(0,t))&&this.viewed&&!this.played&&(r||a.zoomable)){if(!r){var m=Math.max(.01,a.minZoomRatio),p=Math.min(100,a.maxZoomRatio);t=Math.min(Math.max(t,m),p)}if(n)switch(n.type){case"wheel":a.zoomRatio>=.055&&t>.95&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":t>.99&&t<1.01&&(t=1)}var g=f*t,b=v*t,y=g-h,w=b-d,x=c.ratio;if(Ct(a.zoom)&&Gt(o,yt,a.zoom,{once:!0}),!1===Kt(o,yt,{ratio:t,oldRatio:x,originalEvent:n}))return this;if(this.zooming=!0,n){var O=Zt(this.viewer),E=s&&Object.keys(s).length>0?ne(s):{pageX:n.pageX,pageY:n.pageY};c.x-=y*((E.pageX-O.left-l)/h),c.y-=w*((E.pageY-O.top-u)/d)}else c.x-=y/2,c.y-=w/2;c.left=c.x,c.top=c.y,c.width=g,c.height=b,c.oldRatio=x,c.ratio=t,this.renderImage((function(){e.zooming=!1,Ct(a.zoomed)&&Gt(o,wt,a.zoomed,{once:!0}),Kt(o,wt,{ratio:t,oldRatio:x,originalEvent:n},{cancelable:!1})})),i&&this.tooltip()}return this},play:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var i=this.element,n=this.options;if(Ct(n.play)&&Gt(i,xt,n.play,{once:!0}),!1===Kt(i,xt))return this;var r=this.player,o=this.loadImage.bind(this),a=[],s=0,c=0;if(this.played=!0,this.onLoadWhenPlay=o,e&&this.requestFullscreen(e),Yt(r,V),Ft(this.items,(function(t,e){var i=t.querySelector("img"),l=document.createElement("img");l.src=Vt(i,"originalUrl"),l.alt=i.getAttribute("alt"),l.referrerPolicy=i.referrerPolicy,s+=1,Yt(l,L),Wt(l,H,n.transition),Rt(t,D)&&(Yt(l,Y),c=e),a.push(l),Gt(l,J,o,{once:!0}),r.appendChild(l)})),St(n.interval)&&n.interval>0){var l=function e(){t.playing=setTimeout((function(){Xt(a[c],Y),Yt(a[c=(c+=1)<s?c:0],Y),e()}),n.interval)};s>1&&l()}return this},stop:function(){var t=this;if(!this.played)return this;var e=this.element,i=this.options;if(Ct(i.stop)&&Gt(e,Ot,i.stop,{once:!0}),!1===Kt(e,Ot))return this;var n=this.player;return this.played=!1,clearTimeout(this.playing),Ft(n.getElementsByTagName("img"),(function(e){Bt(e,J,t.onLoadWhenPlay)})),Xt(n,V),n.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,e=this.options,i=this.viewer,n=this.image,r=this.list;return!this.isShown||this.played||this.fulled||!e.inline||(this.fulled=!0,this.open(),Yt(this.button,P),e.transition&&(Xt(r,H),this.viewed&&Xt(n,H)),Yt(i,C),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),Mt(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=Pt({},this.containerData),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){Yt(n,H),Yt(r,H)}),0)}))}))),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,r=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline?(this.fulled=!1,this.close(),Xt(this.button,P),e.transition&&(Xt(r,H),this.viewed&&Xt(n,H)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),Xt(i,C),Mt(i,{zIndex:e.zIndexInline}),this.viewerData=Pt({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){Yt(n,H),Yt(r,H)}),0)}))})),this):this},tooltip:function(){var t=this,e=this.options,i=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&e.tooltip?(i.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):e.transition?(this.fading&&Kt(i,rt),Yt(i,V),Yt(i,L),Yt(i,H),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,Yt(i,Y)):(Yt(i,V),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout((function(){e.transition?(Gt(i,rt,(function(){Xt(i,V),Xt(i,L),Xt(i,H),i.setAttribute("aria-hidden",!0),t.fading=!1}),{once:!0}),Xt(i,Y),t.fading=!0):(Xt(i,V),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1}),1e3),this):this},toggle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,t):this.zoomTo(1,!0,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=Pt({},this.initialImageData),this.renderImage()),this},update:function(){var t=this,e=this.element,i=this.options,n=this.isImg;if(n&&!e.parentNode)return this.destroy();var r=[];if(Ft(n?[e]:e.querySelectorAll("img"),(function(e){Ct(i.filter)?i.filter.call(t,e)&&r.push(e):t.getImageURL(e)&&r.push(e)})),!r.length)return this;if(this.images=r,this.length=r.length,this.ready){var o=[];if(Ft(this.items,(function(t,e){var i=t.querySelector("img"),n=r[e];n&&i&&n.src===i.src&&n.alt===i.alt||o.push(e)})),Mt(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var a=o.indexOf(this.index);if(a>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-a,this.length-1),0));else{var s=this.items[this.index];Yt(s,D),s.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var t=this.element,e=this.options;return t.viewer?(this.destroyed=!0,this.ready?(this.played&&this.stop(),e.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):e.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),e.inline||Bt(t,U,this.onStart),t.viewer=void 0,this):this}},le={getImageURL:function(t){var e=this.options.url;return e=Tt(e)?t.getAttribute(e):Ct(e)?e.call(this,t):""},enforceFocus:function(){var t=this;this.clearEnforceFocus(),Gt(document,K,this.onFocusin=function(e){var i=t.viewer,n=e.target;if(n!==document&&n!==i&&!i.contains(n)){for(;n;){if(null!==n.getAttribute("tabindex")||"true"===n.getAttribute("aria-modal"))return;n=n.parentElement}i.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Bt(document,K,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;Yt(t,$),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px")},close:function(){var t=this.body;Xt(t,$),t.style.paddingRight=this.initialBodyPaddingRight},shown:function(){var t=this.element,e=this.options,i=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,e.focus&&(i.focus(),this.enforceFocus()),Ct(e.shown)&&Gt(t,ct,e.shown,{once:!0}),!1!==Kt(t,ct)&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer;e.fucus&&this.clearEnforceFocus(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),Yt(i,N),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(Ct(e.hidden)&&Gt(t,ut,e.hidden,{once:!0}),Kt(t,ut,null,{cancelable:!1}))},requestFullscreen:function(t){var e=this.element.ownerDocument;if(this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)){var i=e.documentElement;i.requestFullscreen?Lt(t)?i.requestFullscreen(t):i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen()}},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var e=this.options,i=this.pointers,n=i[Object.keys(i)[0]];if(n){var r=n.endX-n.startX,o=n.endY-n.startY;switch(this.action){case A:this.move(r,o,t);break;case I:this.zoom(function(t){var e=p({},t),i=[];return Ft(t,(function(t,n){delete e[n],Ft(e,(function(e){var n=Math.abs(t.startX-e.startX),r=Math.abs(t.startY-e.startY),o=Math.abs(t.endX-e.endX),a=Math.abs(t.endY-e.endY),s=Math.sqrt(n*n+r*r),c=(Math.sqrt(o*o+a*a)-s)/s;i.push(c)}))})),i.sort((function(t,e){return Math.abs(t)<Math.abs(e)})),i[0]}(i),!1,t);break;case S:this.action="switched";var a=Math.abs(r);a>1&&a>Math.abs(o)&&(this.pointers={},r>1?this.prev(e.loop):r<-1&&this.next(e.loop))}Ft(i,(function(t){t.startX=t.endX,t.startY=t.endY}))}},isSwitchable:function(){var t=this.imageData,e=this.viewerData;return this.length>1&&t.x>=0&&t.y>=0&&t.width<=e.width&&t.height<=e.height}},ue=E.Viewer,he=(re=-1,function(){return re+=1}),de=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(b(this,t),!e||1!==e.nodeType)throw new Error("The first argument is required and must be an element.");this.element=e,this.options=Pt({},x,Lt(i)&&i),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.id=he(),this.init()}var e,i,n;return e=t,n=[{key:"noConflict",value:function(){return window.Viewer=ue,t}},{key:"setDefaults",value:function(t){Pt(x,Lt(t)&&t)}}],(i=[{key:"init",value:function(){var t=this,e=this.element,i=this.options;if(!e.viewer){e.viewer=this,i.focus&&!i.keyboard&&(i.focus=!1);var n="img"===e.localName,r=[];if(Ft(n?[e]:e.querySelectorAll("img"),(function(e){Ct(i.filter)?i.filter.call(t,e)&&r.push(e):t.getImageURL(e)&&r.push(e)})),this.isImg=n,this.length=r.length,this.images=r,this.initBody(),It(document.createElement(T).style.transition)&&(i.transition=!1),i.inline){var o=0,a=function(){var e;(o+=1)===t.length&&(t.initializing=!1,t.delaying={abort:function(){clearTimeout(e)}},e=setTimeout((function(){t.delaying=!1,t.build()}),0))};this.initializing={abort:function(){Ft(r,(function(t){t.complete||(Bt(t,J,a),Bt(t,Q,a))}))}},Ft(r,(function(t){var e,i;t.complete?a():(Gt(t,J,e=function(){Bt(t,Q,i),a()},{once:!0}),Gt(t,Q,i=function(){Bt(t,J,e),a()},{once:!0}))}))}else Gt(e,U,this.onStart=function(e){var n=e.target;"img"!==n.localName||Ct(i.filter)&&!i.filter.call(t,n)||t.view(t.images.indexOf(n))})}}},{key:"build",value:function(){if(!this.ready){var t=this.element,e=this.options,i=t.parentNode,n=document.createElement("div");n.innerHTML='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>';var r=n.querySelector(".".concat(T,"-container")),o=r.querySelector(".".concat(T,"-title")),a=r.querySelector(".".concat(T,"-toolbar")),s=r.querySelector(".".concat(T,"-navbar")),c=r.querySelector(".".concat(T,"-button")),l=r.querySelector(".".concat(T,"-canvas"));if(this.parent=i,this.viewer=r,this.title=o,this.toolbar=a,this.navbar=s,this.button=c,this.canvas=l,this.footer=r.querySelector(".".concat(T,"-footer")),this.tooltipBox=r.querySelector(".".concat(T,"-tooltip")),this.player=r.querySelector(".".concat(T,"-player")),this.list=r.querySelector(".".concat(T,"-list")),r.id="".concat(T).concat(this.id),o.id="".concat(T,"Title").concat(this.id),Yt(o,e.title?ee(Array.isArray(e.title)?e.title[0]:e.title):N),Yt(s,e.navbar?ee(e.navbar):N),Wt(c,N,!e.button),e.keyboard&&c.setAttribute("tabindex",0),e.backdrop&&(Yt(r,"".concat(T,"-backdrop")),e.inline||"static"===e.backdrop||Ht(l,Et,"hide")),Tt(e.className)&&e.className&&e.className.split(jt).forEach((function(t){Yt(r,t)})),e.toolbar){var u=document.createElement("ul"),h=Lt(e.toolbar),d=kt.slice(0,3),f=kt.slice(7,9),v=kt.slice(9);h||Yt(a,ee(e.toolbar)),Ft(h?e.toolbar:kt,(function(t,i){var n=h&&Lt(t),r=h?$t(i):t,o=n&&!It(t.show)?t.show:t;if(o&&(e.zoomable||-1===d.indexOf(r))&&(e.rotatable||-1===f.indexOf(r))&&(e.scalable||-1===v.indexOf(r))){var a=n&&!It(t.size)?t.size:t,s=n&&!It(t.click)?t.click:t,c=document.createElement("li");e.keyboard&&c.setAttribute("tabindex",0),c.setAttribute("role","button"),Yt(c,"".concat(T,"-").concat(r)),Ct(s)||Ht(c,Et,r),St(o)&&Yt(c,ee(o)),-1!==["small","large"].indexOf(a)?Yt(c,"".concat(T,"-").concat(a)):"play"===r&&Yt(c,"".concat(T,"-large")),Ct(s)&&Gt(c,U,s),u.appendChild(c)}})),a.appendChild(u)}else Yt(a,N);if(!e.rotatable){var m=a.querySelectorAll('li[class*="rotate"]');Yt(m,X),Ft(m,(function(t){a.appendChild(t)}))}if(e.inline)Yt(c,F),Mt(r,{zIndex:e.zIndexInline}),"static"===window.getComputedStyle(i).position&&Mt(i,{position:"relative"}),i.insertBefore(r,t.nextSibling);else{Yt(c,z),Yt(r,C),Yt(r,L),Yt(r,N),Mt(r,{zIndex:e.zIndex});var p=e.container;Tt(p)&&(p=t.ownerDocument.querySelector(p)),p||(p=this.body),p.appendChild(r)}e.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,Ct(e.ready)&&Gt(t,at,e.ready,{once:!0}),!1!==Kt(t,at)?this.ready&&e.inline&&this.view(this.index):this.ready=!1}}}])&&y(e.prototype,i),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();Pt(de.prototype,oe,ae,se,ce,le);
  12. /*!
  13. * v-viewer v3.0.10
  14. * https://github.com/mirari/v-viewer#readme
  15. *
  16. * Copyright 2021 mirari
  17. * Released under the MIT license
  18. *
  19. * Date: 2021-09-21T05:13:15.278Z
  20. */
  21. var fe,ve,me,pe,ge,be,ye,we,xe,Oe,Ee,je,ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Te=function(t){return t},Ae=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},Se=Math.max,Ie="object"==typeof ke&&ke&&ke.Object===Object&&ke,De=Ie,ze="object"==typeof self&&self&&self.Object===Object&&self,Le=De||ze||Function("return this")(),Ce=Le.Symbol,Fe=Ce,Pe=Object.prototype,Ne=Pe.hasOwnProperty,Me=Pe.toString,_e=Fe?Fe.toStringTag:void 0,Re=Object.prototype.toString,Ye=function(t){var e=Ne.call(t,_e),i=t[_e];try{t[_e]=void 0;var n=!0}catch(o){}var r=Me.call(t);return n&&(e?t[_e]=i:delete t[_e]),r},Xe=Ce?Ce.toStringTag:void 0,We=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Xe&&Xe in Object(t)?Ye(t):function(t){return Re.call(t)}(t)},qe=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},$e=We,Ve=qe,He=function(t){if(!Ve(t))return!1;var e=$e(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Ue=Le["__core-js_shared__"],Be=(fe=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||""))?"Symbol(src)_1."+fe:"",Ge=Function.prototype.toString,Ke=He,Ze=function(t){return!!Be&&Be in t},Je=qe,Qe=/^\[object .+?Constructor\]$/,ti=Function.prototype,ei=Object.prototype,ii=ti.toString,ni=ei.hasOwnProperty,ri=RegExp("^"+ii.call(ni).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oi=function(t){return!(!Je(t)||Ze(t))&&(Ke(t)?ri:Qe).test(function(t){if(null!=t){try{return Ge.call(t)}catch(me){}try{return t+""}catch(me){}}return""}(t))},ai=function(){try{var t=function(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return oi(i)?i:void 0}(Object,"defineProperty");return t({},"",{}),t}catch(me){}}(),si=function(t){return function(){return t}},ci=ai,li=ci?function(t,e){return ci(t,"toString",{configurable:!0,enumerable:!1,value:si(e),writable:!0})}:Te,ui=Date.now,hi=(ve=li,me=0,pe=0,function(){var t=ui(),e=16-(t-pe);if(pe=t,e>0){if(++me>=800)return arguments[0]}else me=0;return ve.apply(void 0,arguments)}),di=Te,fi=function(t,e,i){return e=Se(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=Se(n.length-e,0),a=Array(o);++r<o;)a[r]=n[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=n[r];return s[e]=i(a),Ae(t,this,s)}},vi=hi,mi=function(t,e){return t===e||t!=t&&e!=e},pi=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},gi=He,bi=pi,yi=function(t){return null!=t&&bi(t.length)&&!gi(t)},wi=/^(?:0|[1-9]\d*)$/,xi=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&wi.test(t))&&t>-1&&t%1==0&&t<e},Oi=mi,Ei=yi,ji=xi,ki=qe,Ti=function(t){return null!=t&&"object"==typeof t},Ai=We,Si=Ti,Ii=function(t){return Si(t)&&"[object Arguments]"==Ai(t)},Di=Ti,zi=Object.prototype,Li=zi.hasOwnProperty,Ci=zi.propertyIsEnumerable,Fi=Ii(function(){return arguments}())?Ii:function(t){return Di(t)&&Li.call(t,"callee")&&!Ci.call(t,"callee")},Pi=Array.isArray,Ni={exports:{}};ge=Ni,ye=Le,we=function(){return!1},je=((Ee=(Oe=(xe=(be=Ni.exports)&&!be.nodeType&&be)&&ge&&!ge.nodeType&&ge)&&Oe.exports===xe?ye.Buffer:void 0)?Ee.isBuffer:void 0)||we,ge.exports=je;var Mi=We,_i=pi,Ri=Ti,Yi={};Yi["[object Float32Array]"]=Yi["[object Float64Array]"]=Yi["[object Int8Array]"]=Yi["[object Int16Array]"]=Yi["[object Int32Array]"]=Yi["[object Uint8Array]"]=Yi["[object Uint8ClampedArray]"]=Yi["[object Uint16Array]"]=Yi["[object Uint32Array]"]=!0,Yi["[object Arguments]"]=Yi["[object Array]"]=Yi["[object ArrayBuffer]"]=Yi["[object Boolean]"]=Yi["[object DataView]"]=Yi["[object Date]"]=Yi["[object Error]"]=Yi["[object Function]"]=Yi["[object Map]"]=Yi["[object Number]"]=Yi["[object Object]"]=Yi["[object RegExp]"]=Yi["[object Set]"]=Yi["[object String]"]=Yi["[object WeakMap]"]=!1;var Xi={exports:{}};!function(t,e){var i=Ie,n=e&&!e.nodeType&&e,r=n&&t&&!t.nodeType&&t,o=r&&r.exports===n&&i.process,a=function(){try{return r&&r.require&&r.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();t.exports=a}(Xi,Xi.exports);var Wi=function(t){return Ri(t)&&_i(t.length)&&!!Yi[Mi(t)]},qi=function(t){return function(e){return t(e)}},$i=Xi.exports,Vi=$i&&$i.isTypedArray,Hi=Vi?qi(Vi):Wi,Ui=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n},Bi=Fi,Gi=Pi,Ki=Ni.exports,Zi=xi,Ji=Hi,Qi=Object.prototype.hasOwnProperty,tn=Object.prototype,en=qe,nn=Object.prototype.hasOwnProperty,rn=function(t,e){var i=Gi(t),n=!i&&Bi(t),r=!i&&!n&&Ki(t),o=!i&&!n&&!r&&Ji(t),a=i||n||r||o,s=a?Ui(t.length,String):[],c=s.length;for(var l in t)!e&&!Qi.call(t,l)||a&&("length"==l||r&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Zi(l,c))||s.push(l);return s},on=function(t){if(!en(t))return function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}(t);var e=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||tn)}(t),i=[];for(var n in t)("constructor"!=n||!e&&nn.call(t,n))&&i.push(n);return i},an=yi,sn=function(t,e){return vi(fi(t,e,di),t+"")},cn=mi,ln=function(t,e,i){if(!ki(i))return!1;var n=typeof e;return!!("number"==n?Ei(i)&&ji(e,i.length):"string"==n&&e in i)&&Oi(i[e],t)},un=function(t){return an(t)?rn(t,!0):on(t)},hn=Object.prototype,dn=hn.hasOwnProperty,fn=sn((function(t,e){t=Object(t);var i=-1,n=e.length,r=n>2?e[2]:void 0;for(r&&ln(e[0],e[1],r)&&(n=1);++i<n;)for(var o=e[i],a=un(o),s=-1,c=a.length;++s<c;){var l=a[s],u=t[l];(void 0===u||cn(u,hn[l])&&!dn.call(t,l))&&(t[l]=o[l])}return t})),vn="undefined"!=typeof window&&null!==window;!function(){if(vn&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}})}();var mn=Object.prototype.propertyIsEnumerable,pn=Object.getOwnPropertySymbols;function gn(t){return"function"==typeof t||"[object Object]"===toString.call(t)}function bn(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t}function yn(t){if(!gn(t))throw new TypeError("expected the first argument to be an object");for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];if(0===i.length||"function"!=typeof Symbol||"function"!=typeof pn)return t;for(var o=0,a=i;o<a.length;o++){var s,c=a[o],l=pn(c),u=n(l);try{for(u.s();!(s=u.n()).done;){var h=s.value;mn.call(c,h)&&(t[h]=c[h])}}catch(d){u.e(d)}finally{u.f()}}return t}function wn(t){for(var e,i=0,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(("object"==typeof(e=t)?null===e:"function"!=typeof e)&&(t=r[i++]),t||(t={});i<r.length;i++)if(gn(r[i])){for(var a=0,s=Object.keys(r[i]);a<s.length;a++){var c=s[a];bn(c)&&(gn(t[c])&&gn(r[i][c])?wn(t[c],r[i][c]):t[c]=r[i][c])}yn(t,r[i])}return t}var xn=function(t){var e=t.images,i=void 0===e?[]:e,n=t.options;n=wn(n,{inline:!1});var r=document.createElement("div"),o=d("div",{style:{display:"none"},class:["__viewer-token"]},i.map((function(t){return d("img","string"==typeof t?{src:t}:t)})));f(o,r);var a=r.firstElementChild;document.body.appendChild(a);var s=new de(a,n),c=s.destroy.bind(s);return s.destroy=function(){return c(),f(null,r),s},s.show(),a.addEventListener("hidden",(function(){this.viewer===s&&s.destroy()})),s},On=Le,En=/\s/,jn=/^\s+/,kn=We,Tn=Ti,An=function(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&En.test(t.charAt(e)););return e}(t)+1).replace(jn,""):t},Sn=qe,In=/^[-+]0x[0-9a-f]+$/i,Dn=/^0b[01]+$/i,zn=/^0o[0-7]+$/i,Ln=parseInt,Cn=qe,Fn=function(){return On.Date.now()},Pn=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||Tn(t)&&"[object Symbol]"==kn(t)}(t))return NaN;if(Sn(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Sn(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=An(t);var i=Dn.test(t);return i||zn.test(t)?Ln(t.slice(2),i?2:8):In.test(t)?NaN:+t},Nn=Math.max,Mn=Math.min,_n=function(t,e,i){var n,r,o,a,s,c,l=0,u=!1,h=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var i=n,o=r;return n=r=void 0,l=e,a=t.apply(o,i)}function v(t){return l=t,s=setTimeout(p,e),u?f(t):a}function m(t){var i=t-c;return void 0===c||i>=e||i<0||h&&t-l>=o}function p(){var t=Fn();if(m(t))return g(t);s=setTimeout(p,function(t){var i=e-(t-c);return h?Mn(i,o-(t-l)):i}(t))}function g(t){return s=void 0,d&&n?f(t):(n=r=void 0,a)}function b(){var t=Fn(),i=m(t);if(n=arguments,r=this,c=t,i){if(void 0===s)return v(c);if(h)return clearTimeout(s),s=setTimeout(p,e),f(c)}return void 0===s&&(s=setTimeout(p,e)),a}return e=Pn(e)||0,Cn(i)&&(u=!!i.leading,o=(h="maxWait"in i)?Nn(Pn(i.maxWait)||0,e):o,d="trailing"in i?!!i.trailing:d),b.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=c=r=s=void 0},b.flush=function(){return void 0===s?a:g(Fn())},b},Rn=r({name:"Viewer",props:{images:{type:Array,default:function(){return[]}},rebuild:{type:Boolean,default:!1},trigger:{type:Object,default:null},options:{type:Object,default:function(){return null}}},emits:["inited"],setup(t,e){var i,n=e.emit,r=c();function o(){i=new de(r.value,t.options),n("inited",i)}function a(){i&&i.destroy()}function s(){a(),o()}function d(){i?(i.update(),n("inited",i)):o()}function f(){t.rebuild?s():d()}var m={deep:!0};return l((function(){return t.images}),(function(){return v((function(){return f()}))}),m),l((function(){return t.trigger}),(function(){return v((function(){return f()}))}),m),l((function(){return t.options}),(function(){return v((function(){return s()}))}),m),u((function(){return o()})),h((function(){return a()})),{root:r,createViewer:o,rebuildViewer:s,updateViewer:d,destroyViewer:a}}}),Yn={ref:"root"};Rn.render=function(t,e,i,n,r,c){return o(),a("div",Yn,[s(t.$slots,"default",{images:t.images,options:t.options})],512)};e("t",{install(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.name,o=void 0===r?"viewer":r,a=n.debug,s=void 0!==a&&a,c=n.defaultOptions;c&&de.setDefaults(c),e.config.globalProperties[`$${o}Api`]=xn,e.component(o,fn(Rn,{name:o})),e.directive(o,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.name,r=void 0===n?"viewer":n,o=e.debug,a=void 0!==o&&o;function s(t,e){return c.apply(this,arguments)}function c(){return c=i(t().mark((function e(i,n){var o,a,s=arguments;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=s.length>2&&void 0!==s[2]&&s[2],a=s.length>3&&void 0!==s[3]&&s[3],t.next=4,v();case 4:a&&!function(t){var e=t.innerHTML.match(/<img([\w\W]+?)[\\/]?>/g),i=e?e.join(""):void 0;return t.__viewerImageDiffCache===i?(d("Element change detected, but image(s) has not changed"),!1):(d("Image change detected"),t.__viewerImageDiffCache=i,!0)}(i)||(o||!i[`$${r}`]?(u(i),i[`$${r}`]=new de(i,n),d("Viewer created")):(i[`$${r}`].update(),d("Viewer updated")));case 5:case"end":return t.stop()}}),e)}))),c.apply(this,arguments)}function u(t){t[`$${r}`]&&(t[`$${r}`].destroy(),delete t[`$${r}`],d("Viewer destroyed"))}function h(t){t.__viewerMutationObserver&&(t.__viewerMutationObserver.disconnect(),delete t.__viewerMutationObserver,d("observer destroyed"))}function d(){var t;a&&(t=console).log.apply(t,arguments)}return{mounted(t,e,i){d("Viewer bind");var n=_n(s,50);n(t,e.value),function(t,e,i,n){t.__viewerUnwatch=l((function(){return e.value}),(function(i,r){d("Change detected by watcher: ",e.value),n(t,i,!0,!1)}),{deep:!0}),d("Watcher created, expression: ",e.value)}(t,e,0,n),e.modifiers.static||function(t,e,i,n){h(t);var r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(r){var o=new r((function(r){r.forEach((function(r){d(`Viewer mutation:${r.type}`),i(t,e,n,!0)}))}));o.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),t.__viewerMutationObserver=o,d("Observer created")}else d("Observer not supported")}(t,e.value,n,e.modifiers.rebuild)},unmounted(t){d("Viewer unbind"),h(t),function(t){t.__viewerUnwatch&&(t.__viewerUnwatch(),delete t.__viewerUnwatch,d("Watcher destroyed"))}(t),u(t)}}}({name:o,debug:s}))},setDefaults(t){de.setDefaults(t)}})}}}))}();