mirror of
https://github.com/vastxie/99AI.git
synced 2025-09-19 18:16:39 +08:00
18 lines
50 KiB
JavaScript
18 lines
50 KiB
JavaScript
import{l as Rt,R as Vt,w as vt,d as Ue,r as Xe,n as gt,f as He,G as qe,S as Be,U as Ke,m as Ge}from"./vue-10b4afc0.js";/*!
|
||
* Viewer.js v1.11.6
|
||
* https://fengyuanchen.github.io/viewerjs
|
||
*
|
||
* Copyright 2015-present Chen Fengyuan
|
||
* Released under the MIT license
|
||
*
|
||
* Date: 2023-09-17T03:16:38.052Z
|
||
*/function Mt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,r)}return i}function kt(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Mt(Object(i),!0).forEach(function(r){Qe(e,r,i[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Mt(Object(i)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(i,r))})}return e}function xt(e){"@babel/helpers - typeof";return xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(e)}function Ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ft(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xe(r.key),r)}}function Je(e,t,i){return t&&Ft(e.prototype,t),i&&Ft(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qe(e,t,i){return t=xe(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ti(e,t){if(typeof e!="object"||e===null)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var r=i.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xe(e){var t=ti(e,"string");return typeof t=="symbol"?t:String(t)}var Wt={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"],initialCoverage:.9,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},ei='<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>',Tt=typeof window<"u"&&typeof window.document<"u",Y=Tt?window:{},Z=Tt&&Y.document.documentElement?"ontouchstart"in Y.document.documentElement:!1,jt=Tt?"PointerEvent"in Y:!1,g="viewer",mt="move",De="switch",nt="zoom",ut="".concat(g,"-active"),ii="".concat(g,"-close"),pt="".concat(g,"-fade"),Dt="".concat(g,"-fixed"),ri="".concat(g,"-fullscreen"),Yt="".concat(g,"-fullscreen-exit"),U="".concat(g,"-hide"),ni="".concat(g,"-hide-md-down"),ai="".concat(g,"-hide-sm-down"),si="".concat(g,"-hide-xs-down"),k="".concat(g,"-in"),at="".concat(g,"-invisible"),J="".concat(g,"-loading"),oi="".concat(g,"-move"),Ut="".concat(g,"-open"),H="".concat(g,"-show"),x="".concat(g,"-transition"),Q="click",Nt="dblclick",Xt="dragstart",Ht="focusin",qt="keydown",j="load",X="error",li=Z?"touchend touchcancel":"mouseup",ui=Z?"touchmove":"mousemove",ci=Z?"touchstart":"mousedown",Bt=jt?"pointerdown":ci,Kt=jt?"pointermove":ui,Gt=jt?"pointerup pointercancel":li,Zt="resize",V="transitionend",Jt="wheel",Qt="ready",te="show",ee="shown",ie="hide",re="hidden",ne="view",st="viewed",ae="move",se="moved",oe="rotate",le="rotated",ue="scale",ce="scaled",he="zoom",fe="zoomed",de="play",ve="stop",wt="".concat(g,"Action"),zt=/\s\s*/,ct=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ot(e){return typeof e=="string"}var hi=Number.isNaN||Y.isNaN;function A(e){return typeof e=="number"&&!hi(e)}function B(e){return typeof e>"u"}function tt(e){return xt(e)==="object"&&e!==null}var fi=Object.prototype.hasOwnProperty;function K(e){if(!tt(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&fi.call(i,"isPrototypeOf")}catch{return!1}}function E(e){return typeof e=="function"}function O(e,t){if(e&&E(t))if(Array.isArray(e)||A(e.length)){var i=e.length,r;for(r=0;r<i&&t.call(e,e[r],r,e)!==!1;r+=1);}else tt(e)&&Object.keys(e).forEach(function(n){t.call(e,e[n],n,e)});return e}var L=Object.assign||function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return tt(t)&&r.length>0&&r.forEach(function(a){tt(a)&&Object.keys(a).forEach(function(s){t[s]=a[s]})}),t},di=/^(?:width|height|left|top|marginLeft|marginTop)$/;function M(e,t){var i=e.style;O(t,function(r,n){di.test(n)&&A(r)&&(r+="px"),i[n]=r})}function vi(e){return ot(e)?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):e}function q(e,t){return!e||!t?!1:e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function d(e,t){if(!(!e||!t)){if(A(e.length)){O(e,function(r){d(r,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function b(e,t){if(!(!e||!t)){if(A(e.length)){O(e,function(i){b(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function lt(e,t,i){if(t){if(A(e.length)){O(e,function(r){lt(r,t,i)});return}i?d(e,t):b(e,t)}}var gi=/([a-z\d])([A-Z])/g;function Pt(e){return e.replace(gi,"$1-$2").toLowerCase()}function G(e,t){return tt(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Pt(t)))}function $t(e,t,i){tt(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(Pt(t)),i)}var Ne=function(){var e=!1;if(Tt){var t=!1,i=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(a){t=a}});Y.addEventListener("test",i,r),Y.removeEventListener("test",i,r)}return e}();function _(e,t,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(zt).forEach(function(a){if(!Ne){var s=e.listeners;s&&s[a]&&s[a][i]&&(n=s[a][i],delete s[a][i],Object.keys(s[a]).length===0&&delete s[a],Object.keys(s).length===0&&delete e.listeners)}e.removeEventListener(a,n,r)})}function v(e,t,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(zt).forEach(function(a){if(r.once&&!Ne){var s=e.listeners,l=s===void 0?{}:s;n=function(){delete l[a][i],e.removeEventListener(a,n,r);for(var o=arguments.length,h=new Array(o),u=0;u<o;u++)h[u]=arguments[u];i.apply(e,h)},l[a]||(l[a]={}),l[a][i]&&e.removeEventListener(a,l[a][i],r),l[a][i]=n,e.listeners=l}e.addEventListener(a,n,r)})}function N(e,t,i,r){var n;return E(Event)&&E(CustomEvent)?n=new CustomEvent(t,kt({bubbles:!0,cancelable:!0,detail:i},r)):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,i)),e.dispatchEvent(n)}function mi(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}function bt(e){var t=e.rotate,i=e.scaleX,r=e.scaleY,n=e.translateX,a=e.translateY,s=[];A(n)&&n!==0&&s.push("translateX(".concat(n,"px)")),A(a)&&a!==0&&s.push("translateY(".concat(a,"px)")),A(t)&&t!==0&&s.push("rotate(".concat(t,"deg)")),A(i)&&i!==1&&s.push("scaleX(".concat(i,")")),A(r)&&r!==1&&s.push("scaleY(".concat(r,")"));var l=s.length?s.join(" "):"none";return{WebkitTransform:l,msTransform:l,transform:l}}function pi(e){return ot(e)?decodeURIComponent(e.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var St=Y.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(Y.navigator.userAgent);function $e(e,t,i){var r=document.createElement("img");if(e.naturalWidth&&!St)return i(e.naturalWidth,e.naturalHeight),r;var n=document.body||document.documentElement;return r.onload=function(){i(r.width,r.height),St||n.removeChild(r)},O(t.inheritedAttributes,function(a){var s=e.getAttribute(a);s!==null&&r.setAttribute(a,s)}),r.src=e.src,St||(r.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.appendChild(r)),r}function ht(e){switch(e){case 2:return si;case 3:return ai;case 4:return ni;default:return""}}function bi(e){var t=kt({},e),i=[];return O(e,function(r,n){delete t[n],O(t,function(a){var s=Math.abs(r.startX-a.startX),l=Math.abs(r.startY-a.startY),c=Math.abs(r.endX-a.endX),o=Math.abs(r.endY-a.endY),h=Math.sqrt(s*s+l*l),u=Math.sqrt(c*c+o*o),f=(u-h)/h;i.push(f)})}),i.sort(function(r,n){return Math.abs(r)<Math.abs(n)}),i[0]}function ft(e,t){var i=e.pageX,r=e.pageY,n={endX:i,endY:r};return t?n:kt({timeStamp:Date.now(),startX:i,startY:r},n)}function yi(e){var t=0,i=0,r=0;return O(e,function(n){var a=n.startX,s=n.startY;t+=a,i+=s,r+=1}),t/=r,i/=r,{pageX:t,pageY:i}}var wi={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.element.ownerDocument,i=t.body||t.documentElement;this.body=i,this.scrollbarWidth=window.innerWidth-t.documentElement.clientWidth,this.initialBodyPaddingRight=i.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(i).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t=this.options,i=this.parent,r;t.inline&&(r={width:Math.max(i.offsetWidth,t.minWidth),height:Math.max(i.offsetHeight,t.minHeight)},this.parentData=r),(this.fulled||!r)&&(r=this.containerData),this.viewerData=L({},r)},renderViewer:function(){this.options.inline&&!this.fulled&&M(this.viewer,this.viewerData)},initList:function(){var t=this,i=this.element,r=this.options,n=this.list,a=[];n.innerHTML="",O(this.images,function(s,l){var c=s.src,o=s.alt||pi(c),h=t.getImageURL(s);if(c||h){var u=document.createElement("li"),f=document.createElement("img");O(r.inheritedAttributes,function(m){var p=s.getAttribute(m);p!==null&&f.setAttribute(m,p)}),r.navbar&&(f.src=c||h),f.alt=o,f.setAttribute("data-original-url",h||c),u.setAttribute("data-index",l),u.setAttribute("data-viewer-action","view"),u.setAttribute("role","button"),r.keyboard&&u.setAttribute("tabindex",0),u.appendChild(f),n.appendChild(u),a.push(u)}}),this.items=a,O(a,function(s){var l=s.firstElementChild,c,o;$t(l,"filled",!0),r.loading&&d(s,J),v(l,j,c=function(u){_(l,X,o),r.loading&&b(s,J),t.loadImage(u)},{once:!0}),v(l,X,o=function(){_(l,j,c),r.loading&&b(s,J)},{once:!0})}),r.transition&&v(i,st,function(){d(n,x)},{once:!0})},renderList:function(){var t=this.index,i=this.items[t];if(i){var r=i.nextElementSibling,n=parseInt(window.getComputedStyle(r||i).marginLeft,10),a=i.offsetWidth,s=a+n;M(this.list,L({width:s*this.length-n},bt({translateX:(this.viewerData.width-a)/2-s*t})))}},resetList:function(){var t=this.list;t.innerHTML="",b(t,x),M(t,bt({translateX:0}))},initImage:function(t){var i=this,r=this.options,n=this.image,a=this.viewerData,s=this.footer.offsetHeight,l=a.width,c=Math.max(a.height-s,s),o=this.imageData||{},h;this.imageInitializing={abort:function(){h.onload=null}},h=$e(n,r,function(u,f){var m=u/f,p=Math.max(0,Math.min(1,r.initialCoverage)),y=l,I=c;i.imageInitializing=!1,c*m>l?I=l/m:y=c*m,p=A(p)?p:.9,y=Math.min(y*p,u),I=Math.min(I*p,f);var D=(l-y)/2,$=(c-I)/2,T={left:D,top:$,x:D,y:$,width:y,height:I,oldRatio:1,ratio:y/u,aspectRatio:m,naturalWidth:u,naturalHeight:f},z=L({},T);r.rotatable&&(T.rotate=o.rotate||0,z.rotate=0),r.scalable&&(T.scaleX=o.scaleX||1,T.scaleY=o.scaleY||1,z.scaleX=1,z.scaleY=1),i.imageData=T,i.initialImageData=z,t&&t()})},renderImage:function(t){var i=this,r=this.image,n=this.imageData;if(M(r,L({width:n.width,height:n.height,marginLeft:n.x,marginTop:n.y},bt(n))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&q(r,x)){var a=function(){i.imageRendering=!1,t()};this.imageRendering={abort:function(){_(r,V,a)}},v(r,V,a,{once:!0})}else t()},resetImage:function(){var t=this.image;t&&(this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null,this.title.innerHTML="")}},Ti={bind:function(){var t=this.options,i=this.viewer,r=this.canvas,n=this.element.ownerDocument;v(i,Q,this.onClick=this.click.bind(this)),v(i,Xt,this.onDragStart=this.dragstart.bind(this)),v(r,Bt,this.onPointerDown=this.pointerdown.bind(this)),v(n,Kt,this.onPointerMove=this.pointermove.bind(this)),v(n,Gt,this.onPointerUp=this.pointerup.bind(this)),v(n,qt,this.onKeyDown=this.keydown.bind(this)),v(window,Zt,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&v(i,Jt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&v(r,Nt,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,i=this.viewer,r=this.canvas,n=this.element.ownerDocument;_(i,Q,this.onClick),_(i,Xt,this.onDragStart),_(r,Bt,this.onPointerDown),_(n,Kt,this.onPointerMove),_(n,Gt,this.onPointerUp),_(n,qt,this.onKeyDown),_(window,Zt,this.onResize),t.zoomable&&t.zoomOnWheel&&_(i,Jt,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&_(r,Nt,this.onDblclick)}},Ei={click:function(t){var i=this.options,r=this.imageData,n=t.target,a=G(n,wt);switch(!a&&n.localName==="img"&&n.parentElement.localName==="li"&&(n=n.parentElement,a=G(n,wt)),Z&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),a){case"mix":this.played?this.stop():i.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(G(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(i.loop);break;case"play":this.play(i.fullscreen);break;case"next":this.next(i.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-r.scaleX||-1);break;case"flip-vertical":this.scaleY(-r.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(Z&&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 i=this.element,r=this.options,n=this.image,a=this.index,s=this.viewerData;b(n,at),r.loading&&b(this.canvas,J),n.style.cssText="height:0;"+"margin-left:".concat(s.width/2,"px;")+"margin-top:".concat(s.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){lt(n,oi,r.movable),lt(n,x,r.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,E(r.viewed)&&v(i,st,r.viewed,{once:!0}),N(i,st,{originalImage:t.images[a],index:a,image:n},{cancelable:!1})})})},loadImage:function(t){var i=t.target,r=i.parentNode,n=r.offsetWidth||30,a=r.offsetHeight||50,s=!!G(i,"filled");$e(i,this.options,function(l,c){var o=l/c,h=n,u=a;a*o>n?s?h=a*o:u=n/o:s?u=n/o:h=a*o,M(i,L({width:h,height:u},bt({translateX:(n-h)/2,translateY:(a-u)/2})))})},keydown:function(t){var i=this.options;if(i.keyboard){var r=t.keyCode||t.which||t.charCode;switch(r){case 13:this.viewer.contains(t.target)&&this.click(t);break}if(this.fulled)switch(r){case 27:this.played?this.stop():i.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(i.loop);break;case 38:t.preventDefault(),this.zoom(i.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(i.loop);break;case 40:t.preventDefault(),this.zoom(-i.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle());break}}},dragstart:function(t){t.target.localName==="img"&&t.preventDefault()},pointerdown:function(t){var i=this.options,r=this.pointers,n=t.buttons,a=t.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(A(n)&&n!==1||A(a)&&a!==0||t.ctrlKey))){t.preventDefault(),t.changedTouches?O(t.changedTouches,function(l){r[l.identifier]=ft(l)}):r[t.pointerId||0]=ft(t);var s=i.movable?mt:!1;i.zoomOnTouch&&i.zoomable&&Object.keys(r).length>1?s=nt:i.slideOnTouch&&(t.pointerType==="touch"||t.type==="touchstart")&&this.isSwitchable()&&(s=De),i.transition&&(s===mt||s===nt)&&b(this.image,x),this.action=s}},pointermove:function(t){var i=this.pointers,r=this.action;!this.viewed||!r||(t.preventDefault(),t.changedTouches?O(t.changedTouches,function(n){L(i[n.identifier]||{},ft(n,!0))}):L(i[t.pointerId||0]||{},ft(t,!0)),this.change(t))},pointerup:function(t){var i=this,r=this.options,n=this.action,a=this.pointers,s;t.changedTouches?O(t.changedTouches,function(l){s=a[l.identifier],delete a[l.identifier]}):(s=a[t.pointerId||0],delete a[t.pointerId||0]),n&&(t.preventDefault(),r.transition&&(n===mt||n===nt)&&d(this.image,x),this.action=!1,Z&&n!==nt&&s&&Date.now()-s.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),r.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){N(i.image,Nt,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){i.imageClicked=!1},500)):(this.imageClicked=!1,r.backdrop&&r.backdrop!=="static"&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){N(i.canvas,Q,{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)){this.stop();return}O(this.player.getElementsByTagName("img"),function(i){v(i,j,t.loadImage.bind(t),{once:!0}),N(i,j)})}},wheel:function(t){var i=this;if(this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50);var r=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*r,!0,null,t)}}},_i={show:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.element,r=this.options;if(r.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(E(r.show)&&v(i,te,r.show,{once:!0}),N(i,te)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(b(n,U),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("aria-hidden"),r.transition&&!t){var a=this.shown.bind(this);this.transitioning={abort:function(){_(n,V,a),b(n,k)}},d(n,x),n.initialOffsetWidth=n.offsetWidth,v(n,V,a,{once:!0}),d(n,k)}else d(n,k),this.shown();return this},hide:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.element,n=this.options;if(n.inline||this.hiding||!(this.isShown||this.showing))return this;if(E(n.hide)&&v(r,ie,n.hide,{once:!0}),N(r,ie)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var a=this.viewer,s=this.image,l=function(){b(a,k),t.hidden()};if(n.transition&&!i){var c=function h(u){u&&u.target===a&&(_(a,V,h),t.hidden())},o=function(){q(a,x)?(v(a,V,c),b(a,k)):l()};this.transitioning={abort:function(){t.viewed&&q(s,x)?_(s,V,o):q(a,x)&&_(a,V,c)}},this.viewed&&q(s,x)?(v(s,V,o,{once:!0}),this.zoomTo(0,!1,null,null,!0)):o()}else l();return this},view:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(i=Number(i)||0,this.hiding||this.played||i<0||i>=this.length||this.viewed&&i===this.index)return this;if(!this.isShown)return this.index=i,this.show();this.viewing&&this.viewing.abort();var r=this.element,n=this.options,a=this.title,s=this.canvas,l=this.items[i],c=l.querySelector("img"),o=G(c,"originalUrl"),h=c.getAttribute("alt"),u=document.createElement("img");if(O(n.inheritedAttributes,function(I){var D=c.getAttribute(I);D!==null&&u.setAttribute(I,D)}),u.src=o,u.alt=h,E(n.view)&&v(r,ne,n.view,{once:!0}),N(r,ne,{originalImage:this.images[i],index:i,image:u})===!1||!this.isShown||this.hiding||this.played)return this;var f=this.items[this.index];f&&(b(f,ut),f.removeAttribute("aria-selected")),d(l,ut),l.setAttribute("aria-selected",!0),n.focus&&l.focus(),this.image=u,this.viewed=!1,this.index=i,this.imageData={},d(u,at),n.loading&&d(s,J),s.innerHTML="",s.appendChild(u),this.renderList(),a.innerHTML="";var m=function(){var D=t.imageData,$=Array.isArray(n.title)?n.title[1]:n.title;a.innerHTML=vi(E($)?$.call(t,u,D):"".concat(h," (").concat(D.naturalWidth," × ").concat(D.naturalHeight,")"))},p,y;return v(r,st,m,{once:!0}),this.viewing={abort:function(){_(r,st,m),u.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(u.src="",_(u,j,p),t.timeout&&clearTimeout(t.timeout))}},u.complete?this.load():(v(u,j,p=function(){_(u,X,y),t.load()},{once:!0}),v(u,X,y=function(){_(u,j,p),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),b(u,at),n.loading&&b(t.canvas,J)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){b(u,at),t.timeout=!1},1e3)),this},prev:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.index-1;return i<0&&(i=t?this.length-1:0),this.view(i),this},next:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.length-1,r=this.index+1;return r>i&&(r=t?0:i),this.view(r),this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=this.imageData;return this.moveTo(B(t)?t:r.x+Number(t),B(i)?i:r.y+Number(i)),this},moveTo:function(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=this.element,s=this.options,l=this.imageData;if(t=Number(t),r=Number(r),this.viewed&&!this.played&&s.movable){var c=l.x,o=l.y,h=!1;if(A(t)?h=!0:t=c,A(r)?h=!0:r=o,h){if(E(s.move)&&v(a,ae,s.move,{once:!0}),N(a,ae,{x:t,y:r,oldX:c,oldY:o,originalEvent:n})===!1)return this;l.x=t,l.y=r,l.left=t,l.top=r,this.moving=!0,this.renderImage(function(){i.moving=!1,E(s.moved)&&v(a,se,s.moved,{once:!0}),N(a,se,{x:t,y:r,oldX:c,oldY:o,originalEvent:n},{cancelable:!1})})}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var i=this,r=this.element,n=this.options,a=this.imageData;if(t=Number(t),A(t)&&this.viewed&&!this.played&&n.rotatable){var s=a.rotate;if(E(n.rotate)&&v(r,oe,n.rotate,{once:!0}),N(r,oe,{degree:t,oldDegree:s})===!1)return this;a.rotate=t,this.rotating=!0,this.renderImage(function(){i.rotating=!1,E(n.rotated)&&v(r,le,n.rotated,{once:!0}),N(r,le,{degree:t,oldDegree:s},{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 i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.element,a=this.options,s=this.imageData;if(t=Number(t),r=Number(r),this.viewed&&!this.played&&a.scalable){var l=s.scaleX,c=s.scaleY,o=!1;if(A(t)?o=!0:t=l,A(r)?o=!0:r=c,o){if(E(a.scale)&&v(n,ue,a.scale,{once:!0}),N(n,ue,{scaleX:t,scaleY:r,oldScaleX:l,oldScaleY:c})===!1)return this;s.scaleX=t,s.scaleY=r,this.scaling=!0,this.renderImage(function(){i.scaling=!1,E(a.scaled)&&v(n,ce,a.scaled,{once:!0}),N(n,ce,{scaleX:t,scaleY:r,oldScaleX:l,oldScaleY:c},{cancelable:!1})})}}return this},zoom:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,a=this.imageData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,i,r,n),this},zoomTo:function(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,l=this.element,c=this.options,o=this.pointers,h=this.imageData,u=h.x,f=h.y,m=h.width,p=h.height,y=h.naturalWidth,I=h.naturalHeight;if(t=Math.max(0,t),A(t)&&this.viewed&&!this.played&&(s||c.zoomable)){if(!s){var D=Math.max(.01,c.minZoomRatio),$=Math.min(100,c.maxZoomRatio);t=Math.min(Math.max(t,D),$)}if(a)switch(a.type){case"wheel":c.zoomRatio>=.055&&t>.95&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":t>.99&&t<1.01&&(t=1);break}var T=y*t,z=I*t,P=T-m,w=z-p,C=h.ratio;if(E(c.zoom)&&v(l,he,c.zoom,{once:!0}),N(l,he,{ratio:t,oldRatio:C,originalEvent:a})===!1)return this;if(this.zooming=!0,a){var R=mi(this.viewer),F=o&&Object.keys(o).length>0?yi(o):{pageX:a.pageX,pageY:a.pageY};h.x-=P*((F.pageX-R.left-u)/m),h.y-=w*((F.pageY-R.top-f)/p)}else K(n)&&A(n.x)&&A(n.y)?(h.x-=P*((n.x-u)/m),h.y-=w*((n.y-f)/p)):(h.x-=P/2,h.y-=w/2);h.left=h.x,h.top=h.y,h.width=T,h.height=z,h.oldRatio=C,h.ratio=t,this.renderImage(function(){i.zooming=!1,E(c.zoomed)&&v(l,fe,c.zoomed,{once:!0}),N(l,fe,{ratio:t,oldRatio:C,originalEvent:a},{cancelable:!1})}),r&&this.tooltip()}return this},play:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var r=this.element,n=this.options;if(E(n.play)&&v(r,de,n.play,{once:!0}),N(r,de)===!1)return this;var a=this.player,s=this.loadImage.bind(this),l=[],c=0,o=0;if(this.played=!0,this.onLoadWhenPlay=s,i&&this.requestFullscreen(i),d(a,H),O(this.items,function(f,m){var p=f.querySelector("img"),y=document.createElement("img");y.src=G(p,"originalUrl"),y.alt=p.getAttribute("alt"),y.referrerPolicy=p.referrerPolicy,c+=1,d(y,pt),lt(y,x,n.transition),q(f,ut)&&(d(y,k),o=m),l.push(y),v(y,j,s,{once:!0}),a.appendChild(y)}),A(n.interval)&&n.interval>0){var h=function f(){clearTimeout(t.playing.timeout),b(l[o],k),o-=1,o=o>=0?o:c-1,d(l[o],k),t.playing.timeout=setTimeout(f,n.interval)},u=function f(){clearTimeout(t.playing.timeout),b(l[o],k),o+=1,o=o<c?o:0,d(l[o],k),t.playing.timeout=setTimeout(f,n.interval)};c>1&&(this.playing={prev:h,next:u,timeout:setTimeout(u,n.interval)})}return this},stop:function(){var t=this;if(!this.played)return this;var i=this.element,r=this.options;if(E(r.stop)&&v(i,ve,r.stop,{once:!0}),N(i,ve)===!1)return this;var n=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,O(n.getElementsByTagName("img"),function(a){_(a,j,t.onLoadWhenPlay)}),b(n,H),n.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,i=this.options,r=this.viewer,n=this.image,a=this.list;return!this.isShown||this.played||this.fulled||!i.inline?this:(this.fulled=!0,this.open(),d(this.button,Yt),i.transition&&(b(a,x),this.viewed&&b(n,x)),d(r,Dt),r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",this.title.id),r.setAttribute("aria-modal",!0),r.removeAttribute("style"),M(r,{zIndex:i.zIndex}),i.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=L({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){d(n,x),d(a,x)},0)})}),this)},exit:function(){var t=this,i=this.options,r=this.viewer,n=this.image,a=this.list;return!this.isShown||this.played||!this.fulled||!i.inline?this:(this.fulled=!1,this.close(),b(this.button,Yt),i.transition&&(b(a,x),this.viewed&&b(n,x)),i.focus&&this.clearEnforceFocus(),r.removeAttribute("role"),r.removeAttribute("aria-labelledby"),r.removeAttribute("aria-modal"),b(r,Dt),M(r,{zIndex:i.zIndexInline}),this.viewerData=L({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){d(n,x),d(a,x)},0)})}),this)},tooltip:function(){var t=this,i=this.options,r=this.tooltipBox,n=this.imageData;return!this.viewed||this.played||!i.tooltip?this:(r.textContent="".concat(Math.round(n.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):i.transition?(this.fading&&N(r,V),d(r,H),d(r,pt),d(r,x),r.removeAttribute("aria-hidden"),r.initialOffsetWidth=r.offsetWidth,d(r,k)):(d(r,H),r.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){i.transition?(v(r,V,function(){b(r,H),b(r,pt),b(r,x),r.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),b(r,k),t.fading=!0):(b(r,H),r.setAttribute("aria-hidden",!0)),t.tooltipping=!1},1e3),this)},toggle:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=L({},this.initialImageData),this.renderImage()),this},update:function(){var t=this,i=this.element,r=this.options,n=this.isImg;if(n&&!i.parentNode)return this.destroy();var a=[];if(O(n?[i]:i.querySelectorAll("img"),function(o){E(r.filter)?r.filter.call(t,o)&&a.push(o):t.getImageURL(o)&&a.push(o)}),!a.length)return this;if(this.images=a,this.length=a.length,this.ready){var s=[];if(O(this.items,function(o,h){var u=o.querySelector("img"),f=a[h];f&&u?(f.src!==u.src||f.alt!==u.alt)&&s.push(h):s.push(h)}),M(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var l=s.indexOf(this.index);if(l>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-l,this.length-1),0));else{var c=this.items[this.index];d(c,ut),c.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,i=this.options;return t[g]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),i.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)):i.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),i.inline||_(t,Q,this.onStart),t[g]=void 0,this):this}},Oi={getImageURL:function(t){var i=this.options.url;return ot(i)?i=t.getAttribute(i):E(i)?i=i.call(this,t):i="",i},enforceFocus:function(){var t=this;this.clearEnforceFocus(),v(document,Ht,this.onFocusin=function(i){var r=t.viewer,n=i.target;if(!(n===document||n===r||r.contains(n))){for(;n;){if(n.getAttribute("tabindex")!==null||n.getAttribute("aria-modal")==="true")return;n=n.parentElement}r.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(_(document,Ht,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;d(t,Ut),this.scrollbarWidth>0&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;b(t,Ut),this.scrollbarWidth>0&&(t.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var t=this.element,i=this.options,r=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,i.focus&&(r.focus(),this.enforceFocus()),E(i.shown)&&v(t,ee,i.shown,{once:!0}),N(t,ee)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,i=this.options,r=this.viewer;i.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),d(r,U),r.removeAttribute("role"),r.removeAttribute("aria-labelledby"),r.removeAttribute("aria-modal"),r.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(E(i.hidden)&&v(t,re,i.hidden,{once:!0}),N(t,re,null,{cancelable:!1}))},requestFullscreen:function(t){var i=this.element.ownerDocument;if(this.fulled&&!(i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement)){var r=i.documentElement;r.requestFullscreen?K(t)?r.requestFullscreen(t):r.requestFullscreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):r.mozRequestFullScreen?r.mozRequestFullScreen():r.msRequestFullscreen&&r.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 i=this.options,r=this.pointers,n=r[Object.keys(r)[0]];if(n){var a=n.endX-n.startX,s=n.endY-n.startY;switch(this.action){case mt:(a!==0||s!==0)&&(this.pointerMoved=!0,this.move(a,s,t));break;case nt:this.zoom(bi(r),!1,null,t);break;case De:{this.action="switched";var l=Math.abs(a);l>1&&l>Math.abs(s)&&(this.pointers={},a>1?this.prev(i.loop):a<-1&&this.next(i.loop));break}}O(r,function(c){c.startX=c.endX,c.startY=c.endY})}},isSwitchable:function(){var t=this.imageData,i=this.viewerData;return this.length>1&&t.x>=0&&t.y>=0&&t.width<=i.width&&t.height<=i.height}},Si=Y.Viewer,Ii=function(e){return function(){return e+=1,e}}(-1),et=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ze(this,e),!t||t.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=L({},Wt,K(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.pointerMoved=!1,this.id=Ii(),this.init()}return Je(e,[{key:"init",value:function(){var i=this,r=this.element,n=this.options;if(!r[g]){r[g]=this,n.focus&&!n.keyboard&&(n.focus=!1);var a=r.localName==="img",s=[];if(O(a?[r]:r.querySelectorAll("img"),function(o){E(n.filter)?n.filter.call(i,o)&&s.push(o):i.getImageURL(o)&&s.push(o)}),this.isImg=a,this.length=s.length,this.images=s,this.initBody(),B(document.createElement(g).style.transition)&&(n.transition=!1),n.inline){var l=0,c=function(){if(l+=1,l===i.length){var h;i.initializing=!1,i.delaying={abort:function(){clearTimeout(h)}},h=setTimeout(function(){i.delaying=!1,i.build()},0)}};this.initializing={abort:function(){O(s,function(h){h.complete||(_(h,j,c),_(h,X,c))})}},O(s,function(o){if(o.complete)c();else{var h,u;v(o,j,h=function(){_(o,X,u),c()},{once:!0}),v(o,X,u=function(){_(o,j,h),c()},{once:!0})}})}else v(r,Q,this.onStart=function(o){var h=o.target;h.localName==="img"&&(!E(n.filter)||n.filter.call(i,h))&&i.view(i.images.indexOf(h))})}}},{key:"build",value:function(){if(!this.ready){var i=this.element,r=this.options,n=i.parentNode,a=document.createElement("div");a.innerHTML=ei;var s=a.querySelector(".".concat(g,"-container")),l=s.querySelector(".".concat(g,"-title")),c=s.querySelector(".".concat(g,"-toolbar")),o=s.querySelector(".".concat(g,"-navbar")),h=s.querySelector(".".concat(g,"-button")),u=s.querySelector(".".concat(g,"-canvas"));if(this.parent=n,this.viewer=s,this.title=l,this.toolbar=c,this.navbar=o,this.button=h,this.canvas=u,this.footer=s.querySelector(".".concat(g,"-footer")),this.tooltipBox=s.querySelector(".".concat(g,"-tooltip")),this.player=s.querySelector(".".concat(g,"-player")),this.list=s.querySelector(".".concat(g,"-list")),s.id="".concat(g).concat(this.id),l.id="".concat(g,"Title").concat(this.id),d(l,r.title?ht(Array.isArray(r.title)?r.title[0]:r.title):U),d(o,r.navbar?ht(r.navbar):U),lt(h,U,!r.button),r.keyboard&&h.setAttribute("tabindex",0),r.backdrop&&(d(s,"".concat(g,"-backdrop")),!r.inline&&r.backdrop!=="static"&&$t(u,wt,"hide")),ot(r.className)&&r.className&&r.className.split(zt).forEach(function(T){d(s,T)}),r.toolbar){var f=document.createElement("ul"),m=K(r.toolbar),p=ct.slice(0,3),y=ct.slice(7,9),I=ct.slice(9);m||d(c,ht(r.toolbar)),O(m?r.toolbar:ct,function(T,z){var P=m&&K(T),w=m?Pt(z):T,C=P&&!B(T.show)?T.show:T;if(!(!C||!r.zoomable&&p.indexOf(w)!==-1||!r.rotatable&&y.indexOf(w)!==-1||!r.scalable&&I.indexOf(w)!==-1)){var R=P&&!B(T.size)?T.size:T,F=P&&!B(T.click)?T.click:T,W=document.createElement("li");r.keyboard&&W.setAttribute("tabindex",0),W.setAttribute("role","button"),d(W,"".concat(g,"-").concat(w)),E(F)||$t(W,wt,w),A(C)&&d(W,ht(C)),["small","large"].indexOf(R)!==-1?d(W,"".concat(g,"-").concat(R)):w==="play"&&d(W,"".concat(g,"-large")),E(F)&&v(W,Q,F),f.appendChild(W)}}),c.appendChild(f)}else d(c,U);if(!r.rotatable){var D=c.querySelectorAll('li[class*="rotate"]');d(D,at),O(D,function(T){c.appendChild(T)})}if(r.inline)d(h,ri),M(s,{zIndex:r.zIndexInline}),window.getComputedStyle(n).position==="static"&&M(n,{position:"relative"}),n.insertBefore(s,i.nextSibling);else{d(h,ii),d(s,Dt),d(s,pt),d(s,U),M(s,{zIndex:r.zIndex});var $=r.container;ot($)&&($=i.ownerDocument.querySelector($)),$||($=this.body),$.appendChild(s)}if(r.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,E(r.ready)&&v(i,Qt,r.ready,{once:!0}),N(i,Qt)===!1){this.ready=!1;return}this.ready&&r.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=Si,e}},{key:"setDefaults",value:function(i){L(Wt,K(i)&&i)}}]),e}();L(et.prototype,wi,Ti,Ei,_i,Oi);/*!
|
||
* v-viewer v3.0.11
|
||
* https://github.com/mirari/v-viewer#readme
|
||
*
|
||
* Copyright 2022 mirari
|
||
* Released under the MIT license
|
||
*
|
||
* Date: 2022-10-25T08:49:33.301Z
|
||
*/var dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ai(e){return e}var Ce=Ai;function xi(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}var Di=xi,Ni=Di,ge=Math.max;function $i(e,t,i){return t=ge(t===void 0?e.length-1:t,0),function(){for(var r=arguments,n=-1,a=ge(r.length-t,0),s=Array(a);++n<a;)s[n]=r[t+n];n=-1;for(var l=Array(t+1);++n<t;)l[n]=r[n];return l[t]=i(s),Ni(e,this,l)}}var Ci=$i;function Li(e){return function(){return e}}var ki=Li,ji=typeof dt=="object"&&dt&&dt.Object===Object&&dt,Le=ji,zi=Le,Pi=typeof self=="object"&&self&&self.Object===Object&&self,Ri=zi||Pi||Function("return this")(),Et=Ri,Vi=Et,Mi=Vi.Symbol,ke=Mi,me=ke,je=Object.prototype,Fi=je.hasOwnProperty,Wi=je.toString,rt=me?me.toStringTag:void 0;function Yi(e){var t=Fi.call(e,rt),i=e[rt];try{e[rt]=void 0;var r=!0}catch{}var n=Wi.call(e);return r&&(t?e[rt]=i:delete e[rt]),n}var Ui=Yi,Xi=Object.prototype,Hi=Xi.toString;function qi(e){return Hi.call(e)}var Bi=qi,pe=ke,Ki=Ui,Gi=Bi,Zi="[object Null]",Ji="[object Undefined]",be=pe?pe.toStringTag:void 0;function Qi(e){return e==null?e===void 0?Ji:Zi:be&&be in Object(e)?Ki(e):Gi(e)}var _t=Qi;function tr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var it=tr,er=_t,ir=it,rr="[object AsyncFunction]",nr="[object Function]",ar="[object GeneratorFunction]",sr="[object Proxy]";function or(e){if(!ir(e))return!1;var t=er(e);return t==nr||t==ar||t==rr||t==sr}var ze=or,lr=Et,ur=lr["__core-js_shared__"],cr=ur,It=cr,ye=function(){var e=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function hr(e){return!!ye&&ye in e}var fr=hr,dr=Function.prototype,vr=dr.toString;function gr(e){if(e!=null){try{return vr.call(e)}catch{}try{return e+""}catch{}}return""}var mr=gr,pr=ze,br=fr,yr=it,wr=mr,Tr=/[\\^$.*+?()[\]{}|]/g,Er=/^\[object .+?Constructor\]$/,_r=Function.prototype,Or=Object.prototype,Sr=_r.toString,Ir=Or.hasOwnProperty,Ar=RegExp("^"+Sr.call(Ir).replace(Tr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xr(e){if(!yr(e)||br(e))return!1;var t=pr(e)?Ar:Er;return t.test(wr(e))}var Dr=xr;function Nr(e,t){return e==null?void 0:e[t]}var $r=Nr,Cr=Dr,Lr=$r;function kr(e,t){var i=Lr(e,t);return Cr(i)?i:void 0}var jr=kr,zr=jr,Pr=function(){try{var e=zr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Rr=Pr,Vr=ki,we=Rr,Mr=Ce,Fr=we?function(e,t){return we(e,"toString",{configurable:!0,enumerable:!1,value:Vr(t),writable:!0})}:Mr,Wr=Fr,Yr=800,Ur=16,Xr=Date.now;function Hr(e){var t=0,i=0;return function(){var r=Xr(),n=Ur-(r-i);if(i=r,n>0){if(++t>=Yr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var qr=Hr,Br=Wr,Kr=qr,Gr=Kr(Br),Zr=Gr,Jr=Ce,Qr=Ci,tn=Zr;function en(e,t){return tn(Qr(e,t,Jr),e+"")}var rn=en;function nn(e,t){return e===t||e!==e&&t!==t}var Pe=nn,an=9007199254740991;function sn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=an}var Re=sn,on=ze,ln=Re;function un(e){return e!=null&&ln(e.length)&&!on(e)}var Ve=un,cn=9007199254740991,hn=/^(?:0|[1-9]\d*)$/;function fn(e,t){var i=typeof e;return t=t??cn,!!t&&(i=="number"||i!="symbol"&&hn.test(e))&&e>-1&&e%1==0&&e<t}var Me=fn,dn=Pe,vn=Ve,gn=Me,mn=it;function pn(e,t,i){if(!mn(i))return!1;var r=typeof t;return(r=="number"?vn(i)&&gn(t,i.length):r=="string"&&t in i)?dn(i[t],e):!1}var bn=pn;function yn(e,t){for(var i=-1,r=Array(e);++i<e;)r[i]=t(i);return r}var wn=yn;function Tn(e){return e!=null&&typeof e=="object"}var Ot=Tn,En=_t,_n=Ot,On="[object Arguments]";function Sn(e){return _n(e)&&En(e)==On}var In=Sn,Te=In,An=Ot,Fe=Object.prototype,xn=Fe.hasOwnProperty,Dn=Fe.propertyIsEnumerable,Nn=Te(function(){return arguments}())?Te:function(e){return An(e)&&xn.call(e,"callee")&&!Dn.call(e,"callee")},$n=Nn,Cn=Array.isArray,Ln=Cn,Ct={exports:{}};function kn(){return!1}var jn=kn;(function(e,t){var i=Et,r=jn,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,l=s?i.Buffer:void 0,c=l?l.isBuffer:void 0,o=c||r;e.exports=o})(Ct,Ct.exports);var zn=_t,Pn=Re,Rn=Ot,Vn="[object Arguments]",Mn="[object Array]",Fn="[object Boolean]",Wn="[object Date]",Yn="[object Error]",Un="[object Function]",Xn="[object Map]",Hn="[object Number]",qn="[object Object]",Bn="[object RegExp]",Kn="[object Set]",Gn="[object String]",Zn="[object WeakMap]",Jn="[object ArrayBuffer]",Qn="[object DataView]",ta="[object Float32Array]",ea="[object Float64Array]",ia="[object Int8Array]",ra="[object Int16Array]",na="[object Int32Array]",aa="[object Uint8Array]",sa="[object Uint8ClampedArray]",oa="[object Uint16Array]",la="[object Uint32Array]",S={};S[ta]=S[ea]=S[ia]=S[ra]=S[na]=S[aa]=S[sa]=S[oa]=S[la]=!0;S[Vn]=S[Mn]=S[Jn]=S[Fn]=S[Qn]=S[Wn]=S[Yn]=S[Un]=S[Xn]=S[Hn]=S[qn]=S[Bn]=S[Kn]=S[Gn]=S[Zn]=!1;function ua(e){return Rn(e)&&Pn(e.length)&&!!S[zn(e)]}var ca=ua;function ha(e){return function(t){return e(t)}}var fa=ha,Lt={exports:{}};(function(e,t){var i=Le,r=t&&!t.nodeType&&t,n=r&&!0&&e&&!e.nodeType&&e,a=n&&n.exports===r,s=a&&i.process,l=function(){try{var c=n&&n.require&&n.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(Lt,Lt.exports);var da=ca,va=fa,Ee=Lt.exports,_e=Ee&&Ee.isTypedArray,ga=_e?va(_e):da,ma=ga,pa=wn,ba=$n,ya=Ln,wa=Ct.exports,Ta=Me,Ea=ma,_a=Object.prototype,Oa=_a.hasOwnProperty;function Sa(e,t){var i=ya(e),r=!i&&ba(e),n=!i&&!r&&wa(e),a=!i&&!r&&!n&&Ea(e),s=i||r||n||a,l=s?pa(e.length,String):[],c=l.length;for(var o in e)(t||Oa.call(e,o))&&!(s&&(o=="length"||n&&(o=="offset"||o=="parent")||a&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||Ta(o,c)))&&l.push(o);return l}var Ia=Sa,Aa=Object.prototype;function xa(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Aa;return e===i}var Da=xa;function Na(e){var t=[];if(e!=null)for(var i in Object(e))t.push(i);return t}var $a=Na,Ca=it,La=Da,ka=$a,ja=Object.prototype,za=ja.hasOwnProperty;function Pa(e){if(!Ca(e))return ka(e);var t=La(e),i=[];for(var r in e)r=="constructor"&&(t||!za.call(e,r))||i.push(r);return i}var Ra=Pa,Va=Ia,Ma=Ra,Fa=Ve;function Wa(e){return Fa(e)?Va(e,!0):Ma(e)}var Ya=Wa,Ua=rn,Xa=Pe,Ha=bn,qa=Ya,We=Object.prototype,Ba=We.hasOwnProperty,Ka=Ua(function(e,t){e=Object(e);var i=-1,r=t.length,n=r>2?t[2]:void 0;for(n&&Ha(t[0],t[1],n)&&(r=1);++i<r;)for(var a=t[i],s=qa(a),l=-1,c=s.length;++l<c;){var o=s[l],h=e[o];(h===void 0||Xa(h,We[o])&&!Ba.call(e,o))&&(e[o]=a[o])}return e}),Ga=Ka;const Za=typeof window<"u"&&window!==null;es();const Ja=Object.prototype.propertyIsEnumerable,Oe=Object.getOwnPropertySymbols;function yt(e){return typeof e=="function"||toString.call(e)==="[object Object]"}function Qa(e){return typeof e=="object"?e===null:typeof e!="function"}function ts(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function es(){return Za&&"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}}),!0):!1}function is(e,...t){if(!yt(e))throw new TypeError("expected the first argument to be an object");if(t.length===0||typeof Symbol!="function"||typeof Oe!="function")return e;for(const i of t){const r=Oe(i);for(const n of r)Ja.call(i,n)&&(e[n]=i[n])}return e}function Ye(e,...t){let i=0;for(Qa(e)&&(e=t[i++]),e||(e={});i<t.length;i++)if(yt(t[i])){for(const r of Object.keys(t[i]))ts(r)&&(yt(e[r])&&yt(t[i][r])?Ye(e[r],t[i][r]):e[r]=t[i][r]);is(e,t[i])}return e}const rs=({images:e=[],options:t})=>{t=Ye(t,{inline:!1});const i=document.createElement("div"),r=Rt("div",{style:{display:"none"},class:["__viewer-token"]},e.map(l=>Rt("img",typeof l=="string"?{src:l}:l)));Vt(r,i);const n=i.firstElementChild;document.body.appendChild(n);const a=new et(n,t),s=a.destroy.bind(a);return a.destroy=function(){return s(),Vt(null,i),a},a.show(),n.addEventListener("hidden",function(){this.viewer===a&&a.destroy()}),a};var ns=Et,as=function(){return ns.Date.now()},ss=as,os=/\s/;function ls(e){for(var t=e.length;t--&&os.test(e.charAt(t)););return t}var us=ls,cs=us,hs=/^\s+/;function fs(e){return e&&e.slice(0,cs(e)+1).replace(hs,"")}var ds=fs,vs=_t,gs=Ot,ms="[object Symbol]";function ps(e){return typeof e=="symbol"||gs(e)&&vs(e)==ms}var bs=ps,ys=ds,Se=it,ws=bs,Ie=0/0,Ts=/^[-+]0x[0-9a-f]+$/i,Es=/^0b[01]+$/i,_s=/^0o[0-7]+$/i,Os=parseInt;function Ss(e){if(typeof e=="number")return e;if(ws(e))return Ie;if(Se(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Se(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ys(e);var i=Es.test(e);return i||_s.test(e)?Os(e.slice(2),i?2:8):Ts.test(e)?Ie:+e}var Is=Ss,As=it,At=ss,Ae=Is,xs="Expected a function",Ds=Math.max,Ns=Math.min;function $s(e,t,i){var r,n,a,s,l,c,o=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(xs);t=Ae(t)||0,As(i)&&(h=!!i.leading,u="maxWait"in i,a=u?Ds(Ae(i.maxWait)||0,t):a,f="trailing"in i?!!i.trailing:f);function m(w){var C=r,R=n;return r=n=void 0,o=w,s=e.apply(R,C),s}function p(w){return o=w,l=setTimeout(D,t),h?m(w):s}function y(w){var C=w-c,R=w-o,F=t-C;return u?Ns(F,a-R):F}function I(w){var C=w-c,R=w-o;return c===void 0||C>=t||C<0||u&&R>=a}function D(){var w=At();if(I(w))return $(w);l=setTimeout(D,y(w))}function $(w){return l=void 0,f&&r?m(w):(r=n=void 0,s)}function T(){l!==void 0&&clearTimeout(l),o=0,r=c=n=l=void 0}function z(){return l===void 0?s:$(At())}function P(){var w=At(),C=I(w);if(r=arguments,n=this,c=w,C){if(l===void 0)return p(c);if(u)return clearTimeout(l),l=setTimeout(D,t),m(c)}return l===void 0&&(l=setTimeout(D,t)),s}return P.cancel=T,P.flush=z,P}var Cs=$s;const Ls=({name:e="viewer",debug:t=!1}={})=>{async function i(u,f,m=!1,p=!1){await gt(),!(p&&!r(u))&&(m||!u[`$${e}`]?(s(u),u[`$${e}`]=new et(u,f),o("Viewer created")):(u[`$${e}`].update(),o("Viewer updated")))}function r(u){const f=u.innerHTML.match(/<img([\w\W]+?)[\\/]?>/g),m=f?f.join(""):void 0;return u.__viewerImageDiffCache===m?(o("Element change detected, but image(s) has not changed"),!1):(o("Image change detected"),u.__viewerImageDiffCache=m,!0)}function n(u,f,m,p){l(u);const y=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(!y){o("Observer not supported");return}const I=new y($=>{$.forEach(T=>{o(`Viewer mutation:${T.type}`),m(u,f,p,!0)})}),D={attributes:!0,childList:!0,characterData:!0,subtree:!0};I.observe(u,D),u.__viewerMutationObserver=I,o("Observer created")}function a(u,f,m,p){u.__viewerUnwatch=vt(()=>f.value,(y,I)=>{o("Change detected by watcher: ",f.value),p(u,y,!0,!1)},{deep:!0}),o("Watcher created, expression: ",f.value)}function s(u){u[`$${e}`]&&(u[`$${e}`].destroy(),delete u[`$${e}`],o("Viewer destroyed"))}function l(u){u.__viewerMutationObserver&&(u.__viewerMutationObserver.disconnect(),delete u.__viewerMutationObserver,o("observer destroyed"))}function c(u){u.__viewerUnwatch&&(u.__viewerUnwatch(),delete u.__viewerUnwatch,o("Watcher destroyed"))}function o(...u){t&&console.log(...u)}return{mounted(u,f,m){o("Viewer bind");const p=Cs(i,50);p(u,f.value),a(u,f,m,p),f.modifiers.static||n(u,f.value,p,f.modifiers.rebuild)},unmounted(u){o("Viewer unbind"),l(u),c(u),s(u)}}};var ks=(e,t)=>{const i=e.__vccOpts||e;for(const[r,n]of t)i[r]=n;return i};const js=Ue({name:"Viewer",props:{images:{type:Array,default:()=>[]},rebuild:{type:Boolean,default:!1},trigger:{type:Object,default:null},options:{type:Object,default:()=>null}},emits:["inited"],setup(e,{emit:t}){let i;const r=Xe();function n(){i=new et(r.value,e.options),t("inited",i)}function a(){i&&i.destroy()}function s(){a(),n()}function l(){i?(i.update(),t("inited",i)):n()}function c(){e.rebuild?s():l()}const o={deep:!0};return vt(()=>e.images,()=>gt(()=>c()),o),vt(()=>e.trigger,()=>gt(()=>c()),o),vt(()=>e.options,()=>gt(()=>s()),o),He(()=>n()),qe(()=>a()),{root:r,createViewer:n,rebuildViewer:s,updateViewer:l,destroyViewer:a}}}),zs={ref:"root"};function Ps(e,t,i,r,n,a){return Be(),Ke("div",zs,[Ge(e.$slots,"default",{images:e.images,options:e.options})],512)}var Rs=ks(js,[["render",Ps]]),Ms={install(e,{name:t="viewer",debug:i=!1,defaultOptions:r}={}){r&&et.setDefaults(r),e.config.globalProperties[`$${t}Api`]=rs,e.component(t,Ga(Rs,{name:t})),e.directive(t,Ls({name:t,debug:i}))},setDefaults(e){et.setDefaults(e)}};export{et as Viewer,rs as api,Rs as component,Ms as default,Ls as directive};
|