(()=>{var Me=Object.create;var At=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var He=T=>At(T,"__esModule",{value:!0});var qe=(T,v)=>()=>(v||T((v={exports:{}}).exports,v),v.exports);var Ue=(T,v,C,F)=>{if(v&&typeof v=="object"||typeof v=="function")for(let X of Ye(v))!Xe.call(T,X)&&(C||X!=="default")&&At(T,X,{get:()=>v[X],enumerable:!(F=Pe(v,X))||F.enumerable});return T},je=(T,v)=>Ue(He(At(T!=null?Me(We(T)):{},"default",!v&&T&&T.__esModule?{get:()=>T.default,enumerable:!0}:{value:T,enumerable:!0})),T);var se=qe((xt,Nt)=>{(function(T,v){typeof xt=="object"&&typeof Nt<"u"?Nt.exports=v():typeof define=="function"&&define.amd?define(v):(T=typeof globalThis<"u"?globalThis:T||self,T.Viewer=v())})(xt,function(){"use strict";function T(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),i.push.apply(i,e)}return i}function v(n){for(var t=1;t
',ot=typeof window<"u"&&typeof window.document<"u",Y=ot?window:{},q=ot&&Y.document.documentElement?"ontouchstart"in Y.document.documentElement:!1,bt=ot?"PointerEvent"in Y:!1,m="viewer",lt="move",Ct="switch",tt="zoom",ht="".concat(m,"-active"),de="".concat(m,"-close"),ut="".concat(m,"-fade"),wt="".concat(m,"-fixed"),me="".concat(m,"-fullscreen"),Lt="".concat(m,"-fullscreen-exit"),H="".concat(m,"-hide"),ge="".concat(m,"-hide-md-down"),ve="".concat(m,"-hide-sm-down"),pe="".concat(m,"-hide-xs-down"),M="".concat(m,"-in"),et="".concat(m,"-invisible"),U="".concat(m,"-loading"),be="".concat(m,"-move"),_t="".concat(m,"-open"),j="".concat(m,"-show"),D="".concat(m,"-transition"),B="click",yt="dblclick",zt="dragstart",kt="focusin",Rt="keydown",k="load",ct="error",we=q?"touchend touchcancel":"mouseup",ye=q?"touchmove":"mousemove",Ee=q?"touchstart":"mousedown",Vt=bt?"pointerdown":Ee,Ft=bt?"pointermove":ye,Mt=bt?"pointerup pointercancel":we,Pt="resize",R="transitionend",Yt="wheel",Wt="ready",Xt="show",Ht="shown",qt="hide",Ut="hidden",jt="view",it="viewed",Bt="move",Kt="moved",Zt="rotate",Gt="rotated",$t="scale",Jt="scaled",Qt="zoom",te="zoomed",ee="play",ie="stop",ft="".concat(m,"Action"),Et=/\s\s*/,dt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function nt(n){return typeof n=="string"}var Te=Number.isNaN||Y.isNaN;function x(n){return typeof n=="number"&&!Te(n)}function K(n){return typeof n>"u"}function Z(n){return C(n)==="object"&&n!==null}var Se=Object.prototype.hasOwnProperty;function at(n){if(!Z(n))return!1;try{var t=n.constructor,i=t.prototype;return t&&i&&Se.call(i,"isPrototypeOf")}catch{return!1}}function p(n){return typeof n=="function"}function y(n,t){if(n&&p(t))if(Array.isArray(n)||x(n.length)){var i=n.length,e;for(e=0;e1?i-1:0),a=1;a0&&e.forEach(function(r){Z(r)&&Object.keys(r).forEach(function(s){t[s]=r[s]})}),t},De=/^(?:width|height|left|top|marginLeft|marginTop)$/;function V(n,t){var i=n.style;y(t,function(e,a){De.test(a)&&x(e)&&(e+="px"),i[a]=e})}function Ie(n){return nt(n)?n.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):n}function G(n,t){return!n||!t?!1:n.classList?n.classList.contains(t):n.className.indexOf(t)>-1}function f(n,t){if(!(!n||!t)){if(x(n.length)){y(n,function(e){f(e,t)});return}if(n.classList){n.classList.add(t);return}var i=n.className.trim();i?i.indexOf(t)<0&&(n.className="".concat(i," ").concat(t)):n.className=t}}function g(n,t){if(!(!n||!t)){if(x(n.length)){y(n,function(i){g(i,t)});return}if(n.classList){n.classList.remove(t);return}n.className.indexOf(t)>=0&&(n.className=n.className.replace(t,""))}}function rt(n,t,i){if(!!t){if(x(n.length)){y(n,function(e){rt(e,t,i)});return}i?f(n,t):g(n,t)}}var Ae=/([a-z\d])([A-Z])/g;function Tt(n){return n.replace(Ae,"$1-$2").toLowerCase()}function $(n,t){return Z(n[t])?n[t]:n.dataset?n.dataset[t]:n.getAttribute("data-".concat(Tt(t)))}function St(n,t,i){Z(i)?n[t]=i:n.dataset?n.dataset[t]=i:n.setAttribute("data-".concat(Tt(t)),i)}var ne=function(){var n=!1;if(ot){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return n=!0,t},set:function(r){t=r}});Y.addEventListener("test",i,e),Y.removeEventListener("test",i,e)}return n}();function E(n,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=i;t.trim().split(Et).forEach(function(r){if(!ne){var s=n.listeners;s&&s[r]&&s[r][i]&&(a=s[r][i],delete s[r][i],Object.keys(s[r]).length===0&&delete s[r],Object.keys(s).length===0&&delete n.listeners)}n.removeEventListener(r,a,e)})}function d(n,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=i;t.trim().split(Et).forEach(function(r){if(e.once&&!ne){var s=n.listeners,l=s===void 0?{}:s;a=function(){delete l[r][i],n.removeEventListener(r,a,e);for(var o=arguments.length,c=new Array(o),h=0;hl?z=l/I:w=u*I,w=Math.min(w*.9,h),z=Math.min(z*.9,b);var _=(l-w)/2,O=(u-z)/2,N={left:_,top:O,x:_,y:O,width:w,height:z,oldRatio:1,ratio:w/h,aspectRatio:I,naturalWidth:h,naturalHeight:b},S=L({},N);e.rotatable&&(N.rotate=o.rotate||0,S.rotate=0),e.scalable&&(N.scaleX=o.scaleX||1,N.scaleY=o.scaleY||1,S.scaleX=1,S.scaleY=1),i.imageData=N,i.initialImageData=S,t&&t()})},renderImage:function(t){var i=this,e=this.image,a=this.imageData;if(V(e,L({width:a.width,height:a.height,marginLeft:a.x,marginTop:a.y},mt(a))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&G(e,D)){var r=function(){i.imageRendering=!1,t()};this.imageRendering={abort:function(){E(e,R,r)}},d(e,R,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}}},_e={bind:function(){var t=this.options,i=this.viewer,e=this.canvas,a=this.element.ownerDocument;d(i,B,this.onClick=this.click.bind(this)),d(i,zt,this.onDragStart=this.dragstart.bind(this)),d(e,Vt,this.onPointerDown=this.pointerdown.bind(this)),d(a,Ft,this.onPointerMove=this.pointermove.bind(this)),d(a,Mt,this.onPointerUp=this.pointerup.bind(this)),d(a,Rt,this.onKeyDown=this.keydown.bind(this)),d(window,Pt,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&d(i,Yt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&d(e,yt,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,i=this.viewer,e=this.canvas,a=this.element.ownerDocument;E(i,B,this.onClick),E(i,zt,this.onDragStart),E(e,Vt,this.onPointerDown),E(a,Ft,this.onPointerMove),E(a,Mt,this.onPointerUp),E(a,Rt,this.onKeyDown),E(window,Pt,this.onResize),t.zoomable&&t.zoomOnWheel&&E(i,Yt,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&E(e,yt,this.onDblclick)}},ze={click:function(t){var i=this.options,e=this.imageData,a=t.target,r=$(a,ft);switch(!r&&a.localName==="img"&&a.parentElement.localName==="li"&&(a=a.parentElement,r=$(a,ft)),q&&t.isTrusted&&a===this.canvas&&clearTimeout(this.clickCanvasTimeout),r){case"mix":this.played?this.stop():i.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.hide();break;case"view":this.view($(a,"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(-e.scaleX||-1);break;case"flip-vertical":this.scaleY(-e.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(q&&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,e=this.options,a=this.image,r=this.index,s=this.viewerData;g(a,et),e.loading&&g(this.canvas,U),a.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(){rt(a,be,e.movable),rt(a,D,e.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,p(e.viewed)&&d(i,it,e.viewed,{once:!0}),A(i,it,{originalImage:t.images[r],index:r,image:a},{cancelable:!1})})})},loadImage:function(t){var i=t.target,e=i.parentNode,a=e.offsetWidth||30,r=e.offsetHeight||50,s=!!$(i,"filled");ae(i,this.options,function(l,u){var o=l/u,c=a,h=r;r*o>a?s?c=r*o:h=a/o:s?h=a/o:c=r*o,V(i,L({width:c,height:h},mt({translateX:(a-c)/2,translateY:(r-h)/2})))})},keydown:function(t){var i=this.options;if(!!i.keyboard){var e=t.keyCode||t.which||t.charCode;switch(e){case 13:this.viewer.contains(t.target)&&this.click(t);break}if(!!this.fulled)switch(e){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.prev(i.loop);break;case 38:t.preventDefault(),this.zoom(i.zoomRatio,!0);break;case 39: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,e=this.pointers,a=t.buttons,r=t.button;if(!(!this.viewed||this.showing||this.viewing||this.hiding||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(x(a)&&a!==1||x(r)&&r!==0||t.ctrlKey))){t.preventDefault(),t.changedTouches?y(t.changedTouches,function(l){e[l.identifier]=vt(l)}):e[t.pointerId||0]=vt(t);var s=i.movable?lt:!1;i.zoomOnTouch&&i.zoomable&&Object.keys(e).length>1?s=tt:i.slideOnTouch&&(t.pointerType==="touch"||t.type==="touchstart")&&this.isSwitchable()&&(s=Ct),i.transition&&(s===lt||s===tt)&&g(this.image,D),this.action=s}},pointermove:function(t){var i=this.pointers,e=this.action;!this.viewed||!e||(t.preventDefault(),t.changedTouches?y(t.changedTouches,function(a){L(i[a.identifier]||{},vt(a,!0))}):L(i[t.pointerId||0]||{},vt(t,!0)),this.change(t))},pointerup:function(t){var i=this,e=this.options,a=this.action,r=this.pointers,s;t.changedTouches?y(t.changedTouches,function(l){s=r[l.identifier],delete r[l.identifier]}):(s=r[t.pointerId||0],delete r[t.pointerId||0]),!!a&&(t.preventDefault(),e.transition&&(a===lt||a===tt)&&f(this.image,D),this.action=!1,q&&a!==tt&&s&&Date.now()-s.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),e.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){A(i.image,yt,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){i.imageClicked=!1},500)):(this.imageClicked=!1,e.backdrop&&e.backdrop!=="static"&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){A(i.canvas,B,{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}y(this.player.getElementsByTagName("img"),function(i){d(i,k,t.loadImage.bind(t),{once:!0}),A(i,k)})}},wheel:function(t){var i=this;if(!!this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50);var e=Number(this.options.zoomRatio)||.1,a=1;t.deltaY?a=t.deltaY>0?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=t.detail>0?1:-1),this.zoom(-a*e,!0,t)}}},ke={show:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.element,e=this.options;if(e.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(p(e.show)&&d(i,Xt,e.show,{once:!0}),A(i,Xt)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var a=this.viewer;if(g(a,H),a.setAttribute("role","dialog"),a.setAttribute("aria-labelledby",this.title.id),a.setAttribute("aria-modal",!0),a.removeAttribute("aria-hidden"),e.transition&&!t){var r=this.shown.bind(this);this.transitioning={abort:function(){E(a,R,r),g(a,M)}},f(a,D),a.initialOffsetWidth=a.offsetWidth,d(a,R,r,{once:!0}),f(a,M)}else f(a,M),this.shown();return this},hide:function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.element,a=this.options;if(a.inline||this.hiding||!(this.isShown||this.showing))return this;if(p(a.hide)&&d(e,qt,a.hide,{once:!0}),A(e,qt)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var r=this.viewer,s=this.image,l=function(){g(r,M),t.hidden()};if(a.transition&&!i){var u=function c(h){h&&h.target===r&&(E(r,R,c),t.hidden())},o=function(){G(r,D)?(d(r,R,u),g(r,M)):l()};this.transitioning={abort:function(){t.viewed&&G(s,D)?E(s,R,o):G(r,D)&&E(r,R,u)}},this.viewed&&G(s,D)?(d(s,R,o,{once:!0}),this.zoomTo(0,!1,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 e=this.element,a=this.options,r=this.title,s=this.canvas,l=this.items[i],u=l.querySelector("img"),o=$(u,"originalUrl"),c=u.getAttribute("alt"),h=document.createElement("img");if(y(a.inheritedAttributes,function(_){var O=u.getAttribute(_);O!==null&&h.setAttribute(_,O)}),h.src=o,h.alt=c,p(a.view)&&d(e,jt,a.view,{once:!0}),A(e,jt,{originalImage:this.images[i],index:i,image:h})===!1||!this.isShown||this.hiding||this.played)return this;var b=this.items[this.index];b&&(g(b,ht),b.removeAttribute("aria-selected")),f(l,ht),l.setAttribute("aria-selected",!0),a.focus&&l.focus(),this.image=h,this.viewed=!1,this.index=i,this.imageData={},f(h,et),a.loading&&f(s,U),s.innerHTML="",s.appendChild(h),this.renderList(),r.innerHTML="";var I=function(){var O=t.imageData,N=Array.isArray(a.title)?a.title[1]:a.title;r.innerHTML=Ie(p(N)?N.call(t,h,O):"".concat(c," (").concat(O.naturalWidth," \xD7 ").concat(O.naturalHeight,")"))},w,z;return d(e,it,I,{once:!0}),this.viewing={abort:function(){E(e,it,I),h.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(h.src="",E(h,k,w),t.timeout&&clearTimeout(t.timeout))}},h.complete?this.load():(d(h,k,w=function(){E(h,ct,z),t.load()},{once:!0}),d(h,ct,z=function(){E(h,k,w),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),g(h,et),a.loading&&g(t.canvas,U)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){g(h,et),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,e=this.index+1;return e>i&&(e=t?0:i),this.view(e),this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.imageData;return this.moveTo(K(t)?t:e.x+Number(t),K(i)?i:e.y+Number(i)),this},moveTo:function(t){var i=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=this.element,s=this.options,l=this.imageData;if(t=Number(t),e=Number(e),this.viewed&&!this.played&&s.movable){var u=l.x,o=l.y,c=!1;if(x(t)?c=!0:t=u,x(e)?c=!0:e=o,c){if(p(s.move)&&d(r,Bt,s.move,{once:!0}),A(r,Bt,{x:t,y:e,oldX:u,oldY:o,originalEvent:a})===!1)return this;l.x=t,l.y=e,l.left=t,l.top=e,this.moving=!0,this.renderImage(function(){i.moving=!1,p(s.moved)&&d(r,Kt,s.moved,{once:!0}),A(r,Kt,{x:t,y:e,oldX:u,oldY:o,originalEvent:a},{cancelable:!1})})}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var i=this,e=this.element,a=this.options,r=this.imageData;if(t=Number(t),x(t)&&this.viewed&&!this.played&&a.rotatable){var s=r.rotate;if(p(a.rotate)&&d(e,Zt,a.rotate,{once:!0}),A(e,Zt,{degree:t,oldDegree:s})===!1)return this;r.rotate=t,this.rotating=!0,this.renderImage(function(){i.rotating=!1,p(a.rotated)&&d(e,Gt,a.rotated,{once:!0}),A(e,Gt,{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,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.element,r=this.options,s=this.imageData;if(t=Number(t),e=Number(e),this.viewed&&!this.played&&r.scalable){var l=s.scaleX,u=s.scaleY,o=!1;if(x(t)?o=!0:t=l,x(e)?o=!0:e=u,o){if(p(r.scale)&&d(a,$t,r.scale,{once:!0}),A(a,$t,{scaleX:t,scaleY:e,oldScaleX:l,oldScaleY:u})===!1)return this;s.scaleX=t,s.scaleY=e,this.scaling=!0,this.renderImage(function(){i.scaling=!1,p(r.scaled)&&d(a,Jt,r.scaled,{once:!0}),A(a,Jt,{scaleX:t,scaleY:e,oldScaleX:l,oldScaleY:u},{cancelable:!1})})}}return this},zoom:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]: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,e),this},zoomTo:function(t){var i=this,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=this.element,l=this.options,u=this.pointers,o=this.imageData,c=o.x,h=o.y,b=o.width,I=o.height,w=o.naturalWidth,z=o.naturalHeight;if(t=Math.max(0,t),x(t)&&this.viewed&&!this.played&&(r||l.zoomable)){if(!r){var _=Math.max(.01,l.minZoomRatio),O=Math.min(100,l.maxZoomRatio);t=Math.min(Math.max(t,_),O)}if(a)switch(a.type){case"wheel":l.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 N=w*t,S=z*t,pt=N-b,J=S-I,P=o.ratio;if(p(l.zoom)&&d(s,Qt,l.zoom,{once:!0}),A(s,Qt,{ratio:t,oldRatio:P,originalEvent:a})===!1)return this;if(this.zooming=!0,a){var Q=xe(this.viewer),st=u&&Object.keys(u).length>0?Ce(u):{pageX:a.pageX,pageY:a.pageY};o.x-=pt*((st.pageX-Q.left-c)/b),o.y-=J*((st.pageY-Q.top-h)/I)}else o.x-=pt/2,o.y-=J/2;o.left=o.x,o.top=o.y,o.width=N,o.height=S,o.oldRatio=P,o.ratio=t,this.renderImage(function(){i.zooming=!1,p(l.zoomed)&&d(s,te,l.zoomed,{once:!0}),A(s,te,{ratio:t,oldRatio:P,originalEvent:a},{cancelable:!1})}),e&&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 e=this.element,a=this.options;if(p(a.play)&&d(e,ee,a.play,{once:!0}),A(e,ee)===!1)return this;var r=this.player,s=this.loadImage.bind(this),l=[],u=0,o=0;if(this.played=!0,this.onLoadWhenPlay=s,i&&this.requestFullscreen(i),f(r,j),y(this.items,function(h,b){var I=h.querySelector("img"),w=document.createElement("img");w.src=$(I,"originalUrl"),w.alt=I.getAttribute("alt"),w.referrerPolicy=I.referrerPolicy,u+=1,f(w,ut),rt(w,D,a.transition),G(h,ht)&&(f(w,M),o=b),l.push(w),d(w,k,s,{once:!0}),r.appendChild(w)}),x(a.interval)&&a.interval>0){var c=function h(){t.playing=setTimeout(function(){g(l[o],M),o+=1,o=o1&&c()}return this},stop:function(){var t=this;if(!this.played)return this;var i=this.element,e=this.options;if(p(e.stop)&&d(i,ie,e.stop,{once:!0}),A(i,ie)===!1)return this;var a=this.player;return this.played=!1,clearTimeout(this.playing),y(a.getElementsByTagName("img"),function(r){E(r,k,t.onLoadWhenPlay)}),g(a,j),a.innerHTML="",this.exitFullscreen(),this},full:function(){var t=this,i=this.options,e=this.viewer,a=this.image,r=this.list;return!this.isShown||this.played||this.fulled||!i.inline?this:(this.fulled=!0,this.open(),f(this.button,Lt),i.transition&&(g(r,D),this.viewed&&g(a,D)),f(e,wt),e.setAttribute("role","dialog"),e.setAttribute("aria-labelledby",this.title.id),e.setAttribute("aria-modal",!0),e.removeAttribute("style"),V(e,{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(){f(a,D),f(r,D)},0)})}),this)},exit:function(){var t=this,i=this.options,e=this.viewer,a=this.image,r=this.list;return!this.isShown||this.played||!this.fulled||!i.inline?this:(this.fulled=!1,this.close(),g(this.button,Lt),i.transition&&(g(r,D),this.viewed&&g(a,D)),i.focus&&this.clearEnforceFocus(),e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-modal"),g(e,wt),V(e,{zIndex:i.zIndexInline}),this.viewerData=L({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){i.transition&&setTimeout(function(){f(a,D),f(r,D)},0)})}),this)},tooltip:function(){var t=this,i=this.options,e=this.tooltipBox,a=this.imageData;return!this.viewed||this.played||!i.tooltip?this:(e.textContent="".concat(Math.round(a.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):i.transition?(this.fading&&A(e,R),f(e,j),f(e,ut),f(e,D),e.removeAttribute("aria-hidden"),e.initialOffsetWidth=e.offsetWidth,f(e,M)):(f(e,j),e.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){i.transition?(d(e,R,function(){g(e,j),g(e,ut),g(e,D),e.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),g(e,M),t.fading=!0):(g(e,j),e.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,t):this.zoomTo(1,!0,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,e=this.options,a=this.isImg;if(a&&!i.parentNode)return this.destroy();var r=[];if(y(a?[i]:i.querySelectorAll("img"),function(o){p(e.filter)?e.filter.call(t,o)&&r.push(o):t.getImageURL(o)&&r.push(o)}),!r.length)return this;if(this.images=r,this.length=r.length,this.ready){var s=[];if(y(this.items,function(o,c){var h=o.querySelector("img"),b=r[c];b&&h?(b.src!==h.src||b.alt!==h.alt)&&s.push(c):s.push(c)}),V(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 u=this.items[this.index];f(u,ht),u.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[m]?(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||E(t,B,this.onStart),t[m]=void 0,this):this}},Re={getImageURL:function(t){var i=this.options.url;return nt(i)?i=t.getAttribute(i):p(i)?i=i.call(this,t):i="",i},enforceFocus:function(){var t=this;this.clearEnforceFocus(),d(document,kt,this.onFocusin=function(i){var e=t.viewer,a=i.target;a!==document&&a!==e&&!e.contains(a)&&(a.getAttribute("tabindex")===null||a.getAttribute("aria-modal")!=="true")&&e.focus()})},clearEnforceFocus:function(){this.onFocusin&&(E(document,kt,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;f(t,_t),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px")},close:function(){var t=this.body;g(t,_t),t.style.paddingRight=this.initialBodyPaddingRight},shown:function(){var t=this.element,i=this.options,e=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,i.focus&&(e.focus(),this.enforceFocus()),p(i.shown)&&d(t,Ht,i.shown,{once:!0}),A(t,Ht)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,i=this.options,e=this.viewer;i.fucus&&this.clearEnforceFocus(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),f(e,H),e.removeAttribute("role"),e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-modal"),e.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(p(i.hidden)&&d(t,Ut,i.hidden,{once:!0}),A(t,Ut,null,{cancelable:!1}))},requestFullscreen:function(t){var i=this.element.ownerDocument;if(this.fulled&&!(i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement)){var e=i.documentElement;e.requestFullscreen?at(t)?e.requestFullscreen(t):e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.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,e=this.pointers,a=e[Object.keys(e)[0]];if(!!a){var r=a.endX-a.startX,s=a.endY-a.startY;switch(this.action){case lt:this.move(r,s,t);break;case tt:this.zoom(Oe(e),!1,t);break;case Ct:{this.action="switched";var l=Math.abs(r);l>1&&l>Math.abs(s)&&(this.pointers={},r>1?this.prev(i.loop):r<-1&&this.next(i.loop));break}}y(e,function(u){u.startX=u.endX,u.startY=u.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}},Ve=Y.Viewer,Fe=function(n){return function(){return n+=1,n}}(-1),re=function(){function n(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(F(this,n),!t||t.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=L({},Ot,at(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=Fe(),this.init()}return ue(n,[{key:"init",value:function(){var i=this,e=this.element,a=this.options;if(!e[m]){e[m]=this,a.focus&&!a.keyboard&&(a.focus=!1);var r=e.localName==="img",s=[];if(y(r?[e]:e.querySelectorAll("img"),function(o){p(a.filter)?a.filter.call(i,o)&&s.push(o):i.getImageURL(o)&&s.push(o)}),this.isImg=r,this.length=s.length,this.images=s,this.initBody(),K(document.createElement(m).style.transition)&&(a.transition=!1),a.inline){var l=0,u=function(){if(l+=1,l===i.length){var c;i.initializing=!1,i.delaying={abort:function(){clearTimeout(c)}},c=setTimeout(function(){i.delaying=!1,i.build()},0)}};this.initializing={abort:function(){y(s,function(c){c.complete||E(c,k,u)})}},y(s,function(o){o.complete?u():d(o,k,u,{once:!0})})}else d(e,B,this.onStart=function(o){var c=o.target;c.localName==="img"&&(!p(a.filter)||a.filter.call(i,c))&&i.view(i.images.indexOf(c))})}}},{key:"build",value:function(){if(!this.ready){var i=this.element,e=this.options,a=i.parentNode,r=document.createElement("div");r.innerHTML=fe;var s=r.querySelector(".".concat(m,"-container")),l=s.querySelector(".".concat(m,"-title")),u=s.querySelector(".".concat(m,"-toolbar")),o=s.querySelector(".".concat(m,"-navbar")),c=s.querySelector(".".concat(m,"-button")),h=s.querySelector(".".concat(m,"-canvas"));if(this.parent=a,this.viewer=s,this.title=l,this.toolbar=u,this.navbar=o,this.button=c,this.canvas=h,this.footer=s.querySelector(".".concat(m,"-footer")),this.tooltipBox=s.querySelector(".".concat(m,"-tooltip")),this.player=s.querySelector(".".concat(m,"-player")),this.list=s.querySelector(".".concat(m,"-list")),s.id="".concat(m).concat(this.id),l.id="".concat(m,"Title").concat(this.id),f(l,e.title?gt(Array.isArray(e.title)?e.title[0]:e.title):H),f(o,e.navbar?gt(e.navbar):H),rt(c,H,!e.button),e.keyboard&&c.setAttribute("tabindex",0),e.backdrop&&(f(s,"".concat(m,"-backdrop")),!e.inline&&e.backdrop!=="static"&&St(h,ft,"hide")),nt(e.className)&&e.className&&e.className.split(Et).forEach(function(S){f(s,S)}),e.toolbar){var b=document.createElement("ul"),I=at(e.toolbar),w=dt.slice(0,3),z=dt.slice(7,9),_=dt.slice(9);I||f(u,gt(e.toolbar)),y(I?e.toolbar:dt,function(S,pt){var J=I&&at(S),P=I?Tt(pt):S,Q=J&&!K(S.show)?S.show:S;if(!(!Q||!e.zoomable&&w.indexOf(P)!==-1||!e.rotatable&&z.indexOf(P)!==-1||!e.scalable&&_.indexOf(P)!==-1)){var st=J&&!K(S.size)?S.size:S,It=J&&!K(S.click)?S.click:S,W=document.createElement("li");e.keyboard&&W.setAttribute("tabindex",0),W.setAttribute("role","button"),f(W,"".concat(m,"-").concat(P)),p(It)||St(W,ft,P),x(Q)&&f(W,gt(Q)),["small","large"].indexOf(st)!==-1?f(W,"".concat(m,"-").concat(st)):P==="play"&&f(W,"".concat(m,"-large")),p(It)&&d(W,B,It),b.appendChild(W)}}),u.appendChild(b)}else f(u,H);if(!e.rotatable){var O=u.querySelectorAll('li[class*="rotate"]');f(O,et),y(O,function(S){u.appendChild(S)})}if(e.inline)f(c,me),V(s,{zIndex:e.zIndexInline}),window.getComputedStyle(a).position==="static"&&V(a,{position:"relative"}),a.insertBefore(s,i.nextSibling);else{f(c,de),f(s,wt),f(s,ut),f(s,H),V(s,{zIndex:e.zIndex});var N=e.container;nt(N)&&(N=i.ownerDocument.querySelector(N)),N||(N=this.body),N.appendChild(s)}if(e.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,p(e.ready)&&d(i,Wt,e.ready,{once:!0}),A(i,Wt)===!1){this.ready=!1;return}this.ready&&e.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=Ve,n}},{key:"setDefaults",value:function(i){L(Ot,at(i)&&i)}}]),n}();return L(re.prototype,Le,_e,ze,ke,Re),re})});var le=je(se());var Be={},oe=Be;var he=class{gallery;excludeClassNames=["profile-avatar"];constructor(){let v=this,C={filter(F){return v.isImageValid(F)},url(F){return F.hasAttribute("data-src")?F.getAttribute("data-src"):F.src}};this.gallery=new le.default(document.querySelector("main"),Object.assign(C,oe))}run(){let v=this;document.querySelectorAll("img").forEach(function(C){C.parentElement.tagName!=="A"&&v.isImageValid(C)&&C.addEventListener("click",function(){v.gallery.show()})})}isImageValid(v){return this.excludeClassNames.filter(C=>v.classList.contains(C)).length==0}};document.addEventListener("DOMContentLoaded",()=>{new he().run()});})(); /*! * Viewer.js v1.10.4 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2022-02-13T08:40:00.127Z */