{"version":3,"file":"main-DbpOnkN6.js","sources":["../../../node_modules/@fancyapps/ui/dist/index.esm.js","../../../Scripts/accordion.ts","../../../node_modules/svelte-retag/utils.js","../../../node_modules/svelte-retag/index.js","../../../node_modules/svelte/src/runtime/internal/utils.js","../../../node_modules/svelte/src/runtime/internal/dom.js","../../../node_modules/svelte/src/runtime/internal/lifecycle.js","../../../node_modules/svelte/src/runtime/internal/scheduler.js","../../../node_modules/svelte/src/runtime/internal/transitions.js","../../../node_modules/svelte/src/runtime/internal/each.js","../../../node_modules/svelte/src/runtime/internal/spread.js","../../../node_modules/svelte/src/runtime/internal/Component.js","../../../node_modules/svelte/src/shared/version.js","../../../node_modules/svelte/src/runtime/internal/disclose-version/index.js","../../../node_modules/n4s/dist/es/email.production.js","../../../node_modules/svelte/src/runtime/store/index.js","../../../node_modules/svelte-writable-derived/index.mjs","../../../node_modules/@leodog896/svelte-french-toast/dist/core/store.js","../../../node_modules/@leodog896/svelte-french-toast/dist/core/types.js","../../../node_modules/@leodog896/svelte-french-toast/dist/core/utils.js","../../../node_modules/@leodog896/svelte-french-toast/dist/core/toast.js","../../../node_modules/@leodog896/svelte-french-toast/dist/core/use-toaster.js","../../../node_modules/@leodog896/svelte-french-toast/dist/components/CheckmarkIcon.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/ErrorIcon.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/LoaderIcon.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/ToastIcon.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/ToastMessage.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/ToastBar.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/ToastWrapper.svelte","../../../node_modules/@leodog896/svelte-french-toast/dist/components/Toaster.svelte","../../../node_modules/@svelteuidev/core/dist/internal/errors/Error.svelte","../../../node_modules/@svelteuidev/core/dist/internal/errors/modules/browser.js","../../../node_modules/@svelteuidev/core/dist/internal/errors/assets/error-styles.js","../../../node_modules/@svelteuidev/core/dist/internal/errors/user-exception.js","../../../node_modules/@svelteuidev/core/dist/internal/errors/exception.js","../../../node_modules/@svelteuidev/core/dist/internal/utils/forwarding/forward-actions.js","../../../node_modules/@svelteuidev/core/dist/internal/utils/forwarding/forward-events.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/SvelteUIProvider/svelteui.provider.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/SvelteUIProvider/svelteui.stores.js","../../../node_modules/@stitches/core/dist/index.mjs","../../../node_modules/@svelteuidev/core/dist/styles/theme/default-colors.js","../../../node_modules/@svelteuidev/core/dist/styles/stitches.config.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/theme-color/theme-color.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/utils/rem/rem.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/cover/cover.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/size/size.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/radius/radius.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/utils/to-rgba/to-rgba.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/rgba/rgba.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/variant/variant.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/functions/fns/index.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/SvelteUIProvider/default-theme.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/SvelteUIProvider/SvelteUIProvider.svelte","../../../node_modules/@svelteuidev/core/dist/styles/theme/utils/get-variant-theme/get-variant-theme.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/utils/random-id/random-id.js","../../../node_modules/@svelteuidev/core/dist/styles/theme/utils/merge-theme/merge-theme.js","../../../node_modules/@svelteuidev/core/dist/styles/engine/css.js","../../../node_modules/@svelteuidev/core/dist/styles/engine/utils/from-entries/from-entries.js","../../../node_modules/@svelteuidev/core/dist/styles/engine/create-styles.js","../../../node_modules/@svelteuidev/core/dist/components/Box/context/get-system-styles/get-system-styles.js","../../../node_modules/@svelteuidev/core/dist/components/Box/Box.svelte","../../../node_modules/@svelteuidev/core/dist/components/Button/Button.styles.js","../../../node_modules/@svelteuidev/core/dist/components/Button/Button.errors.js","../../../node_modules/@svelteuidev/core/dist/components/Loader/loaders/Circle.svelte","../../../node_modules/@svelteuidev/core/dist/components/Loader/loaders/Bars.svelte","../../../node_modules/@svelteuidev/core/dist/components/Loader/loaders/Dots.svelte","../../../node_modules/@svelteuidev/core/dist/components/Loader/Loader.styles.js","../../../node_modules/@svelteuidev/core/dist/components/Loader/Loader.svelte","../../../node_modules/@svelteuidev/core/dist/components/Button/Ripple.svelte","../../../node_modules/@svelteuidev/core/dist/components/Button/Button.svelte","../../../node_modules/@svelteuidev/core/dist/components/IconRenderer/IconRenderer.styles.js","../../../node_modules/@svelteuidev/core/dist/components/IconRenderer/IconRenderer.svelte","../../../node_modules/@svelteuidev/core/dist/components/Text/Text.styles.js","../../../node_modules/@svelteuidev/core/dist/components/Text/Text.errors.js","../../../node_modules/@svelteuidev/core/dist/components/Text/Text.svelte","../../../node_modules/@svelteuidev/core/dist/components/InputWrapper/InputWrapper.styles.js","../../../node_modules/@svelteuidev/core/dist/components/InputWrapper/LabelElement.svelte","../../../node_modules/@svelteuidev/core/dist/components/InputWrapper/InputWrapper.svelte","../../../node_modules/@svelteuidev/core/dist/components/Input/Input.styles.js","../../../node_modules/@svelteuidev/core/dist/components/Input/Input.svelte","../../../node_modules/@svelteuidev/core/dist/components/Textarea/Textarea.svelte","../../../node_modules/@svelteuidev/core/dist/components/TextInput/TextInput.svelte","../../../Scripts/toast-content.svelte","../../../node_modules/walkjs/lib/types.js","../../../node_modules/walkjs/lib/defaults.js","../../../node_modules/walkjs/lib/node.js","../../../node_modules/walkjs/lib/callback.js","../../../node_modules/walkjs/lib/break.js","../../../node_modules/walkjs/lib/walk.js","../../../node_modules/walkjs/lib/builders.js","../../../node_modules/walkjs/lib/utils/apply.js","../../../node_modules/walkjs/lib/utils/deepCopy.js","../../../node_modules/walkjs/lib/utils/compare.js","../../../node_modules/walkjs/lib/utils/reduce.js","../../../node_modules/walkjs/lib/index.js","../../../Scripts/validating-store.ts","../../../Scripts/utils.ts","../../../Scripts/contact-form.svelte","../../../Scripts/index.ts"],"sourcesContent":["const t=(t,e=1e4)=>(t=parseFloat(t+\"\")||0,Math.round((t+Number.EPSILON)*e)/e),e=function(t){if(!(t&&t instanceof Element&&t.offsetParent))return!1;const e=t.scrollHeight>t.clientHeight,i=window.getComputedStyle(t).overflowY,n=-1!==i.indexOf(\"hidden\"),s=-1!==i.indexOf(\"visible\");return e&&!n&&!s},i=function(t,n){return!(!t||t===document.body||n&&t===n)&&(e(t)?t:i(t.parentElement,n))},n=function(t){var e=(new DOMParser).parseFromString(t,\"text/html\").body;if(e.childElementCount>1){for(var i=document.createElement(\"div\");e.firstChild;)i.appendChild(e.firstChild);return i}return e.firstChild},s=t=>`${t||\"\"}`.split(\" \").filter((t=>!!t)),o=(t,e,i)=>{s(e).forEach((e=>{t&&t.classList.toggle(e,i||!1)}))};class a{constructor(t){Object.defineProperty(this,\"pageX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"pageY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"clientX\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"clientY\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"id\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"time\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"nativePointer\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=t,this.pageX=t.pageX,this.pageY=t.pageY,this.clientX=t.clientX,this.clientY=t.clientY,this.id=self.Touch&&t instanceof Touch?t.identifier:-1,this.time=Date.now()}}const r={passive:!1};class l{constructor(t,{start:e=(()=>!0),move:i=(()=>{}),end:n=(()=>{})}){Object.defineProperty(this,\"element\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"startCallback\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"moveCallback\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"endCallback\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"currentPointers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"startPointers\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=t,this.startCallback=e,this.moveCallback=i,this.endCallback=n;for(const t of[\"onPointerStart\",\"onTouchStart\",\"onMove\",\"onTouchEnd\",\"onPointerEnd\",\"onWindowBlur\"])this[t]=this[t].bind(this);this.element.addEventListener(\"mousedown\",this.onPointerStart,r),this.element.addEventListener(\"touchstart\",this.onTouchStart,r),this.element.addEventListener(\"touchmove\",this.onMove,r),this.element.addEventListener(\"touchend\",this.onTouchEnd),this.element.addEventListener(\"touchcancel\",this.onTouchEnd)}onPointerStart(t){if(!t.buttons||0!==t.button)return;const e=new a(t);this.currentPointers.some((t=>t.id===e.id))||this.triggerPointerStart(e,t)&&(window.addEventListener(\"mousemove\",this.onMove),window.addEventListener(\"mouseup\",this.onPointerEnd),window.addEventListener(\"blur\",this.onWindowBlur))}onTouchStart(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerStart(new a(e),t);window.addEventListener(\"blur\",this.onWindowBlur)}onMove(t){const e=this.currentPointers.slice(),i=\"changedTouches\"in t?Array.from(t.changedTouches||[]).map((t=>new a(t))):[new a(t)],n=[];for(const t of i){const e=this.currentPointers.findIndex((e=>e.id===t.id));e<0||(n.push(t),this.currentPointers[e]=t)}n.length&&this.moveCallback(t,this.currentPointers.slice(),e)}onPointerEnd(t){t.buttons>0&&0!==t.button||(this.triggerPointerEnd(t,new a(t)),window.removeEventListener(\"mousemove\",this.onMove),window.removeEventListener(\"mouseup\",this.onPointerEnd),window.removeEventListener(\"blur\",this.onWindowBlur))}onTouchEnd(t){for(const e of Array.from(t.changedTouches||[]))this.triggerPointerEnd(t,new a(e))}triggerPointerStart(t,e){return!!this.startCallback(e,t,this.currentPointers.slice())&&(this.currentPointers.push(t),this.startPointers.push(t),!0)}triggerPointerEnd(t,e){const i=this.currentPointers.findIndex((t=>t.id===e.id));i<0||(this.currentPointers.splice(i,1),this.startPointers.splice(i,1),this.endCallback(t,e,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const t=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event(\"touchend\",{bubbles:!0,cancelable:!0,clientX:t.clientX,clientY:t.clientY}),t,this.currentPointers.slice())}}stop(){this.element.removeEventListener(\"mousedown\",this.onPointerStart,r),this.element.removeEventListener(\"touchstart\",this.onTouchStart,r),this.element.removeEventListener(\"touchmove\",this.onMove,r),this.element.removeEventListener(\"touchend\",this.onTouchEnd),this.element.removeEventListener(\"touchcancel\",this.onTouchEnd),window.removeEventListener(\"mousemove\",this.onMove),window.removeEventListener(\"mouseup\",this.onPointerEnd),window.removeEventListener(\"blur\",this.onWindowBlur)}}function c(t,e){return e?Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2)):0}function h(t,e){return e?{clientX:(t.clientX+e.clientX)/2,clientY:(t.clientY+e.clientY)/2}:t}const d=t=>\"object\"==typeof t&&null!==t&&t.constructor===Object&&\"[object Object]\"===Object.prototype.toString.call(t),u=(t,...e)=>{const i=e.length;for(let n=0;n{const n=Array.isArray(i)?[]:{};t[e]||Object.assign(t,{[e]:n}),d(i)?Object.assign(t[e],u(n,i)):Array.isArray(i)?Object.assign(t,{[e]:[...i]}):Object.assign(t,{[e]:i})}))}return t},p=function(t,e){return t.split(\".\").reduce(((t,e)=>\"object\"==typeof t?t[e]:void 0),e)};class f{constructor(t={}){Object.defineProperty(this,\"options\",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,\"events\",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(t);for(const t of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))t.startsWith(\"on\")&&\"function\"==typeof this[t]&&(this[t]=this[t].bind(this))}setOptions(t){this.options=t?u({},this.constructor.defaults,t):{};for(const[t,e]of Object.entries(this.option(\"on\")||{}))this.on(t,e)}option(t,...e){let i=p(t,this.options);return i&&\"function\"==typeof i&&(i=i.call(this,this,...e)),i}optionFor(t,e,i,...n){let s=p(e,t);var o;\"string\"!=typeof(o=s)||isNaN(o)||isNaN(parseFloat(o))||(s=parseFloat(s)),\"true\"===s&&(s=!0),\"false\"===s&&(s=!1),s&&\"function\"==typeof s&&(s=s.call(this,this,t,...n));let a=p(e,this.options);return a&&\"function\"==typeof a?s=a.call(this,this,t,...n,s):void 0===s&&(s=a),void 0===s?i:s}cn(t){const e=this.options.classes;return e&&e[t]||\"\"}localize(t,e=[]){t=String(t).replace(/\\{\\{(\\w+).?(\\w+)?\\}\\}/g,((t,e,i)=>{let n=\"\";return i?n=this.option(`${e[0]+e.toLowerCase().substring(1)}.l10n.${i}`):e&&(n=this.option(`l10n.${e}`)),n||(n=t),n}));for(let i=0;ie))}on(t,e){let i=[];\"string\"==typeof t?i=t.split(\" \"):Array.isArray(t)&&(i=t),this.events||(this.events=new Map),i.forEach((t=>{let i=this.events.get(t);i||(this.events.set(t,[]),i=[]),i.includes(e)||i.push(e),this.events.set(t,i)}))}off(t,e){let i=[];\"string\"==typeof t?i=t.split(\" \"):Array.isArray(t)&&(i=t),i.forEach((t=>{const i=this.events.get(t);if(Array.isArray(i)){const t=i.indexOf(e);t>-1&&i.splice(t,1)}}))}emit(t,...e){[...this.events.get(t)||[]].forEach((t=>t(this,...e))),\"*\"!==t&&this.emit(\"*\",t,...e)}}Object.defineProperty(f,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:\"5.0.16\"}),Object.defineProperty(f,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{}});class m extends f{constructor(t={}){super(t),Object.defineProperty(this,\"plugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(t={}){const e=new Map;for(const[i,n]of Object.entries(t)){const t=this.option(i),s=this.plugins[i];s||!1===t?s&&!1===t&&(s.detach(),delete this.plugins[i]):e.set(i,new n(this,t||{}))}for(const[t,i]of e)this.plugins[t]=i,i.attach();this.emit(\"attachPlugins\")}detachPlugins(t){t=t||Object.keys(this.plugins);for(const e of t){const t=this.plugins[e];t&&t.detach(),delete this.plugins[e]}return this.emit(\"detachPlugins\"),this}}var g;!function(t){t[t.Init=0]=\"Init\",t[t.Error=1]=\"Error\",t[t.Ready=2]=\"Ready\",t[t.Panning=3]=\"Panning\",t[t.Mousemove=4]=\"Mousemove\",t[t.Destroy=5]=\"Destroy\"}(g||(g={}));const b=[\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"],v={PANUP:\"Move up\",PANDOWN:\"Move down\",PANLEFT:\"Move left\",PANRIGHT:\"Move right\",ZOOMIN:\"Zoom in\",ZOOMOUT:\"Zoom out\",TOGGLEZOOM:\"Toggle zoom level\",TOGGLE1TO1:\"Toggle zoom level\",ITERATEZOOM:\"Toggle zoom level\",ROTATECCW:\"Rotate counterclockwise\",ROTATECW:\"Rotate clockwise\",FLIPX:\"Flip horizontally\",FLIPY:\"Flip vertically\",FITX:\"Fit horizontally\",FITY:\"Fit vertically\",RESET:\"Reset\",TOGGLEFS:\"Toggle fullscreen\"},y={content:null,width:\"auto\",height:\"auto\",panMode:\"drag\",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:\"auto\",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:\"toggleZoom\",dblClick:!1,wheel:\"zoom\",wheelLimit:7,spinner:!0,bounds:\"auto\",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:\"f-panzoom__content\",isLoading:\"is-loading\",canZoomIn:\"can-zoom_in\",canZoomOut:\"can-zoom_out\",isDraggable:\"is-draggable\",isDragging:\"is-dragging\",inFullscreen:\"in-fullscreen\",htmlHasFullscreen:\"with-panzoom-in-fullscreen\"},l10n:v},w='
',x=t=>t&&null!==t&&t instanceof Element&&\"nodeType\"in t,E=(t,e)=>{t&&s(e).forEach((e=>{t.classList.remove(e)}))},S=(t,e)=>{t&&s(e).forEach((e=>{t.classList.add(e)}))},P={a:1,b:0,c:0,d:1,e:0,f:0};let C=null,M=null;class T extends m{get isTouchDevice(){return null===M&&(M=window.matchMedia(\"(hover: none)\").matches),M}get isMobile(){return null===C&&(C=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),C}get panMode(){return\"mousemove\"!==this.options.panMode||this.isTouchDevice?\"drag\":\"mousemove\"}get panOnlyZoomed(){const t=this.options.panOnlyZoomed;return\"auto\"===t?this.isTouchDevice:t}get isInfinite(){return this.option(\"infinite\")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:t,b:e}=this.current;return Math.sqrt(t*t+e*e)||1}get targetScale(){const{a:t,b:e}=this.target;return Math.sqrt(t*t+e*e)||1}get minScale(){return this.option(\"minScale\")||1}get fullScale(){const{contentRect:t}=this;return t.fullWidth/t.fitWidth||1}get maxScale(){return this.fullScale*(this.option(\"maxScale\")||1)||1}get coverScale(){const{containerRect:t,contentRect:e}=this,i=Math.max(t.height/e.fitHeight,t.width/e.fitWidth)||1;return Math.min(this.fullScale,i)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const t=this.content;return!!(t&&t instanceof HTMLImageElement)&&!t.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const t of b){const e=\"e\"==t||\"f\"===t?.001:1e-5;if(Math.abs(this.target[t]-this.current[t])>e)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(t,e={},i={}){var s;if(super(e),Object.defineProperty(this,\"pointerTracker\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"resizeObserver\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"updateTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"clickTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"rAF\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"isTicking\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"friction\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"ignoreBounds\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"isBouncingX\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"isBouncingY\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"clicks\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"trackingPoints\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"pwt\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"cwd\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"pmme\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:g.Init}),Object.defineProperty(this,\"isDragging\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"content\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"spinner\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"containerRect\",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,\"contentRect\",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,\"dragStart\",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,\"dragOffset\",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,\"current\",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},P)}),Object.defineProperty(this,\"target\",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},P)}),Object.defineProperty(this,\"velocity\",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,\"lockedAxis\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!t)throw new Error(\"Container Element Not Found\");this.container=t,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},T.Plugins),i)),this.emit(\"init\");const o=this.content;if(o.addEventListener(\"load\",this.onLoad),o.addEventListener(\"error\",this.onError),this.isContentLoading){if(this.option(\"spinner\")){t.classList.add(this.cn(\"isLoading\"));const e=n(w);!t.contains(o)||o.parentElement instanceof HTMLPictureElement?this.spinner=t.appendChild(e):this.spinner=(null===(s=o.parentElement)||void 0===s?void 0:s.insertBefore(e,o))||null}this.emit(\"beforeLoad\")}else queueMicrotask((()=>{this.enable()}))}initContent(){const{container:t}=this,e=this.cn(\"content\");let i=this.option(\"content\")||t.querySelector(`.${e}`);if(i||(i=t.querySelector(\"img,picture\")||t.firstElementChild,i&&S(i,e)),i instanceof HTMLPictureElement&&(i=i.querySelector(\"img\")),!i)throw new Error(\"No content found\");this.content=i}onLoad(){this.spinner&&(this.spinner.remove(),this.spinner=null),this.option(\"spinner\")&&this.container.classList.remove(this.cn(\"isLoading\")),this.emit(\"afterLoad\"),this.state===g.Init?this.enable():this.updateMetrics()}onError(){this.state!==g.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=g.Error,this.emit(\"error\"))}attachObserver(){var t;const e=()=>Math.abs(this.containerRect.width-this.container.getBoundingClientRect().width)>.1||Math.abs(this.containerRect.height-this.container.getBoundingClientRect().height)>.1;this.resizeObserver||void 0===window.ResizeObserver||(this.resizeObserver=new ResizeObserver((()=>{this.updateTimer||(e()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout((()=>{e()&&this.onResize(),this.updateTimer=null}),500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))}))),null===(t=this.resizeObserver)||void 0===t||t.observe(this.container)}detachObserver(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}attachEvents(){const{container:t}=this;t.addEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.addEventListener(\"wheel\",this.onWheel,{passive:!1}),this.pointerTracker=new l(t,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(\"mousemove\",this.onMouseMove)}detachEvents(){var t;const{container:e}=this;e.removeEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),e.removeEventListener(\"wheel\",this.onWheel,{passive:!1}),null===(t=this.pointerTracker)||void 0===t||t.stop(),this.pointerTracker=null,document.removeEventListener(\"mousemove\",this.onMouseMove),document.removeEventListener(\"keydown\",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){const t=this.friction;this.setTargetForce();const e=this.option(\"maxVelocity\");for(const i of b)t?(this.velocity[i]*=1-t,e&&!this.isScaling&&(this.velocity[i]=Math.max(Math.min(this.velocity[i],e),-1*e)),this.current[i]+=this.velocity[i]):this.current[i]=this.target[i];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame((()=>this.animate())):this.stop(\"current\")}setTargetForce(){for(const t of b)\"e\"===t&&this.isBouncingX||\"f\"===t&&this.isBouncingY||(this.velocity[t]=(1/(1-this.friction)-1)*(this.target[t]-this.current[t]))}checkBounds(t=0,e=0){const{current:i}=this,n=i.e+t,s=i.f+e,o=this.getBounds(),{x:a,y:r}=o,l=a.min,c=a.max,h=r.min,d=r.max;let u=0,p=0;return l!==1/0&&nc&&(u=c-n),h!==1/0&&sd&&(p=d-s),Math.abs(u)<.001&&(u=0),Math.abs(p)<.001&&(p=0),Object.assign(Object.assign({},o),{xDiff:u,yDiff:p,inBounds:!u&&!p})}clampTargetBounds(){const{target:t}=this,{x:e,y:i}=this.getBounds();e.min!==1/0&&(t.e=Math.max(t.e,e.min)),e.max!==1/0&&(t.e=Math.min(t.e,e.max)),i.min!==1/0&&(t.f=Math.max(t.f,i.min)),i.max!==1/0&&(t.f=Math.min(t.f,i.max))}calculateContentDim(t=this.current){const{content:e,contentRect:i}=this,{fitWidth:n,fitHeight:s,fullWidth:o,fullHeight:a}=i;let r=o,l=a;if(this.option(\"zoom\")||0!==this.angle){const i=!(e instanceof HTMLImageElement)&&(\"none\"===window.getComputedStyle(e).maxWidth||\"none\"===window.getComputedStyle(e).maxHeight),c=i?o:n,h=i?a:s,d=this.getMatrix(t),u=new DOMPoint(0,0).matrixTransform(d),p=new DOMPoint(0+c,0).matrixTransform(d),f=new DOMPoint(0+c,0+h).matrixTransform(d),m=new DOMPoint(0,0+h).matrixTransform(d),g=Math.abs(f.x-u.x),b=Math.abs(f.y-u.y),v=Math.abs(m.x-p.x),y=Math.abs(m.y-p.y);r=Math.max(g,v),l=Math.max(b,y)}return{contentWidth:r,contentHeight:l}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||\"mousemove\"===this.panMode||this.targetScale{const t=window.getSelection();return t&&\"Range\"===t.type})()&&!i.closest(\"button\"))return;const n=i.closest(\"[data-panzoom-action]\"),s=i.closest(\"[data-panzoom-change]\"),o=n||s,a=o&&x(o)?o.dataset:null;if(a){const e=a.panzoomChange,i=a.panzoomAction;if((e||i)&&t.preventDefault(),e){let t={};try{t=JSON.parse(e)}catch(t){console&&console.warn(\"The given data was not valid JSON\")}return void this.applyChange(t)}if(i)return void(this[i]&&this[i]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return t.preventDefault(),void t.stopPropagation();const r=this.content.getBoundingClientRect();if(this.dragStart.time&&!this.canZoomOut()&&(Math.abs(r.x-this.dragStart.x)>2||Math.abs(r.y-this.dragStart.y)>2))return;this.dragStart.time=0;const l=e=>{this.option(\"zoom\")&&e&&\"string\"==typeof e&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(e)&&\"function\"==typeof this[e]&&(t.preventDefault(),this[e]({event:t}))},c=this.option(\"click\",t),h=this.option(\"dblClick\",t);h?(this.clicks++,1==this.clicks&&(this.clickTimer=setTimeout((()=>{1===this.clicks?(this.emit(\"click\",t),!t.defaultPrevented&&c&&l(c)):(this.emit(\"dblClick\",t),t.defaultPrevented||l(h)),this.clicks=0,this.clickTimer=null}),350))):(this.emit(\"click\",t),!t.defaultPrevented&&c&&l(c))}addTrackingPoint(t){const e=this.trackingPoints.filter((t=>t.time>Date.now()-100));e.push(t),this.trackingPoints=e}onPointerDown(t,e,i){var n;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const s=this.content.getBoundingClientRect();if(this.dragStart={x:s.x,y:s.y,top:s.top,left:s.left,time:Date.now()},this.clickTimer)return!1;if(\"mousemove\"===this.panMode&&this.targetScale>1)return t.preventDefault(),t.stopPropagation(),!1;if(!i.length){const e=t.composedPath()[0];if([\"A\",\"TEXTAREA\",\"OPTION\",\"INPUT\",\"SELECT\",\"VIDEO\"].includes(e.nodeName)||e.closest(\"[contenteditable]\")||e.closest(\"[data-selectable]\")||e.closest(\"[data-panzoom-change]\")||e.closest(\"[data-panzoom-action]\"))return!1;null===(n=window.getSelection())||void 0===n||n.removeAllRanges()}if(\"mousedown\"===t.type)t.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(e),this.emit(\"touchStart\",t)),!0}onPointerMove(e,n,s){if(!1===this.option(\"touch\",e))return;if(!this.isDragging)return;if(n.length<2&&this.panOnlyZoomed&&t(this.targetScale)<=t(this.minScale))return;if(this.emit(\"touchMove\",e),e.defaultPrevented)return;this.addTrackingPoint(n[0]);const{content:o}=this,a=h(s[0],s[1]),r=h(n[0],n[1]);let l=0,d=0;if(n.length>1){const t=o.getBoundingClientRect();l=a.clientX-t.left-.5*t.width,d=a.clientY-t.top-.5*t.height}const u=c(s[0],s[1]),p=c(n[0],n[1]);let f=u?p/u:1,m=r.clientX-a.clientX,g=r.clientY-a.clientY;this.dragOffset.x+=m,this.dragOffset.y+=g,this.dragOffset.time=Date.now()-this.dragStart.time;let b=t(this.targetScale)===t(this.minScale)&&this.option(\"lockAxis\");if(b&&!this.lockedAxis)if(\"xy\"===b||\"y\"===b||\"touchmove\"===e.type){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void e.preventDefault();const t=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=t>45&&t<135?\"y\":\"x\",this.dragOffset.x=0,this.dragOffset.y=0,m=0,g=0}else this.lockedAxis=b;if(i(e.target,this.content)&&(b=\"x\",this.dragOffset.y=0),b&&\"xy\"!==b&&this.lockedAxis!==b&&t(this.targetScale)===t(this.minScale))return;e.cancelable&&e.preventDefault(),this.container.classList.add(this.cn(\"isDragging\"));const v=this.checkBounds(m,g);this.option(\"rubberband\")?(\"x\"!==this.isInfinite&&(v.xDiff>0&&m<0||v.xDiff<0&&m>0)&&(m*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*v.xDiff))),\"y\"!==this.isInfinite&&(v.yDiff>0&&g<0||v.yDiff<0&&g>0)&&(g*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*v.yDiff)))):(v.xDiff&&(m=0),v.yDiff&&(g=0));const y=this.targetScale,w=this.minScale,x=this.maxScale;y<.5*w&&(f=Math.max(f,w)),y>1.5*x&&(f=Math.min(f,x)),\"y\"===this.lockedAxis&&t(y)===t(w)&&(m=0),\"x\"===this.lockedAxis&&t(y)===t(w)&&(g=0),this.applyChange({originX:l,originY:d,panX:m,panY:g,scale:f,friction:this.option(\"dragFriction\"),ignoreBounds:!0})}onPointerUp(t,e,n){if(n.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn(\"isDragging\")),this.isDragging&&(this.addTrackingPoint(e),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),i(t.target,this.content)&&\"y\"===this.lockedAxis&&(this.trackingPoints=[]),this.emit(\"touchEnd\",t),this.isDragging=!1,this.lockedAxis=!1,this.state!==g.Destroy&&(t.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){const e=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const t of b)this.velocity[t]=0;this.target.e=this.current.e,this.target.f=this.current.f,E(this.container,\"is-scaling\"),E(this.container,\"is-animating\"),this.isTicking=!1;const{trackingPoints:i}=this,n=i[0],s=i[i.length-1];let o=0,a=0,r=0;s&&n&&(o=s.clientX-n.clientX,a=s.clientY-n.clientY,r=s.time-n.time);let l=0,c=0,h=0,d=0,u=this.option(\"decelFriction\");const p=this.targetScale;if(r>0){h=Math.abs(o)>3?o/(r/30):0,d=Math.abs(a)>3?a/(r/30):0;const t=this.option(\"maxVelocity\");t&&(h=Math.max(Math.min(h,t),-1*t),d=Math.max(Math.min(d,t),-1*t))}h&&(l=h/(1/(1-u)-1)),d&&(c=d/(1/(1-u)-1)),(\"y\"===this.option(\"lockAxis\")||\"xy\"===this.option(\"lockAxis\")&&\"y\"===this.lockedAxis&&t(p)===this.minScale)&&(l=h=0),(\"x\"===this.option(\"lockAxis\")||\"xy\"===this.option(\"lockAxis\")&&\"x\"===this.lockedAxis&&t(p)===this.minScale)&&(c=d=0);const f=this.dragOffset.x,m=this.dragOffset.y,g=this.option(\"dragMinThreshold\")||0;Math.abs(f)this.maxScale+1e-5||e&&!l&&!c)&&(u=.35),this.applyChange({panX:l,panY:c,friction:u}),this.emit(\"decel\",h,d,f,m)}onWheel(t){var e=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const i=Math.max(-1,Math.min(1,e));if(this.emit(\"wheel\",t,i),\"mousemove\"===this.panMode)return;if(t.defaultPrevented)return;const n=this.option(\"wheel\");\"pan\"===n?(t.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-t.deltaX,panY:2*-t.deltaY,bounce:!1})):\"zoom\"===n&&!1!==this.option(\"zoom\")&&this.zoomWithWheel(t)}onMouseMove(t){this.panWithMouse(t)}onKeydown(t){\"Escape\"===t.key&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit(\"beforeTransform\");const{current:e,target:i,content:n,contentRect:s}=this,o=Object.assign({},P);for(const n of b){const s=\"e\"==n||\"f\"===n?1e3:1e5;o[n]=t(e[n],s),Math.abs(i[n]-e[n])<(\"e\"==n||\"f\"===n?.51:.001)&&(e[n]=i[n])}let{a:a,b:r,c:l,d:c,e:h,f:d}=o,u=`matrix(${a}, ${r}, ${l}, ${c}, ${h}, ${d})`,p=n.parentElement instanceof HTMLPictureElement?n.parentElement:n;if(this.option(\"transformParent\")&&(p=p.parentElement||p),p.style.transform===u)return;p.style.transform=u;const{contentWidth:f,contentHeight:m}=this.calculateContentDim();s.width=f,s.height=m,this.emit(\"afterTransform\")}updateMetrics(e=!1){if(!this||this.state===g.Destroy)return;if(this.isContentLoading)return;const{container:i,content:n}=this,s=n instanceof HTMLImageElement,o=i.getBoundingClientRect(),a=getComputedStyle(this.container),r=o.width,l=o.height,c=parseFloat(a.paddingTop)+parseFloat(a.paddingBottom),h=r-(parseFloat(a.paddingLeft)+parseFloat(a.paddingRight)),d=l-c;this.containerRect={width:r,height:l,innerWidth:h,innerHeight:d};let u=this.option(\"width\")||\"auto\",p=this.option(\"height\")||\"auto\";\"auto\"===u&&(u=parseFloat(n.dataset.width||\"\")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalWidth:t instanceof SVGElement?t.width.baseVal.value:Math.max(t.offsetWidth,t.scrollWidth),e||0})(n)),\"auto\"===p&&(p=parseFloat(n.dataset.height||\"\")||(t=>{let e=0;return e=t instanceof HTMLImageElement?t.naturalHeight:t instanceof SVGElement?t.height.baseVal.value:Math.max(t.offsetHeight,t.scrollHeight),e||0})(n));let f=n.parentElement instanceof HTMLPictureElement?n.parentElement:n;this.option(\"transformParent\")&&(f=f.parentElement||f);const m=f.getAttribute(\"style\")||\"\";f.style.setProperty(\"transform\",\"none\",\"important\"),s&&(f.style.width=\"\",f.style.height=\"\"),f.offsetHeight;const b=n.getBoundingClientRect();let v=b.width,y=b.height,w=0,x=0;s&&(Math.abs(u-v)>1||Math.abs(p-y)>1)&&({width:v,height:y,top:w,left:x}=((t,e,i,n)=>{const s=i/n;return s>t/e?(i=t,n=t/s):(i=e*s,n=e),{width:i,height:n,top:.5*(e-n),left:.5*(t-i)}})(v,y,u,p)),this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:b.top-o.top+w,bottom:o.bottom-b.bottom+w,left:b.left-o.left+x,right:o.right-b.right+x,fitWidth:v,fitHeight:y,width:v,height:y,fullWidth:u,fullHeight:p}),f.style.cssText=m,s&&(f.style.width=`${v}px`,f.style.height=`${y}px`),this.setTransform(),!0!==e&&this.emit(\"refresh\"),this.ignoreBounds||(t(this.targetScale)this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===g.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}getBounds(){const e=this.option(\"bounds\");if(\"auto\"!==e)return e;const{contentWidth:i,contentHeight:n}=this.calculateContentDim(this.target);let s=0,o=0,a=0,r=0;const l=this.option(\"infinite\");if(!0===l||this.lockedAxis&&l===this.lockedAxis)s=-1/0,a=1/0,o=-1/0,r=1/0;else{let{containerRect:e,contentRect:l}=this,c=t(this.contentRect.fitWidth*this.targetScale,1e3),h=t(this.contentRect.fitHeight*this.targetScale,1e3),{innerWidth:d,innerHeight:u}=e;if(this.containerRect.width===c&&(d=e.width),this.containerRect.width===h&&(u=e.height),i>d){a=.5*(i-d),s=-1*a;let t=.5*(l.right-l.left);s+=t,a+=t}if(this.contentRect.fitWidth>d&&iu){r=.5*(n-u),o=-1*r;let t=.5*(l.bottom-l.top);o+=t,r+=t}this.contentRect.fitHeight>u&&nt(s.fitWidth,1)||t(s.height,1)>t(s.fitHeight,1))&&(f=!0),t(s.width*r,1)t(r),g=!m&&!f&&p&&t(d)i&&(n=i/t)}v=v.scale(n)}v=v.translate(-o,-a).translate(-p,-f).multiply(m),s&&(v=v.rotate(s)),l&&(v=v.scale(-1,1)),c&&(v=v.scale(1,-1));for(const e of b)\"e\"!==e&&\"f\"!==e&&(v[e]>this.minScale+1e-5||v[e].1||\"mousemove\"===this.panMode||!1===d)&&!h&&this.clampTargetBounds(),this.isResting||(this.state=g.Panning,this.requestTick())}stop(t=!1){if(this.state===g.Init||this.state===g.Destroy)return;const e=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const e of b)this.velocity[e]=0,\"current\"===t?this.current[e]=this.target[e]:\"target\"===t&&(this.target[e]=this.current[e]);this.setTransform(),E(this.container,\"is-scaling\"),E(this.container,\"is-animating\"),this.isTicking=!1,this.state=g.Ready,e&&(this.emit(\"endAnimation\"),this.updateControls())}requestTick(){this.isTicking||(this.emit(\"startAnimation\"),this.updateControls(),S(this.container,\"is-animating\"),this.isScaling&&S(this.container,\"is-scaling\")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame((()=>this.animate())))}panWithMouse(e,i=this.option(\"mouseMoveFriction\")){if(this.pmme=e,\"mousemove\"!==this.panMode||!e)return;if(t(this.targetScale)<=t(this.minScale))return;this.emit(\"mouseMove\",e);const{container:n,containerRect:s,contentRect:o}=this,a=s.width,r=s.height,l=n.getBoundingClientRect(),c=(e.clientX||0)-l.left,h=(e.clientY||0)-l.top;let{contentWidth:d,contentHeight:u}=this.calculateContentDim(this.target);const p=this.option(\"mouseMoveFactor\");p>1&&(d!==a&&(d*=p),u!==r&&(u*=p));let f=.5*(d-a)-c/a*100/100*(d-a);f+=.5*(o.right-o.left);let m=.5*(u-r)-h/r*100/100*(u-r);m+=.5*(o.bottom-o.top),this.applyChange({panX:f-this.target.e,panY:m-this.target.f,friction:i})}zoomWithWheel(e){if(this.state===g.Destroy||this.state===g.Init)return;const i=Date.now();if(i-this.pwt<45)return void e.preventDefault();this.pwt=i;var n=[-e.deltaX||0,-e.deltaY||0,-e.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t}));const s=Math.max(-1,Math.min(1,n)),{targetScale:o,maxScale:a,minScale:r}=this;let l=o*(100+45*s)/100;t(l)t(a)&&t(o)>=t(a)?(this.cwd+=Math.abs(s),l=a):(this.cwd=0,l=Math.max(Math.min(l,a),r)),this.cwd>this.option(\"wheelLimit\")||(e.preventDefault(),t(l)!==t(o)&&this.zoomTo(l,{event:e}))}canZoomIn(){return this.option(\"zoom\")&&(t(this.contentRect.width,1)t(this.minScale)}zoomIn(t=1.25,e){this.zoomTo(this.targetScale*t,e)}zoomOut(t=.8,e){this.zoomTo(this.targetScale*t,e)}zoomToFit(t){this.zoomTo(\"fit\",t)}zoomToCover(t){this.zoomTo(\"cover\",t)}zoomToFull(t){this.zoomTo(\"full\",t)}zoomToMax(t){this.zoomTo(\"max\",t)}toggleZoom(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.fullScale-this.minScale)?\"full\":\"fit\",t)}toggleMax(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.maxScale-this.minScale)?\"max\":\"fit\",t)}toggleCover(t){this.zoomTo(this.targetScale-this.minScale<.5*(this.coverScale-this.minScale)?\"cover\":\"fit\",t)}iterateZoom(t){this.zoomTo(\"next\",t)}zoomTo(t=1,{friction:e=\"auto\",originX:i=0,originY:n=0,event:s}={}){if(this.isContentLoading||this.state===g.Destroy)return;const{targetScale:o}=this;this.stop();let a=1;if(\"mousemove\"===this.panMode&&(s=this.pmme||s),s){const t=this.content.getBoundingClientRect(),e=s.clientX||0,o=s.clientY||0;i=e-t.left-.5*t.width,n=o-t.top-.5*t.height}const r=this.fullScale,l=this.maxScale;let c=this.coverScale;\"number\"==typeof t?a=t/o:(\"next\"===t&&(r-c<.2&&(c=r),t=o1?.15:.25:e,this.applyChange({scale:a,originX:i,originY:n,friction:e}),s&&\"mousemove\"===this.panMode&&this.panWithMouse(s,e)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop(\"target\");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.height-(e.top+.5*e.fitHeight)-i.f,scale:t.width/e.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop(\"target\");const{containerRect:t,contentRect:e,target:i}=this;this.applyChange({panX:.5*t.width-(e.left+.5*e.fitWidth)-i.e,panY:.5*t.innerHeight-(e.top+.5*e.fitHeight)-i.f,scale:t.height/e.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:t}=this,e=this.cn(\"inFullscreen\"),i=this.cn(\"htmlHasFullscreen\");t.classList.toggle(e);const n=t.classList.contains(e);n?(document.documentElement.classList.add(i),document.addEventListener(\"keydown\",this.onKeydown,!0)):(document.documentElement.classList.remove(i),document.removeEventListener(\"keydown\",this.onKeydown,!0)),this.updateMetrics(),this.emit(n?\"enterFS\":\"exitFS\")}getMatrix(t=this.current){const{a:e,b:i,c:n,d:s,e:o,f:a}=t;return new DOMMatrix([e,i,n,s,o,a])}reset(t){if(this.state!==g.Init&&this.state!==g.Destroy){this.stop(\"current\");for(const t of b)this.target[t]=P[t];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=void 0===t?this.option(\"friction\"):t,this.state=g.Panning,this.requestTick())}}destroy(){this.stop(),this.state=g.Destroy,this.detachEvents(),this.detachObserver();const{container:t,content:e}=this,i=this.option(\"classes\")||{};for(const e of Object.values(i))t.classList.remove(e+\"\");e&&(e.removeEventListener(\"load\",this.onLoad),e.removeEventListener(\"error\",this.onError)),this.detachPlugins()}}Object.defineProperty(T,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:y}),Object.defineProperty(T,\"Plugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}});const O=function(t,e){let i=!0;return(...n)=>{i&&(i=!1,t(...n),setTimeout((()=>{i=!0}),e))}},A=(t,e)=>{let i=[];return t.childNodes.forEach((t=>{t.nodeType!==Node.ELEMENT_NODE||e&&!t.matches(e)||i.push(t)})),i},z={viewport:null,track:null,enabled:!0,slides:[],axis:\"x\",transition:\"fade\",preload:1,slidesPerPage:\"auto\",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:\"ltr\",classes:{container:\"f-carousel\",viewport:\"f-carousel__viewport\",track:\"f-carousel__track\",slide:\"f-carousel__slide\",isLTR:\"is-ltr\",isRTL:\"is-rtl\",isHorizontal:\"is-horizontal\",isVertical:\"is-vertical\",inTransition:\"in-transition\",isSelected:\"is-selected\"},l10n:{NEXT:\"Next slide\",PREV:\"Previous slide\",GOTO:\"Go to slide #%d\"}};var L;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Destroy=2]=\"Destroy\"}(L||(L={}));const R=t=>{if(\"string\"==typeof t&&(t={html:t}),!(t instanceof String||t instanceof HTMLElement)){const e=t.thumb;void 0!==e&&(\"string\"==typeof e&&(t.thumbSrc=e),e instanceof HTMLImageElement&&(t.thumbEl=e,t.thumbElSrc=e.src,t.thumbSrc=e.src),delete t.thumb)}return Object.assign({html:\"\",el:null,isDom:!1,class:\"\",index:-1,dim:0,gap:0,pos:0,transition:!1},t)},k=(t={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},t);class I extends f{constructor(t,e){super(e),Object.defineProperty(this,\"instance\",{enumerable:!0,configurable:!0,writable:!0,value:t})}attach(){}detach(){}}const D={classes:{list:\"f-carousel__dots\",isDynamic:\"is-dynamic\",hasDots:\"has-dots\",dot:\"f-carousel__dot\",isBeforePrev:\"is-before-prev\",isPrev:\"is-prev\",isCurrent:\"is-current\",isNext:\"is-next\",isAfterNext:\"is-after-next\"},dotTpl:'',dynamicFrom:11,maxCount:1/0,minCount:2};class F extends I{constructor(){super(...arguments),Object.defineProperty(this,\"isDynamic\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"list\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let t=this.list;return t||(t=document.createElement(\"ul\"),S(t,this.cn(\"list\")),t.setAttribute(\"role\",\"tablist\"),this.instance.container.appendChild(t),S(this.instance.container,this.cn(\"hasDots\")),this.list=t),t}refresh(){var t;const e=this.instance.pages.length,i=Math.min(2,this.option(\"minCount\")),n=Math.max(2e3,this.option(\"maxCount\")),s=this.option(\"dynamicFrom\");if(en)return void this.cleanup();const a=\"number\"==typeof s&&e>5&&e>=s,r=!this.list||this.isDynamic!==a||this.list.children.length!==e;r&&this.cleanup();const l=this.build();if(o(l,this.cn(\"isDynamic\"),!!a),r)for(let t=0;t=e-1&&s.setAttribute(\"disabled\",\"\")))}createButton(t){const e=this.instance,i=document.createElement(\"button\");i.setAttribute(\"tabindex\",\"0\"),i.setAttribute(\"title\",e.localize(`{{${t.toUpperCase()}}}`)),S(i,this.cn(\"button\")+\" \"+this.cn(\"next\"===t?\"isNext\":\"isPrev\"));const n=e.isRTL?\"next\"===t?\"prev\":\"next\":t;var s;return i.innerHTML=e.localize(this.option(`${n}Tpl`)),i.dataset[`carousel${s=t,s?s.match(\"^[a-z]\")?s.charAt(0).toUpperCase()+s.substring(1):s:\"\"}`]=\"true\",i}build(){let t=this.container;t||(this.container=t=document.createElement(\"div\"),S(t,this.cn(\"container\")),this.instance.container.appendChild(t)),this.next||(this.next=t.appendChild(this.createButton(\"next\"))),this.prev||(this.prev=t.appendChild(this.createButton(\"prev\")))}cleanup(){this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove(),this.prev=null,this.next=null,this.container=null}attach(){this.instance.on([\"refresh\",\"change\"],this.onRefresh)}detach(){this.instance.off([\"refresh\",\"change\"],this.onRefresh),this.cleanup()}}Object.defineProperty(j,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:\"f-carousel__nav\",button:\"f-button\",isNext:\"is-next\",isPrev:\"is-prev\"},nextTpl:'',prevTpl:''}});class H extends I{constructor(){super(...arguments),Object.defineProperty(this,\"selectedIndex\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"target\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"nav\",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(t){this.target=this.instance,this.nav=t,this.attachEvents()}addAsNavFor(t){this.nav=this.instance,this.target=t,this.attachEvents()}attachEvents(){this.nav&&this.target&&(this.nav.options.initialSlide=this.target.options.initialPage,this.nav.on(\"ready\",this.onNavReady),this.nav.state===L.Ready&&this.onNavReady(this.nav),this.target.on(\"ready\",this.onTargetReady),this.target.state===L.Ready&&this.onTargetReady(this.target))}onNavReady(t){t.on(\"createSlide\",this.onNavCreateSlide),t.on(\"Panzoom.click\",this.onNavClick),t.on(\"Panzoom.touchEnd\",this.onNavTouch),this.onTargetChange()}onTargetReady(t){t.on(\"change\",this.onTargetChange),t.on(\"Panzoom.refresh\",this.onTargetChange),this.onTargetChange()}onNavClick(t,e,i){i.pointerType||this.onNavTouch(t,t.panzoom,i)}onNavTouch(t,e,i){var n,s;if(Math.abs(e.dragOffset.x)>3||Math.abs(e.dragOffset.y)>3)return;const o=i.target,{nav:a,target:r}=this;if(!a||!r||!o)return;const l=o.closest(\"[data-index]\");if(i.stopPropagation(),i.preventDefault(),!l)return;const c=parseInt(l.dataset.index||\"\",10)||0,h=r.getPageForSlide(c),d=a.getPageForSlide(c);a.slideTo(d),r.slideTo(h,{friction:null===(s=null===(n=this.nav)||void 0===n?void 0:n.plugins)||void 0===s?void 0:s.Sync.option(\"friction\")}),this.markSelectedSlide(c)}onNavCreateSlide(t,e){e.index===this.selectedIndex&&this.markSelectedSlide(e.index)}onTargetChange(){const{target:t,nav:e}=this;if(!t||!e)return;if(e.state!==L.Ready||t.state!==L.Ready)return;const i=t.pages[t.page].slides[0].index,n=e.getPageForSlide(i);this.markSelectedSlide(i),e.slideTo(n)}markSelectedSlide(t){const{nav:e}=this;e&&e.state===L.Ready&&(this.selectedIndex=t,[...e.slides].map((e=>{e.el&&e.el.classList[e.index===t?\"add\":\"remove\"](\"is-nav-selected\")})))}attach(){let t=this.options.target,e=this.options.nav;t?this.addAsNavFor(t):e&&this.addAsTargetFor(e)}detach(){this.nav&&(this.nav.off(\"ready\",this.onNavReady),this.nav.off(\"createSlide\",this.onNavCreateSlide),this.nav.off(\"Panzoom.click\",this.onNavClick),this.nav.off(\"Panzoom.touchEnd\",this.onNavTouch)),this.nav=null,this.target&&(this.target.off(\"ready\",this.onTargetReady),this.target.off(\"refresh\",this.onTargetChange),this.target.off(\"change\",this.onTargetChange)),this.target=null}}Object.defineProperty(H,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const B={Navigation:j,Dots:F,Sync:H};class _ extends m{get axis(){return this.isHorizontal?\"e\":\"f\"}get isEnabled(){return this.state===L.Ready}get isInfinite(){let t=!1;const e=this.contentDim,i=this.viewportDim;return this.pages.length>=2&&e>1.5*i&&(t=this.option(\"infinite\")),t}get isRTL(){return\"rtl\"===this.option(\"direction\")}get isHorizontal(){return\"x\"===this.option(\"axis\")}constructor(t,e={},i={}){if(super(),Object.defineProperty(this,\"userOptions\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"userPlugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"bp\",{enumerable:!0,configurable:!0,writable:!0,value:\"\"}),Object.defineProperty(this,\"lp\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:L.Init}),Object.defineProperty(this,\"page\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"prevPage\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"viewport\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"track\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"slides\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"pages\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"panzoom\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"inTransition\",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,\"contentDim\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"viewportDim\",{enumerable:!0,configurable:!0,writable:!0,value:0}),\"string\"==typeof t&&(t=document.querySelector(t)),!t||!x(t))throw new Error(\"No Element found\");this.container=t,this.slideNext=O(this.slideNext.bind(this),150),this.slidePrev=O(this.slidePrev.bind(this),150),this.userOptions=e,this.userPlugins=i,queueMicrotask((()=>{this.processOptions()}))}processOptions(){const t=u({},_.defaults,this.userOptions);let e=\"\";const i=t.breakpoints;if(i&&d(i))for(const[n,s]of Object.entries(i))window.matchMedia(n).matches&&d(s)&&(e+=n,u(t,s));e===this.bp&&this.state!==L.Init||(this.bp=e,this.state===L.Ready&&(t.initialSlide=this.pages[this.page].slides[0].index),this.state!==L.Init&&this.destroy(),super.setOptions(t),!1===this.option(\"enabled\")?this.attachEvents():setTimeout((()=>{this.init()}),0))}init(){this.state=L.Init,this.emit(\"init\"),this.attachPlugins(Object.assign(Object.assign({},_.Plugins),this.userPlugins)),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=L.Ready,this.emit(\"ready\")}initLayout(){const{container:t}=this,e=this.option(\"classes\");S(t,this.cn(\"container\")),o(t,e.isLTR,!this.isRTL),o(t,e.isRTL,this.isRTL),o(t,e.isVertical,!this.isHorizontal),o(t,e.isHorizontal,this.isHorizontal);let i=this.option(\"viewport\")||t.querySelector(`.${e.viewport}`);i||(i=document.createElement(\"div\"),S(i,e.viewport),i.append(...A(t,`.${e.slide}`)),t.prepend(i));let n=this.option(\"track\")||t.querySelector(`.${e.track}`);n||(n=document.createElement(\"div\"),S(n,e.track),n.append(...Array.from(i.childNodes))),n.setAttribute(\"aria-live\",\"polite\"),i.contains(n)||i.prepend(n),this.viewport=i,this.track=n,this.emit(\"initLayout\")}initSlides(){const{track:t}=this;if(t){this.slides=[],[...A(t,`.${this.cn(\"slide\")}`)].forEach((t=>{if(x(t)){const e=R({el:t,isDom:!0,index:this.slides.length});this.slides.push(e),this.emit(\"initSlide\",e,this.slides.length)}}));for(let t of this.option(\"slides\",[])){const e=R(t);e.index=this.slides.length,this.slides.push(e),this.emit(\"initSlide\",e,this.slides.length)}this.emit(\"initSlides\")}}setInitialPage(){let t=0;const e=this.option(\"initialSlide\");t=\"number\"==typeof e?this.getPageForSlide(e):parseInt(this.option(\"initialPage\",0)+\"\",10)||0,this.page=t}setInitialPosition(){if(!this.track||!this.pages.length)return;const t=this.isHorizontal;let e=this.page;this.pages[e]||(this.page=e=0);const i=this.pages[e].pos*(this.isRTL&&t?1:-1),n=t?`${i}px`:\"0\",s=t?\"0\":`${i}px`;this.track.style.transform=`translate3d(${n}, ${s}, 0) scale(1)`,this.option(\"adaptiveHeight\")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const t=this.option(\"Panzoom\")||{};this.panzoom=new T(this.viewport,u({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?\"x\":\"y\",infinite:this.isInfinite,click:!1,dblClick:!1,touch:t=>!(this.pages.length<2&&!t.options.infinite),bounds:()=>this.getBounds(),maxVelocity:t=>Math.abs(t.target[this.axis]-t.current[this.axis])<2*this.viewportDim?100:0},t)),this.panzoom.on(\"*\",((t,e,...i)=>{this.emit(`Panzoom.${e}`,t,...i)})),this.panzoom.on(\"decel\",this.onDecel),this.panzoom.on(\"refresh\",this.onRefresh),this.panzoom.on(\"beforeTransform\",this.onBeforeTransform),this.panzoom.on(\"endAnimation\",this.onEndAnimation)}attachEvents(){const t=this.container;t&&(t.addEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.addEventListener(\"slideTo\",this.onSlideTo)),window.addEventListener(\"resize\",this.onResize)}createPages(){let t=[];const{contentDim:e,viewportDim:i}=this;let n=this.option(\"slidesPerPage\");(\"number\"!=typeof n||e<=i)&&(n=1/0);let s=0,o=0,a=0;for(const e of this.slides)(!t.length||o+e.dim>i||a===n)&&(t.push(k()),s=t.length-1,o=0,a=0),t[s].slides.push(e),o+=e.dim+e.gap,a++;return t}processPages(){const e=this.pages,{contentDim:i,viewportDim:n}=this,s=this.option(\"center\"),o=this.option(\"fill\"),a=o&&s&&i>n&&!this.isInfinite;if(e.forEach(((t,e)=>{t.index=e,t.pos=t.slides[0].pos,t.dim=0;for(const[e,i]of t.slides.entries())t.dim+=i.dim,e=i-.5*n?t.pos=i-n:s&&(t.pos+=-.5*(n-t.dim))})),e.forEach(((e,s)=>{o&&!this.isInfinite&&i>n&&(e.pos=Math.max(e.pos,0),e.pos=Math.min(e.pos,i-n)),e.pos=t(e.pos,1e3),e.dim=t(e.dim,1e3),e.pos<.1&&e.pos>-.1&&(e.pos=0)})),this.isInfinite)return e;const r=[];let l;return e.forEach((t=>{const e=Object.assign({},t);l&&e.pos===l.pos?(l.dim+=e.dim,l.slides=[...l.slides,...e.slides]):(e.index=r.length,l=e,r.push(e))})),r}getPageFromIndex(t=0){const e=this.pages.length;let i;return t=parseInt((t||0).toString())||0,i=this.isInfinite?(t%e+e)%e:Math.max(Math.min(t,e-1),0),i}getSlideMetrics(e){const i=this.isHorizontal?\"width\":\"height\";let n=0,s=0,o=e.el;o?n=parseFloat(o.dataset[i]||\"\")||0:(o=document.createElement(\"div\"),o.style.visibility=\"hidden\",S(o,this.cn(\"slide\")+\" \"+e.class),(this.track||document.body).prepend(o)),n?(o.style[i]=`${n}px`,o.style[\"width\"===i?\"height\":\"width\"]=\"\"):n=o.getBoundingClientRect()[i];const a=getComputedStyle(o);return\"content-box\"===a.boxSizing&&(this.isHorizontal?(n+=parseFloat(a.paddingLeft)||0,n+=parseFloat(a.paddingRight)||0):(n+=parseFloat(a.paddingTop)||0,n+=parseFloat(a.paddingBottom)||0)),s=parseFloat(a[this.isHorizontal?\"marginRight\":\"marginBottom\"])||0,this.isHorizontal,e.el||o.remove(),{dim:t(n,1e3),gap:t(s,1e3)}}getBounds(){let t={min:0,max:0};if(this.isInfinite)t={min:-1/0,max:1/0};else if(this.pages.length){const e=this.pages[0].pos,i=this.pages[this.pages.length-1].pos;t=this.isRTL&&this.isHorizontal?{min:e,max:i}:{min:-1*i,max:-1*e}}return{x:this.isHorizontal?t:{min:0,max:0},y:this.isHorizontal?{min:0,max:0}:t}}repositionSlides(){let e,{viewport:i,viewportDim:n,contentDim:s,page:o,pages:a}=this,r=0,l=0,c=0,h=0;this.panzoom?h=-1*this.panzoom.current[this.axis]:a[o]&&(h=a[o].pos||0),e=this.isHorizontal?this.isRTL?\"right\":\"left\":\"top\",this.isRTL&&this.isHorizontal&&(h*=-1);for(const i of this.slides)i.el?(\"top\"===e?(i.el.style.right=\"\",i.el.style.left=\"\"):i.el.style.top=\"\",i.index!==r?i.el.style[e]=0===l?\"\":`${t(l,1e3)}px`:i.el.style[e]=\"\",c+=i.dim+i.gap,r++):l+=i.dim+i.gap;if(this.isInfinite&&c&&i){const o=this.isHorizontal;let a=getComputedStyle(i),r=\"padding\",d=o?\"Right\":\"Bottom\",u=parseFloat(a[r+(o?\"Left\":\"Top\")]);h-=u,n+=u,n+=parseFloat(a[r+d]);for(const i of this.slides)i.el&&(t(i.pos)t(s-n)&&(i.el.style[e]=`${t(l+c,1e3)}px`),t(i.pos+i.gap)>=t(s-n)&&t(i.pos)>t(h+n)&&t(h)1&&(d=this.pages[p[0]],u=this.pages[p[1]]),d&&u){let i=0;for(const n of this.slides)n.el?this.inTransition.has(n.index)&&d.slides.indexOf(n)<0&&(n.el.style[e]=`${t(i+(d.pos-u.pos),1e3)}px`):i+=n.dim+n.gap}}createSlideEl(t){if(!this.track||!t)return;if(t.el)return;const e=document.createElement(\"div\");S(e,this.cn(\"slide\")),S(e,t.class),S(e,t.customClass),t.html&&(e.innerHTML=t.html);const i=[];this.slides.forEach(((t,e)=>{t.el&&i.push(e)}));const n=t.index;let s=null;if(i.length){let t=i.reduce(((t,e)=>Math.abs(e-n)1)return!1;const a=e>this.page?1:-1,r=this.pages[o].pos*(this.isRTL?1:-1);if(this.page===o&&t(r,1e3)===t(s.target[this.axis],1e3))return!1;this.clearTransitions();const l=s.isResting;S(this.container,this.cn(\"inTransition\"));const c=this.pages[this.page].slides[0],h=this.pages[o].slides[0];this.inTransition.add(h.index),this.createSlideEl(h);let d=c.el,u=h.el;l||\"slide\"===i||(i=\"fadeFast\",d=null);const p=this.isRTL?\"next\":\"prev\",f=this.isRTL?\"prev\":\"next\";return d&&(this.inTransition.add(c.index),c.transition=i,d.addEventListener(\"animationend\",this.onAnimationEnd),d.classList.add(`f-${i}Out`,`to-${a>0?f:p}`)),u&&(h.transition=i,u.addEventListener(\"animationend\",this.onAnimationEnd),u.classList.add(`f-${i}In`,`from-${a>0?p:f}`)),s.panTo({x:this.isHorizontal?r:0,y:this.isHorizontal?0:r,friction:0}),this.onChange(o),!0}manageSlideVisiblity(){const t=new Set,e=new Set,i=this.getVisibleSlides(parseFloat(this.option(\"preload\",0)+\"\")||0);for(const n of this.slides)i.has(n)?t.add(n):e.add(n);for(const e of this.inTransition)t.add(this.slides[e]);for(const e of t)this.createSlideEl(e),this.lazyLoadSlide(e);for(const i of e)t.has(i)||this.removeSlideEl(i);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const t=\"aria-hidden\";let e=this.cn(\"isSelected\");if(e)for(const i of this.slides)i.el&&(i.el.dataset.index=`${i.index}`,this.pages[this.page].slides.includes(i)?(i.el.classList.contains(e)||(S(i.el,e),this.emit(\"selectSlide\",i)),i.el.removeAttribute(t)):(i.el.classList.contains(e)&&(E(i.el,e),this.emit(\"unselectSlide\",i)),i.el.setAttribute(t,\"true\")))}flipInfiniteTrack(){const t=this.panzoom;if(!t||!this.isInfinite)return;const e=\"x\"===this.option(\"axis\")?\"e\":\"f\",{viewportDim:i,contentDim:n}=this;let s=t.current[e],o=t.target[e]-s,a=0,r=.5*i,l=n;this.isRTL&&this.isHorizontal?(s<-r&&(a=-1,s+=l),s>l-r&&(a=1,s-=l)):(s>r&&(a=1,s-=l),s<-l+r&&(a=-1,s+=l)),a&&(t.current[e]=s,t.target[e]=s+o)}lazyLoadSlide(t){const e=this,i=t&&t.el;if(!i)return;const s=new Set,o=\"f-fadeIn\";i.querySelectorAll(\"[data-lazy-srcset]\").forEach((t=>{t instanceof HTMLImageElement&&s.add(t)}));let a=Array.from(i.querySelectorAll(\"[data-lazy-src]\"));i.dataset.lazySrc&&a.push(i),a.map((t=>{t instanceof HTMLImageElement?s.add(t):x(t)&&(t.style.backgroundImage=`url('${t.dataset.lazySrc||\"\"}')`,delete t.dataset.lazySrc)}));const r=(t,i,n)=>{n&&(n.remove(),n=null),i.complete&&(i.classList.add(o),setTimeout((()=>{i.classList.remove(o)}),350),i.style.display=\"\"),this.option(\"adaptiveHeight\")&&t.el&&this.pages[this.page].slides.indexOf(t)>-1&&(e.updateMetrics(),e.setViewportHeight()),this.emit(\"load\",t)};for(const e of s){let i=null;e.src=e.dataset.lazySrcset||e.dataset.lazySrc||\"\",delete e.dataset.lazySrc,delete e.dataset.lazySrcset,e.style.display=\"none\",e.addEventListener(\"error\",(()=>{r(t,e,i)})),e.addEventListener(\"load\",(()=>{r(t,e,i)})),setTimeout((()=>{e.parentNode&&t.el&&(e.complete?r(t,e,i):(i=n(w),e.parentNode.insertBefore(i,e)))}),300)}}onAnimationEnd(t){var e;const i=t.target,n=i?parseInt(i.dataset.index||\"\",10)||0:-1,s=this.slides[n],o=t.animationName;if(!i||!s||!o)return;const a=!!this.inTransition.has(n)&&s.transition;a&&o.substring(0,a.length+2)===`f-${a}`&&this.inTransition.delete(n),this.inTransition.size||this.clearTransitions(),n===this.page&&(null===(e=this.panzoom)||void 0===e?void 0:e.isResting)&&this.emit(\"settle\")}onDecel(t,e=0,i=0){const{isRTL:n,isHorizontal:s,axis:o,pages:a}=this,r=a.length,l=Math.abs(Math.atan2(i,e)/(Math.PI/180));let c=0;if(c=l>45&&l<135?s?0:i:s?e:0,!r)return;const h=this.option(\"dragFree\");let d=this.page,u=n&&s?1:-1;const p=t.target[o]*u,f=t.current[o]*u;let{pageIndex:m}=this.getPageFromPosition(p),{pageIndex:g}=this.getPageFromPosition(f);h?this.onChange(m):(Math.abs(c)>5?(a[d].dim.5&&(e.target[this.axis]=-1*this.pages[this.page].pos,e.current[this.axis]=-1*this.pages[this.page].pos,e.stop()),this.manageSlideVisiblity(),this.emit(\"refresh\")}getProgress(e,i=!1){void 0===e&&(e=this.page);const n=this,s=n.panzoom,o=n.pages[e]||0;if(!o||!s)return 0;let a=-1*s.current.e,r=n.contentDim;var l=[t((a-o.pos)/(1*o.dim),1e3),t((a+r-o.pos)/(1*o.dim),1e3),t((a-r-o.pos)/(1*o.dim),1e3)].reduce((function(t,e){return Math.abs(e){t.el&&(s=Math.max(s,t.el.offsetHeight))}))),i.style.height=s?`${s}px`:\"\"}getPageForSlide(t){for(const e of this.pages)for(const i of e.slides)if(i.index===t)return e.index;return-1}getVisibleSlides(t=0){var e;const i=new Set;let{contentDim:n,viewportDim:s,pages:o,page:a}=this;n=n+(null===(e=this.slides[this.slides.length-1])||void 0===e?void 0:e.gap)||0;let r=0;r=this.panzoom?-1*this.panzoom.current[this.axis]:o[a]&&o[a].pos||0,this.isInfinite&&(r-=Math.floor(r/n)*n),this.isRTL&&this.isHorizontal&&(r*=-1);const l=r-s*t,c=r+s*(t+1),h=this.isInfinite?[-1,0,1]:[0];for(const t of this.slides)for(const e of h){const s=t.pos+e*n,o=t.pos+t.dim+t.gap+e*n;sl&&i.add(t)}return i}getPageFromPosition(t){const{viewportDim:e,contentDim:i}=this,n=this.pages.length,s=this.slides.length,o=this.slides[s-1];let a=0,r=0,l=0;const c=this.option(\"center\");c&&(t+=.5*e),this.isInfinite||(t=Math.max(this.slides[0].pos,Math.min(t,o.pos)));const h=i+o.gap;l=Math.floor(t/h)||0,t-=l*h;let d=o,u=this.slides.find((e=>{const i=t+(d&&!c?.5*d.dim:0);return d=e,e.pos<=i&&e.pos+e.dim+e.gap>i}));return u||(u=o),r=this.getPageForSlide(u.index),a=r+l*n,{page:a,pageIndex:r}}destroy(){if([L.Destroy].includes(this.state))return;this.state=L.Destroy;const{container:t,viewport:e,track:i,slides:n,panzoom:s}=this,o=this.option(\"classes\");t.removeEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.removeEventListener(\"slideTo\",this.onSlideTo),window.removeEventListener(\"resize\",this.onResize),s&&(s.destroy(),this.panzoom=null),n&&n.forEach((t=>{this.removeSlideEl(t)})),this.detachPlugins(),e&&e.offsetParent&&i&&i.offsetParent&&e.replaceWith(...i.childNodes);for(const[e,i]of Object.entries(o))\"container\"!==e&&i&&t.classList.remove(i);this.track=null,this.viewport=null,this.page=0,this.slides=[];const a=this.events.get(\"ready\");this.events=new Map,a&&this.events.set(\"ready\",a)}}Object.defineProperty(_,\"Panzoom\",{enumerable:!0,configurable:!0,writable:!0,value:T}),Object.defineProperty(_,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:z}),Object.defineProperty(_,\"Plugins\",{enumerable:!0,configurable:!0,writable:!0,value:B});const N=function(t){const e=window.pageYOffset,i=window.pageYOffset+window.innerHeight;if(!x(t))return 0;const n=t.getBoundingClientRect(),s=n.y+window.pageYOffset,o=n.y+n.height+window.pageYOffset;if(e>o||io)return 100;if(si)return 100;let a=n.height;si&&(a-=o-i);const r=a/window.innerHeight*100;return Math.round(r)},W=!(\"undefined\"==typeof window||!window.document||!window.document.createElement);let $;const X=[\"a[href]\",\"area[href]\",'input:not([disabled]):not([type=\"hidden\"]):not([aria-hidden])',\"select:not([disabled]):not([aria-hidden])\",\"textarea:not([disabled]):not([aria-hidden])\",\"button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)\",\"iframe\",\"object\",\"embed\",\"video\",\"audio\",\"[contenteditable]\",'[tabindex]:not([tabindex^=\"-\"]):not([disabled]):not([aria-hidden])'].join(\",\"),Y=t=>{if(t&&W){void 0===$&&document.createElement(\"div\").focus({get preventScroll(){return $=!0,!1}});try{if($)t.focus({preventScroll:!0});else{const e=window.pageXOffset||document.body.scrollTop,i=window.pageYOffset||document.body.scrollLeft;t.focus(),document.body.scrollTo({top:e,left:i,behavior:\"auto\"})}}catch(t){}}},q={dragToClose:!0,hideScrollbar:!0,Carousel:{classes:{container:\"fancybox__carousel\",viewport:\"fancybox__viewport\",track:\"fancybox__track\",slide:\"fancybox__slide\"}},contentClick:\"toggleZoom\",contentDblClick:!1,backdropClick:\"close\",animated:!0,idle:3500,showClass:\"f-zoomInUp\",hideClass:\"f-fadeOut\",commonCaption:!1,parentEl:null,startIndex:0,l10n:Object.assign(Object.assign({},v),{CLOSE:\"Close\",NEXT:\"Next\",PREV:\"Previous\",MODAL:\"You can close this modal content with the ESC key\",ERROR:\"Something Went Wrong, Please Try Again Later\",IMAGE_ERROR:\"Image Not Found\",ELEMENT_NOT_FOUND:\"HTML Element Not Found\",AJAX_NOT_FOUND:\"Error Loading AJAX : Not Found\",AJAX_FORBIDDEN:\"Error Loading AJAX : Forbidden\",IFRAME_ERROR:\"Error Loading Page\",TOGGLE_ZOOM:\"Toggle zoom level\",TOGGLE_THUMBS:\"Toggle thumbnails\",TOGGLE_SLIDESHOW:\"Toggle slideshow\",TOGGLE_FULLSCREEN:\"Toggle full-screen mode\",DOWNLOAD:\"Download\"}),tpl:{closeButton:'',main:'
\\n
\\n
\\n
\\n
'},groupAll:!1,groupAttr:\"data-fancybox\",defaultType:\"image\",defaultDisplay:\"block\",autoFocus:!0,trapFocus:!0,placeFocusBack:!0,closeButton:\"auto\",keyboard:{Escape:\"close\",Delete:\"close\",Backspace:\"close\",PageUp:\"next\",PageDown:\"prev\",ArrowUp:\"prev\",ArrowDown:\"next\",ArrowRight:\"next\",ArrowLeft:\"prev\"},Fullscreen:{autoStart:!1},compact:()=>window.matchMedia(\"(max-width: 578px), (max-height: 578px)\").matches,wheel:\"zoom\"};var Z,V;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Closing=2]=\"Closing\",t[t.CustomClosing=3]=\"CustomClosing\",t[t.Destroy=4]=\"Destroy\"}(Z||(Z={})),function(t){t[t.Loading=0]=\"Loading\",t[t.Opening=1]=\"Opening\",t[t.Ready=2]=\"Ready\",t[t.Closing=3]=\"Closing\"}(V||(V={}));const G=()=>{queueMicrotask((()=>{(()=>{const{slug:t,index:e}=U.parseURL(),i=xt.getInstance();if(i&&!1!==i.option(\"Hash\")){const n=i.carousel;if(t&&n){for(let e of n.slides)if(e.slug&&e.slug===t)return n.slideTo(e.index);if(t===i.option(\"slug\"))return n.slideTo(e-1);const s=i.getSlide(),o=s&&s.triggerEl&&s.triggerEl.dataset;if(o&&o.fancybox===t)return n.slideTo(e-1)}U.hasSilentClose=!0,i.close()}U.startFromUrl()})()}))};class U extends I{constructor(){super(...arguments),Object.defineProperty(this,\"origHash\",{enumerable:!0,configurable:!0,writable:!0,value:\"\"}),Object.defineProperty(this,\"timer\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onChange(){const t=this.instance,e=t.carousel;this.timer&&clearTimeout(this.timer);const i=t.getSlide();if(!e||!i)return;const n=t.isOpeningSlide(i),s=new URL(document.URL).hash;let o,a=i.slug||void 0;o=a||this.instance.option(\"slug\"),!o&&i.triggerEl&&i.triggerEl.dataset&&(o=i.triggerEl.dataset.fancybox);let r=\"\";o&&\"true\"!==o&&(r=\"#\"+o+(!a&&e.slides.length>1?\"-\"+(i.index+1):\"\")),n&&(this.origHash=s!==r?s:\"\"),r&&s!==r&&(this.timer=setTimeout((()=>{try{window.history[n?\"pushState\":\"replaceState\"]({},document.title,window.location.pathname+window.location.search+r)}catch(t){}}),300))}onClose(){if(this.timer&&clearTimeout(this.timer),!0!==U.hasSilentClose)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(this.origHash||\"\"))}catch(t){}}attach(){this.instance.on(\"Carousel.ready\",this.onChange),this.instance.on(\"Carousel.change\",this.onChange),this.instance.on(\"close\",this.onClose)}detach(){this.instance.off(\"Carousel.ready\",this.onChange),this.instance.off(\"Carousel.change\",this.onChange),this.instance.off(\"close\",this.onClose)}static parseURL(){const t=window.location.hash.slice(1),e=t.split(\"-\"),i=e[e.length-1],n=i&&/^\\+?\\d+$/.test(i)&&parseInt(e.pop()||\"1\",10)||1;return{hash:t,slug:e.join(\"-\"),index:n}}static startFromUrl(){if(U.hasSilentClose=!1,xt.getInstance()||!1===xt.defaults.Hash)return;const{hash:t,slug:e,index:i}=U.parseURL();if(!e)return;let n=document.querySelector(`[data-slug=\"${t}\"]`);if(n&&n.dispatchEvent(new CustomEvent(\"click\",{bubbles:!0,cancelable:!0})),xt.getInstance())return;const s=document.querySelectorAll(`[data-fancybox=\"${e}\"]`);s.length&&(n=s[i-1],n&&n.dispatchEvent(new CustomEvent(\"click\",{bubbles:!0,cancelable:!0})))}static destroy(){window.removeEventListener(\"hashchange\",G,!1)}}function K(){window.addEventListener(\"hashchange\",G,!1),setTimeout((()=>{U.startFromUrl()}),500)}Object.defineProperty(U,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(U,\"hasSilentClose\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),W&&(/complete|interactive|loaded/.test(document.readyState)?K():document.addEventListener(\"DOMContentLoaded\",K));class J extends I{onCreateSlide(t,e,i){const n=this.instance,s=n.optionFor(i,\"src\")||\"\",{el:o,type:a}=i;o&&\"image\"===a&&\"string\"==typeof s&&this.setContent(i,s).then((t=>{const e=i.contentEl,s=i.imageEl,a=i.thumbElSrc;if(n.isClosing()||!e||!s)return;e.offsetHeight;const r=!!n.isOpeningSlide(i)&&this.getZoomInfo(i);if(this.option(\"protected\")){o.addEventListener(\"contextmenu\",(t=>{t.preventDefault()}));const t=document.createElement(\"div\");S(t,\"fancybox-protected\"),e.appendChild(t)}if(a&&r){const s=t.contentRect,o=Math.max(s.fullWidth,s.fullHeight);let c=null;!r.opacity&&o>1200&&(c=document.createElement(\"img\"),S(c,\"fancybox-ghost\"),c.src=a,e.appendChild(c));const h=()=>{c&&(S(c,\"f-fadeFastOut\"),setTimeout((()=>{c&&(c.remove(),c=null)}),200))};(l=a,new Promise(((t,e)=>{const i=new Image;i.onload=t,i.onerror=e,i.src=l}))).then((()=>{i.state=V.Opening,this.instance.emit(\"reveal\",i),this.zoomIn(i).then((()=>{h(),this.instance.done(i)}),(()=>{n.hideLoading(i)})),c&&setTimeout((()=>{h()}),o>2500?800:200)}),(()=>{n.hideLoading(i),n.revealContent(i)}))}else{const e=this.optionFor(i,\"initialSize\"),s=this.optionFor(i,\"zoom\"),o={event:n.prevMouseMoveEvent||n.options.event,friction:s?.12:0};let a=n.optionFor(i,\"showClass\")||void 0,r=!0;n.isOpeningSlide(i)&&(\"full\"===e?t.zoomToFull(o):\"cover\"===e?t.zoomToCover(o):\"max\"===e?t.zoomToMax(o):r=!1,t.stop(\"current\")),r&&a&&(a=t.isDragging?\"f-fadeIn\":\"\"),n.revealContent(i,a)}var l}),(()=>{n.setError(i,\"{{IMAGE_ERROR}}\")}))}onRemoveSlide(t,e,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(t,e,i,n){for(const t of e.slides){const e=t.panzoom;e&&t.index!==i&&e.reset(.35)}}onClose(){const t=this.instance,e=t.container,i=t.getSlide();if(!e||!e.parentElement||!i)return;const{el:n,contentEl:s,panzoom:o}=i,a=i.thumbElSrc;if(!n||!a||!s||!o||o.isContentLoading||o.state===g.Init||o.state===g.Destroy)return;o.updateMetrics();let r=this.getZoomInfo(i);if(!r)return;this.instance.state=Z.CustomClosing,e.classList.remove(\"is-zooming-in\"),e.classList.add(\"is-zooming-out\"),s.style.backgroundImage=`url('${a}')`;const l=e.getBoundingClientRect();Object.assign(e.style,{position:\"absolute\",top:`${window.pageYOffset}px`,left:`${window.pageXOffset}px`,bottom:\"auto\",right:\"auto\",width:`${l.width}px`,height:`${l.height}px`,overflow:\"hidden\"});const{x:c,y:h,scale:d,opacity:u}=r;if(u){const t=((t,e,i,n)=>{const s=e-t,o=n-i;return e=>i+((e-t)/s*o||0)})(o.scale,d,1,0);o.on(\"afterTransform\",(()=>{s.style.opacity=t(o.scale)+\"\"}))}o.on(\"endAnimation\",(()=>{t.destroy()})),o.target.a=d,o.target.b=0,o.target.c=0,o.target.d=d,o.panTo({x:c,y:h,scale:d,friction:u?.2:.33,ignoreBounds:!0}),o.isResting&&t.destroy()}setContent(t,e){return new Promise(((i,s)=>{var o,a;const r=this.instance,l=t.el;if(!l)return void s();r.showLoading(t);let c=this.optionFor(t,\"content\");\"string\"==typeof c&&(c=n(c)),c&&x(c)||(c=document.createElement(\"img\"),c instanceof HTMLImageElement&&(c.src=e||\"\",c.alt=(null===(o=t.caption)||void 0===o?void 0:o.replace(/<[^>]+>/gi,\"\").substring(0,1e3))||`Image ${t.index+1} of ${null===(a=r.carousel)||void 0===a?void 0:a.pages.length}`,c.draggable=!1,t.srcset&&c.setAttribute(\"srcset\",t.srcset)),t.sizes&&c.setAttribute(\"sizes\",t.sizes)),c.classList.add(\"fancybox-image\"),t.imageEl=c,r.setContent(t,c,!1);t.panzoom=new T(l,u({},this.option(\"Panzoom\")||{},{content:c,width:r.optionFor(t,\"width\",\"auto\"),height:r.optionFor(t,\"height\",\"auto\"),wheel:()=>{const t=r.option(\"wheel\");return(\"zoom\"===t||\"pan\"==t)&&t},click:(e,i)=>{var n,s;if(r.isCompact||r.isClosing())return!1;if(t.index!==(null===(n=r.getSlide())||void 0===n?void 0:n.index))return!1;let o=!i||i.target&&(null===(s=t.contentEl)||void 0===s?void 0:s.contains(i.target));return r.option(o?\"contentClick\":\"backdropClick\")||!1},dblClick:()=>r.isCompact?\"toggleZoom\":r.option(\"contentDblClick\")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,transformParent:!0,on:{ready:t=>{i(t)},error:()=>{s()},destroy:()=>{s()}}}))}))}zoomIn(t){return new Promise(((e,i)=>{const n=this.instance,s=n.container,{panzoom:o,contentEl:a,el:r}=t;o&&o.updateMetrics();const l=this.getZoomInfo(t);if(!(l&&r&&a&&o&&s))return void i();const{x:c,y:h,scale:d,opacity:u}=l,p=()=>{t.state!==V.Closing&&(u&&(a.style.opacity=Math.max(Math.min(1,1-(1-o.scale)/(1-d)),0)+\"\"),o.scale>=1&&o.scale>o.targetScale-.1&&e(o))},f=t=>{E(s,\"is-zooming-in\"),t.scale<.99||t.scale>1.01||(a.style.opacity=\"\",t.off(\"endAnimation\",f),t.off(\"touchStart\",f),t.off(\"afterTransform\",p),e(t))};o.on(\"endAnimation\",f),o.on(\"touchStart\",f),o.on(\"afterTransform\",p),o.on([\"error\",\"destroy\"],(()=>{i()})),o.panTo({x:c,y:h,scale:d,friction:0,ignoreBounds:!0}),o.stop(\"current\");const m={event:\"mousemove\"===o.panMode?n.prevMouseMoveEvent||n.options.event:void 0},g=this.optionFor(t,\"initialSize\");S(s,\"is-zooming-in\"),n.hideLoading(t),\"full\"===g?o.zoomToFull(m):\"cover\"===g?o.zoomToCover(m):\"max\"===g?o.zoomToMax(m):o.reset(.172)}))}getZoomInfo(t){const{el:e,imageEl:i,thumbEl:n,panzoom:s}=t;if(!e||!i||!n||!s||N(n)<3||!this.optionFor(t,\"zoom\")||this.instance.state===Z.Destroy)return!1;const{top:o,left:a,width:r,height:l}=n.getBoundingClientRect();let{top:c,left:h,fitWidth:d,fitHeight:u}=s.contentRect;if(!(r&&l&&d&&u))return!1;const p=r/d,f=s.container.getBoundingClientRect();c+=f.top,h+=f.left;const m=-1*(h+.5*d-(a+.5*r)),g=-1*(c+.5*u-(o+.5*l));let b=this.option(\"zoomOpacity\")||!1;return\"auto\"===b&&(b=Math.abs(r/l-d/u)>.1),{x:m,y:g,scale:p,opacity:b}}attach(){this.instance.on(\"Carousel.change\",this.onChange),this.instance.on(\"Carousel.createSlide\",this.onCreateSlide),this.instance.on(\"Carousel.removeSlide\",this.onRemoveSlide),this.instance.on(\"close\",this.onClose)}detach(){this.instance.off(\"Carousel.change\",this.onChange),this.instance.off(\"Carousel.createSlide\",this.onCreateSlide),this.instance.off(\"Carousel.removeSlide\",this.onRemoveSlide),this.instance.off(\"close\",this.onClose)}}Object.defineProperty(J,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:\"fit\",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:\"auto\"}});const Q=(t,e={})=>{const i=new URL(t),n=new URLSearchParams(i.search),s=new URLSearchParams;for(const[t,i]of[...n,...Object.entries(e)]){let e=i.toString();\"t\"===t?s.set(\"start\",parseInt(e).toString()):s.set(t,e)}let o=s.toString(),a=t.match(/#t=((.*)?\\d+s)/);return a&&(o+=`#t=${a[1]}`),o},tt={ajax:null,autoSize:!0,preload:!0,iframeAttr:{allow:\"autoplay; fullscreen\",scrolling:\"auto\"},videoAutoplay:!0,videoRatio:16/9,videoTpl:'',videoFormat:\"\",vimeo:{byline:1,color:\"00adef\",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},et=[\"image\",\"html\",\"ajax\",\"inline\",\"clone\",\"iframe\",\"map\",\"pdf\",\"html5video\",\"youtube\",\"vimeo\",\"video\"];class it extends I{onInitSlide(t,e,i){this.processType(i)}onCreateSlide(t,e,i){this.setContent(i)}onRemoveSlide(t,e,i){i.closeBtnEl&&(i.closeBtnEl.remove(),i.closeBtnEl=void 0),i.xhr&&(i.xhr.abort(),i.xhr=null),i.iframeEl&&(i.iframeEl.onload=i.iframeEl.onerror=null,i.iframeEl.src=\"//about:blank\",i.iframeEl=null);const n=i.contentEl,s=i.placeholderEl;if(\"inline\"===i.type&&n&&s)n.classList.remove(\"fancybox__content\"),\"none\"!==n.style.display&&(n.style.display=\"none\"),s.parentNode&&s.parentNode.insertBefore(n,s),s.remove(),i.placeholderEl=null;else for(;i.el&&i.el.firstChild;)i.el.removeChild(i.el.firstChild)}onSelectSlide(t,e,i){i.state===V.Ready&&this.playVideo()}onUnselectSlide(t,e,i){var n,s;if(\"html5video\"===i.type){try{null===(s=null===(n=i.el)||void 0===n?void 0:n.querySelector(\"video\"))||void 0===s||s.pause()}catch(t){}return}let o;\"vimeo\"===i.type?o={method:\"pause\",value:\"true\"}:\"youtube\"===i.type&&(o={event:\"command\",func:\"pauseVideo\"}),o&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(o),\"*\"),i.poller&&clearTimeout(i.poller)}onDone(t,e){t.isCurrentSlide(e)&&!t.isClosing()&&this.playVideo()}onRefresh(t,e){e.slides.forEach((t=>{t.el&&(this.setAspectRatio(t),this.resizeIframe(t))}))}onMessage(t){try{let e=JSON.parse(t.data);if(\"https://player.vimeo.com\"===t.origin){if(\"ready\"===e.event)for(let e of Array.from(document.getElementsByClassName(\"fancybox__iframe\")))e instanceof HTMLIFrameElement&&e.contentWindow===t.source&&(e.dataset.ready=\"true\")}else if(t.origin.match(/^https:\\/\\/(www.)?youtube(-nocookie)?.com$/)&&\"onReady\"===e.event){const t=document.getElementById(e.id);t&&(t.dataset.ready=\"true\")}}catch(t){}}loadAjaxContent(t){const e=this.instance.optionFor(t,\"src\")||\"\";this.instance.showLoading(t);const i=this.instance,n=new XMLHttpRequest;i.showLoading(t),n.onreadystatechange=function(){n.readyState===XMLHttpRequest.DONE&&i.state===Z.Ready&&(i.hideLoading(t),200===n.status?i.setContent(t,n.responseText):i.setError(t,404===n.status?\"{{AJAX_NOT_FOUND}}\":\"{{AJAX_FORBIDDEN}}\"))};const s=t.ajax||null;n.open(s?\"POST\":\"GET\",e+\"\"),n.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\"),n.setRequestHeader(\"X-Requested-With\",\"XMLHttpRequest\"),n.send(s),t.xhr=n}setInlineContent(t){let e=null;if(x(t.src))e=t.src;else if(\"string\"==typeof t.src){const i=t.src.split(\"#\",2).pop();e=i?document.getElementById(i):null}if(e){if(\"clone\"===t.type||e.closest(\".fancybox__slide\")){e=e.cloneNode(!0);const i=e.dataset.animationName;i&&(e.classList.remove(i),delete e.dataset.animationName);let n=e.getAttribute(\"id\");n=n?`${n}--clone`:`clone-${this.instance.id}-${t.index}`,e.setAttribute(\"id\",n)}else if(e.parentNode){const i=document.createElement(\"div\");i.classList.add(\"fancybox-placeholder\"),e.parentNode.insertBefore(i,e),t.placeholderEl=i}this.instance.setContent(t,e)}else this.instance.setError(t,\"{{ELEMENT_NOT_FOUND}}\")}setIframeContent(t){const{src:e,el:i}=t;if(!e||\"string\"!=typeof e||!i)return;const n=this.instance,s=document.createElement(\"iframe\");s.className=\"fancybox__iframe\",s.setAttribute(\"id\",`fancybox__iframe_${n.id}_${t.index}`);for(const[e,i]of Object.entries(this.optionFor(t,\"iframeAttr\")||{}))s.setAttribute(e,i);s.onerror=()=>{n.setError(t,\"{{IFRAME_ERROR}}\")},t.iframeEl=s;const o=this.optionFor(t,\"preload\");if(i.classList.add(\"is-loading\"),\"iframe\"!==t.type||!1===o)return s.setAttribute(\"src\",t.src+\"\"),this.resizeIframe(t),void n.setContent(t,s);n.showLoading(t),s.onload=()=>{if(!s.src.length)return;const e=\"true\"!==s.dataset.ready;s.dataset.ready=\"true\",this.resizeIframe(t),e?n.revealContent(t):n.hideLoading(t)},s.setAttribute(\"src\",e),n.setContent(t,s,!1)}resizeIframe(t){const e=t.iframeEl,i=null==e?void 0:e.parentElement;if(!e||!i)return;let n=t.autoSize,s=t.width||0,o=t.height||0;s&&o&&(n=!1);const a=i&&i.style;if(!1!==t.preload&&!1!==n&&a)try{const t=window.getComputedStyle(i),n=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),r=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=e.contentWindow;if(l){const t=l.document,e=t.getElementsByTagName(\"html\")[0],i=t.body;a.width=\"\",i.style.overflow=\"hidden\",s=s||e.scrollWidth+n,a.width=`${s}px`,i.style.overflow=\"\",a.flex=\"0 0 auto\",a.height=`${i.scrollHeight}px`,o=e.scrollHeight+r}}catch(t){}if(s||o){const t={flex:\"0 1 auto\",width:\"\",height:\"\"};s&&(t.width=`${s}px`),o&&(t.height=`${o}px`),Object.assign(a,t)}}playVideo(){const t=this.instance.getSlide();if(!t)return;const{el:e}=t;if(!e||!e.offsetParent)return;if(!this.optionFor(t,\"videoAutoplay\"))return;if(\"html5video\"===t.type)try{const t=e.querySelector(\"video\");if(t){const e=t.play();void 0!==e&&e.then((()=>{})).catch((e=>{t.muted=!0,t.play()}))}}catch(t){}if(\"youtube\"!==t.type&&\"vimeo\"!==t.type)return;const i=()=>{if(t.iframeEl&&t.iframeEl.contentWindow){let e;if(\"true\"===t.iframeEl.dataset.ready)return e=\"youtube\"===t.type?{event:\"command\",func:\"playVideo\"}:{method:\"play\",value:\"true\"},e&&t.iframeEl.contentWindow.postMessage(JSON.stringify(e),\"*\"),void(t.poller=void 0);\"youtube\"===t.type&&(e={event:\"listening\",id:t.iframeEl.getAttribute(\"id\")},t.iframeEl.contentWindow.postMessage(JSON.stringify(e),\"*\"))}t.poller=setTimeout(i,250)};i()}processType(t){if(t.html)return t.type=\"html\",t.src=t.html,void(t.html=\"\");const e=this.instance.optionFor(t,\"src\",\"\");if(!e||\"string\"!=typeof e)return;let i=t.type,n=null;if(n=e.match(/(youtube\\.com|youtu\\.be|youtube\\-nocookie\\.com)\\/(?:watch\\?(?:.*&)?v=|v\\/|u\\/|embed\\/?)?(videoseries\\?list=(?:.*)|[\\w-]{11}|\\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const s=this.optionFor(t,\"youtube\"),{nocookie:o}=s,a=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&\"function\"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s0?\"svembed\":\"embed\"}`,i=\"map\"):(n=e.match(/(?:maps\\.)?google\\.([a-z]{2,3}(?:\\.[a-z]{2})?)\\/(?:maps\\/search\\/)(.*)/i))&&(t.src=`https://maps.google.${n[1]}/maps?q=${n[2].replace(\"query=\",\"q=\").replace(\"api=1\",\"\")}&output=embed`,i=\"map\")),i=i||this.instance.option(\"defaultType\"),t.type=i,\"image\"===i&&(t.thumbSrc=t.thumbSrc||t.src)}setContent(t){const e=this.instance.optionFor(t,\"src\")||\"\";if(t&&t.type&&e){switch(t.type){case\"html\":this.instance.setContent(t,e);break;case\"html5video\":const i=this.option(\"videoTpl\");i&&this.instance.setContent(t,i.replace(/\\{\\{src\\}\\}/gi,e+\"\").replace(/\\{\\{format\\}\\}/gi,this.optionFor(t,\"videoFormat\")||\"\").replace(/\\{\\{poster\\}\\}/gi,t.poster||t.thumbSrc||\"\"));break;case\"inline\":case\"clone\":this.setInlineContent(t);break;case\"ajax\":this.loadAjaxContent(t);break;case\"pdf\":case\"map\":case\"youtube\":case\"vimeo\":t.preload=!1;case\"iframe\":this.setIframeContent(t)}this.setAspectRatio(t)}}setAspectRatio(t){var e;const i=t.contentEl,n=this.optionFor(t,\"videoRatio\"),s=null===(e=t.el)||void 0===e?void 0:e.getBoundingClientRect();if(!(i&&s&&n&&1!==n&&t.type&&[\"video\",\"youtube\",\"vimeo\",\"html5video\"].includes(t.type)))return;const o=s.width,a=s.height;i.style.aspectRatio=n+\"\",i.style.width=o/a>n?\"auto\":\"\",i.style.height=o/a>n?\"\":\"auto\"}attach(){this.instance.on(\"Carousel.initSlide\",this.onInitSlide),this.instance.on(\"Carousel.createSlide\",this.onCreateSlide),this.instance.on(\"Carousel.removeSlide\",this.onRemoveSlide),this.instance.on(\"Carousel.selectSlide\",this.onSelectSlide),this.instance.on(\"Carousel.unselectSlide\",this.onUnselectSlide),this.instance.on(\"Carousel.Panzoom.refresh\",this.onRefresh),this.instance.on(\"done\",this.onDone),window.addEventListener(\"message\",this.onMessage)}detach(){this.instance.off(\"Carousel.initSlide\",this.onInitSlide),this.instance.off(\"Carousel.createSlide\",this.onCreateSlide),this.instance.off(\"Carousel.removeSlide\",this.onRemoveSlide),this.instance.off(\"Carousel.selectSlide\",this.onSelectSlide),this.instance.off(\"Carousel.unselectSlide\",this.onUnselectSlide),this.instance.off(\"Carousel.Panzoom.refresh\",this.onRefresh),this.instance.off(\"done\",this.onDone),window.removeEventListener(\"message\",this.onMessage)}}Object.defineProperty(it,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:tt});class nt extends I{constructor(){super(...arguments),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:\"ready\"}),Object.defineProperty(this,\"inHover\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"timer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"progressBar\",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return\"ready\"!==this.state}onReady(t){this.option(\"autoStart\")&&(t.isInfinite||t.page{this.timer=null,this.inHover||this.onTimerEnd()}),t),this.emit(\"set\")}clear(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.removeProgressBar()}start(){if(this.set(),this.option(\"pauseOnHover\")){const t=this.instance.container;t.addEventListener(\"mouseenter\",this.onMouseEnter,!1),t.addEventListener(\"mouseleave\",this.onMouseLeave,!1)}document.addEventListener(\"visibilitychange\",this.onVisibilityChange,!1)}stop(){const t=this.instance.container;this.clear(),this.state=\"ready\",t.removeEventListener(\"mouseenter\",this.onMouseEnter,!1),t.removeEventListener(\"mouseleave\",this.onMouseLeave,!1),document.removeEventListener(\"visibilitychange\",this.onVisibilityChange,!1),E(t,\"has-autoplay\"),this.emit(\"stop\")}pause(){\"play\"===this.state&&(this.state=\"pause\",this.clear(),this.emit(\"pause\"))}resume(){const t=this.instance;if(t.isInfinite||t.page!==t.pages.length-1)if(\"play\"!==this.state){if(\"pause\"===this.state&&!this.inHover){const t=new Event(\"resume\",{bubbles:!0,cancelable:!0});this.emit(\"resume\",event),t.defaultPrevented||this.set()}}else this.set();else this.stop()}toggle(){\"play\"===this.state||\"pause\"===this.state?this.stop():this.set()}attach(){this.instance.on(\"ready\",this.onReady),this.instance.on(\"Panzoom.startAnimation\",this.onChange),this.instance.on(\"Panzoom.endAnimation\",this.onSettle),this.instance.on(\"Panzoom.touchMove\",this.onChange)}detach(){this.instance.off(\"ready\",this.onReady),this.instance.off(\"Panzoom.startAnimation\",this.onChange),this.instance.off(\"Panzoom.endAnimation\",this.onSettle),this.instance.off(\"Panzoom.touchMove\",this.onChange),this.stop()}}Object.defineProperty(nt,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class st extends I{constructor(){super(...arguments),Object.defineProperty(this,\"ref\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(t){const e=t.carousel;if(!e)return;const i=t.container;i&&(e.options.Autoplay=u(this.option(\"Autoplay\")||{},{pauseOnHover:!1,autoStart:!1,timeout:this.option(\"timeout\"),progressParentEl:()=>i.querySelector(\".fancybox__toolbar [data-fancybox-toggle-slideshow]\")||i,on:{set:e=>{var n;i.classList.add(\"has-slideshow\"),(null===(n=t.getSlide())||void 0===n?void 0:n.state)!==V.Ready&&e.pause()},stop:()=>{i.classList.remove(\"has-slideshow\"),t.isCompact||t.endIdle()},resume:(e,i)=>{var n,s,o;!i||!i.cancelable||(null===(n=t.getSlide())||void 0===n?void 0:n.state)===V.Ready&&(null===(o=null===(s=t.carousel)||void 0===s?void 0:s.panzoom)||void 0===o?void 0:o.isResting)||i.preventDefault()}}}),e.attachPlugins({Autoplay:nt}),this.ref=e.plugins.Autoplay)}onReady(t){const e=t.carousel,i=this.ref;e&&i&&this.option(\"playOnStart\")&&(e.isInfinite||e.page{t.isCurrentSlide(e)&&i.stop()})),t.isCurrentSlide(e)&&i.resume()}onKeydown(t,e){var i;const n=this.ref;n&&e===this.option(\"key\")&&\"BUTTON\"!==(null===(i=document.activeElement)||void 0===i?void 0:i.nodeName)&&n.toggle()}attach(){this.instance.on(\"Carousel.init\",this.onPrepare),this.instance.on(\"Carousel.ready\",this.onReady),this.instance.on(\"done\",this.onDone),this.instance.on(\"keydown\",this.onKeydown)}detach(){this.instance.off(\"Carousel.init\",this.onPrepare),this.instance.off(\"Carousel.ready\",this.onReady),this.instance.off(\"done\",this.onDone),this.instance.off(\"keydown\",this.onKeydown)}}Object.defineProperty(st,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:{key:\" \",playOnStart:!1,timeout:3e3}});const ot={classes:{container:\"f-thumbs f-carousel__thumbs\",viewport:\"f-thumbs__viewport\",track:\"f-thumbs__track\",slide:\"f-thumbs__slide\",isResting:\"is-resting\",isSelected:\"is-selected\",isLoading:\"is-loading\",hasThumbs:\"has-thumbs\"},minCount:2,parentEl:null,thumbTpl:'',type:\"modern\"};var at;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Hidden=2]=\"Hidden\",t[t.Disabled=3]=\"Disabled\"}(at||(at={}));let rt=class extends I{constructor(){super(...arguments),Object.defineProperty(this,\"type\",{enumerable:!0,configurable:!0,writable:!0,value:\"modern\"}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"track\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"carousel\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"panzoom\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"thumbWidth\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbClipWidth\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbHeight\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbGap\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"thumbExtraGap\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"shouldCenter\",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:at.Init})}formatThumb(t,e){return this.instance.localize(e,[[\"%i\",t.index],[\"%d\",t.index+1],[\"%s\",t.thumbSrc||\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"]])}getSlides(){const t=[],e=this.option(\"thumbTpl\")||\"\";if(e)for(const i of this.instance.slides||[]){let n=\"\";i.type&&(n=`for-${i.type}`,i.type&&[\"video\",\"youtube\",\"vimeo\",\"html5video\"].includes(i.type)&&(n+=\" for-video\")),t.push({html:this.formatThumb(i,e),customClass:n})}return t}onInitSlide(t,e){const i=e.el;i&&(e.thumbSrc=i.dataset.thumbSrc||e.thumbSrc||\"\",e.thumbClipWidth=parseFloat(i.dataset.thumbClipWidth||\"\")||e.thumbClipWidth||0,e.thumbHeight=parseFloat(i.dataset.thumbHeight||\"\")||e.thumbHeight||0)}onInitSlides(){this.state===at.Init&&this.build()}onRefreshM(){this.refreshModern()}onChangeM(){\"modern\"===this.type&&(this.shouldCenter=!0,this.centerModern())}onClickModern(t){t.preventDefault(),t.stopPropagation();const e=this.instance,i=e.page,n=t=>{if(t){const e=t.closest(\"[data-carousel-index]\");if(e)return parseInt(e.dataset.carouselIndex||\"\",10)||0}return-1},s=(t,e)=>{const i=document.elementFromPoint(t,e);return i?n(i):-1};let o=n(t.target);o<0&&(o=s(t.clientX+this.thumbGap,t.clientY),o===i&&(o=i-1)),o<0&&(o=s(t.clientX-this.thumbGap,t.clientY),o===i&&(o=i+1)),o<0&&(o=(e=>{let n=s(t.clientX-e,t.clientY),a=s(t.clientX+e,t.clientY);return o<0&&n===i&&(o=i+1),o<0&&a===i&&(o=i-1),o})(this.thumbExtraGap)),o===i?this.centerModern():o>-1&&o{this.emit(\"ready\")}))}buildModern(){if(\"modern\"!==this.type)return;const{container:t,track:e,instance:i}=this,s=this.option(\"thumbTpl\")||\"\";if(!t||!e||!s)return;S(t,\"is-horizontal\"),this.updateModern();for(const t of i.slides||[]){const i=document.createElement(\"div\");if(S(i,this.cn(\"slide\")),t.type){let e=`for-${t.type}`;[\"video\",\"youtube\",\"vimeo\",\"html5video\"].includes(t.type)&&(e+=\" for-video\"),S(i,e)}i.appendChild(n(this.formatThumb(t,s))),t.thumbSlideEl=i,e.appendChild(i),this.resizeModernSlide(t)}const o=new i.constructor.Panzoom(t,{content:e,lockAxis:\"x\",zoom:!1,panOnlyZoomed:!1,bounds:()=>{let t=0,e=0,n=i.slides[0],s=i.slides[i.slides.length-1],o=i.slides[i.page];return n&&s&&o&&(e=-1*this.getModernThumbPos(0),0!==i.page&&(e+=.5*(n.thumbWidth||0)),t=-1*this.getModernThumbPos(i.slides.length-1),i.page!==i.slides.length-1&&(t+=(s.thumbWidth||0)-(o.thumbWidth||0)-.5*(s.thumbWidth||0))),{x:{min:t,max:e},y:{min:0,max:0}}}});o.on(\"touchStart\",((t,e)=>{this.shouldCenter=!1})),o.on(\"click\",((t,e)=>this.onClickModern(e))),o.on(\"ready\",(()=>{this.centerModern(),this.emit(\"ready\")})),o.on([\"afterTransform\",\"refresh\"],(t=>{this.lazyLoadModern()})),this.panzoom=o,this.refreshModern()}updateModern(){if(\"modern\"!==this.type)return;const{container:t}=this;t&&(this.thumbGap=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-gap\"))||0,this.thumbExtraGap=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-extra-gap\"))||0,this.thumbWidth=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-width\"))||40,this.thumbClipWidth=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-clip-width\"))||40,this.thumbHeight=parseFloat(getComputedStyle(t).getPropertyValue(\"--f-thumb-height\"))||40)}refreshModern(){var t;if(\"modern\"===this.type){this.updateModern();for(const t of this.instance.slides||[])this.resizeModernSlide(t);this.onTransformM(),null===(t=this.panzoom)||void 0===t||t.updateMetrics(!0),this.centerModern(0)}}centerModern(e){const i=this.instance,{container:n,panzoom:s}=this;if(!n||!s||s.state===g.Init)return;const o=i.page;let a=this.getModernThumbPos(o),r=a;for(let t=i.page-3;ti.pages.length-1||t===i.page)continue;const e=1-Math.abs(i.getProgress(t));e>0&&e<1&&(r+=e*(this.getModernThumbPos(t)-a))}let l=100;void 0===e&&(e=.2,i.inTransition.size>0&&(e=.12),Math.abs(-1*s.current.e-r)>s.containerRect.width&&(e=.5,l=0)),s.options.maxVelocity=l,s.applyChange({panX:t(-1*r-s.target.e,1e3),friction:null===i.prevPage?0:e})}lazyLoadModern(){const{instance:t,panzoom:e}=this;if(!e)return;const i=-1*e.current.e||0;let s=this.getModernThumbPos(t.page);if(e.state!==g.Init||0===s)for(const s of t.slides||[]){const t=s.thumbSlideEl;if(!t)continue;const o=t.querySelector(\"img[data-lazy-src]\"),a=s.index,r=this.getModernThumbPos(a),l=i-.5*e.containerRect.innerWidth,c=l+e.containerRect.innerWidth;if(!o||rc)continue;let h=o.dataset.lazySrc;if(!h||!h.length)continue;if(delete o.dataset.lazySrc,o.src=h,o.complete)continue;S(t,this.cn(\"isLoading\"));const d=n(w);t.appendChild(d),o.addEventListener(\"load\",(()=>{t.offsetParent&&(t.classList.remove(this.cn(\"isLoading\")),d.remove())}),!1)}}resizeModernSlide(t){if(\"modern\"!==this.type)return;if(!t.thumbSlideEl)return;const e=t.thumbClipWidth&&t.thumbHeight?Math.round(this.thumbHeight*(t.thumbClipWidth/t.thumbHeight)):this.thumbWidth;t.thumbWidth=e}getModernThumbPos(e){const i=this.instance.slides[e],n=this.panzoom;if(!n||!n.contentRect.fitWidth)return 0;let s=n.containerRect.innerWidth,o=n.contentRect.width;2===this.instance.slides.length&&(e-=1,o=2*this.thumbClipWidth);let a=e*(this.thumbClipWidth+this.thumbGap)+this.thumbExtraGap+.5*(i.thumbWidth||0);return a-=o>s?.5*s:.5*o,t(a||0,1)}build(){const t=this.instance,e=t.container,i=this.option(\"minCount\")||0;if(i){let e=0;for(const i of t.slides||[])i.thumbSrc&&e++;if(e{setTimeout((()=>{var e;null===(e=null==s?void 0:s.querySelector(`[data-carousel-index=\"${t.page}\"]`))||void 0===e||e.focus()}),100)}))}cleanup(){this.carousel&&this.carousel.destroy(),this.carousel=null,this.panzoom&&this.panzoom.destroy(),this.panzoom=null,this.container&&this.container.remove(),this.container=null,this.track=null,this.state=at.Init,E(this.instance.container,this.cn(\"hasThumbs\"))}attach(){const{instance:t}=this;t.on(\"initSlide\",this.onInitSlide),t.state===L.Init?t.on(\"initSlides\",this.onInitSlides):this.onInitSlides(),t.on(\"Panzoom.afterTransform\",this.onTransformM),t.on(\"Panzoom.refresh\",this.onRefreshM),t.on(\"change\",this.onChangeM)}detach(){const{instance:t}=this;t.off(\"initSlide\",this.onInitSlide),t.off(\"initSlides\",this.onInitSlides),t.off(\"Panzoom.afterTransform\",this.onTransformM),t.off(\"Panzoom.refresh\",this.onRefreshM),t.off(\"change\",this.onChangeM),this.cleanup()}};Object.defineProperty(rt,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:ot});const lt=Object.assign(Object.assign({},ot),{key:\"t\",showOnStart:!0,parentEl:null});class ct extends I{constructor(){super(...arguments),Object.defineProperty(this,\"ref\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"hidden\",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const t=this.ref;return t&&t.state!==at.Disabled}get isHidden(){return this.hidden}onInit(){const t=this.instance,e=t.carousel;if(this.ref||!e)return;const i=this.option(\"parentEl\")||t.footer||t.container;i&&(e.options.Thumbs=u({},this.options,{parentEl:i,classes:{container:\"f-thumbs fancybox__thumbs\"},Carousel:{Sync:{friction:t.option(\"Carousel.friction\")},on:{click:(t,e)=>{e.stopPropagation()}}},on:{ready:t=>{const e=t.container;e&&this.hidden&&(this.refresh(),e.style.transition=\"none\",this.hide(),e.offsetHeight,queueMicrotask((()=>{e.style.transition=\"\",this.show()})))}}}),e.attachPlugins({Thumbs:rt}),this.ref=e.plugins.Thumbs,this.option(\"showOnStart\")||(this.ref.state=at.Hidden,this.hidden=!0))}onResize(){var t;const e=null===(t=this.ref)||void 0===t?void 0:t.container;e&&(e.style.maxHeight=\"\")}onKeydown(t,e){const i=this.option(\"key\");i&&i===e&&this.toggle()}toggle(){const t=this.ref;t&&t.state!==at.Disabled&&(t.state!==at.Hidden?this.hidden?this.show():this.hide():t.build())}show(){const t=this.ref,e=t&&t.state!==at.Disabled&&t.container;e&&(this.refresh(),e.offsetHeight,e.removeAttribute(\"aria-hidden\"),e.classList.remove(\"is-hidden\"),this.hidden=!1)}hide(){const t=this.ref,e=t&&t.container;e&&(this.refresh(),e.offsetHeight,e.classList.add(\"is-hidden\"),e.setAttribute(\"aria-hidden\",\"true\")),this.hidden=!0}refresh(){const t=this.ref;if(!t||t.state===at.Disabled)return;const e=t.container,i=(null==e?void 0:e.firstChild)||null;e&&i&&i.childNodes.length&&(e.style.maxHeight=`${i.getBoundingClientRect().height}px`)}attach(){this.instance.state===Z.Init?this.instance.on(\"Carousel.init\",this.onInit):this.onInit(),this.instance.on(\"resize\",this.onResize),this.instance.on(\"keydown\",this.onKeydown)}detach(){var t;this.instance.off(\"Carousel.init\",this.onInit),this.instance.off(\"resize\",this.onResize),this.instance.off(\"keydown\",this.onKeydown),null===(t=this.instance.carousel)||void 0===t||t.detachPlugins([\"Thumbs\"]),this.ref=null}}Object.defineProperty(ct,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:lt});const ht={panLeft:{icon:'',change:{panX:-100}},panRight:{icon:'',change:{panX:100}},panUp:{icon:'',change:{panY:-100}},panDown:{icon:'',change:{panY:100}},zoomIn:{icon:'',action:\"zoomIn\"},zoomOut:{icon:'',action:\"zoomOut\"},toggle1to1:{icon:'',action:\"toggleZoom\"},toggleZoom:{icon:'',action:\"toggleZoom\"},iterateZoom:{icon:'',action:\"iterateZoom\"},rotateCCW:{icon:'',action:\"rotateCCW\"},rotateCW:{icon:'',action:\"rotateCW\"},flipX:{icon:'',action:\"flipX\"},flipY:{icon:'',action:\"flipY\"},fitX:{icon:'',action:\"fitX\"},fitY:{icon:'',action:\"fitY\"},reset:{icon:'',action:\"reset\"},toggleFS:{icon:'',action:\"toggleFS\"}};var dt;!function(t){t[t.Init=0]=\"Init\",t[t.Ready=1]=\"Ready\",t[t.Disabled=2]=\"Disabled\"}(dt||(dt={}));const ut={absolute:\"auto\",display:{left:[\"infobar\"],middle:[],right:[\"iterateZoom\",\"slideshow\",\"fullscreen\",\"thumbs\",\"close\"]},enabled:\"auto\",items:{infobar:{tpl:'
/
'},download:{tpl:''},prev:{tpl:''},next:{tpl:''},slideshow:{tpl:''},fullscreen:{tpl:''},thumbs:{tpl:''},close:{tpl:''}},parentEl:null},pt={tabindex:\"-1\",width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",xmlns:\"http://www.w3.org/2000/svg\"};class ft extends I{constructor(){super(...arguments),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:dt.Init}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(t){var e;if(!t.carousel)return;let i=this.option(\"display\"),n=this.option(\"absolute\"),s=this.option(\"enabled\");if(\"auto\"===s){const t=this.instance.carousel;let e=0;if(t)for(const i of t.slides)(i.panzoom||\"image\"===i.type)&&e++;e||(s=!1)}s||(i=void 0);let o=0;const a={left:[],middle:[],right:[]};if(i)for(const t of[\"left\",\"middle\",\"right\"])for(const n of i[t]){const i=this.createEl(n);i&&(null===(e=a[t])||void 0===e||e.push(i),o++)}let r=null;if(o&&(r=this.createContainer()),r){for(const[t,e]of Object.entries(a)){const i=document.createElement(\"div\");S(i,\"fancybox__toolbar__column is-\"+t);for(const t of e)i.appendChild(t);\"auto\"!==n||\"middle\"!==t||e.length||(n=!0),r.appendChild(i)}!0===n&&S(r,\"is-absolute\"),this.state=dt.Ready,this.onRefresh()}else this.state=dt.Disabled}onClick(t){var e,i;const n=this.instance,s=n.getSlide(),o=null==s?void 0:s.panzoom,a=t.target,r=a&&x(a)?a.dataset:null;if(!r)return;if(void 0!==r.fancyboxToggleThumbs)return t.preventDefault(),t.stopPropagation(),void(null===(e=n.plugins.Thumbs)||void 0===e||e.toggle());if(void 0!==r.fancyboxToggleFullscreen)return t.preventDefault(),t.stopPropagation(),void this.instance.toggleFullscreen();if(void 0!==r.fancyboxToggleSlideshow){t.preventDefault(),t.stopPropagation();const e=null===(i=n.carousel)||void 0===i?void 0:i.plugins.Autoplay;let s=e.isActive;return o&&\"mousemove\"===o.panMode&&!s&&o.reset(),void(s?e.stop():e.start())}const l=r.panzoomAction,c=r.panzoomChange;if((c||l)&&(t.preventDefault(),t.stopPropagation()),c){let t={};try{t=JSON.parse(c)}catch(t){}o&&o.applyChange(t)}else l&&o&&o[l]&&o[l]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const t=this.container;if(!t)return;const e=this.instance.getSlide();if(!e||e.state!==V.Ready)return;const i=e&&!e.error&&e.panzoom;for(const e of t.querySelectorAll(\"[data-panzoom-action]\"))i?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));let n=i&&i.canZoomIn(),s=i&&i.canZoomOut();for(const e of t.querySelectorAll('[data-panzoom-action=\"zoomIn\"]'))n?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));for(const e of t.querySelectorAll('[data-panzoom-action=\"zoomOut\"]'))s?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));for(const e of t.querySelectorAll('[data-panzoom-action=\"toggleZoom\"],[data-panzoom-action=\"iterateZoom\"]')){s||n?(e.removeAttribute(\"disabled\"),e.removeAttribute(\"tabindex\")):(e.setAttribute(\"disabled\",\"\"),e.setAttribute(\"tabindex\",\"-1\"));const t=e.querySelector(\"g\");t&&(t.style.display=n?\"\":\"none\")}}onDone(t,e){var i;null===(i=e.panzoom)||void 0===i||i.on(\"afterTransform\",(()=>{this.instance.isCurrentSlide(e)&&this.onRefresh()})),this.instance.isCurrentSlide(e)&&this.onRefresh()}createContainer(){const t=this.instance.container;if(!t)return null;const e=this.option(\"parentEl\")||t,i=document.createElement(\"div\");return S(i,\"fancybox__toolbar\"),e.prepend(i),i.addEventListener(\"click\",this.onClick,{passive:!1,capture:!0}),t&&S(t,\"has-toolbar\"),this.container=i,i}createEl(t){var e;const i=this.instance.carousel;if(!i)return null;if(\"toggleFS\"===t)return null;if(\"fullscreen\"===t&&!this.instance.fsAPI)return null;let s=null;const o=i.slides.length||0;let a=0,r=0;for(const t of i.slides)(t.panzoom||\"image\"===t.type)&&a++,(\"image\"===t.type||t.downloadSrc)&&r++;if(o<2&&[\"infobar\",\"prev\",\"next\"].includes(t))return s;if(void 0!==ht[t]&&!a)return null;if(\"download\"===t&&!r)return null;if(\"thumbs\"===t){const t=this.instance.plugins.Thumbs;if(!t||!t.isEnabled)return null}if(\"slideshow\"===t){if(!(null===(e=this.instance.carousel)||void 0===e?void 0:e.plugins.Autoplay)||o<2)return null}if(void 0!==ht[t]){const e=ht[t];s=document.createElement(\"button\"),s.setAttribute(\"title\",this.instance.localize(`{{${t.toUpperCase()}}}`)),S(s,\"f-button\"),e.action&&(s.dataset.panzoomAction=e.action),e.change&&(s.dataset.panzoomChange=JSON.stringify(e.change)),s.appendChild(n(this.instance.localize(e.icon)))}else{const e=(this.option(\"items\")||[])[t];e&&(s=n(this.instance.localize(e.tpl)),\"function\"==typeof e.click&&s.addEventListener(\"click\",(t=>{t.preventDefault(),t.stopPropagation(),\"function\"==typeof e.click&&e.click.call(this,this,t)})))}const l=null==s?void 0:s.querySelector(\"svg\");if(l)for(const[t,e]of Object.entries(pt))l.getAttribute(t)||l.setAttribute(t,String(e));return s}removeContainer(){const t=this.container;t&&t.remove(),this.container=null,this.state=dt.Disabled;const e=this.instance.container;e&&E(e,\"has-toolbar\")}attach(){const t=this,{instance:e}=t;e.on(\"Carousel.initSlides\",t.onReady),e.on(\"done\",t.onDone),e.on(\"reveal\",t.onChange),e.on(\"Carousel.change\",t.onChange),t.onReady(t.instance)}detach(){const t=this,{instance:e}=t;e.off(\"Carousel.initSlides\",t.onReady),e.off(\"done\",t.onDone),e.off(\"reveal\",t.onChange),e.off(\"Carousel.change\",t.onChange),t.removeContainer()}}Object.defineProperty(ft,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:ut});const mt={Hash:U,Html:it,Images:J,Slideshow:st,Thumbs:ct,Toolbar:ft},gt=function(){var t=window.getSelection();return t&&\"Range\"===t.type};let bt=null,vt=null;const yt=new Map;let wt=0;class xt extends m{get isIdle(){return this.idle}get isCompact(){return this.option(\"compact\")}constructor(t=[],e={},i={}){super(e),Object.defineProperty(this,\"userSlides\",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,\"userPlugins\",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,\"idle\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"idleTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"clickTimer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"pwt\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"ignoreFocusChange\",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,\"state\",{enumerable:!0,configurable:!0,writable:!0,value:Z.Init}),Object.defineProperty(this,\"id\",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,\"container\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"footer\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"carousel\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"lastFocus\",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,\"prevMouseMoveEvent\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,\"fsAPI\",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fsAPI=(()=>{let t,e=\"\",i=\"\",n=\"\";return document.fullscreenEnabled?(e=\"requestFullscreen\",i=\"exitFullscreen\",n=\"fullscreenElement\"):document.webkitFullscreenEnabled&&(e=\"webkitRequestFullscreen\",i=\"webkitExitFullscreen\",n=\"webkitFullscreenElement\"),e&&(t={request:function(t){return\"webkitRequestFullscreen\"===e?t[e](Element.ALLOW_KEYBOARD_INPUT):t[e]()},exit:function(){return document[n]&&document[i]()},isFullscreen:function(){return document[n]}}),t})(),this.id=e.id||++wt,yt.set(this.id,this),this.userSlides=t,this.userPlugins=i,queueMicrotask((()=>{this.init()}))}init(){if(this.state===Z.Destroy)return;this.state=Z.Init,this.attachPlugins(Object.assign(Object.assign({},xt.Plugins),this.userPlugins)),this.emit(\"init\"),!0===this.option(\"hideScrollbar\")&&(()=>{if(!W)return;const t=document.body;if(t.classList.contains(\"hide-scrollbar\"))return;const e=window.innerWidth-document.documentElement.getBoundingClientRect().width,i=t.currentStyle||window.getComputedStyle(t),n=parseFloat(i.marginRight);document.documentElement.style.setProperty(\"--fancybox-scrollbar-compensate\",`${e}px`),n&&t.style.setProperty(\"--fancybox-body-margin\",`${n}px`),t.classList.add(\"hide-scrollbar\")})(),this.initLayout();const t=()=>{this.initCarousel(this.userSlides),this.state=Z.Ready,this.attachEvents(),this.emit(\"ready\"),setTimeout((()=>{this.container&&this.container.setAttribute(\"aria-hidden\",\"false\")}),16)};this.option(\"Fullscreen.autoStart\")&&this.fsAPI&&!this.fsAPI.isFullscreen()?this.fsAPI.request(this.container).then((()=>t())).catch((()=>t())):t()}initLayout(){var t,e;const i=this.option(\"parentEl\")||document.body,s=n(this.localize(this.option(\"tpl.main\")||\"\"));s&&(s.setAttribute(\"id\",`fancybox-${this.id}`),s.setAttribute(\"aria-label\",this.localize(\"{{MODAL}}\")),s.classList.toggle(\"is-compact\",this.isCompact),S(s,this.option(\"mainClass\")||\"\"),this.container=s,this.footer=s.querySelector(\".fancybox__footer\"),i.appendChild(s),S(document.documentElement,\"with-fancybox\"),bt&&vt||(bt=document.createElement(\"span\"),S(bt,\"fancybox-focus-guard\"),bt.setAttribute(\"tabindex\",\"0\"),bt.setAttribute(\"aria-hidden\",\"true\"),bt.setAttribute(\"aria-label\",\"Focus guard\"),vt=bt.cloneNode(),null===(t=s.parentElement)||void 0===t||t.insertBefore(bt,s),null===(e=s.parentElement)||void 0===e||e.append(vt)),this.option(\"animated\")&&(S(s,\"is-animated\"),setTimeout((()=>{this.isClosing()||E(s,\"is-animated\")}),350)),this.emit(\"initLayout\"))}initCarousel(t){const i=this.container;if(!i)return;const n=i.querySelector(\".fancybox__carousel\");if(!n)return;const s=this.carousel=new _(n,u({},{slides:t,transition:\"fade\",Panzoom:{lockAxis:this.option(\"dragToClose\")?\"xy\":\"x\",infinite:!!this.option(\"dragToClose\")&&\"y\"},Dots:!1,Navigation:{classes:{container:\"fancybox__nav\",button:\"f-button\",isNext:\"is-next\",isPrev:\"is-prev\"}},initialPage:this.option(\"startIndex\"),l10n:this.option(\"l10n\")},this.option(\"Carousel\")||{}));s.on(\"*\",((t,e,...i)=>{this.emit(`Carousel.${e}`,t,...i)})),s.on([\"ready\",\"change\"],(()=>{var t;const e=this.getSlide();e&&(null===(t=e.panzoom)||void 0===t||t.updateControls()),this.manageCaption(e)})),s.on(\"removeSlide\",((t,e)=>{e.closeBtnEl&&e.closeBtnEl.remove(),e.closeBtnEl=void 0,e.captionEl&&e.captionEl.remove(),e.captionEl=void 0,e.spinnerEl&&e.spinnerEl.remove(),e.spinnerEl=void 0,e.state=void 0})),s.on(\"Panzoom.touchStart\",(()=>{this.isCompact||this.endIdle()})),s.on(\"settle\",(()=>{this.idleTimer||this.isCompact||!this.option(\"idle\")||this.setIdle(),this.option(\"autoFocus\")&&this.checkFocus()})),this.option(\"dragToClose\")&&(s.on(\"Panzoom.afterTransform\",((t,i)=>{const n=this.getSlide();if(n&&e(n.el))return;const s=this.container;if(s){const t=Math.abs(i.current.f),e=t<1?\"\":Math.max(.5,Math.min(1,1-t/i.contentRect.fitHeight*1.5));s.style.setProperty(\"--fancybox-ts\",e?\"0s\":\"\"),s.style.setProperty(\"--fancybox-opacity\",e+\"\")}})),s.on(\"Panzoom.touchEnd\",((t,i,n)=>{var s;const o=this.getSlide();if(o&&e(o.el))return;if(i.isMobile&&document.activeElement&&-1!==[\"TEXTAREA\",\"INPUT\"].indexOf(null===(s=document.activeElement)||void 0===s?void 0:s.nodeName))return;const a=Math.abs(i.dragOffset.y);\"y\"===i.lockedAxis&&(a>=200||a>=50&&i.dragOffset.time<300)&&(n&&n.cancelable&&n.preventDefault(),this.close(n,\"f-throwOut\"+(i.current.f<0?\"Up\":\"Down\")))}))),s.on([\"change\"],(t=>{var e;let i=null===(e=this.getSlide())||void 0===e?void 0:e.triggerEl;if(i){const e=new CustomEvent(\"slideTo\",{bubbles:!0,cancelable:!0,detail:t.page});i.dispatchEvent(e)}})),s.on([\"refresh\",\"change\"],(t=>{const e=this.container;if(!e)return;for(const i of e.querySelectorAll(\"[data-fancybox-current-index]\"))i.innerHTML=t.page+1;for(const i of e.querySelectorAll(\"[data-fancybox-count]\"))i.innerHTML=t.pages.length;if(!t.isInfinite){for(const i of e.querySelectorAll(\"[data-fancybox-next]\"))t.page0?(i.removeAttribute(\"disabled\"),i.removeAttribute(\"tabindex\")):(i.setAttribute(\"disabled\",\"\"),i.setAttribute(\"tabindex\",\"-1\"))}const i=this.getSlide();if(!i)return;let n=i.downloadSrc||\"\";n||\"image\"!==i.type||i.error||\"string\"!=typeof i.src||(n=i.src);for(const t of e.querySelectorAll(\"[data-fancybox-download]\")){const e=i.downloadFilename;n?(t.removeAttribute(\"disabled\"),t.removeAttribute(\"tabindex\"),t.setAttribute(\"href\",n),t.setAttribute(\"download\",e||n),t.setAttribute(\"target\",\"_blank\")):(t.setAttribute(\"disabled\",\"\"),t.setAttribute(\"tabindex\",\"-1\"),t.removeAttribute(\"href\"),t.removeAttribute(\"download\"))}})),this.emit(\"initCarousel\")}attachEvents(){const t=this.container;t&&(t.addEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),t.addEventListener(\"wheel\",this.onWheel,{passive:!1,capture:!1}),document.addEventListener(\"keydown\",this.onKeydown,{passive:!1,capture:!0}),document.addEventListener(\"visibilitychange\",this.onVisibilityChange,!1),document.addEventListener(\"mousemove\",this.onMousemove),this.option(\"trapFocus\")&&document.addEventListener(\"focus\",this.onFocus,!0),window.addEventListener(\"resize\",this.onResize))}detachEvents(){const t=this.container;t&&(document.removeEventListener(\"keydown\",this.onKeydown,{passive:!1,capture:!0}),t.removeEventListener(\"wheel\",this.onWheel,{passive:!1,capture:!1}),t.removeEventListener(\"click\",this.onClick,{passive:!1,capture:!1}),document.removeEventListener(\"mousemove\",this.onMousemove),window.removeEventListener(\"resize\",this.onResize),document.removeEventListener(\"visibilitychange\",this.onVisibilityChange,!1),document.removeEventListener(\"focus\",this.onFocus,!0))}onClick(t){var e,i;const{container:n,isCompact:s}=this;if(!n||this.isClosing())return;!s&&this.option(\"idle\")&&this.resetIdle();const o=document.activeElement;if(gt()&&o&&n.contains(o))return;const a=t.composedPath()[0];if(a===(null===(e=this.carousel)||void 0===e?void 0:e.container))return;if(a.closest(\".f-spinner\")||a.closest(\"[data-fancybox-close]\"))return t.preventDefault(),void this.close(t);if(a.closest(\"[data-fancybox-prev]\"))return t.preventDefault(),void this.prev();if(a.closest(\"[data-fancybox-next]\"))return t.preventDefault(),void this.next();if(s&&\"image\"===(null===(i=this.getSlide())||void 0===i?void 0:i.type))return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout((()=>{this.toggleIdle(),this.clickTimer=null}),350));if(this.emit(\"click\",t),t.defaultPrevented)return;let r=!1;if(a.closest(\".fancybox__content\")){if(o){if(o.closest(\"[contenteditable]\"))return;a.matches(X)||o.blur()}if(gt())return;r=this.option(\"contentClick\")}else a.closest(\".fancybox__carousel\")&&!a.matches(X)&&(r=this.option(\"backdropClick\"));\"close\"===r?(t.preventDefault(),this.close(t)):\"next\"===r?(t.preventDefault(),this.next()):\"prev\"===r&&(t.preventDefault(),this.prev())}onWheel(t){const e=this.option(\"wheel\",t),i=\"slide\"===e,n=[-t.deltaX||0,-t.deltaY||0,-t.detail||0].reduce((function(t,e){return Math.abs(e)>Math.abs(t)?e:t})),s=Math.max(-1,Math.min(1,n)),o=Date.now();this.pwt&&o-this.pwt<300?i&&t.preventDefault():(this.pwt=o,this.emit(\"wheel\",t),t.defaultPrevented||(\"close\"===e?(t.preventDefault(),this.close(t)):\"slide\"===e&&(t.preventDefault(),this[s>0?\"prev\":\"next\"]())))}onKeydown(t){if(!this.isTopmost())return;this.isCompact||!this.option(\"idle\")||this.isClosing()||this.resetIdle();const e=t.key,i=this.option(\"keyboard\");if(!i||t.ctrlKey||t.altKey||t.shiftKey)return;const n=t.composedPath()[0],s=document.activeElement&&document.activeElement.classList,o=s&&s.contains(\"f-button\")||n.dataset.carouselPage||n.dataset.carouselIndex;if(\"Escape\"!==e&&!o&&x(n)){if(n.isContentEditable||-1!==[\"TEXTAREA\",\"OPTION\",\"INPUT\",\"SELECT\",\"VIDEO\"].indexOf(n.nodeName))return}this.emit(\"keydown\",e,t);const a=i[e];\"function\"==typeof this[a]&&(t.preventDefault(),this[a]())}onResize(){const t=this.container;if(!t)return;const e=this.isCompact;t.classList.toggle(\"is-compact\",e),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.emit(\"resize\")}onFocus(t){this.isTopmost()&&this.checkFocus(t)}onMousemove(t){this.prevMouseMoveEvent=t,!this.isCompact&&this.option(\"idle\")&&this.resetIdle()}onVisibilityChange(){\"visible\"===document.visibilityState?this.checkFocus():this.endIdle()}manageCloseBtn(t){const e=this.optionFor(t,\"closeButton\")||!1;if(\"auto\"===e){const t=this.plugins.Toolbar;if(t&&t.state===dt.Ready)return}if(!e)return;if(!t.contentEl||t.closeBtnEl)return;const i=this.option(\"tpl.closeButton\");if(i){const e=n(this.localize(i));t.closeBtnEl=t.contentEl.appendChild(e),t.el&&S(t.el,\"has-close-btn\")}}manageCaption(t){var e,i;const n=\"fancybox__caption\",s=\"has-caption\",o=this.container;if(!o)return;const a=this.isCompact||this.option(\"commonCaption\"),r=!a;if(this.caption&&this.stop(this.caption),r&&this.caption&&(this.caption.remove(),this.caption=null),a&&!this.caption)for(const t of(null===(e=this.carousel)||void 0===e?void 0:e.slides)||[])t.captionEl&&(t.captionEl.remove(),t.captionEl=void 0,E(t.el,s),null===(i=t.el)||void 0===i||i.removeAttribute(\"aria-labelledby\"));if(t||(t=this.getSlide()),!t||a&&!this.isCurrentSlide(t))return;const l=t.el;let c=this.optionFor(t,\"caption\",\"\");if(\"string\"!=typeof c||!c.length)return void(a&&this.caption&&this.animate(this.caption,\"f-fadeOut\",(()=>{var t;null===(t=this.caption)||void 0===t||t.remove(),this.caption=null})));let h=null;if(r){if(h=t.captionEl||null,l&&!h){const e=`fancybox__caption_${this.id}_${t.index}`;h=document.createElement(\"div\"),S(h,n),h.setAttribute(\"id\",e),t.captionEl=l.appendChild(h),S(l,s),l.setAttribute(\"aria-labelledby\",e)}}else{if(h=this.caption,h||(h=o.querySelector(\".\"+n)),!h){h=document.createElement(\"div\"),h.dataset.fancyboxCaption=\"\",S(h,n),h.innerHTML=c;(this.footer||o).prepend(h)}S(o,s),this.caption=h}h&&(h.innerHTML=c)}checkFocus(t){var e;const i=document.activeElement||null;i&&(null===(e=this.container)||void 0===e?void 0:e.contains(i))||this.focus(t)}focus(t){var e;if(this.ignoreFocusChange)return;const i=document.activeElement||null,n=(null==t?void 0:t.target)||null,s=this.container,o=this.getSlide();if(!s||!(null===(e=this.carousel)||void 0===e?void 0:e.viewport))return;if(!t&&i&&s.contains(i))return;const a=o&&o.state===V.Ready?o.el:null;if(!a||a.contains(i)||s===i)return;t&&t.cancelable&&t.preventDefault(),this.ignoreFocusChange=!0;const r=Array.from(s.querySelectorAll(X));let l=[],c=null;for(let t of r){const e=!t.offsetParent||t.closest('[aria-hidden=\"true\"]'),i=a&&a.contains(t),n=!this.carousel.viewport.contains(t);t===s||(i||n)&&!e?(l.push(t),void 0!==t.dataset.origTabindex&&(t.tabIndex=parseFloat(t.dataset.origTabindex)),t.removeAttribute(\"data-orig-tabindex\"),!t.hasAttribute(\"autoFocus\")&&c||(c=t)):(t.dataset.origTabindex=void 0===t.dataset.origTabindex?t.getAttribute(\"tabindex\")||void 0:t.dataset.origTabindex,t.tabIndex=-1)}let h=null;t?(!n||l.indexOf(n)<0)&&(h=c||s,l.length&&(i===vt?h=l[0]:this.lastFocus!==s&&i!==bt||(h=l[l.length-1]))):h=o&&\"image\"===o.type?s:c||s,h&&Y(h),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const t=this.carousel;t&&t.pages.length>1&&t.slideNext()}prev(){const t=this.carousel;t&&t.pages.length>1&&t.slidePrev()}jumpTo(...t){this.carousel&&this.carousel.slideTo(...t)}isTopmost(){var t;return(null===(t=xt.getInstance())||void 0===t?void 0:t.id)==this.id}animate(t=null,e=\"\",i){if(!t||!e)return void(i&&i());this.stop(t);const n=s=>{s.target===t&&t.dataset.animationName&&(t.removeEventListener(\"animationend\",n),delete t.dataset.animationName,i&&i(),E(t,e))};t.dataset.animationName=e,t.addEventListener(\"animationend\",n),S(t,e)}stop(t){t&&t.dispatchEvent(new CustomEvent(\"animationend\",{bubbles:!1,cancelable:!0,currentTarget:t}))}setContent(t,e=\"\",i=!0){if(this.isClosing())return;const s=t.el;if(!s)return;let o=null;if(x(e)?o=e:(o=n(e+\"\"),x(o)||(o=document.createElement(\"div\"),o.innerHTML=e+\"\")),[\"img\",\"picture\",\"iframe\",\"video\",\"audio\"].includes(o.nodeName.toLowerCase())){const t=document.createElement(\"div\");t.appendChild(o),o=t}x(o)&&t.filter&&!t.error&&(o=o.querySelector(t.filter)),o&&x(o)?(S(o,\"fancybox__content\"),t.id&&o.setAttribute(\"id\",t.id),\"none\"!==o.style.display&&\"none\"!==getComputedStyle(o).getPropertyValue(\"display\")||(o.style.display=t.display||this.option(\"defaultDisplay\")||\"flex\"),s.classList.add(`has-${t.error?\"error\":t.type||\"unknown\"}`),s.prepend(o),t.contentEl=o,i&&this.revealContent(t),this.manageCloseBtn(t),this.manageCaption(t)):this.setError(t,\"{{ELEMENT_NOT_FOUND}}\")}revealContent(t,e){const i=t.el,n=t.contentEl;i&&n&&(this.emit(\"reveal\",t),this.hideLoading(t),t.state=V.Opening,(e=this.isOpeningSlide(t)?void 0===e?this.optionFor(t,\"showClass\"):e:\"f-fadeIn\")?this.animate(n,e,(()=>{this.done(t)})):this.done(t))}done(t){this.isClosing()||(t.state=V.Ready,this.emit(\"done\",t),S(t.el,\"is-done\"),this.isCurrentSlide(t)&&this.option(\"autoFocus\")&&queueMicrotask((()=>{this.option(\"autoFocus\")&&(this.option(\"autoFocus\")?this.focus():this.checkFocus())})),this.isOpeningSlide(t)&&!this.isCompact&&this.option(\"idle\")&&this.setIdle())}isCurrentSlide(t){const e=this.getSlide();return!(!t||!e)&&e.index===t.index}isOpeningSlide(t){var e,i;return null===(null===(e=this.carousel)||void 0===e?void 0:e.prevPage)&&t.index===(null===(i=this.getSlide())||void 0===i?void 0:i.index)}showLoading(t){t.state=V.Loading;const e=t.el;if(!e)return;S(e,\"is-loading\"),this.emit(\"loading\",t),t.spinnerEl||setTimeout((()=>{if(!this.isClosing()&&!t.spinnerEl&&t.state===V.Loading){let i=n(w);t.spinnerEl=i,e.prepend(i),this.animate(i,\"f-fadeIn\")}}),250)}hideLoading(t){const e=t.el;if(!e)return;const i=t.spinnerEl;this.isClosing()?null==i||i.remove():(E(e,\"is-loading\"),i&&this.animate(i,\"f-fadeOut\",(()=>{i.remove()})),t.state===V.Loading&&(this.emit(\"loaded\",t),t.state=V.Ready))}setError(t,e){if(this.isClosing())return;this.emit(\"error\"),t.error=e,this.hideLoading(t),this.clearContent(t);const i=document.createElement(\"div\");i.classList.add(\"fancybox-error\"),i.innerHTML=this.localize(e||\"

{{ERROR}}

\"),this.setContent(t,i)}clearContent(t){var e;null===(e=this.carousel)||void 0===e||e.emit(\"removeSlide\",t),t.contentEl&&(t.contentEl.remove(),t.contentEl=void 0),t.closeBtnEl&&(t.closeBtnEl.remove(),t.closeBtnEl=void 0);const i=t.el;i&&(E(i,\"is-loading\"),E(i,\"has-error\"),E(i,\"has-unknown\"),E(i,`has-${t.type||\"unknown\"}`))}getSlide(){var t;const e=this.carousel;return(null===(t=null==e?void 0:e.pages[null==e?void 0:e.page])||void 0===t?void 0:t.slides[0])||void 0}close(t,e){if(this.isClosing())return;const i=new Event(\"shouldClose\",{bubbles:!0,cancelable:!0});if(this.emit(\"shouldClose\",i,t),i.defaultPrevented)return;t&&t.cancelable&&(t.preventDefault(),t.stopPropagation());const n=this.fsAPI,s=()=>{this.proceedClose(t,e)};n&&n.isFullscreen()?Promise.resolve(n.exit()).then((()=>s())):s()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(t=!1){const e=()=>{this.clearIdle(),this.idle=!0,S(this.container,\"is-idle\"),this.emit(\"setIdle\")};if(this.clearIdle(),!this.isClosing())if(t)e();else{const t=this.option(\"idle\");t&&(this.idleTimer=setTimeout(e,t))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,E(this.container,\"is-idle\"),this.emit(\"endIdle\"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){const t=this.fsAPI;t&&(t.isFullscreen()?t.exit():this.container&&t.request(this.container))}isClosing(){return[Z.Closing,Z.CustomClosing,Z.Destroy].includes(this.state)}proceedClose(t,e){var i;this.state=Z.Closing,this.clearIdle(),this.detachEvents();const n=this.container,s=this.carousel,o=this.getSlide(),a=o&&this.option(\"placeFocusBack\")?o.triggerEl||this.option(\"trigger\"):null;if(a&&(N(a)?Y(a):a.focus()),n&&(S(n,\"is-closing\"),n.setAttribute(\"aria-hidden\",\"true\"),this.option(\"animated\")&&S(n,\"is-animated\"),n.style.pointerEvents=\"none\"),s){s.clearTransitions(),null===(i=s.panzoom)||void 0===i||i.destroy();for(const t of s.slides){t.state=V.Closing,this.hideLoading(t);const e=t.contentEl;e&&this.stop(e);const i=null==t?void 0:t.panzoom;i&&(i.stop(),i.detachEvents(),i.detachObserver()),this.isCurrentSlide(t)||s.emit(\"removeSlide\",t)}}this.emit(\"close\",t),this.state!==Z.CustomClosing?(void 0===e&&o&&(e=this.optionFor(o,\"hideClass\")),e&&o?(this.animate(o.contentEl,e,(()=>{s&&s.emit(\"removeSlide\",o)})),setTimeout((()=>{this.destroy()}),500)):this.destroy()):setTimeout((()=>{this.destroy()}),500)}destroy(){var t;if(this.state===Z.Destroy)return;this.state=Z.Destroy,null===(t=this.carousel)||void 0===t||t.destroy();const e=this.container;e&&e.remove(),yt.delete(this.id);const i=xt.getInstance();i?i.focus():(bt&&(bt.remove(),bt=null),vt&&(vt.remove(),vt=null),E(document.documentElement,\"with-fancybox\"),(()=>{if(!W)return;const t=document,e=t.body;e.classList.remove(\"hide-scrollbar\"),e.style.setProperty(\"--fancybox-body-margin\",\"\"),t.documentElement.style.setProperty(\"--fancybox-scrollbar-compensate\",\"\")})(),this.emit(\"destroy\"))}static bind(t,e,i){if(!W)return;let n,s=\"\",o={};if(void 0===t?n=document.body:\"string\"==typeof t?(n=document.body,s=t,\"object\"==typeof e&&(o=e||{})):(n=t,\"string\"==typeof e&&(s=e),\"object\"==typeof i&&(o=i||{})),!n||!x(n))return;s=s||\"[data-fancybox]\";const a=xt.openers.get(n)||new Map;a.set(s,o),xt.openers.set(n,a),1===a.size&&n.addEventListener(\"click\",xt.fromEvent)}static unbind(t,e){let i,n=\"\";if(\"string\"==typeof t?(i=document.body,n=t):(i=t,\"string\"==typeof e&&(n=e)),!i)return;const s=xt.openers.get(i);s&&n&&s.delete(n),n&&s||(xt.openers.delete(i),i.removeEventListener(\"click\",xt.fromEvent))}static destroy(){let t;for(;t=xt.getInstance();)t.destroy();for(const t of xt.openers.keys())t.removeEventListener(\"click\",xt.fromEvent);xt.openers=new Map}static fromEvent(t){if(t.defaultPrevented)return;if(t.button&&0!==t.button)return;if(t.ctrlKey||t.metaKey||t.shiftKey)return;let e=t.composedPath()[0];const i=e.closest(\"[data-fancybox-trigger]\");if(i){const t=i.dataset.fancyboxTrigger||\"\",n=document.querySelectorAll(`[data-fancybox=\"${t}\"]`),s=parseInt(i.dataset.fancyboxIndex||\"\",10)||0;e=n[s]||e}if(!(e&&e instanceof Element))return;let n,s,o,a;if([...xt.openers].reverse().find((([t,i])=>!(!t.contains(e)||![...i].reverse().find((([i,r])=>{let l=e.closest(i);return!!l&&(n=t,s=i,o=l,a=r,!0)}))))),!n||!s||!o)return;a=a||{},t.preventDefault(),e=o;let r=[],l=u({},q,a);l.event=t,l.trigger=e,l.delegate=i;const c=l.groupAll,h=l.groupAttr,d=h&&e?e.getAttribute(`${h}`):\"\";if((!e||d||c)&&(r=[].slice.call(n.querySelectorAll(s))),e&&!c&&(r=d?r.filter((t=>t.getAttribute(`${h}`)===d)):[e]),!r.length)return;const p=xt.getInstance();return p&&p.options.trigger&&r.indexOf(p.options.trigger)>-1?void 0:(e&&(l.startIndex=r.indexOf(e)),xt.fromNodes(r,l))}static fromSelector(t,e){let i=null,n=\"\";if(\"string\"==typeof t?(i=document.body,n=t):t instanceof HTMLElement&&\"string\"==typeof e&&(i=t,n=e),!i||!n)return!1;const s=xt.openers.get(i);if(!s)return!1;const o=s.get(n);return!!o&&xt.fromNodes(Array.from(i.querySelectorAll(n)),o)}static fromNodes(t,e){e=u({},q,e||{});const i=[];for(const n of t){const t=n.dataset||{},s=t.src||n.getAttribute(\"href\")||n.getAttribute(\"currentSrc\")||n.getAttribute(\"src\")||void 0;let o;const a=e.delegate;let r;a&&i.length===e.startIndex&&(o=a instanceof HTMLImageElement?a:a.querySelector(\"img:not([aria-hidden])\")),o||(o=n instanceof HTMLImageElement?n:n.querySelector(\"img:not([aria-hidden])\")),o&&(r=o.currentSrc||o.src||void 0,!r&&o.dataset&&(r=o.dataset.lazySrc||o.dataset.src||void 0));const l={src:s,triggerEl:n,thumbEl:o,thumbElSrc:r,thumbSrc:r};for(const e in t)\"fancybox\"!==e&&(l[e]=t[e]+\"\");i.push(l)}return new xt(i,e)}static getInstance(t){if(t)return yt.get(t);return Array.from(yt.values()).reverse().find((t=>!t.isClosing()&&t))||null}static getSlide(){var t;return(null===(t=xt.getInstance())||void 0===t?void 0:t.getSlide())||null}static show(t=[],e={}){return new xt(t,e)}static next(){const t=xt.getInstance();t&&t.next()}static prev(){const t=xt.getInstance();t&&t.prev()}static close(t=!0,...e){if(t)for(const t of yt.values())t.close(...e);else{const t=xt.getInstance();t&&t.close(...e)}}}Object.defineProperty(xt,\"version\",{enumerable:!0,configurable:!0,writable:!0,value:\"5.0.16\"}),Object.defineProperty(xt,\"defaults\",{enumerable:!0,configurable:!0,writable:!0,value:q}),Object.defineProperty(xt,\"Plugins\",{enumerable:!0,configurable:!0,writable:!0,value:mt}),Object.defineProperty(xt,\"openers\",{enumerable:!0,configurable:!0,writable:!0,value:new Map});export{_ as Carousel,xt as Fancybox,T as Panzoom};\n","export class Accordion {\n\tdetailsElement: HTMLDetailsElement;\n\tsummaryElement: HTMLElement;\n\tcontent: HTMLElement[];\n\tanimation: Animation | null;\n\tisCollapsing: boolean;\n\tisExpanding: boolean;\n\n\tconstructor(detailsElement: HTMLDetailsElement) {\n\t\tthis.detailsElement = detailsElement;\n\t\tthis.summaryElement = detailsElement.querySelector(\"summary\")!;\n\t\tthis.content = Array.from(detailsElement.children).filter(e => e !== this.summaryElement) as HTMLElement[];\n\n\t\tthis.animation = null;\n\t\tthis.isCollapsing = false;\n\t\tthis.isExpanding = false;\n\t\tthis.summaryElement.addEventListener(\"click\", e => {\n\t\t\te.preventDefault();\n\t\t\tthis.toggle();\n\t\t});\n\t}\n\n\ttoggle() {\n\t\tthis.detailsElement.style.overflow = \"hidden\";\n\n\t\tif (this.isCollapsing || !this.detailsElement.open) {\n\t\t\tthis.detailsElement.style.height = `${this.detailsElement.offsetHeight}px`;\n\t\t\tthis.detailsElement.open = true;\n\t\t\twindow.requestAnimationFrame(() => this.expand());\n\t\t} else if (this.isExpanding || this.detailsElement.open) {\n\t\t\tthis.collapse();\n\t\t}\n\t}\n\n\topen() {\n\t\tif (this.isCollapsing || !this.detailsElement.open) {\n\t\t\tthis.detailsElement.style.height = `${this.detailsElement.offsetHeight}px`;\n\t\t\tthis.detailsElement.open = true;\n\t\t\twindow.requestAnimationFrame(() => this.expand());\n\t\t}\n\t}\n\n\tclose() {\n\t\tif (this.isExpanding || this.detailsElement.open) {\n\t\t\tthis.collapse();\n\t\t}\n\t}\n\n\tprivate expand() {\n\t\tthis.isExpanding = true;\n\t\tconst startHeight = `${this.detailsElement.offsetHeight}px`;\n\t\tconst endHeight = `${this.detailsElement.offsetHeight + this.content.map(e => e.offsetHeight).reduce((prev, curr) => prev + curr, 0)}px`;\n\n\t\tif (this.animation) {\n\t\t\tthis.animation.cancel();\n\t\t}\n\n\t\tthis.animation = this.detailsElement.animate({\n\t\t\theight: [startHeight, endHeight]\n\t\t}, {\n\t\t\tduration: 400,\n\t\t\teasing: \"ease-out\"\n\t\t});\n\n\t\tthis.animation.onfinish = () => this.onAnimationFinish(true);\n\t\tthis.animation.oncancel = () => this.isExpanding = false;\n\t}\n\n\tprivate collapse() {\n\t\tthis.isCollapsing = true;\n\n\t\tconst detailsStyle = window.getComputedStyle(this.detailsElement);\n\t\tconst startHeight = `${this.detailsElement.offsetHeight}px`;\n\t\tconst endHeight = `${this.summaryElement.offsetHeight + parseFloat(detailsStyle.paddingTop) + parseFloat(detailsStyle.paddingBottom) }px`;\n\n\t\tif (this.animation) {\n\t\t\tthis.animation.cancel();\n\t\t}\n\n\t\tthis.animation = this.detailsElement.animate({\n\t\t\theight: [startHeight, endHeight]\n\t\t}, {\n\t\t\tduration: 400,\n\t\t\teasing: \"ease-out\"\n\t\t});\n\n\t\tthis.animation.onfinish = () => this.onAnimationFinish(false);\n\t\tthis.animation.oncancel = () => this.isCollapsing = false;\n\t}\n\n\tprivate onAnimationFinish(open: boolean) {\n\t\tthis.detailsElement.open = open;\n\t\tthis.animation = null;\n\t\tthis.isCollapsing = false;\n\t\tthis.isExpanding = false;\n\t\tthis.detailsElement.style.height = \"\";\n\t\tthis.detailsElement.style.overflow = \"\";\n\t}\n}\n","/**\n * Functions are placed here for better encapsulation and readability of the main codebase. This helps to isolate them\n * from the DOM API of the implemented web component (particularly if they are static and do not need access to instance\n * level information, i.e. they do not call \"this\").\n */\n\n\n/**\n * Extracted from svelte's internal API @ src/runtime/internal/dom.js\n *\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nfunction insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n\n/**\n * Extracted from svelte's internal API @ src/runtime/internal/dom.js\n *\n * @param {Node} node\n * @returns {void}\n */\nfunction detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n\n/**\n * Creates an object where each property represents the slot name and each value represents a Svelte-specific slot\n * object containing the lifecycle hooks for each slot. This wraps our slot elements and is passed to Svelte itself.\n *\n * Much of this witchcraft is from svelte issue - https://github.com/sveltejs/svelte/issues/2588\n */\nexport function createSvelteSlots(slots) {\n\tconst svelteSlots = {};\n\tfor(const slotName in slots) {\n\t\tsvelteSlots[slotName] = [createSlotFn(slots[slotName])];\n\t}\n\n\tfunction createSlotFn(element) {\n\t\treturn function() {\n\t\t\treturn {\n\t\t\t\tc: function() {}, // noop\n\t\t\t\tm: function mount(target, anchor) {\n\t\t\t\t\tinsert(target, element.cloneNode(true), anchor);\n\t\t\t\t},\n\t\t\t\td: function destroy(detaching) {\n\t\t\t\t\tif (detaching) {\n\t\t\t\t\t\tdetach(element);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tl: function() {}, // noop\n\t\t\t};\n\t\t};\n\t}\n\n\treturn svelteSlots;\n}\n\n\n/**\n * Traverses DOM to find the first custom element that the provided element happens to belong to.\n *\n * @param {Element} slot\n * @returns {HTMLElement|null}\n */\nexport function findSlotParent(slot) {\n\tlet parentEl = slot.parentElement;\n\twhile(parentEl) {\n\t\tif (parentEl.tagName.indexOf('-') !== -1) return parentEl;\n\t\tparentEl = parentEl.parentElement;\n\t}\n\treturn null;\n}\n\n\n/**\n * Carefully \"unwraps\" the custom element tag itself from its default slot content (particularly if that content\n * is just a text node). Only used when not using shadow root.\n *\n * @param {HTMLElement} from\n *\n * @returns {DocumentFragment}\n */\nexport function unwrap(from) {\n\tlet node = document.createDocumentFragment();\n\twhile(from.firstChild) {\n\t\tnode.appendChild(from.firstChild);\n\t}\n\treturn node;\n}\n","import { createSvelteSlots, findSlotParent, unwrap } from './utils.js';\n\n\n/**\n * Tracks the mapping of case-insensitive attributes to case-sensitive component props on a per-tag basis. Setup as a\n * global cache so we can avoid setting up a Proxy on every single component render but also to assist in mapping during\n * hits to attributeChangedCallback().\n */\nconst propMapCache = new Map();\n\n\n/**\n * Mutation observer must be used to track changes to attributes on our custom elements, since we cannot know the\n * component props ahead of time (required if we were to use observedAttributes instead). In this case, only one\n * observer is necessary, since each call to .observe() can have a different \"attributeFilter\" specified.\n * NOTE: We can .observe() many separate elements and don't have to .disconnect() each one individually, since if the\n * element being observed is removed from the DOM and released by the garbage collector, the MutationObserver will\n * stop observing the removed element automatically.\n */\nconst attributeObserver = new MutationObserver((mutations) => {\n\t// Go through each mutation and forward the updated attribute value to the corresponding Svelte prop.\n\tmutations.forEach(mutation => {\n\t\tconst element = mutation.target;\n\t\tconst attributeName = mutation.attributeName;\n\t\tconst newValue = element.getAttribute(attributeName);\n\t\telement.forwardAttributeToProp(attributeName, newValue);\n\t});\n});\n\n\n/**\n * Processes the queued set of svelte-retag managed elements which have been initialized, connected and flagged as ready\n * for render. This is done just before paint with the goal of processing as many as possible at once not only for speed\n * but also to ensure we can render properly from the top down (parent to child). This is necessary, as the actual\n * construct() and connectedCallback()'s for custom elements depends largely on *when* the elements are defined and\n * encountered in the DOM (can be in any order). This allows us to better control that process.\n *\n * @param {number} timestamp\n */\n// eslint-disable-next-line no-unused-vars\nfunction renderElements(timestamp) {\n\t// This is key: Fetches elements in document order so we can render top-down (for context).\n\tlet renderQueue = document.querySelectorAll('[data-svelte-retag-render]');\n\tif (renderQueue.length === 0) {\n\t\t// TODO: Consider build of svelte-retag so we can drop console.logs() when publishing without having to comment out. See: https://github.com/vitejs/vite/discussions/7920\n\t\t//console.debug(`renderElements(${timestamp}): returned, queue is now empty`);\n\t\treturn;\n\t}\n\n\tfor(let element of renderQueue) {\n\t\t// Element was queued but likely rearranged due to the parent rendering first (resulting in a new instance and this\n\t\t// being forever orphaned).\n\t\tif (!element.isConnected) {\n\t\t\t//console.debug(`renderElements(${timestamp}): skipped, already disconnected:`, element);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Quick double check: Skip any which have *light* DOM parents that are queued for render. See _queueForRender() for details.\n\t\tif (element.parentElement.closest('[data-svelte-retag-render=\"light\"]') === null) {\n\t\t\telement.removeAttribute('data-svelte-retag-render');\n\t\t\telement._renderSvelteComponent();\n\t\t} else {\n\t\t\t//console.debug(`renderElements(${timestamp}): skipped, light DOM parent is queued for render:`, element);\n\t\t}\n\t}\n}\n\n\n/**\n * @typedef {new(...args: any[]) => any} Newable Type alias for a really generic class constructor\n * @typedef {Newable} CmpConstructor Svelte component class constructor (basically a \"newable\" object)\n */\n\n/**\n * @typedef {object} SvelteRetagOptions Configuration options for svelte-retag. See README.md for details.\n *\n * @property {CmpConstructor} component The Svelte component *class* constructor to incorporate into your custom element (this is the imported component class, *not* an instance)\n * @property {string} tagname Name of the custom element tag you'd like to define.\n * @property {string[]|boolean} [attributes=[]] Optional array of attributes that should be reactively forwarded to the component when modified. Set to true to automatically watch all attributes.\n * @property {boolean|string[]} [ignoreCommonAttribWarnings=false] Suppresses warnings in development mode about common attributes (such as \"id\", \"class\" and \"data-*\") if they don't already exist on the component. Set to an array to customize the list of ignored attributes.\n * @property {boolean} [shadow=false] Indicates if we should build the component in the shadow root instead of in the regular (\"light\") DOM.\n * @property {string} [href=\"\"] URL to the CSS stylesheet to incorporate into the shadow DOM (if enabled).\n *\n * Experimental:\n * @property {boolean} [hydratable=false] EXPERIMENTAL. Light DOM slot hydration (specific to svelte-retag): Enables\n * \t pre-rendering of the web component (e.g. SSR) by adding extra markers\n * \t (attributes & wrappers) during rendering to enable svelte-retag to find and\n * \t restore light DOM slots when restoring interactivity. See README.md for more.\n * @property {boolean|'cli'} [debugMode=false] Hidden option to enable debugging for package development purposes.\n *\n */\n\n/**\n * Please see README.md for usage information.\n *\n * @param {SvelteRetagOptions} opts Configuration options for svelte-retag. See README.md for details.\n */\nexport default function svelteRetag(opts) {\n\t/**\n\t * Reserves our special custom element container which is used to wrap Svelte components.\n\t *\n\t * When performing light DOM rendering, this provides the opportunity to isolate the slot content away from the HTML\n\t * rendered by the component itself. This is particularly necessary if we're executing early (e.g. via IIFE formatted\n\t * bundles and not via native ESM modules, which are deferred) since we need to rerender the component as the parser\n\t * progresses along the current element's slot content. This ultimately reduces (if not eliminates) the typical\n\t * cumulative layout shift (CLS) seen when injecting components into the DOM like this (especially noticeable on\n\t * initial page loads). That CLS typically occurs because ESM modules are deferred (as noted above) but also because\n\t * it's difficult to know what the correct/final slot content will be until after the parser has rendered the DOM for\n\t * us.\n\t *\n\t * When performing shadow DOM rendering, it provides an un-styled container where we can attach the Svelte component\n\t * once it begins rendering.\n\t */\n\tif (!window.customElements.get('svelte-retag')) {\n\t\twindow.customElements.define('svelte-retag', class extends HTMLElement {\n\t\t\t// noop\n\t\t});\n\n\t\t// When the 'hydratable' option is enabled, this special wrapper will be applied around default slot content so\n\t\t// that it can be discovered and restored later after pre-rendering. NOTE: This tag is always available since\n\t\t// we can always hydrate. It is only applied to rendered content if elected for a particular component.\n\t\twindow.customElements.define('svelte-retag-default', class extends HTMLElement {\n\t\t\t// noop\n\t\t});\n\t}\n\n\t// Filter for dynamically ignoring errors when using common attributes which might potentially be on a custom element\n\t// but ALSO aren't already explicitly defined on the Svelte component. Default to false but allow user to enable.\n\tlet ignoreAttribFilter = () => false;\n\tif (opts?.ignoreCommonAttribWarnings === true) {\n\t\tignoreAttribFilter = (name) => {\n\t\t\treturn (name === 'id' || name === 'class' || name === 'style' || name.startsWith('data-'));\n\t\t};\n\t} else if (Array.isArray(opts.ignoreCommonAttribWarnings)) {\n\t\tignoreAttribFilter = (name) => {\n\t\t\treturn opts.ignoreCommonAttribWarnings.includes(name);\n\t\t};\n\t}\n\n\t/**\n\t * Object containing keys pointing to slots: Either an actual element or a document fragment created to wrap\n\t * default slot content.\n\t *\n\t * @typedef {Object.} SlotList\n\t */\n\n\t/**\n\t * Defines the actual custom element responsible for rendering the provided Svelte component.\n\t */\n\twindow.customElements.define(opts.tagname, class extends HTMLElement {\n\t\tconstructor() {\n\t\t\tsuper();\n\n\t\t\tthis._debug('constructor()');\n\n\t\t\t// New instances, attributes not yet being observed.\n\t\t\tthis.attributesObserved = false;\n\n\n\t\t\t// Setup shadow root early (light-DOM root is initialized in connectedCallback() below).\n\t\t\tif (opts.shadow) {\n\t\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t\t\t// TODO: Better than
, but: Is a wrapper entirely necessary? Why not just set this._root = this.shadowRoot?\n\t\t\t\tthis._root = document.createElement('svelte-retag');\n\t\t\t\tthis.shadowRoot.appendChild(this._root);\n\n\t\t\t\t// Link generated style. Do early as possible to ensure we start downloading CSS (reduces FOUC).\n\t\t\t\tif (opts.href) {\n\t\t\t\t\tlet link = document.createElement('link');\n\t\t\t\t\tlink.setAttribute('href', opts.href);\n\t\t\t\t\tlink.setAttribute('rel', 'stylesheet');\n\t\t\t\t\tthis.shadowRoot.appendChild(link);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attributes we're watching for changes after render (doesn't affect attributes already present prior to render).\n\t\t *\n\t\t * NOTE: This only applies if opts.attributes is an array. If opts.attributes is true, then all attributes are\n\t\t * watched using the mutation observer instead.\n\t\t *\n\t\t * @returns string[]\n\t\t */\n\t\tstatic get observedAttributes() {\n\t\t\tif (Array.isArray(opts.attributes)) {\n\t\t\t\t// User defined an explicit list or nothing at all.\n\t\t\t\treturn opts.attributes;\n\t\t\t} else {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Attached to DOM.\n\t\t */\n\t\tconnectedCallback() {\n\t\t\tthis._debug('connectedCallback()');\n\n\t\t\t/**\n\t\t\t * TODO: Light DOM: Potential optimization opportunities:\n\t\t\t * 1. Don't bother setting up wrapper if the component doesn't have a default slot and isn't hydratable\n\t\t\t * 2. Don't setup wrapper if we don't end up processing mutations (i.e. document not in loading state).\n\t\t\t * If this happens though, we must only setup/destroy in connected/disconnected callbacks and thus anything that\n\t\t\t * depends upon it needs a separate method of determining. Maybe getter that checks if this._root.tagName === 'SVELTE-RETAG'?\n\t\t\t */\n\n\t\t\t// Initialize the slot elements object which retains a reference to the original elements (by slot name) so they\n\t\t\t// can be restored later on disconnectedCallback(). Also useful for debugging purposes.\n\t\t\tthis.slotEls = {};\n\n\t\t\t// If compiled as IIFE/UMD and executed early, then the document is likely to be in the process of loading\n\t\t\t// and thus actively parsing tags, including not only this tag but also nested content (which may not yet be\n\t\t\t// available).\n\t\t\tconst isLoading = (document.readyState === 'loading');\n\n\t\t\t// Setup the special wrapper if not already present (which can happen when\n\t\t\t// disconnected/reconnected due to being in a slot).\n\t\t\tif (!opts.shadow) {\n\t\t\t\t// See if this component is pre-rendered and flagged as able to hydrate slots from the light DOM root.\n\t\t\t\tif (this.hasAttribute('data-svelte-retag-hydratable')) {\n\t\t\t\t\tif (isLoading) {\n\t\t\t\t\t\t// Wait for the slots to become fully available.\n\t\t\t\t\t\t// NOTE: We expect wrapper to already be present, however it may not be\n\t\t\t\t\t\t// accessible until after the browser has finished parsing the DOM.\n\t\t\t\t\t\tthis._onSlotsReady(() => {\n\t\t\t\t\t\t\tthis._initLightRoot();\n\t\t\t\t\t\t\tthis._hydrateLightSlots();\n\t\t\t\t\t\t\tthis._queueForRender();\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Light DOM slots are already all available, so hydrate them now and allow Svelte component\n\t\t\t\t\t\t// rendering to proceed normally below.\n\t\t\t\t\t\tthis._initLightRoot();\n\t\t\t\t\t\tthis._hydrateLightSlots();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Setup the wrapper now since we don't have to worry about hydration.\n\t\t\t\t\tthis._initLightRoot();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Watch for changes to slot elements and ensure they're reflected in the Svelte component.\n\t\t\tif (opts.shadow) {\n\t\t\t\tthis._observeSlots(true);\n\t\t\t} else {\n\t\t\t\tif (isLoading) {\n\t\t\t\t\t// Setup the mutation observer to watch content as parser progresses through the HTML and adds nodes under\n\t\t\t\t\t// this element. However, since this is only useful in light DOM elements *during* parsing, we should be sure\n\t\t\t\t\t// to stop observing once the HTML is fully parsed and loaded.\n\t\t\t\t\tthis._observeSlots(true);\n\t\t\t\t\tthis._onSlotsReady(() => {\n\t\t\t\t\t\tthis._observeSlots(false);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Now that we're connected to the DOM, we can render the component now.\n\t\t\tthis._queueForRender();\n\n\t\t\t// If we want to enable the current component as hydratable, add the flag now that it has been fully\n\t\t\t// rendered (now that slots have been located under the Svelte component). This attribute is important since\n\t\t\t// it allows us to know immediately that this component is capable of being hydrated (useful if compiled and\n\t\t\t// executed as IIFE/UMD).\n\t\t\tif (opts.hydratable) {\n\t\t\t\tthis.setAttribute('data-svelte-retag-hydratable', '');\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Removed from DOM (could be called inside another custom element that starts rendering after this one). In that\n\t\t * situation, the connectedCallback() will be executed again (most likely with constructor() as well, unfortunately).\n\t\t */\n\t\tdisconnectedCallback() {\n\t\t\tthis._debug('disconnectedCallback()');\n\n\t\t\t// Remove render flag (if present). This could happen in case the element is disconnected while waiting to render\n\t\t\t// (particularly if slotted under a light DOM parent).\n\t\t\tthis.removeAttribute('data-svelte-retag-render');\n\n\t\t\t// Remove hydration flag, if present. This component will be able to be rendered from scratch instead.\n\t\t\tthis.removeAttribute('data-svelte-retag-hydratable');\n\n\t\t\t// Disconnect slot mutation observer (if it's currently active).\n\t\t\tthis._observeSlots(false);\n\n\t\t\t// Double check that element has been initialized already. This could happen in case connectedCallback() hasn't\n\t\t\t// fully completed yet (e.g. if initialization is async)\n\t\t\tif (this.componentInstance) {\n\t\t\t\ttry {\n\t\t\t\t\t// Clean up: Destroy Svelte component when removed from DOM.\n\t\t\t\t\tthis.componentInstance.$destroy();\n\t\t\t\t\tdelete this.componentInstance;\n\t\t\t\t} catch(err) {\n\t\t\t\t\tconsole.error(`Error destroying Svelte component in '${this.tagName}'s disconnectedCallback(): ${err}`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!opts.shadow) {\n\t\t\t\t// Restore slots back to the light DOM in case we're just being appended elsewhere (likely if we're nested under\n\t\t\t\t// another custom element that initializes after this custom element, thus causing *another* round of\n\t\t\t\t// construct/connectedCallback on this one).\n\t\t\t\tthis._restoreLightSlots();\n\n\t\t\t\t// Lastly, unwinding everything in reverse: Remove the \"light\" DOM root (the special wrapper) which\n\t\t\t\t// is only added during connectedCallback(), unlike shadow DOM which is attached in construct.\n\t\t\t\tthis.removeChild(this._root);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Callback/hook for observedAttributes.\n\t\t *\n\t\t * @param {string} name\n\t\t * @param {string} oldValue\n\t\t * @param {string} newValue\n\t\t */\n\t\tattributeChangedCallback(name, oldValue, newValue) {\n\t\t\tthis._debug('attributes changed', { name, oldValue, newValue });\n\t\t\tthis.forwardAttributeToProp(name, newValue);\n\t\t}\n\n\t\t/**\n\t\t * Forward modifications to element attributes to the corresponding Svelte prop (if applicable).\n\t\t *\n\t\t * @param {string} name\n\t\t * @param {string} value\n\t\t */\n\t\tforwardAttributeToProp(name, value) {\n\t\t\tthis._debug('forwardAttributeToProp', { name, value });\n\n\t\t\t// If instance already available, pass it through immediately.\n\t\t\tif (this.componentInstance) {\n\t\t\t\tlet translatedName = this._translateAttribute(name);\n\t\t\t\tif (translatedName !== null) {\n\t\t\t\t\tthis.componentInstance.$set({ [translatedName]: value });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Setup a wrapper in the light DOM which can keep the rendered Svelte component separate from the default Slot\n\t\t * content, which is potentially being actively appended (at least while the browser parses during loading).\n\t\t */\n\t\t_initLightRoot() {\n\t\t\t// Recycle the existing light DOM root, if already present.\n\t\t\tlet existingRoot = this.querySelector('svelte-retag');\n\t\t\tif (existingRoot !== null && existingRoot.parentElement === this) {\n\t\t\t\tthis._debug('_initLightRoot(): Restore from existing light DOM root');\n\t\t\t\tthis._root = existingRoot;\n\t\t\t} else {\n\t\t\t\t// Setup new (first time).\n\t\t\t\tthis._root = document.createElement('svelte-retag');\n\t\t\t\tthis.prepend(this._root);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Queues the provided callback to execute when we think all slots are fully loaded and available to fetch and\n\t\t * manipulate.\n\t\t *\n\t\t * @param {callback} callback\n\t\t */\n\t\t_onSlotsReady(callback) {\n\t\t\tdocument.addEventListener('readystatechange', () => {\n\t\t\t\tif (document.readyState === 'interactive') {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Converts the provided lowercase attribute name to the correct case-sensitive component prop name, if possible.\n\t\t *\n\t\t * @param {string} attributeName\n\t\t * @returns {string|null}\n\t\t */\n\t\t_translateAttribute(attributeName) {\n\t\t\t// In the unlikely scenario that a browser somewhere doesn't do this for us (or maybe we're in a quirks mode or something...)\n\t\t\tattributeName = attributeName.toLowerCase();\n\t\t\tif (this.propMap && this.propMap.has(attributeName)) {\n\t\t\t\treturn this.propMap.get(attributeName);\n\t\t\t} else {\n\t\t\t\t// Return it unchanged but only if it's not in our \"ignore attributes\" filter.\n\t\t\t\tif (!ignoreAttribFilter(attributeName)) {\n\t\t\t\t\tthis._debug(`_translateAttribute(): ${attributeName} not found on component, keeping unchanged`);\n\t\t\t\t\treturn attributeName;\n\t\t\t\t} else {\n\t\t\t\t\t// Ignored.\n\t\t\t\t\tthis._debug(`_translateAttribute(): ${attributeName} matched ignore filter, skipping entirely`);\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * To support context, this traverses the DOM to find potential parent elements (also managed by svelte-retag) which\n\t\t * may contain context necessary to render this component.\n\t\t *\n\t\t * See context functions at: https://svelte.dev/docs/svelte#setcontext\n\t\t *\n\t\t * @returns {Map|null}\n\t\t */\n\t\t_getAncestorContext() {\n\t\t\tlet node = this;\n\t\t\twhile(node.parentNode) {\n\t\t\t\tnode = node.parentNode;\n\t\t\t\tlet context = node?.componentInstance?.$$?.context;\n\t\t\t\tif (context instanceof Map) {\n\t\t\t\t\treturn context;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Queue this element for render in the next animation frame. This offers the opportunity to render known available\n\t\t * elements all at once and, ideally, from the top down (to preserve context).\n\t\t */\n\t\t_queueForRender() {\n\t\t\t// No point if already disconnected. Attempting to hit the parent element will trigger an error.\n\t\t\tif (!this.isConnected) {\n\t\t\t\tthis._debug('queueForRender(): skipped, already disconnected');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Skip the queue if a parent is already queued for render, but for the light DOM only. This is because if it's in the\n\t\t\t// light DOM slot, it will be disconnected and reconnected again (which will then also trigger a need to render).\n\t\t\tif (this.parentElement.closest('[data-svelte-retag-render=\"light\"]') !== null) {\n\t\t\t\tthis._debug('queueForRender(): skipped, light DOM parent is queued for render');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// When queuing for render, it's also necessary to identify the DOM rendering type. This is necessary for child\n\t\t\t// components which are *underneath* a parent that is using light DOM rendering (see above). This helps to ensure\n\t\t\t// rendering is performed in the correct order (useful for things like context).\n\t\t\tthis.setAttribute('data-svelte-retag-render', opts.shadow ? 'shadow' : 'light');\n\t\t\trequestAnimationFrame(renderElements);\n\t\t}\n\n\t\t/**\n\t\t * Renders (or rerenders) the Svelte component into this custom element based on the latest properties and slots\n\t\t * (with slots initialized elsewhere).\n\t\t *\n\t\t * IMPORTANT:\n\t\t *\n\t\t * Despite the intuitive name, this method is private since its functionality requires a deeper understanding\n\t\t * of how it depends on current internal state and how it alters internal state. Be sure to study how it's called\n\t\t * before calling it yourself externally. (\"Yarrr! Here be dragons! 🔥🐉\")\n\t\t *\n\t\t * That said... this is currently the workflow:\n\t\t *\n\t\t * 1. Wait for connection to DOM\n\t\t * 2. Ensure slots are properly prepared (e.g. in case of hydration) or observed (in case actively parsing DOM, e.g.\n\t\t * IIFE/UMD or shadow DOM) in case there are any changes *after* this render\n\t\t * 3. _queueForRender(): Kick off to requestAnimationFrame() to queue render of the component (instead of rendering\n\t\t * immediately) to ensure that all currently connected and available components are taken into account (this is\n\t\t * necessary for properly supporting context to prevent from initializing components out of order).\n\t\t * 4. renderElements(): Renders through the DOM tree in document order and from the top down (parent to child),\n\t\t * reaching this element instantiating this component, ensuring context is preserved.\n\t\t *\n\t\t */\n\t\t_renderSvelteComponent() {\n\t\t\tthis._debug('renderSvelteComponent()');\n\n\t\t\t// Fetch the latest set of available slot elements to use in the render. For light DOM, this must be done prior\n\t\t\t// to clearing inner HTML below since the slots exist there.\n\t\t\tif (opts.shadow) {\n\t\t\t\tthis.slotEls = this._getShadowSlots();\n\t\t\t} else {\n\t\t\t\tthis.slotEls = this._getLightSlots();\n\t\t\t}\n\n\t\t\t// On each rerender, we have to reset our root container since Svelte will just append to our target.\n\t\t\tthis._root.innerHTML = '';\n\n\t\t\t// Prep context, which is an important dependency prior to ANY instantiation of the Svelte component.\n\t\t\tconst context = this._getAncestorContext() || new Map();\n\n\t\t\t// Props always passed to Svelte component constructor.\n\t\t\tlet props = {\n\t\t\t\t$$scope: {},\n\n\t\t\t\t// Convert our list of slots into Svelte-specific slot objects\n\t\t\t\t$$slots: createSvelteSlots(this.slotEls),\n\n\t\t\t\t// All other *initial* props are pulled dynamically from element attributes (see proxy below)...\n\t\t\t};\n\n\t\t\t// Conveying props while translating them FROM a case-insensitive form like attributes (which are forced\n\t\t\t// case-insensitive) TO a case-sensitive form (which is required by the component) can be very tricky. This is\n\t\t\t// because we really cannot know the correct case until AFTER the component is instantiated. Therefore, a proxy is\n\t\t\t// a great way to infer the correct case, since by design, all components attempt to access ALL their props when\n\t\t\t// instantiated. Once accessed the first time for a particular tag, we no longer need to proxy since we know for\n\t\t\t// certain that the same tag will be used for any particular component (whose props will not change).\n\t\t\tif (!propMapCache.has(this.tagName)) {\n\t\t\t\t// Initialize mapping of props for this tag for use later. This way, we can avoid proxying on every single\n\t\t\t\t// component render/instantiation but also for attributeChangedCallback().\n\t\t\t\tthis.propMap = new Map();\n\t\t\t\tpropMapCache.set(this.tagName, this.propMap);\n\n\t\t\t\tprops = new Proxy(props, {\n\t\t\t\t\tget: (target, prop) => {\n\t\t\t\t\t\t// Warm cache with prop translations from forced lowercase to their real case.\n\t\t\t\t\t\tlet propName = prop.toString();\n\t\t\t\t\t\tif (prop.indexOf('$$') === -1) {\n\t\t\t\t\t\t\tthis.propMap.set(propName.toLowerCase(), propName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// While here, see if this attempted access matches an element attribute. Note, this lookup is\n\t\t\t\t\t\t// already case-insensitive, see: https://dom.spec.whatwg.org/#namednodemap\n\t\t\t\t\t\tlet attribValue = this.attributes.getNamedItem(propName);\n\t\t\t\t\t\tif (attribValue !== null) {\n\t\t\t\t\t\t\t// Before returning, ensure the prop is at least initialized on the target. This ensures that Vite HMR\n\t\t\t\t\t\t\t// will be aware that the prop exists when creating the proxied component (since it enumerates all props).\n\t\t\t\t\t\t\t// This prevents it from resetting back to the props default state during HMR reloads (the same as how it\n\t\t\t\t\t\t\t// works if the component were to have been defined inside of another Svelte component instead of as a\n\t\t\t\t\t\t\t// custom element here).\n\t\t\t\t\t\t\treturn target[propName] = attribValue.value;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// IMPORTANT: Unlike above, we SHOULD NOT be initializing target[propName] here, even though it could offer benefits\n\t\t\t\t\t\t\t// (like allowing the latest *evolved* prop value to be persisted after HMR updates). The reason is that\n\t\t\t\t\t\t\t// Svelte itself will *also* reset the prop to its default value after HMR updates *unless* the parent Svelte\n\t\t\t\t\t\t\t// component explicitly sets the prop. If we set it here, we would diverge from how Svelte handles undefined\n\t\t\t\t\t\t\t// props during HMR reloads.\n\n\t\t\t\t\t\t\t// Fail over to what would have otherwise been returned.\n\t\t\t\t\t\t\treturn target[prop];\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t} else {\n\t\t\t\t// Skip the proxying of props and just recycle the cached mapping to populate custom element attributes into the\n\t\t\t\t// props object with the correct case.\n\t\t\t\tthis.propMap = propMapCache.get(this.tagName);\n\t\t\t\tfor(let attr of [...this.attributes]) {\n\t\t\t\t\t// Note: Skip svelte-retag specific attributes (used for hydration purposes). This is not included in the ignored\n\t\t\t\t\t// attributes filter since it's a special case and cannot be overridden.\n\t\t\t\t\tif (attr.name.startsWith('data-svelte-retag')) continue;\n\t\t\t\t\tconst translatedName = this._translateAttribute(attr.name);\n\t\t\t\t\tif (translatedName !== null) {\n\t\t\t\t\t\tprops[translatedName] = attr.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Instantiate component into our root now, which is either the \"light DOM\" (i.e. directly under this element) or\n\t\t\t// in the shadow DOM.\n\t\t\tthis.componentInstance = new opts.component({ target: this._root, props: props, context });\n\n\t\t\t// Setup mutation observer to watch for changes to attributes on this element (if not already done) now that we\n\t\t\t// know the full set of component props. Only do this if configured and if the observer hasn't already been setup\n\t\t\t// (since we can render an element multiple times).\n\t\t\tif (opts.attributes === true && !this.attributesObserved) {\n\t\t\t\tthis.attributesObserved = true;\n\t\t\t\tif (this.propMap.size > 0) {\n\t\t\t\t\tattributeObserver.observe(this, {\n\t\t\t\t\t\tattributes: true, // implicit, but... 🤷‍♂️\n\t\t\t\t\t\tattributeFilter: [...this.propMap.keys()],\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// No props to observe, so no point in setting up the observer.\n\t\t\t\t\tthis._debug('renderSvelteComponent(): skipped attribute observer, no props');\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tthis._debug('renderSvelteComponent(): completed');\n\t\t}\n\n\t\t/**\n\t\t * Fetches slots from pre-rendered Svelte component HTML using special markers (either data attributes or custom\n\t\t * wrappers). Note that this will only work during initialization and only if the Svelte retag instance is\n\t\t * hydratable.\n\t\t */\n\t\t_hydrateLightSlots() {\n\t\t\t// Get the named slots inside the already rendered component by looking for our special data attribute.\n\t\t\tlet existingNamedSlots = this._root.querySelectorAll('[data-svelte-retag-slot]');\n\t\t\tfor(let slot of existingNamedSlots) {\n\t\t\t\t// Ensure we stick only to slots that belong to this element (avoid deeply nested components).\n\t\t\t\tlet slotParent = findSlotParent(slot);\n\t\t\t\tif (slotParent !== this._root) continue;\n\n\t\t\t\tlet slotName = slot.getAttribute('slot');\n\t\t\t\tthis.slotEls[slotName] = slot;\n\t\t\t}\n\n\t\t\t// If default slot content was used, it should still be wrapped in a special ,\n\t\t\t// which preserves all child nodes (including text nodes).\n\t\t\tlet existingDefaultSlot = this.querySelector('svelte-retag-default');\n\t\t\tif (existingDefaultSlot !== null) {\n\t\t\t\tthis.slotEls['default'] = existingDefaultSlot;\n\t\t\t}\n\n\t\t\t// Put all slots back to their original positions (including unwrapping default slot content) to\n\t\t\t// prepare for initial component render.\n\t\t\tthis._restoreLightSlots();\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t * Indicates if the provided element instance belongs to this custom element or not.\n\t\t *\n\t\t * @param {Element} slot\n\t\t * @returns {boolean}\n\t\t */\n\t\t_isOwnSlot(slot) {\n\t\t\tlet slotParent = findSlotParent(slot);\n\t\t\tif (slotParent === null) return false;\n\t\t\treturn (slotParent === this);\n\t\t}\n\n\t\t/**\n\t\t * Returns a map of slot names and the corresponding HTMLElement (named slots) or DocumentFragment (default slots).\n\t\t *\n\t\t * IMPORTANT: Since this custom element is the \"root\", these slots must be removed (which is done in THIS method).\n\t\t *\n\t\t * TODO: Problematic name. We are \"getting\" but we're also mangling/mutating state (which *is* necessary). \"Get\" may be confusing here; is there a better name?\n\t\t *\n\t\t * @returns {SlotList}\n\t\t */\n\t\t_getLightSlots() {\n\t\t\tthis._debug('_getLightSlots()');\n\t\t\tlet slots = {};\n\n\n\t\t\t/***************\n\t\t\t * NAMED SLOTS *\n\t\t\t ***************/\n\n\t\t\t// Look for named slots below this element. IMPORTANT: This may return slots nested deeper (see check in forEach below).\n\t\t\tconst queryNamedSlots = this.querySelectorAll('[slot]');\n\t\t\tfor(let candidate of queryNamedSlots) {\n\t\t\t\t// Skip this slot if it doesn't happen to belong to THIS custom element.\n\t\t\t\tif (!this._isOwnSlot(candidate)) continue;\n\n\t\t\t\tslots[candidate.slot] = candidate;\n\n\t\t\t\t// If this is a hydratable component, flag this slot so we can find it later once it has been relocated\n\t\t\t\t// under the fully rendered Svelte component (in the light DOM).\n\t\t\t\tif (opts.hydratable) {\n\t\t\t\t\tcandidate.setAttribute('data-svelte-retag-slot', '');\n\t\t\t\t}\n\n\t\t\t\t// TODO: Potentially problematic in edge cases where the browser may *oddly* return slots from query selector\n\t\t\t\t// above, yet their not actually a child of the current element. This seems to only happen if another\n\t\t\t\t// constructor() + connectedCallback() are BOTH called for this particular element again BEFORE a\n\t\t\t\t// disconnectedCallback() gets called (out of sync). Only experienced in Chrome when manually editing the HTML\n\t\t\t\t// when there were multiple other custom elements present inside the slot of another element (very edge case?)\n\t\t\t\tthis.removeChild(candidate);\n\t\t\t}\n\n\n\t\t\t/**************************\n\t\t\t * DEFAULT SLOT (UNNAMED) *\n\t\t\t **************************/\n\n\t\t\t// \"Unwrap\" the remainder of this tag by iterating through child nodes and placing them into a fragment which\n\t\t\t// we can use as our default slot. Importantly, we need to ensure we skip our special wrapper.\n\t\t\t// Here we use a special custom element that allows us to target it later in case we\n\t\t\t// need to hydrate it (e.g. tag was rendered via SSG/SSR and disconnectedCallback() was not run).\n\t\t\tlet fragment = document.createDocumentFragment();\n\n\t\t\t// For hydratable components, we have to nest these nodes under a tag that we can still recognize once\n\t\t\t// they're shifted inside of the fully rendered Svelte component, which could be anywhere.\n\t\t\tif (opts.hydratable) {\n\t\t\t\tfragment = document.createElement('svelte-retag-default');\n\t\t\t}\n\n\t\t\t// Important: The conversion of these children to an array is necessary since we are actually modifying the list by calling .appendChild().\n\t\t\tlet childNodes = [...this.childNodes];\n\t\t\tlet childHTML = '';\n\t\t\tfor(let childNode of childNodes) {\n\t\t\t\tif (childNode instanceof HTMLElement && childNode.tagName === 'SVELTE-RETAG') {\n\t\t\t\t\tthis._debug('_getLightSlots(): skipping container');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Unfortunately, we must manually build HTML because DocumentFragment can be problematic with this:\n\t\t\t\t// 1. Deep clone is required in order to put it into another HTMLElement, might be slow\n\t\t\t\t// 2. Deep clone doesn't work in unit tests\n\t\t\t\tif (childNode instanceof Text) {\n\t\t\t\t\tchildHTML += childNode.textContent;\n\t\t\t\t} else if (childNode.outerHTML) {\n\t\t\t\t\tchildHTML += childNode.outerHTML;\n\t\t\t\t}\n\n\t\t\t\tfragment.appendChild(childNode);\n\t\t\t}\n\n\t\t\t// Now that we've rebuilt the default slot content, it could actually be empty (or just whitespace). So, we\n\t\t\t// have to check the HTML in the fragment to see if it has anything in it before trying to use it.\n\t\t\tif (childHTML.trim() !== '') {\n\t\t\t\t// Now that we've detected remaining content, we've got to make suer we don't already have an explicitly\n\t\t\t\t// named \"default\" slot. If one does exist, then we have a conflict.\n\t\t\t\tif (slots.default) {\n\t\t\t\t\t// Edge case: User has a named \"default\" as well as remaining HTML left over. Use same error as Svelte.\n\t\t\t\t\tconsole.error(`svelteRetag: '${this.tagName}': Found elements without slot attribute when using slot=\"default\"`);\n\t\t\t\t} else {\n\t\t\t\t\tslots.default = fragment;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn slots;\n\t\t}\n\n\t\t/**\n\t\t * Go through originally removed slots and restore back to the custom element.\n\t\t */\n\t\t_restoreLightSlots() {\n\t\t\tthis._debug('_restoreLightSlots:', this.slotEls);\n\n\t\t\tfor(let slotName in this.slotEls) {\n\t\t\t\tlet slotEl = this.slotEls[slotName];\n\n\t\t\t\t// Prepend back so that in case more default slot content has arrived, we can rebuild it in order. This is\n\t\t\t\t// important if we're executing during document.readyState === 'loading' (i.e. IIFE and not module).\n\t\t\t\tif (slotEl.tagName === 'SVELTE-RETAG-DEFAULT') {\n\t\t\t\t\tthis.prepend(unwrap(slotEl));\n\t\t\t\t} else {\n\t\t\t\t\tthis.prepend(slotEl);\n\n\t\t\t\t\t// If hydration was enabled for this particular element (not necessarily for the current context),\n\t\t\t\t\t// we should clean up hydration-specific attributes for consistency.\n\t\t\t\t\tif (slotEl instanceof HTMLElement && slotEl.hasAttribute('data-svelte-retag-slot')) {\n\t\t\t\t\t\tslotEl.removeAttribute('data-svelte-retag-slot');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Since the slots are back in the original element, we should clean up our reference to them. This is because,\n\t\t\t// symbolically and semantically at least, we think of this variable as a holding area ONCE they've been removed.\n\t\t\tthis.slotEls = {};\n\t\t}\n\n\t\t/**\n\t\t * Fetches and returns references to the existing shadow DOM slots. Left unmodified.\n\t\t *\n\t\t * @returns {SlotList}\n\t\t */\n\t\t_getShadowSlots() {\n\t\t\tthis._debug('_getShadowSlots()');\n\t\t\tconst namedSlots = this.querySelectorAll('[slot]');\n\t\t\tlet slots = {};\n\t\t\tlet htmlLength = this.innerHTML.length;\n\t\t\tnamedSlots.forEach(n => {\n\t\t\t\tslots[n.slot] = document.createElement('slot');\n\t\t\t\tslots[n.slot].setAttribute('name', n.slot);\n\t\t\t\thtmlLength -= n.outerHTML.length;\n\t\t\t});\n\t\t\tif (htmlLength > 0) {\n\t\t\t\tslots.default = document.createElement('slot');\n\t\t\t}\n\t\t\treturn slots;\n\t\t}\n\n\t\t/**\n\t\t * Toggle on/off the MutationObserver used to watch for changes in child slots.\n\t\t */\n\t\t_observeSlots(begin) {\n\t\t\t// While MutationObserver de-duplicates requests for us, this helps us with reducing noise while debugging.\n\t\t\tif (begin === this.slotObserverActive) return;\n\n\t\t\t// Setup our slot observer if not done already.\n\t\t\tif (!this.slotObserver) {\n\t\t\t\tthis.slotObserver = new MutationObserver((mutations) => {\n\t\t\t\t\tthis._processSlotMutations(mutations);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (begin) {\n\t\t\t\t// Subtree: Typically, slots (both default and named) are only ever added directly below. So, keeping\n\t\t\t\t// subtree false for now since this could be important for light DOM.\n\t\t\t\tthis.slotObserver.observe(this, { childList: true, subtree: false, attributes: false });\n\t\t\t\tthis._debug('_observeSlots: OBSERVE');\n\t\t\t} else {\n\t\t\t\tthis.slotObserver.disconnect();\n\t\t\t\tthis._debug('_observeSlots: DISCONNECT');\n\t\t\t}\n\n\t\t\tthis.slotObserverActive = begin;\n\t\t}\n\n\t\t/**\n\t\t * Watches for slot changes, specifically:\n\t\t *\n\t\t * 1. Shadow DOM: All slot changes will queue a rerender of the Svelte component\n\t\t *\n\t\t * 2. Light DOM: Only additions will be accounted for. This is particularly because currently we only support\n\t\t * watching for changes during document parsing (i.e. document.readyState === 'loading', prior to the\n\t\t * 'DOMContentLoaded' event.\n\t\t *\n\t\t * @param {MutationRecord[]} mutations\n\t\t */\n\t\t_processSlotMutations(mutations) {\n\t\t\tthis._debug('_processSlotMutations()', mutations);\n\n\t\t\t// Rerender if one of the mutations is of a child element.\n\t\t\tlet rerender = false;\n\t\t\tfor(let mutation of mutations) {\n\t\t\t\tif (mutation.type === 'childList') {\n\t\t\t\t\t// For shadow DOM, it's alright if it's a removal.\n\t\t\t\t\tif (opts.shadow) {\n\t\t\t\t\t\trerender = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// For light DOM, it only matters to rerender on newly added nodes. This is because we're only watching for\n\t\t\t\t\t\t// mutations during initial document parsing. Node removals can happen during the retrieval of light slots in\n\t\t\t\t\t\t// _getLightSlots(). These are necessary, but may cascade into an infinite loop if we're not very careful here.\n\t\t\t\t\t\tif (mutation.addedNodes.length > 0) {\n\t\t\t\t\t\t\trerender = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (rerender) {\n\t\t\t\tif (!opts.shadow) {\n\t\t\t\t\t// For light DOM, ensure original slots are available by prepending them back to the DOM so we can fetch the\n\t\t\t\t\t// latest content. This is important in case the newly visible nodes are part of default content (not just\n\t\t\t\t\t// named slots)\n\t\t\t\t\tthis._observeSlots(false);\n\t\t\t\t\tthis._restoreLightSlots();\n\t\t\t\t\tthis._observeSlots(true);\n\t\t\t\t}\n\n\t\t\t\t// Force a rerender now.\n\t\t\t\tthis._debug('_processMutations(): Queue rerender');\n\t\t\t\tthis._queueForRender();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Pass through to console.log() but includes a reference to the custom element in the log for easier targeting for\n\t\t * debugging purposes.\n\t\t *\n\t\t * @param {...*}\n\t\t */\n\t\t_debug() {\n\t\t\tif (opts.debugMode) {\n\t\t\t\tif (opts.debugMode === 'cli') {\n\t\t\t\t\tconsole.log.apply(null, [performance.now(), this.tagName, ...arguments]);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log.apply(null, [performance.now(), this, ...arguments]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}\n","/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n","import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not \n\n\tlet children = /** @type {ArrayLike} */ (target.childNodes);\n\t// If target is , there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tif (claimed_nodes.length === 0) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364 target for