(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bb1985a8"],{"0808":function(t,e,i){},c82c:function(t,e,i){ /*! * Viewer.js v1.11.2 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2023-01-01T10:14:49.638Z */ (function(e,i){t.exports=i()})(0,(function(){"use strict";function t(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 e(e){for(var i=1;i
',u="undefined"!==typeof window&&"undefined"!==typeof window.document,d=u?window:{},m=!(!u||!d.document.documentElement)&&"ontouchstart"in d.document.documentElement,f=!!u&&"PointerEvent"in d,g="viewer",v="move",p="switch",b="zoom",w="".concat(g,"-active"),y="".concat(g,"-close"),x="".concat(g,"-fade"),k="".concat(g,"-fixed"),z="".concat(g,"-fullscreen"),T="".concat(g,"-fullscreen-exit"),E="".concat(g,"-hide"),D="".concat(g,"-hide-md-down"),S="".concat(g,"-hide-sm-down"),I="".concat(g,"-hide-xs-down"),A="".concat(g,"-in"),O="".concat(g,"-invisible"),C="".concat(g,"-loading"),L="".concat(g,"-move"),R="".concat(g,"-open"),M="".concat(g,"-show"),F="".concat(g,"-transition"),N="click",Y="dblclick",X="dragstart",P="focusin",q="keydown",W="load",j="error",H=m?"touchend touchcancel":"mouseup",B=m?"touchmove":"mousemove",V=m?"touchstart":"mousedown",U=f?"pointerdown":V,K=f?"pointermove":B,Z=f?"pointerup pointercancel":H,$="resize",J="transitionend",_="wheel",G="ready",Q="show",tt="shown",et="hide",it="hidden",nt="view",ot="viewed",st="move",at="moved",rt="rotate",lt="rotated",ht="scale",ct="scaled",ut="zoom",dt="zoomed",mt="play",ft="stop",gt="".concat(g,"Action"),vt=/\s\s*/,pt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function bt(t){return"string"===typeof t}var wt=Number.isNaN||d.isNaN;function yt(t){return"number"===typeof t&&!wt(t)}function xt(t){return"undefined"===typeof t}function kt(t){return"object"===i(t)&&null!==t}var zt=Object.prototype.hasOwnProperty;function Tt(t){if(!kt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&zt.call(i,"isPrototypeOf")}catch(n){return!1}}function Et(t){return"function"===typeof t}function Dt(t,e){if(t&&Et(e))if(Array.isArray(t)||yt(t.length)){var i,n=t.length;for(i=0;i1?e-1:0),n=1;n0&&i.forEach((function(e){kt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},It=/^(?:width|height|left|top|marginLeft|marginTop)$/;function At(t,e){var i=t.style;Dt(e,(function(t,e){It.test(e)&&yt(t)&&(t+="px"),i[e]=t}))}function Ot(t){return bt(t)?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):t}function Ct(t,e){return!(!t||!e)&&(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)}function Lt(t,e){if(t&&e)if(yt(t.length))Dt(t,(function(t){Lt(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 Rt(t,e){t&&e&&(yt(t.length)?Dt(t,(function(t){Rt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Mt(t,e,i){e&&(yt(t.length)?Dt(t,(function(t){Mt(t,e,i)})):i?Lt(t,e):Rt(t,e))}var Ft=/([a-z\d])([A-Z])/g;function Nt(t){return t.replace(Ft,"$1-$2").toLowerCase()}function Yt(t,e){return kt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Nt(e)))}function Xt(t,e,i){kt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Nt(e)),i)}var Pt=function(){var t=!1;if(u){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});d.addEventListener("test",i,n),d.removeEventListener("test",i,n)}return t}();function qt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(vt).forEach((function(e){if(!Pt){var s=t.listeners;s&&s[e]&&s[e][i]&&(o=s[e][i],delete s[e][i],0===Object.keys(s[e]).length&&delete s[e],0===Object.keys(s).length&&delete t.listeners)}t.removeEventListener(e,o,n)}))}function Wt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(vt).forEach((function(e){if(n.once&&!Pt){var s=t.listeners,a=void 0===s?{}:s;o=function(){delete a[e][i],t.removeEventListener(e,o,n);for(var s=arguments.length,r=new Array(s),l=0;lr?u=r/s:c=l*s,a=yt(a)?a:.9,c=Math.min(c*a,e),u=Math.min(u*a,o);var d=(r-c)/2,m=(l-u)/2,f={left:d,top:m,x:d,y:m,width:c,height:u,oldRatio:1,ratio:c/e,aspectRatio:s,naturalWidth:e,naturalHeight:o},g=St({},f);n.rotatable&&(f.rotate=h.rotate||0,g.rotate=0),n.scalable&&(f.scaleX=h.scaleX||1,f.scaleY=h.scaleY||1,g.scaleX=1,g.scaleY=1),i.imageData=f,i.initialImageData=g,t&&t()}))},renderImage:function(t){var e=this,i=this.image,n=this.imageData;if(At(i,St({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&&Ct(i,F)){var o=function(){e.imageRendering=!1,t()};this.imageRendering={abort:function(){qt(i,J,o)}},Wt(i,J,o,{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}}},Qt={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Wt(e,N,this.onClick=this.click.bind(this)),Wt(e,X,this.onDragStart=this.dragstart.bind(this)),Wt(i,U,this.onPointerDown=this.pointerdown.bind(this)),Wt(n,K,this.onPointerMove=this.pointermove.bind(this)),Wt(n,Z,this.onPointerUp=this.pointerup.bind(this)),Wt(n,q,this.onKeyDown=this.keydown.bind(this)),Wt(window,$,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&Wt(e,_,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&Wt(i,Y,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;qt(e,N,this.onClick),qt(e,X,this.onDragStart),qt(i,U,this.onPointerDown),qt(n,K,this.onPointerMove),qt(n,Z,this.onPointerUp),qt(n,q,this.onKeyDown),qt(window,$,this.onResize),t.zoomable&&t.zoomOnWheel&&qt(e,_,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&qt(i,Y,this.onDblclick)}},te={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=Yt(n,gt);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(n=n.parentElement,o=Yt(n,gt)),m&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),o){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(Yt(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&&(m&&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,o=this.index,s=this.viewerData;Rt(n,O),i.loading&&Rt(this.canvas,C),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(){Mt(n,L,i.movable),Mt(n,F,i.transition),t.renderImage((function(){t.viewed=!0,t.viewing=!1,Et(i.viewed)&&Wt(e,ot,i.viewed,{once:!0}),jt(e,ot,{originalImage:t.images[o],index:o,image:n},{cancelable:!1})}))}))},loadImage:function(t){var e=t.target,i=e.parentNode,n=i.offsetWidth||30,o=i.offsetHeight||50,s=!!Yt(e,"filled");Kt(e,this.options,(function(t,i){var a=t/i,r=n,l=o;o*a>n?s?r=o*a:l=n/a:s?l=n/a:r=o*a,At(e,St({width:r,height:l},Bt({translateX:(n-r)/2,translateY:(o-l)/2})))}))},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;switch(i){case 13:this.viewer.contains(t.target)&&this.click(t);break}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.played&&this.playing?this.playing.prev():this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():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());break}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,o=t.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(yt(n)&&1!==n||yt(o)&&0!==o||t.ctrlKey))){t.preventDefault(),t.changedTouches?Dt(t.changedTouches,(function(t){i[t.identifier]=Jt(t)})):i[t.pointerId||0]=Jt(t);var s=!!e.movable&&v;e.zoomOnTouch&&e.zoomable&&Object.keys(i).length>1?s=b:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(s=p),!e.transition||s!==v&&s!==b||Rt(this.image,F),this.action=s}},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),this.pointerMoved=!0,t.changedTouches?Dt(t.changedTouches,(function(t){St(e[t.identifier]||{},Jt(t,!0))})):St(e[t.pointerId||0]||{},Jt(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,o=this.action,s=this.pointers;t.changedTouches?Dt(t.changedTouches,(function(t){e=s[t.identifier],delete s[t.identifier]})):(e=s[t.pointerId||0],delete s[t.pointerId||0]),o&&(t.preventDefault(),!n.transition||o!==v&&o!==b||Lt(this.image,F),this.action=!1,m&&o!==b&&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(){jt(i.image,Y,{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(){jt(i.canvas,N,{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();Dt(this.player.getElementsByTagName("img"),(function(e){Wt(e,W,t.loadImage.bind(t),{once:!0}),jt(e,W)}))}},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,null,t)}}},ee={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(Et(i.show)&&Wt(e,Q,i.show,{once:!0}),!1===jt(e,Q)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(Rt(n,E),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("aria-hidden"),i.transition&&!t){var o=this.shown.bind(this);this.transitioning={abort:function(){qt(n,J,o),Rt(n,A)}},Lt(n,F),n.initialOffsetWidth=n.offsetWidth,Wt(n,J,o,{once:!0}),Lt(n,A)}else Lt(n,A),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(Et(n.hide)&&Wt(i,et,n.hide,{once:!0}),!1===jt(i,et))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var o=this.viewer,s=this.image,a=function(){Rt(o,A),t.hidden()};if(n.transition&&!e){var r=function e(i){i&&i.target===o&&(qt(o,J,e),t.hidden())},l=function(){Ct(o,F)?(Wt(o,J,r),Rt(o,A)):a()};this.transitioning={abort:function(){t.viewed&&Ct(s,F)?qt(s,J,l):Ct(o,F)&&qt(o,J,r)}},this.viewed&&Ct(s,F)?(Wt(s,J,l,{once:!0}),this.zoomTo(0,!1,null,null,!0)):l()}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,o=this.title,s=this.canvas,a=this.items[e],r=a.querySelector("img"),l=Yt(r,"originalUrl"),h=r.getAttribute("alt"),c=document.createElement("img");if(Dt(n.inheritedAttributes,(function(t){var e=r.getAttribute(t);null!==e&&c.setAttribute(t,e)})),c.src=l,c.alt=h,Et(n.view)&&Wt(i,nt,n.view,{once:!0}),!1===jt(i,nt,{originalImage:this.images[e],index:e,image:c})||!this.isShown||this.hiding||this.played)return this;var u=this.items[this.index];u&&(Rt(u,w),u.removeAttribute("aria-selected")),Lt(a,w),a.setAttribute("aria-selected",!0),n.focus&&a.focus(),this.image=c,this.viewed=!1,this.index=e,this.imageData={},Lt(c,O),n.loading&&Lt(s,C),s.innerHTML="",s.appendChild(c),this.renderList(),o.innerHTML="";var d,m,f=function(){var e=t.imageData,i=Array.isArray(n.title)?n.title[1]:n.title;o.innerHTML=Ot(Et(i)?i.call(t,c,e):"".concat(h," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")"))};return Wt(i,ot,f,{once:!0}),this.viewing={abort:function(){qt(i,ot,f),c.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(c.src="",qt(c,W,d),t.timeout&&clearTimeout(t.timeout))}},c.complete?this.load():(Wt(c,W,d=function(){qt(c,j,m),t.load()},{once:!0}),Wt(c,j,m=function(){qt(c,W,d),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),Rt(c,O),n.loading&&Rt(t.canvas,C)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){Rt(c,O),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(xt(t)?t:i.x+Number(t),xt(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,o=this.element,s=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&s.movable){var r=a.x,l=a.y,h=!1;if(yt(t)?h=!0:t=r,yt(i)?h=!0:i=l,h){if(Et(s.move)&&Wt(o,st,s.move,{once:!0}),!1===jt(o,st,{x:t,y:i,oldX:r,oldY:l,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,Et(s.moved)&&Wt(o,at,s.moved,{once:!0}),jt(o,at,{x:t,y:i,oldX:r,oldY:l,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,o=this.imageData;if(t=Number(t),yt(t)&&this.viewed&&!this.played&&n.rotatable){var s=o.rotate;if(Et(n.rotate)&&Wt(i,rt,n.rotate,{once:!0}),!1===jt(i,rt,{degree:t,oldDegree:s}))return this;o.rotate=t,this.rotating=!0,this.renderImage((function(){e.rotating=!1,Et(n.rotated)&&Wt(i,lt,n.rotated,{once:!0}),jt(i,lt,{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 e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.element,o=this.options,s=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var a=s.scaleX,r=s.scaleY,l=!1;if(yt(t)?l=!0:t=a,yt(i)?l=!0:i=r,l){if(Et(o.scale)&&Wt(n,ht,o.scale,{once:!0}),!1===jt(n,ht,{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r}))return this;s.scaleX=t,s.scaleY=i,this.scaling=!0,this.renderImage((function(){e.scaling=!1,Et(o.scaled)&&Wt(n,ct,o.scaled,{once:!0}),jt(n,ct,{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r},{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=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=this.imageData;return t=Number(t),t=t<0?1/(1-t):1+t,this.zoomTo(o.width*t/o.naturalWidth,e,i,n),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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=this.element,r=this.options,l=this.pointers,h=this.imageData,c=h.x,u=h.y,d=h.width,m=h.height,f=h.naturalWidth,g=h.naturalHeight;if(t=Math.max(0,t),yt(t)&&this.viewed&&!this.played&&(s||r.zoomable)){if(!s){var v=Math.max(.01,r.minZoomRatio),p=Math.min(100,r.maxZoomRatio);t=Math.min(Math.max(t,v),p)}if(o)switch(o.type){case"wheel":r.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 b=f*t,w=g*t,y=b-d,x=w-m,k=h.ratio;if(Et(r.zoom)&&Wt(a,ut,r.zoom,{once:!0}),!1===jt(a,ut,{ratio:t,oldRatio:k,originalEvent:o}))return this;if(this.zooming=!0,o){var z=Ht(this.viewer),T=l&&Object.keys(l).length>0?_t(l):{pageX:o.pageX,pageY:o.pageY};h.x-=y*((T.pageX-z.left-c)/d),h.y-=x*((T.pageY-z.top-u)/m)}else Tt(n)&&yt(n.x)&&yt(n.y)?(h.x-=y*((n.x-c)/d),h.y-=x*((n.y-u)/m)):(h.x-=y/2,h.y-=x/2);h.left=h.x,h.top=h.y,h.width=b,h.height=w,h.oldRatio=k,h.ratio=t,this.renderImage((function(){e.zooming=!1,Et(r.zoomed)&&Wt(a,dt,r.zoomed,{once:!0}),jt(a,dt,{ratio:t,oldRatio:k,originalEvent:o},{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(Et(n.play)&&Wt(i,mt,n.play,{once:!0}),!1===jt(i,mt))return this;var o=this.player,s=this.loadImage.bind(this),a=[],r=0,l=0;if(this.played=!0,this.onLoadWhenPlay=s,e&&this.requestFullscreen(e),Lt(o,M),Dt(this.items,(function(t,e){var i=t.querySelector("img"),h=document.createElement("img");h.src=Yt(i,"originalUrl"),h.alt=i.getAttribute("alt"),h.referrerPolicy=i.referrerPolicy,r+=1,Lt(h,x),Mt(h,F,n.transition),Ct(t,w)&&(Lt(h,A),l=e),a.push(h),Wt(h,W,s,{once:!0}),o.appendChild(h)})),yt(n.interval)&&n.interval>0){var h=function e(){clearTimeout(t.playing.timeout),Rt(a[l],A),l-=1,l=l>=0?l:r-1,Lt(a[l],A),t.playing.timeout=setTimeout(e,n.interval)},c=function e(){clearTimeout(t.playing.timeout),Rt(a[l],A),l+=1,l=l1&&(this.playing={prev:h,next:c,timeout:setTimeout(c,n.interval)})}return this},stop:function(){var t=this;if(!this.played)return this;var e=this.element,i=this.options;if(Et(i.stop)&&Wt(e,ft,i.stop,{once:!0}),!1===jt(e,ft))return this;var n=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Dt(n.getElementsByTagName("img"),(function(e){qt(e,W,t.onLoadWhenPlay)})),Rt(n,M),n.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return!this.isShown||this.played||this.fulled||!e.inline||(this.fulled=!0,this.open(),Lt(this.button,T),e.transition&&(Rt(o,F),this.viewed&&Rt(n,F)),Lt(i,k),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),At(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=St({},this.containerData),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){Lt(n,F),Lt(o,F)}),0)}))}))),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline?(this.fulled=!1,this.close(),Rt(this.button,T),e.transition&&(Rt(o,F),this.viewed&&Rt(n,F)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),Rt(i,k),At(i,{zIndex:e.zIndexInline}),this.viewerData=St({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){Lt(n,F),Lt(o,F)}),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&&jt(i,J),Lt(i,M),Lt(i,x),Lt(i,F),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,Lt(i,A)):(Lt(i,M),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout((function(){e.transition?(Wt(i,J,(function(){Rt(i,M),Rt(i,x),Rt(i,F),i.setAttribute("aria-hidden",!0),t.fading=!1}),{once:!0}),Rt(i,A),t.fading=!0):(Rt(i,M),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,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=St({},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 o=[];if(Dt(n?[e]:e.querySelectorAll("img"),(function(e){Et(i.filter)?i.filter.call(t,e)&&o.push(e):t.getImageURL(e)&&o.push(e)})),!o.length)return this;if(this.images=o,this.length=o.length,this.ready){var s=[];if(Dt(this.items,(function(t,e){var i=t.querySelector("img"),n=o[e];n&&i&&n.src===i.src&&n.alt===i.alt||s.push(e)})),At(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var a=s.indexOf(this.index);if(a>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-a,this.length-1),0));else{var r=this.items[this.index];Lt(r,w),r.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[g]?(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||qt(t,N,this.onStart),t[g]=void 0,this):this}},ie={getImageURL:function(t){var e=this.options.url;return e=bt(e)?t.getAttribute(e):Et(e)?e.call(this,t):"",e},enforceFocus:function(){var t=this;this.clearEnforceFocus(),Wt(document,P,this.onFocusin=function(e){var i=t.viewer,n=e.target;if(n!==document&&n!==i&&!i.contains(n)){while(n){if(null!==n.getAttribute("tabindex")||"true"===n.getAttribute("aria-modal"))return;n=n.parentElement}i.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(qt(document,P,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;Lt(t,R),this.scrollbarWidth>0&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;Rt(t,R),this.scrollbarWidth>0&&(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()),Et(e.shown)&&Wt(t,tt,e.shown,{once:!0}),!1!==jt(t,tt)&&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(),Lt(i,E),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||(Et(e.hidden)&&Wt(t,it,e.hidden,{once:!0}),jt(t,it,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?Tt(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 o=n.endX-n.startX,s=n.endY-n.startY;switch(this.action){case v:this.move(o,s,t);break;case b:this.zoom($t(i),!1,null,t);break;case p:this.action="switched";var a=Math.abs(o);a>1&&a>Math.abs(s)&&(this.pointers={},o>1?this.prev(e.loop):o<-1&&this.next(e.loop));break}Dt(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}},ne=d.Viewer,oe=function(t){return function(){return t+=1,t}}(-1),se=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n(this,t),!e||1!==e.nodeType)throw new Error("The first argument is required and must be an element.");this.element=e,this.options=St({},h,Tt(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=oe(),this.init()}return s(t,[{key:"init",value:function(){var t=this,e=this.element,i=this.options;if(!e[g]){e[g]=this,i.focus&&!i.keyboard&&(i.focus=!1);var n="img"===e.localName,o=[];if(Dt(n?[e]:e.querySelectorAll("img"),(function(e){Et(i.filter)?i.filter.call(t,e)&&o.push(e):t.getImageURL(e)&&o.push(e)})),this.isImg=n,this.length=o.length,this.images=o,this.initBody(),xt(document.createElement(g).style.transition)&&(i.transition=!1),i.inline){var s=0,a=function(){var e;(s+=1,s===t.length)&&(t.initializing=!1,t.delaying={abort:function(){clearTimeout(e)}},e=setTimeout((function(){t.delaying=!1,t.build()}),0))};this.initializing={abort:function(){Dt(o,(function(t){t.complete||(qt(t,W,a),qt(t,j,a))}))}},Dt(o,(function(t){var e,i;t.complete?a():(Wt(t,W,e=function(){qt(t,j,i),a()},{once:!0}),Wt(t,j,i=function(){qt(t,W,e),a()},{once:!0}))}))}else Wt(e,N,this.onStart=function(e){var n=e.target;"img"!==n.localName||Et(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=c;var o=n.querySelector(".".concat(g,"-container")),s=o.querySelector(".".concat(g,"-title")),a=o.querySelector(".".concat(g,"-toolbar")),r=o.querySelector(".".concat(g,"-navbar")),l=o.querySelector(".".concat(g,"-button")),h=o.querySelector(".".concat(g,"-canvas"));if(this.parent=i,this.viewer=o,this.title=s,this.toolbar=a,this.navbar=r,this.button=l,this.canvas=h,this.footer=o.querySelector(".".concat(g,"-footer")),this.tooltipBox=o.querySelector(".".concat(g,"-tooltip")),this.player=o.querySelector(".".concat(g,"-player")),this.list=o.querySelector(".".concat(g,"-list")),o.id="".concat(g).concat(this.id),s.id="".concat(g,"Title").concat(this.id),Lt(s,e.title?Zt(Array.isArray(e.title)?e.title[0]:e.title):E),Lt(r,e.navbar?Zt(e.navbar):E),Mt(l,E,!e.button),e.keyboard&&l.setAttribute("tabindex",0),e.backdrop&&(Lt(o,"".concat(g,"-backdrop")),e.inline||"static"===e.backdrop||Xt(h,gt,"hide")),bt(e.className)&&e.className&&e.className.split(vt).forEach((function(t){Lt(o,t)})),e.toolbar){var u=document.createElement("ul"),d=Tt(e.toolbar),m=pt.slice(0,3),f=pt.slice(7,9),v=pt.slice(9);d||Lt(a,Zt(e.toolbar)),Dt(d?e.toolbar:pt,(function(t,i){var n=d&&Tt(t),o=d?Nt(i):t,s=n&&!xt(t.show)?t.show:t;if(s&&(e.zoomable||-1===m.indexOf(o))&&(e.rotatable||-1===f.indexOf(o))&&(e.scalable||-1===v.indexOf(o))){var a=n&&!xt(t.size)?t.size:t,r=n&&!xt(t.click)?t.click:t,l=document.createElement("li");e.keyboard&&l.setAttribute("tabindex",0),l.setAttribute("role","button"),Lt(l,"".concat(g,"-").concat(o)),Et(r)||Xt(l,gt,o),yt(s)&&Lt(l,Zt(s)),-1!==["small","large"].indexOf(a)?Lt(l,"".concat(g,"-").concat(a)):"play"===o&&Lt(l,"".concat(g,"-large")),Et(r)&&Wt(l,N,r),u.appendChild(l)}})),a.appendChild(u)}else Lt(a,E);if(!e.rotatable){var p=a.querySelectorAll('li[class*="rotate"]');Lt(p,O),Dt(p,(function(t){a.appendChild(t)}))}if(e.inline)Lt(l,z),At(o,{zIndex:e.zIndexInline}),"static"===window.getComputedStyle(i).position&&At(i,{position:"relative"}),i.insertBefore(o,t.nextSibling);else{Lt(l,y),Lt(o,k),Lt(o,x),Lt(o,E),At(o,{zIndex:e.zIndex});var b=e.container;bt(b)&&(b=t.ownerDocument.querySelector(b)),b||(b=this.body),b.appendChild(o)}e.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,Et(e.ready)&&Wt(t,G,e.ready,{once:!0}),!1!==jt(t,G)?this.ready&&e.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=ne,t}},{key:"setDefaults",value:function(t){St(h,Tt(t)&&t)}}]),t}();return St(se.prototype,Gt,Qt,te,ee,ie),se}))}}]);