PageSourceSearch

https://montefioreeinstein.org/sites/default/files/js/js_kWZNu7cbt…JT5notWERHN7JI7jpvJL7BGPjViHHuSqcq3mBVGtlfg

js montefioreeinstein.org collected 2026-09-24 17:57:42 UTC 463,313 bytes, 27 lines download raw bytes

1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
2!function(){"use strict";const SCOPE=Symbol(0);let scheduledEffects=!1,runningEffects=!1,currentScope=null,currentObserver=null,currentObservers=null,currentObserversIndex=0,effects=[],defaultContext={};const NOOP=()=>{};function runEffects(){if(effects.length){runningEffects=!0;for(let i=0;i<effects.length;i++)0!==effects[i].$st&&runTop(effects[i]);effects=[],scheduledEffects=!1,runningEffects=!1;}else scheduledEffects=!1;}function runTop(node){let ancestors=[node];for(;node=node[SCOPE];)node.$e&&0!==node.$st&&ancestors.push(node);for(let i=ancestors.length-1;i>=0;i--)updateCheck(ancestors[i]);}function peek(fn){return compute(currentScope,fn,null);}function untrack(fn){return compute(null,fn,null);}function tick(){runningEffects||runEffects();}function getScope(){return currentScope;}function scoped(run,scope){try{return compute(scope,run,null);}catch(error){return void handleError(scope,error);}}function getContext(key,scope=currentScope){return scope?.$cx[key];}function onDispose(disposable){if(!disposable||!currentScope)return disposable||NOOP;const node=currentScope;return node.$d?Array.isArray(node.$d)?node.$d.push(disposable):node.$d=[node.$d,disposable]:node.$d=disposable,function(){3!==node.$st&&(disposable.call(null),isFunction$1(node.$d)?node.$d=null:Array.isArray(node.$d)&&node.$d.splice(node.$d.indexOf(disposable),1));};}function dispose(self=!0){if(3!==this.$st){if(this.$h)if(Array.isArray(this.$h)){for(let i=this.$h.length-1;i>=0;i--)dispose.call(this.$h[i]);}else dispose.call(this.$h);if(self){const parent=this[SCOPE];parent&&(Array.isArray(parent.$h)?parent.$h.splice(parent.$h.indexOf(this),1):parent.$h=null),function(node){node.$st=3,node.$d&&emptyDisposal(node);node.$s&&removeSourceObservers(node,0);node[SCOPE]=null,node.$s=null,node.$o=null,node.$h=null,node.$cx=defaultContext,node.$eh=null;}(this);}}}function emptyDisposal(scope){try{if(Array.isArray(scope.$d)){for(let i=scope.$d.length-1;i>=0;i--){const callable=scope.$d[i];callable.call(callable);}}else scope.$d.call(scope.$d);scope.$d=null;}catch(error){handleError(scope,error);}}function compute(scope,compute2,observer){const prevScope=currentScope,prevObserver=currentObserver;currentScope=scope,currentObserver=observer;try{return compute2.call(scope);}finally{currentScope=prevScope,currentObserver=prevObserver;}}function handleError(scope,error){if(!scope||!scope.$eh)throw error;let i=0,len=scope.$eh.length,currentError=error;for(i=0;i<len;i++)try{scope.$eh[i](currentError);break;}catch(error2){currentError=error2;}if(i===len)throw currentError;}function read(){return 3===this.$st||(currentObserver&&!this.$e&&(!currentObservers&&currentObserver.$s&&currentObserver.$s[currentObserversIndex]==this?currentObserversIndex++:currentObservers?currentObservers.push(this):currentObservers=[this]),this.$c&&updateCheck(this)),this.$v;}function write(newValue){const value=isFunction$1(newValue)?newValue(this.$v):newValue;if(this.$ch(this.$v,value)&&(this.$v=value,this.$o)){for(let i=0;i<this.$o.length;i++)notify(this.$o[i],2);}return this.$v;}const ScopeNode=function(){this[SCOPE]=null,this.$h=null,currentScope&&currentScope.append(this);},ScopeProto=ScopeNode.prototype;ScopeProto.$cx=defaultContext,ScopeProto.$eh=null,ScopeProto.$c=null,ScopeProto.$d=null,ScopeProto.append=function(child){child[SCOPE]=this,this.$h?Array.isArray(this.$h)?this.$h.push(child):this.$h=[this.$h,child]:this.$h=child,child.$cx=child.$cx===defaultContext?this.$cx:{...this.$cx,...child.$cx},this.$eh&&(child.$eh=child.$eh?[...child.$eh,...this.$eh]:this.$eh);},ScopeProto.dispose=function(){dispose.call(this);};const ComputeNode=function(initialValue,compute2,options){ScopeNode.call(this),this.$st=compute2?2:0,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=initialValue,compute2&&(this.$c=compute2),options&&options.dirty&&(this.$ch=options.dirty);},ComputeProto=ComputeNode.prototype;function createComputation(initialValue,compute2,options){return new ComputeNode(initialValue,compute2,options);}function isFunction$1(value){return "function"==typeof value;}function updateCheck(node){if(1===node.$st){for(let i=0;i<node.$s.length&&(updateCheck(node.$s[i]),2!==node.$st);i++);}2===node.$st?update(node):node.$st=0;}function update(node){let prevObservers=currentObservers,prevObserversIndex=currentObserversIndex;currentObservers=null,currentObserversIndex=0;try{!function(node){node.$h&&dispose.call(node,!1),node.$d&&empty
2Disposal(node),node.$eh=node[SCOPE]?node[SCOPE].$eh:null;}(node);const result=compute(node,node.$c,node);updateObservers(node),!node.$e&&node.$i?write.call(node,result):(node.$v=result,node.$i=!0);}catch(error){updateObservers(node),handleError(node,error);}finally{currentObservers=prevObservers,currentObserversIndex=prevObserversIndex,node.$st=0;}}function updateObservers(node){if(currentObservers){if(node.$s&&removeSourceObservers(node,currentObserversIndex),node.$s&&currentObserversIndex>0){node.$s.length=currentObserversIndex+currentObservers.length;for(let i=0;i<currentObservers.length;i++)node.$s[currentObserversIndex+i]=currentObservers[i];}else node.$s=currentObservers;let source;for(let i=currentObserversIndex;i<node.$s.length;i++)source=node.$s[i],source.$o?source.$o.push(node):source.$o=[node];}else node.$s&&currentObserversIndex<node.$s.length&&(removeSourceObservers(node,currentObserversIndex),node.$s.length=currentObserversIndex);}function notify(node,state){if(!(node.$st>=state)&&(node.$e&&0===node.$st&&(effects.push(node),scheduledEffects||(scheduledEffects=!0,queueMicrotask(runEffects))),node.$st=state,node.$o)){for(let i=0;i<node.$o.length;i++)notify(node.$o[i],1);}}function removeSourceObservers(node,index){let source,swap;for(let i=index;i<node.$s.length;i++)source=node.$s[i],source.$o&&(swap=source.$o.indexOf(node),source.$o[swap]=source.$o[source.$o.length-1],source.$o.pop());}function noop(...args){}function isNull(value){return null===value;}function isUndefined(value){return void 0===value;}function isNumber(value){return "number"==typeof value&&!Number.isNaN(value);}function isString(value){return "string"==typeof value;}function isArray(value){return Array.isArray(value);}Object.setPrototypeOf(ComputeProto,ScopeProto),ComputeProto.$ch=function(a,b){return a!==b;},ComputeProto.call=read;const EVENT=class{},DOM_EVENT=Symbol("DOM_EVENT");class DOMEvent extends EVENT{[DOM_EVENT]=!0;detail;triggers=new EventTriggers();get trigger(){return this.triggers.source;}get originEvent(){return this.triggers.origin;}get isOriginTrusted(){return this.triggers.origin?.isTrusted??!1;}constructor(type,...init){super(type,init[0]),this.detail=init[0]?.detail;const trigger=init[0]?.trigger;trigger&&this.triggers.add(trigger);}}class EventTriggers{chain=[];get source(){return this.chain[0];}get origin(){return this.chain[this.chain.length-1];}add(event){this.chain.push(event),function(event){return !!event?.[DOM_EVENT];}(event)&&this.chain.push(...event.triggers);}remove(event){return this.chain.splice(this.chain.indexOf(event),1)[0];}has(event){return this.chain.some((e)=>e===event);}hasType(type){return !!this.findType(type);}findType(type){return this.chain.find((e)=>e.type===type);}walk(callback){for(const event of this.chain){const returnValue=callback(event);if(returnValue)return [event,returnValue];}}[Symbol.iterator](){return this.chain.values();}}class EventsTarget extends EventTarget{$ts__events;addEventListener(type,callback,options){return super.addEventListener(type,callback,options);}removeEventListener(type,callback,options){return super.removeEventListener(type,callback,options);}}function listenEvent(target,type,handler,options){return noop;}class EventsController{#target;#controller;get signal(){return this.#controller.signal;}constructor(target){this.#target=target,this.#controller=new AbortController(),onDispose(this.abort.bind(this));}add(type,handler,options){if(this.signal.aborted)throw Error("aborted");return this.#target.addEventListener(type,handler,{...options,signal:options?.signal?anySignal(this.signal,options.signal):this.signal}),this;}remove(type,handler){return this.#target.removeEventListener(type,handler),this;}abort(reason){this.#controller.abort(reason);}}function anySignal(...signals){const controller=new AbortController(),options={signal:controller.signal};function onAbort(event){controller.abort(event.target.reason);}for(const signal of signals){if(signal.aborted){controller.abort(signal.reason);break;}signal.addEventListener("abort",onAbort,options);}return controller.signal;}function isKeyboardEvent(event){return !!event?.type.startsWith("key");}function isKeyboardClick(event){return isKeyboardEvent(event)&&("Enter"===event.key||" "===event.key);}function setAttribute(host,name,value){if(host)if(value||""===value||0===value){const attrValue=!0===value?"":value+"";host.getAttribute(name)!==attrValue&&host.setAttribute(name,attrValue);}else host.removeAttribute(name);}function setStyle(host,property,value){host&&(value||0===value?host.style.setProperty(property,value+""):host.style.removeProperty(property));}function signal(initialValue,options){const node=createComputation(initialValue,null,options),signal2=read.bind(node);return signal2[SCOPE]=!0,signal2.set=write.bind(node),signal2;}
2function computed(compute,options){const node=createComputation(options?.initial,compute,options),signal2=read.bind(node);return signal2[SCOPE]=!0,signal2;}function isWriteSignal(fn){return function(fn){return isFunction$1(fn)&&SCOPE in fn;}(fn)&&"set" in fn;}function createContext(provide){return {id:Symbol(),provide};}function provideContext(context,value,scope=getScope()){const hasProvidedValue=!isUndefined(value);!function(key,value,scope=currentScope){scope&&(scope.$cx={...scope.$cx,[key]:value});}(context.id,hasProvidedValue?value:context.provide?.(),scope);}function useContext(context){return getContext(context.id);}function hasProvidedContext(context){return !isUndefined(getContext(context.id));}const PROPS=Symbol(0),METHODS=Symbol(0);class ViewController extends EventTarget{$$;get el(){return this.$$.el;}get $el(){return this.$$.$el();}get scope(){return this.$$.scope;}get attachScope(){return this.$$.attachScope;}get connectScope(){return this.$$.connectScope;}get $props(){return this.$$.props;}get $state(){return this.$$.$state;}get state(){return this.$$.state;}constructor(){super();}attach({$$}){return this.$$=$$,$$.addHooks(this),this;}addEventListener(type,callback,options){this.listen(type,callback,options);}removeEventListener(type,callback,options){this.el?.removeEventListener(type,callback,options);}setAttributes(attributes){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,attributes);}setStyles(styles){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,styles);}setCSSVars(vars){this.setStyles(vars);}createEvent(type,...init){return new DOMEvent(type,init[0]);}dispatch(type,...init){return !1;}dispatchEvent(event){return this.dispatch(event);}listen(type,handler,options){return noop;}}const effect=function(effect2,options){if("undefined"!=typeof process&&"test"===process.env?.NODE_ENV)return function(effect2){const signal2=createComputation(null,function(){let effectResult=effect2();return isFunction$1(effectResult)&&onDispose(effectResult),null;},void 0);return signal2.$e=!0,update(signal2),dispose.bind(signal2,!0);}(effect2);return noop;};class Component extends ViewController{subscribe(callback){return scoped(()=>effect(()=>callback(this.state)),this.$$.scope);}destroy(){this.$$.destroy();}}function prop(target,propertyKey,descriptor){target[PROPS]||(target[PROPS]=new Set()),target[PROPS].add(propertyKey);}function method(target,propertyKey,descriptor){target[METHODS]||(target[METHODS]=new Set()),target[METHODS].add(propertyKey);}class State{id=Symbol(0);record;#descriptors;constructor(record){this.record=record,this.#descriptors=Object.getOwnPropertyDescriptors(record);}create(){const store={},state=new Proxy(store,{get:(_,prop2)=>store[prop2]()});for(const name of Object.keys(this.record)){const getter=this.#descriptors[name].get;store[name]=getter?computed(getter.bind(state)):signal(this.record[name]);}return store;}reset(record,filter){for(const name of Object.keys(record))this.#descriptors[name].get||filter&&!filter(name)||record[name].set(this.record[name]);}}function useState(state){return useContext(state);}function camelToKebabCase(str){return str.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();}function ariaBool$1(value){return value?"true":"false";}function deferredPromise(){let resolve,reject;return {promise:new Promise((res,rej)=>{resolve=res,reject=rej;}),resolve,reject};}function animationFrameThrottle(func){return noop;}var key={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},webkit=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],moz=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],ms=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],document$1="undefined"!=typeof window&&void 0!==window.document?window.document:{},vendor="fullscreenEnabled" in document$1&&Object.keys(key)||webkit[0] in document$1&&webkit||moz[0] in document$1&&moz||ms[0] in document$1&&ms||[],fscreen={requestFullscreen:function(element){return element[vendor[key.requestFullscreen]]();},requestFullscreenFunction:function(element){return element[vendor[key.requestFullscreen]];},get exitFullscreen(){return document$1[vendor[key.exitFullscreen]].bind(document$1);},get fullscreenPseudoClass(){return ":"+vendor[key.fullscreen];},addEventListener:function(type,handler,options){return document$1.addEventListener(vendor[key[type]],handler,options);},removeEventListener:function(type,handler,options){return document$1.removeEventListener(vendor[key[type]],handler,options);},get fullscreenEnabled(){return Boolean(document$1[vendor[key.fullscreenEnabled]]);},set fullscreenEnabled(val){},get fullscreenElement(){return document$1[vendor[key.fullscreenElement]];},set fullscreenElement(val){},get onfullscreenchange(){return document$1[("on"+vendor[key.fullscreenchange]).toLowerCase()];},set onfullscreenchange(handler){return document$1[("on"+vendor[key.fullscreenchange]).toLowerCase()]=handler;},get onfullscreenerror(){return document$1[("on"+vendor[key.fullscreenerror]).toLowerCase()];},set onfullscreenerror(handler){return document$1[("on"+vendor[key.fullscreenerror]).toLowerCase()]=handler;}},functionThrottle=function(fn,interval,options){var timeoutId=null,throttledFn=null,leading=options&&options.leading,trailing=options&&options.trailing;null==leading&&(leading=!0);null==trailing&&(trailing=!leading);1==leading&&(trailing=!1);var cancel=function(){timeoutId&&(clearTimeout(timeoutId),timeoutId=null);},throttleWrapper=function(){var callNow=leading&&!timeoutId,context=this,args=arguments;if(throttledFn=function(){return fn.apply(context,args);},timeoutId||(timeoutId=setTimeout(function(){if(timeoutId=null,trailing)return throttledFn();},interval)),callNow)return callNow=!1,throttledFn();};return throttleWrapper.cancel=cancel,throttleWrapper.flush=function(){var call=throttledFn;cancel(),call&&call();},throttleWrapper;};var functionDebounce=function(fn,wait,callFirst){var timeout=null,debouncedFn=null,clear=function(){timeout&&(clearTimeout(timeout),debouncedFn=null,timeout=null);},debounceWrapper=function(){if(!wait)return fn.apply(this,arguments);var context=this,args=arguments,callNow=callFirst&&!timeout;return clear(),debouncedFn=function(){fn.apply(context,args);},timeout=setTimeout(function(){if(timeout=null,!callNow){var call=debouncedFn;return debouncedFn=null,call();}},wait),callNow?debouncedFn():void 0;};return debounceWrapper.cancel=clear,debounceWrapper.flush=function(){var call=debouncedFn;clear(),call&&call();},debounceWrapper;};const t=(t2)=>"object"==typeof t2&&null!=t2&&1===t2.nodeType,e=(t2,e2)=>
2(!e2||"hidden"!==t2)&&"visible"!==t2&&"clip"!==t2,n=(t2,n2)=>{if(t2.clientHeight<t2.scrollHeight||t2.clientWidth<t2.scrollWidth){const o2=getComputedStyle(t2,null);return e(o2.overflowY,n2)||e(o2.overflowX,n2)||((t3)=>{const e2=((t4)=>{if(!t4.ownerDocument||!t4.ownerDocument.defaultView)return null;try{return t4.ownerDocument.defaultView.frameElement;}catch(t5){return null;}})(t3);return !!e2&&(e2.clientHeight<t3.scrollHeight||e2.clientWidth<t3.scrollWidth);})(t2);}return !1;},o$1=(t2,e2,n2,o2,l2,r2,i,s)=>r2<t2&&i>e2||r2>t2&&i<e2?0:r2<=t2&&s<=n2||i>=e2&&s>=n2?r2-t2-o2:i>e2&&s<n2||r2<t2&&s>n2?i-e2+l2:0,l$1=(t2)=>{const e2=t2.parentElement;return null==e2?t2.getRootNode().host||null:e2;};async function canChangeVolume(){const video=document.createElement("video");var delay;return video.volume=.5,await (delay=0,new Promise((resolve)=>setTimeout(resolve,delay))),.5===video.volume;}class TimeRange{#ranges;get length(){return this.#ranges.length;}constructor(start,end){isArray(start)?this.#ranges=start:isUndefined(start)||isUndefined(end)?this.#ranges=[]:this.#ranges=[[start,end]];}start(index){return this.#ranges[index][0]??1/0;}end(index){return this.#ranges[index][1]??1/0;}}function getTimeRangesStart(range){if(!range.length)return null;let min=range.start(0);for(let i=1;i<range.length;i++){const value=range.start(i);value<min&&(min=value);}return min;}function getTimeRangesEnd(range){if(!range.length)return null;let max=range.end(0);for(let i=1;i<range.length;i++){const value=range.end(i);value>max&&(max=value);}return max;}function updateTimeIntervals(intervals,interval,value){let start=interval[0],end=interval[1];return value<start?[value,-1]:value===start?interval:-1===start?(interval[0]=value,interval):(value>start&&(interval[1]=value,-1===end&&intervals.push(interval)),function(intervals){if(intervals.length<=1)return intervals;intervals.sort((a,b)=>a[0]-b[0]);let normalized=[],current=intervals[0];for(let i=1;i<intervals.length;i++){const next=intervals[i];current[1]>=next[0]-1?current=[current[0],Math.max(current[1],next[1])]:(normalized.push(current),current=next);}normalized.push(current);}(intervals),interval);}const AUDIO_EXTENSIONS=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,AUDIO_TYPES=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),VIDEO_EXTENSIONS=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,VIDEO_TYPES=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),HLS_VIDEO_EXTENSIONS=/\.(m3u8)($|\?)/i,DASH_VIDEO_EXTENSIONS=/\.(mpd)($|\?)/i,HLS_VIDEO_TYPES=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),DASH_VIDEO_TYPES=new Set(["application/dash+xml"]);function isHLSSrc({src,type}){return isString(src)&&HLS_VIDEO_EXTENSIONS.test(src)||HLS_VIDEO_TYPES.has(type);}function isDASHSrc({src,type}){return isString(src)&&DASH_VIDEO_EXTENSIONS.test(src)||DASH_VIDEO_TYPES.has(type);}const pendingRequests={};function getRequestCredentials(crossOrigin){return "use-credentials"===crossOrigin?"include":isString(crossOrigin)?"same-origin":void 0;}const CROSS_ORIGIN=Symbol(0),READY_STATE=Symbol(0),UPDATE_ACTIVE_CUES=Symbol(0),CAN_LOAD=Symbol(0),ON_MODE_CHANGE=Symbol(0),NATIVE=Symbol(0),NATIVE_HLS=Symbol(0),TextTrackSymbol_crossOrigin=CROSS_ORIGIN,TextTrackSymbol_readyState=READY_STATE,TextTrackSymbol_updateActiveCues=UPDATE_ACTIVE_CUES,TextTrackSymbol_canLoad=CAN_LOAD,TextTrackSymbol_onModeChange=ON_MODE_CHANGE,TextTrackSymbol_native=NATIVE,TextTrackSymbol_nativeHLS=NATIVE_HLS;function isCueActive(cue,time){return time>=cue.startTime&&time<cue.endTime;}function watchActiveTextTrack(tracks,kind,onChange){let currentTrack=null,scope=getScope();return function(){const kinds=isString(kind)?[kind]:kind,track=tracks.toArray().find((track2)=>kinds.includes(track2.kind)&&"showing"===track2.mode);if(track!==currentTrack){if(!track)return onChange(null),void (currentTrack=null);2==track.readyState?onChange(track):(onChange(null),scoped(()=>{},scope)),currentTrack=track;}}(),listenEvent();}
2class TextTrack extends EventsTarget{static createId(track){return `vds-${track.type}-${track.kind}-${track.src??track.label??"?"}`;}src;content;type;encoding;id="";label="";language="";kind;default=!1;#canLoad=!1;#currentTime=0;#mode="disabled";#metadata={};#regions=[];#cues=[];#activeCues=[];[TextTrackSymbol_readyState]=0;[TextTrackSymbol_crossOrigin];[TextTrackSymbol_onModeChange]=null;[TextTrackSymbol_native]=null;get metadata(){return this.#metadata;}get regions(){return this.#regions;}get cues(){return this.#cues;}get activeCues(){return this.#activeCues;}get readyState(){return this[TextTrackSymbol_readyState];}get mode(){return this.#mode;}set mode(mode){this.setMode(mode);}constructor(init){super();for(const prop of Object.keys(init))this[prop]=init[prop];this.type||(this.type="vtt"),init.src||(this[TextTrackSymbol_readyState]=2);}addCue(cue,trigger){let i=0,length=this.#cues.length;for(i=0;i<length&&!(cue.endTime<=this.#cues[i].startTime);i++);i===length?this.#cues.push(cue):this.#cues.splice(i,0,cue),cue instanceof TextTrackCue||this[TextTrackSymbol_native]?.track.addCue(cue),this.dispatchEvent(new DOMEvent("add-cue",{detail:cue,trigger})),isCueActive(cue,this.#currentTime)&&this[TextTrackSymbol_updateActiveCues](this.#currentTime,trigger);}removeCue(cue,trigger){const index=this.#cues.indexOf(cue);if(index>=0){const isActive=this.#activeCues.includes(cue);this.#cues.splice(index,1),this[TextTrackSymbol_native]?.track.removeCue(cue),this.dispatchEvent(new DOMEvent("remove-cue",{detail:cue,trigger})),isActive&&this[TextTrackSymbol_updateActiveCues](this.#currentTime,trigger);}}setMode(mode,trigger){this.#mode!==mode&&(this.#mode=mode,"disabled"===mode?(this.#activeCues=[],this.#activeCuesChanged()):2===this.readyState?this[TextTrackSymbol_updateActiveCues](this.#currentTime,trigger):this.#load(),this.dispatchEvent(new DOMEvent("mode-change",{detail:this,trigger})),this[TextTrackSymbol_onModeChange]?.());}[TextTrackSymbol_updateActiveCues](currentTime,trigger){if(this.#currentTime=currentTime,"disabled"===this.mode||!this.#cues.length)return;const activeCues=[];for(let i=0,length=this.#cues.length;i<length;i++){const cue=this.#cues[i];isCueActive(cue,currentTime)&&activeCues.push(cue);}let changed=activeCues.length!==this.#activeCues.length;if(!changed){for(let i=0;i<activeCues.length;i++)if(!this.#activeCues.includes(activeCues[i])){changed=!0;break;}}this.#activeCues=activeCues,changed&&this.#activeCuesChanged(trigger);}[TextTrackSymbol_canLoad](){this.#canLoad=!0,"disabled"!==this.#mode&&this.#load();}#parseContent(init){Promise.resolve().then(function(){return prod;}).then(({parseText,VTTCue,VTTRegion})=>{isString(init.content)&&"json"!==init.type?parseText(init.content,{type:init.type}).then(({cues,regions})=>{this.#cues=cues,this.#regions=regions,this.#ready();}):(this.#parseJSON(init.content,VTTCue,VTTRegion),3!==this.readyState&&this.#ready());});}async #load(){if(this.#canLoad&&!(this[TextTrackSymbol_readyState]>0))if(this[TextTrackSymbol_readyState]=1,this.dispatchEvent(new DOMEvent("load-start")),this.src)try{const {parseResponse,VTTCue,VTTRegion}=await Promise.resolve().then(function(){return prod;}),crossOrigin=this[TextTrackSymbol_crossOrigin]?.(),response=fetch(this.src,{headers:"json"===this.type?{"Content-Type":"application/json"}:void 0,credentials:getRequestCredentials(crossOrigin)});if("json"===this.type)this.#parseJSON(await (await response).text(),VTTCue,VTTRegion);else{const {errors,metadata,regions,cues}
2=await parseResponse(response,{type:this.type,encoding:this.encoding});if(0===errors[0]?.code)throw errors[0];this.#metadata=metadata,this.#regions=regions,this.#cues=cues;}this.#ready();}catch(error){this.#error(error);}else this.#ready();}#ready(){if(this[TextTrackSymbol_readyState]=2,!this.src||"vtt"!==this.type){const native=this[TextTrackSymbol_native];if(native&&!native.managed){for(const cue of this.#cues)native.track.addCue(cue);}}const loadEvent=new DOMEvent("load");this[TextTrackSymbol_updateActiveCues](this.#currentTime,loadEvent),this.dispatchEvent(loadEvent);}#error(error){this[TextTrackSymbol_readyState]=3,this.dispatchEvent(new DOMEvent("error",{detail:error}));}#parseJSON(json,VTTCue,VTTRegion){try{const {regions,cues}=function(json,Cue,Region){const content=isString(json)?JSON.parse(json):json;let regions=[],cues=[];content.regions&&Region&&(regions=content.regions.map((region)=>Object.assign(new Region(),region)));(content.cues||isArray(content))&&(cues=(isArray(content)?content:content.cues).filter((content2)=>isNumber(content2.startTime)&&isNumber(content2.endTime)).map((cue)=>Object.assign(new Cue(0,0,""),cue)));return {regions,cues};}(json,VTTCue,VTTRegion);this.#regions=regions,this.#cues=cues;}catch(error){this.#error(error);}}#activeCuesChanged(trigger){this.dispatchEvent(new DOMEvent("cue-change",{trigger}));}}const captionRE=/captions|subtitles/;function isTrackCaptionKind(track){return captionRE.test(track.kind);}const mediaState=new State({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new TimeRange(),canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:!1,canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControl
2s(){return false;},get nativeControls(){return this.controls||this.iOSControls;},controlsVisible:!1,get controlsHidden(){return !this.controlsVisible;},crossOrigin:null,ended:!1,error:null,fullscreen:!1,get loop(){return this.providedLoop||this.userPrefersLoop;},logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new TimeRange(),playing:!1,playsInline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,canSetPlaybackRate:!0,canSetVolume:!1,canSetAudioGain:!1,seekable:new TimeRange(),seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(isTrackCaptionKind).length>0;},volume:1,waiting:!1,realCurrentTime:0,get currentTime(){return this.ended?this.duration:this.clipStartTime>0?Math.max(0,Math.min(this.realCurrentTime-this.clipStartTime,this.duration)):this.realCurrentTime;},providedDuration:-1,intrinsicDuration:0,get duration(){return this.seekableWindow;},get title(){return this.providedTitle||this.inferredTitle;},get poster(){return this.providedPoster||this.inferredPoster;},get viewType(){return "unknown"!==this.providedViewType?this.providedViewType:this.inferredViewType;},get streamType(){return "unknown"!==this.providedStreamType?this.providedStreamType:this.inferredStreamType;},get currentSrc(){return this.source;},get bufferedStart(){const start=getTimeRangesStart(this.buffered)??0;return Math.max(start,this.clipStartTime);},get bufferedEnd(){const end=getTimeRangesEnd(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,end-this.clipStartTime));},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart);}
2,get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);const start=getTimeRangesStart(this.seekable)??0;return Math.max(start,this.clipStartTime);},get seekableEnd(){if(this.providedDuration>0)return this.providedDuration;const end=this.liveSyncPosition>0?this.liveSyncPosition:this.canPlay?getTimeRangesEnd(this.seekable)??1/0:0;return this.clipEndTime>0?Math.min(this.clipEndTime,end):end;},get seekableWindow(){const window=this.seekableEnd-this.seekableStart;return isNaN(window)?1/0:Math.max(0,window);},canAirPlay:!1,canGoogleCast:!1,remotePlaybackState:"disconnected",remotePlaybackType:"none",remotePlaybackLoader:null,remotePlaybackInfo:null,get isAirPlayConnected(){return "airplay"===this.remotePlaybackType&&"connected"===this.remotePlaybackState;},get isGoogleCastConnected(){return "google-cast"===this.remotePlaybackType&&"connected"===this.remotePlaybackState;},pointer:"fine",orientation:"landscape",width:0,height:0,mediaWidth:0,mediaHeight:0,lastKeyboardAction:null,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return /unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.duration)&&(!this.isLiveDVR||this.duration>=this.liveDVRWindow);},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration);},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,this.seekableEnd-this.liveEdgeTolerance):0;},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart);},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0;},get isLiveDVR(){return /:dvr/.test(this.streamType);},get liveDVRWindow(){return Math.max(this.inferredLiveDVRWindow,this.minLiveDVRWindow);},autoPlaying:!1,providedTitle:"",inferredTitle:"",providedLoop:!1,userPrefersLoop:!1,providedPoster:"",inferredPoster:"",inferredViewType:"unknown",providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null,inferredLiveDVRWindow:0,savedState:null}),RESET_ON_SRC_QUALITY_CHANGE=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),RESET_ON_SRC_CHANGE=new Set([...RESET_ON_SRC_QUALITY_CHANGE,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);function softResetMediaState($media,isSourceQualityChange=!1){const filter=isSourceQualityChange?RESET_ON_SRC_QUALITY_CHANGE:RESET_ON_SRC_CHANGE;mediaState.reset($media,(prop)=>filter.has(prop)),tick();}function boundTime(time,store){const clippedTime=time+store.clipStartTime(),isStart=Math.floor(time)===Math.floor(store.seekableStart()),isEnd=Math.floor(clippedTime)===Math.floor(store.seekableEnd());return isStart?store.seekableStart():isEnd?store.seekableEnd():store.isLiveDVR()&&store.liveDVRWindow()>0&&clippedTime<store.seekableEnd()-store.liveDVRWindow()?store.bufferedStart():Math.min(Math.max(store.seekableStart()+.1,clippedTime),store.seekableEnd()-.1);}const ADD=Symbol(0),REMOVE=Symbol(0),RESET=Symbol(0),SELECT=Symbol(0),READONLY=Symbol(0),SET_READONLY=Symbol(0),ON_RESET=Symbol(0),ON_REMOVE=Symbol(0),ON_USER_SELECT=Symbol(0),ListSymbol_add=ADD,ListSymbol_remove=REMOVE,ListSymbol_reset=RESET,ListSymbol_select=SELECT,ListSymbol_readonly=READONLY,ListSymbol_setReadonly=SET_READONLY,ListSymbol_onReset=ON_RESET,ListSymbol_onRemove=ON_REMOVE,ListSymbol_onUserSelect=ON_USER_SELECT;class List extends EventsTarget{items=[];[ListSymbol_readonly]=!1;get length(){return this.items.length;}get readonly(){return this[ListSymbol_readonly];}indexOf(item){return this.items.indexOf(item);}getById(id){return ""===id?null:this.items.find((item)=>item.id===id)??null;}toArray(){return [...this.items];}[Symbol.iterator](){return this.items.values();}[ListSymbol_add](item,trigger){const index=this.items.length;""+index in this||Object.defineProperty(this,index,{get(){return this.items[index];}}),this.items.includes(item)||(this.items.push(item),this.dispatchEvent(new DOMEvent("add",{detail:item,trigger})));}[ListSymbol_remove](item,trigger){const index=this.items.indexOf(item);index>=0&&(this[ListSymbol_onRemove]?.(item,trigger),this.items.splice(index,1),this.dispatchEvent(new DOMEvent("remove",{detail:item,trigger})));}[ListSymbol_reset](trigger){for(const item of [...this.items])this[ListSymbol_remove](item,trigger);this.items=[],this[ListSymbol_setReadonly](!1,trigger),this[ListSymbol_onReset]?.();}[ListSymbol_setReadonly](readonly,trigger){this[ListSymbol_readonly]!==readonly&&(this[ListSymbol_readonly]=readonly,this.dispatchEvent(new DOMEvent("readonly-change",{detail:readonly,trigger})));}}const CAN_FULLSCREEN=fscreen.fullscreenEnabled;class FullscreenController extends ViewController{#listening=!1;#active=!1;get active(){return this.#active;}get supported(){return CAN_FULLSCREEN;}onConnect(){new EventsController(fscreen).add("fullscreenchange",this.#onChange.bind(this)).add("fullscreenerror",this.#onError.bind(this)),onDispose(this.#onDisconnect.bind(this));}async #onDisconnect(){CAN_FULLSCREEN&&await this.exit();}#onChange(event){const active=isFullscreen(this.el);active!==this.#active&&(active||(this.#listening=!1),this.#active=active,this.dispatch("fullscreen-change",{detail:active,trigger:event}));}#onError(event){this.#listening&&(this.dispatch("fullscreen-error",{detail:null,trigger:event}),this.#listening=!1);}async enter(){try{if(this.#listening=!0,!this.el||isFullscreen(this.el))return;return assertFullscreenAPI(),fscreen.requestFullscreen(this.el);}catch(error){throw this.#listening=!1,error;}}async exit(){if(this.el&&isFullscreen(this.el))return assertFullscreenAPI(),fscreen.exitFullscreen();}}function isFullscreen(host){if(fscreen.fullscreenElement===host)return !0;try{return host.matches(fscreen.fullscreenPseudoClass);}catch(error){return !1;}}function assertFullscreenAPI(){if(!CAN_FULLSCREEN)throw Error("[vidstack] no fullscreen API");}class ScreenOrientationController extends ViewController{#type=signal(this.#getScreenOrientation());#locked=signal(!1);#currentLock;get type(){return this.#type();}get locked(){return this.#locked();}get portrait(){return this.#type().startsWith("portrait");}get landscape(){return this.#type().startsWith("landscape");}
2static supported=!1;get supported(){return ScreenOrientationController.supported;}onConnect(){if(this.supported)listenEvent(screen.orientation,0,this.#onOrientationChange.bind(this));else{const query=window.matchMedia("(orientation: landscape)");query.onchange=this.#onOrientationChange.bind(this),onDispose(()=>query.onchange=null);}onDispose(this.#onDisconnect.bind(this));}async #onDisconnect(){this.supported&&this.#locked()&&await this.unlock();}#onOrientationChange(event){this.#type.set(this.#getScreenOrientation()),this.dispatch("orientation-change",{detail:{orientation:peek(this.#type),lock:this.#currentLock},trigger:event});}async lock(lockType){peek(this.#locked)||this.#currentLock===lockType||(this.#assertScreenOrientationAPI(),await screen.orientation.lock(lockType),this.#locked.set(!0),this.#currentLock=lockType);}async unlock(){peek(this.#locked)&&(this.#assertScreenOrientationAPI(),this.#currentLock=void 0,await screen.orientation.unlock(),this.#locked.set(!1));}#assertScreenOrientationAPI(){if(!this.supported)throw Error("[vidstack] no orientation API");}#getScreenOrientation(){return "portrait-primary";}}function isVideoQualitySrc(src){return !isString(src)&&"width" in src&&"height" in src&&isNumber(src.width)&&isNumber(src.height);}const mediaContext=createContext();function useMediaContext(){return useContext(mediaContext);}class MediaRemoteControl{#target=null;#player=null;#prevTrackIndex=-1;#logger;constructor(logger=void 0){this.#logger=logger;}setTarget(target){this.#target=target;}getPlayer(target){return this.#player||(target??this.#target)?.dispatchEvent(new DOMEvent("find-media-player",{detail:(player)=>{this.#player=player;},bubbles:!0,composed:!0})),this.#player;}setPlayer(player){this.#player=player;}startLoading(trigger){this.#dispatchRequest("media-start-loading",trigger);}startLoadingPoster(trigger){this.#dispatchRequest("media-poster-start-loading",trigger);}requestAirPlay(trigger){this.#dispatchRequest("media-airplay-request",trigger);}requestGoogleCast(trigger){this.#dispatchRequest("media-google-cast-request",trigger);}play(trigger){this.#dispatchRequest("media-play-request",trigger);}pause(trigger){this.#dispatchRequest("media-pause-request",trigger);}mute(trigger){this.#dispatchRequest("media-mute-request",trigger);}unmute(trigger){this.#dispatchRequest("media-unmute-request",trigger);}enterFullscreen(target,trigger){this.#dispatchRequest("media-enter-fullscreen-request",trigger,target);}exitFullscreen(target,trigger){this.#dispatchRequest("media-exit-fullscreen-request",trigger,target);}lockScreenOrientation(lockType,trigger){this.#dispatchRequest("media-orientation-lock-request",trigger,lockType);}unlockScreenOrientation(trigger){this.#dispatchRequest("media-orientation-unlock-request",trigger);}enterPictureInPicture(trigger){this.#dispatchRequest("media-enter-pip-request",trigger);}exitPictureInPicture(trigger){this.#dispatchRequest("media-exit-pip-request",trigger);}seeking(time,trigger){this.#dispatchRequest("media-seeking-request",trigger,time);}seek(time,trigger){this.#dispatchRequest("media-seek-request",trigger,time);}seekToLiveEdge(trigger){this.#dispatchRequest("media-live-edge-request",trigger);}changeDuration(duration,trigger){this.#dispatchRequest("media-duration-change-request",trigger,duration);}changeClipStart(startTime,trigger){this.#dispatchRequest("media-clip-start-change-request",trigger,startTime);}changeClipEnd(endTime,trigger){this.#dispatchRequest("media-clip-end-change-request",trigger,endTime);}changeVolume(volume,trigger){this.#dispatchRequest("media-volume-change-request",trigger,Math.max(0,Math.min(1,volume)));}changeAudioTrack(index,trigger){this.#dispatchRequest("media-audio-track-change-request",trigger,index);}changeQuality(index,trigger){this.#dispatchRequest("media-quality-change-request",trigger,index);}requestAutoQuality(trigger){this.changeQuality(-1,trigger);}changeTextTrackMode(index,mode,trigger){this.#dispatchRequest("media-text-track-change-request",trigger,{index,mode});}changePlaybackRate(rate,trigger){this.#dispatchRequest("media-rate-change-request",trigger,rate);}changeAudioGain(gain,trigger){this.#dispatchRequest("media-audio-gain-change-request",trigger,gain);}resumeControls(trigger){this.#dispatchRequest("media-resume-control
2s-request",trigger);}pauseControls(trigger){this.#dispatchRequest("media-pause-controls-request",trigger);}togglePaused(trigger){const player=this.getPlayer(trigger?.target);player&&(player.state.paused?this.play(trigger):this.pause(trigger));}toggleControls(trigger){const player=this.getPlayer(trigger?.target);player&&(player.controls.showing?player.controls.hide(0,trigger):player.controls.show(0,trigger));}toggleMuted(trigger){const player=this.getPlayer(trigger?.target);player&&(player.state.muted?this.unmute(trigger):this.mute(trigger));}toggleFullscreen(target,trigger){const player=this.getPlayer(trigger?.target);player&&(player.state.fullscreen?this.exitFullscreen(target,trigger):this.enterFullscreen(target,trigger));}togglePictureInPicture(trigger){const player=this.getPlayer(trigger?.target);player&&(player.state.pictureInPicture?this.exitPictureInPicture(trigger):this.enterPictureInPicture(trigger));}showCaptions(trigger){const player=this.getPlayer(trigger?.target);if(!player)return;let tracks=player.state.textTracks,index=this.#prevTrackIndex;tracks[index]&&isTrackCaptionKind(tracks[index])||(index=-1),-1===index&&(index=tracks.findIndex((track)=>isTrackCaptionKind(track)&&track.default)),-1===index&&(index=tracks.findIndex((track)=>isTrackCaptionKind(track))),index>=0&&this.changeTextTrackMode(index,"showing",trigger),this.#prevTrackIndex=-1;}disableCaptions(trigger){const player=this.getPlayer(trigger?.target);if(!player)return;const tracks=player.state.textTracks,track=player.state.textTrack;if(track){const index=tracks.indexOf(track);this.changeTextTrackMode(index,"disabled",trigger),this.#prevTrackIndex=index;}}toggleCaptions(trigger){const player=this.getPlayer(trigger?.target);player&&(player.state.textTrack?this.disableCaptions():this.showCaptions());}userPrefersLoopChange(prefersLoop,trigger){this.#dispatchRequest("media-user-loop-change-request",trigger,prefersLoop);}#dispatchRequest(type,trigger,detail){const request=new DOMEvent(type,{bubbles:!0,composed:!0,cancelable:!0,detail,trigger});let target=trigger?.target||null;target&&target instanceof Component&&(target=target.el);const shouldUsePlayer=!target||target===document||target===window||target===document.body||this.#player?.el&&target instanceof Node&&!this.#player.el.contains(target);target=shouldUsePlayer?this.#target??this.getPlayer()?.el:target??this.#target,this.#player&&("media-play-request"!==type||this.#player.state.canLoad)?this.#player.canPlayQueue.enqueue(type,()=>target?.dispatchEvent(request)):target?.dispatchEvent(request);}#noPlayerWarning(method){}}class LocalMediaStorage{playerId="vds-player";mediaId=null;#data={volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null};async getVolume(){return this.#data.volume;}async setVolume(volume){this.#data.volume=volume,this.save();}async getMuted(){return this.#data.muted;}async setMuted(muted){this.#data.muted=muted,this.save();}async getTime(){return this.#data.time;}async setTime(time,ended){const shouldClear=time<0;this.#data.time=shouldClear?null:time,shouldClear||ended?this.saveTime():this.saveTimeThrottled();}async getLang(){return this.#data.lang;}async setLang(lang){this.#data.lang=lang,this.save();}async getCaptions(){return this.#data.captions;}async setCaptions(enabled){this.#data.captions=enabled,this.save();}async getPlaybackRate(){return this.#data.rate;}async setPlaybackRate(rate){this.#data.rate=rate,this.save();}async getAudioGain(){return this.#data.audioGain;}async setAudioGain(gain){this.#data.audioGain=gain,this.save();}async getVideoQuality(){return this.#data.quality;}async setVideoQuality(quality){this.#data.quality=quality,this.save();}onChange(src,mediaId,playerId="vds-player"){const savedData=playerId?localStorage.getItem(playerId):null,savedTime=mediaId?localStorage.getItem(mediaId):null;this.playerId=playerId,this.mediaId=mediaId,this.#data={volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...savedData?JSON.parse(savedData):{},time:savedTime?+savedTime:null};}save(){}saveTimeThrottled=functionThrottle(this.saveTime.bind(this),1e3);saveTime(){}}const SELECTED=Symbol(0);class SelectList extends List{get selected(){return this.items.find((item)=>item.selected)??null;}get selectedIndex(){return this.items.findIndex((item)=>item.selected);}[ListSymbol_onRemove](item,trigger){this[ListSymbol_select](item,!1,trigger);}[ListSymbol_add](item,trigger){item[SELECTED]=!1,Object.defineProperty(item,"selected",{get(){return this[SELECTED];},set:(selected)=>
2{this.readonly||(this[ListSymbol_onUserSelect]?.(),this[ListSymbol_select](item,selected));}}),super[ListSymbol_add](item,trigger);}[ListSymbol_select](item,selected,trigger){if(selected===item?.[SELECTED])return;const prev=this.selected;item&&(item[SELECTED]=selected);(selected?prev!==item:prev===item)&&(prev&&(prev[SELECTED]=!1),this.dispatchEvent(new DOMEvent("change",{detail:{prev,current:this.selected},trigger})));}}class AudioTrackList extends SelectList{}function round(num,decimalPlaces=2){return Number(num.toFixed(decimalPlaces));}function clampNumber(min,value,max){return Math.max(min,Math.min(max,value));}function isEventInside(el,event){const target=event.composedPath()[0];return target instanceof Node&&el.contains(target);}const rafJobs=new Set();function setAttributeIfEmpty(target,name,value){target.hasAttribute(name)||target.setAttribute(name,value);}function checkVisibility(el){return !!el&&("checkVisibility" in el?el.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):function(el){const style=getComputedStyle(el);return "none"!==style.display&&parseInt(style.opacity)>0;}(el));}function observeVisibility(el,callback){return job=()=>callback(checkVisibility(el)),rafJobs.add(job),()=>rafJobs.delete(job);var job;}function isElementParent(owner,node,test){for(;node;){if(node===owner)return !0;if(test?.(node))break;node=node.parentElement;}return !1;}function onPress(target,handler){return new EventsController(target).add("pointerup",(event)=>{0!==event.button||event.defaultPrevented||handler(event);}).add("keydown",(event)=>{isKeyboardClick(event)&&handler(event);});}function isTouchPinchEvent(event){return function(event){return !!event?.type.startsWith("touch");}(event)&&(event.touches.length>1||event.changedTouches.length>1);}function isHTMLElement(el){return el instanceof HTMLElement;}class NativeTextRenderer{priority=0;#display=!0;#video=null;#track=null;#tracks=new Set();canRender(_,video){return !!video;}attach(video){this.#video=video,video&&(video.textTracks.onchange=this.#onChange.bind(this));}addTrack(track){this.#tracks.add(track),this.#attachTrack(track);}removeTrack(track){track[TextTrackSymbol_native]?.remove?.(),track[TextTrackSymbol_native]=null,this.#tracks.delete(track);}changeTrack(track){const current=track?.[TextTrackSymbol_native];current&&"showing"!==current.track.mode&&(current.track.mode="showing"),this.#track=track;}setDisplay(display){this.#display=display,this.#onChange();}detach(){this.#video&&(this.#video.textTracks.onchange=null);for(const track of this.#tracks)this.removeTrack(track);this.#tracks.clear(),this.#video=null,this.#track=null;}#attachTrack(track){if(!this.#video)return;const el=track[TextTrackSymbol_native]??=this.#createTrackElement(track);isHTMLElement(el)&&(this.#video.append(el),el.track.mode=el.default?"showing":"disabled");}#createTrackElement(track){const el=document.createElement("track"),isDefault=track.default||"showing"===track.mode,isSupported=track.src&&"vtt"===track.type;return el.id=track.id,el.src=isSupported?track.src:"",el.label=track.label,el.kind=track.kind,el.default=isDefault,track.language&&(el.srclang=track.language),isDefault&&!isSupported&&this.#copyCues(track,el.track),el;}#copyCues(track,native){if(!(track.src&&"vtt"===track.type||native.cues?.length)){for(const cue of track.cues)native.addCue(cue);}}#onChange(event){for(const track of this.#tracks){const native=track[TextTrackSymbol_native];if(!native)continue;if(!this.#display){native.track.mode=native.managed?"hidden":"disabled";continue;}const isShowing="showing"===native.track.mode;isShowing&&this.#copyCues(track,native.track),track.setMode(isShowing?"showing":"disabled",event);}}}class TextRenderers{#video=null;#textTracks;#renderers=[];#media;#nativeDisplay=!1;#nativeRenderer=null;#customRenderer=null;constructor(media){this.#media=media;const textTracks=media.textTracks;this.#textTracks=textTracks,effect(this.#watchControls.bind(this)),onDispose(this.#detach.bind(this)),new EventsController(textTracks).add("add",this.#onAddTrack.bind(this)).add("remove",this.#onRemoveTrack.bind(this)).add("mode-change",this.#update.bind(this));}
2#watchControls(){const {nativeControls}=this.#media.$state;this.#nativeDisplay=nativeControls(),this.#update();}add(renderer){this.#renderers.push(renderer),untrack(this.#update.bind(this));}remove(renderer){renderer.detach(),this.#renderers.splice(this.#renderers.indexOf(renderer),1),untrack(this.#update.bind(this));}attachVideo(video){requestAnimationFrame(()=>{if(this.#video=video,video){this.#nativeRenderer=new NativeTextRenderer(),this.#nativeRenderer.attach(video);for(const track of this.#textTracks)this.#addNativeTrack(track);}this.#update();});}#addNativeTrack(track){isTrackCaptionKind(track)&&this.#nativeRenderer?.addTrack(track);}#removeNativeTrack(track){isTrackCaptionKind(track)&&this.#nativeRenderer?.removeTrack(track);}#onAddTrack(event){this.#addNativeTrack(event.detail);}#onRemoveTrack(event){this.#removeNativeTrack(event.detail);}#update(){const currentTrack=this.#textTracks.selected;if(this.#video&&(this.#nativeDisplay||currentTrack?.[TextTrackSymbol_nativeHLS]))return this.#customRenderer?.changeTrack(null),this.#nativeRenderer?.setDisplay(!0),void this.#nativeRenderer?.changeTrack(currentTrack);if(this.#nativeRenderer?.setDisplay(!1),this.#nativeRenderer?.changeTrack(null),!currentTrack)return void this.#customRenderer?.changeTrack(null);const customRenderer=this.#renderers.sort((a,b)=>a.priority-b.priority).find((renderer)=>renderer.canRender(currentTrack,this.#video));this.#customRenderer!==customRenderer&&(this.#customRenderer?.detach(),customRenderer?.attach(this.#video),this.#customRenderer=customRenderer??null),customRenderer?.changeTrack(currentTrack);}#detach(){this.#nativeRenderer?.detach(),this.#nativeRenderer=null,this.#customRenderer?.detach(),this.#customRenderer=null;}}class TextTrackList extends List{#canLoad=!1;#defaults={};#storage=null;#preferredLang=null;[TextTrackSymbol_crossOrigin];constructor(){super();}get selected(){const track=this.items.find((t)=>"showing"===t.mode&&isTrackCaptionKind(t));return track??null;}get selectedIndex(){const selected=this.selected;return selected?this.indexOf(selected):-1;}get preferredLang(){return this.#preferredLang;}set preferredLang(lang){this.#preferredLang=lang,this.#saveLang(lang);}add(init,trigger){const track=init instanceof TextTrack?init:new TextTrack(init),kind="captions"===init.kind||"subtitles"===init.kind?"captions":init.kind;return this.#defaults[kind]&&init.default&&delete init.default,track.addEventListener("mode-change",this.#onTrackModeChangeBind),this[ListSymbol_add](track,trigger),track[TextTrackSymbol_crossOrigin]=this[TextTrackSymbol_crossOrigin],this.#canLoad&&track[TextTrackSymbol_canLoad](),init.default&&(this.#defaults[kind]=track),this.#selectTracks(),this;}remove(track,trigger){if(this.#pendingRemoval=track,this.items.includes(track))return track===this.#defaults[track.kind]&&delete this.#defaults[track.kind],track.mode="disabled",track[TextTrackSymbol_onModeChange]=null,track.removeEventListener("mode-change",this.#onTrackModeChangeBind),this[ListSymbol_remove](track,trigger),this.#pendingRemoval=null,this;}clear(trigger){for(const track of [...this.items])this.remove(track,trigger);return this;}getByKind(kind){const kinds=Array.isArray(kind)?kind:[kind];return this.items.filter((track)=>kinds.includes(track.kind));}[TextTrackSymbol_canLoad](){if(!this.#canLoad){for(const track of this.items)track[TextTrackSymbol_canLoad]();this.#canLoad=!0,this.#selectTracks();}}#selectTracks=functionDebounce(async()=>{if(!this.#canLoad)return;!this.#preferredLang&&this.#storage&&(this.#preferredLang=await this.#storage.getLang());const showCaptions=await (this.#storage?.getCaptions()),kinds=[["captions","subtitles"],"chapters","descriptions","metadata"];for(const kind of kinds){const tracks=this.getByKind(kind);if(tracks.find((t)=>"showing"===t.mode))continue;const preferredTrack=this.#preferredLang?tracks.find((track2)=>track2.language===this.#preferredLang):null,defaultTrack=isArray(kind)?this.#defaults[kind.find((kind2)=>this.#defaults[kind2])||""]:this.#defaults[kind],track=preferredTrack??defaultTrack,isCaptionsKind=track&&isTrackCaptionKind(track);!track||isCaptionsKind&&!1===showCaptions||(track.mode="showing",isCaptionsKind&&this.#saveCaptionsTrack(track));}},300);#pendingRemoval=null;#onTrackModeChangeBind=this.#onTrackModeChange.bind(this);#onTrackModeChange(event){const track=event.detail;if(this.#storage&&isTrackCaptionKind(track)&&track!==this.#pendingRemoval&&this.#saveCaptionsTrack(track),"showing"===track.mode){const kinds=isTrackCaptionKind(track)?["captions","subtitles"]:[track.kind];for(const t of this.items)"showing"===t.mode&&t!=track&&kinds.includes(t.kind)&&(t.mode="disabled");}this.dispatchEvent(new DOMEvent("mode-change",{detail:event.detail,trigger:event}));}
2#saveCaptionsTrack(track){"disabled"!==track.mode&&this.#saveLang(track.language),this.#storage?.setCaptions?.("showing"===track.mode);}#saveLang(lang){this.#storage?.setLang?.(this.#preferredLang=lang);}setStorage(storage){this.#storage=storage;}}const SET_AUTO=Symbol(0),ENABLE_AUTO=Symbol(0),QualitySymbol_setAuto=SET_AUTO,QualitySymbol_enableAuto=ENABLE_AUTO;class VideoQualityList extends SelectList{#auto=!1;switch="current";get auto(){return this.#auto||this.readonly;}[QualitySymbol_enableAuto];[ListSymbol_onUserSelect](){this[QualitySymbol_setAuto](!1);}[ListSymbol_onReset](trigger){this[QualitySymbol_enableAuto]=void 0,this[QualitySymbol_setAuto](!1,trigger);}autoSelect(trigger){this.readonly||this.#auto||!this[QualitySymbol_enableAuto]||(this[QualitySymbol_enableAuto]?.(trigger),this[QualitySymbol_setAuto](!0,trigger));}getBySrc(src){return this.items.find((quality)=>quality.src===src);}[QualitySymbol_setAuto](auto,trigger){this.#auto!==auto&&(this.#auto=auto,this.dispatchEvent(new DOMEvent("auto-change",{detail:auto,trigger})));}}function compareVideoQualityAsc(a,b){return a.height===b.height?(a.bitrate??0)-(b.bitrate??0):a.height-b.height;}function compareVideoQualityDesc(a,b){return b.height===a.height?(b.bitrate??0)-(a.bitrate??0):b.height-a.height;}function isYouTubeProvider(provider){return "YOUTUBE"===provider?.$$PROVIDER_TYPE;}function isVimeoProvider(provider){return "VIMEO"===provider?.$$PROVIDER_TYPE;}class MediaPlayerController extends ViewController{}const MODIFIER_KEYS=new Set(["Shift","Alt","Meta","Ctrl"]),IGNORE_SELECTORS='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]';class MediaKeyboardController extends MediaPlayerController{#media;constructor(media){super(),this.#media=media;}onConnect(){effect(this.#onTargetChange.bind(this));}#onTargetChange(){const {keyDisabled,keyTarget}=this.$props;if(keyDisabled())return;const target="player"===keyTarget()?this.el:document,$active=signal(!1);target===this.el?new EventsController(this.el).add("focusin",()=>$active.set(!0)).add("focusout",(event)=>{this.el.contains(event.target)||$active.set(!1);}):peek($active)||$active.set(document.querySelector("[data-media-player]")===this.el),effect(()=>{$active()&&new EventsController(target).add("keyup",this.#onKeyUp.bind(this)).add("keydown",this.#onKeyDown.bind(this)).add("keydown",this.#onPreventVideoKeys.bind(this),{capture:!0});});}#onKeyUp(event){const focusedEl=document.activeElement;if(!event.key||!this.$state.canSeek()||focusedEl?.matches(IGNORE_SELECTORS))return;let {method,value}=this.#getMatchingMethod(event);if(!isString(value)&&!isArray(value))return value?.onKeyUp?.({event,player:this.#media.player,remote:this.#media.remote}),void value?.callback?.(event,this.#media.remote);if(method?.startsWith("seek")&&(event.preventDefault(),event.stopPropagation(),this.#timeSlider?(this.#forwardTimeKeyboardEvent(event,"seekForward"===method),this.#timeSlider=null):(this.#media.remote.seek(this.#seekTotal,event),this.#seekTotal=void 0)),method?.startsWith("volume")){const volumeSlider=this.el.querySelector("[data-media-volume-slider]");volumeSlider?.dispatchEvent(new KeyboardEvent("keyup",{key:"volumeUp"===method?"Up":"Down",shiftKey:event.shiftKey,trigger:event}));}}#onKeyDown(event){if(!event.key||MODIFIER_KEYS.has(event.key))return;const focusedEl=document.activeElement;if(focusedEl?.matches(IGNORE_SELECTORS)||isKeyboardClick(event)&&focusedEl?.matches('button, [role="button"]'))return;let {method,value}=this.#getMatchingMethod(event),isNumberPress=!event.metaKey&&/^[0-9]$/.test(event.key);if(!isString(value)&&!isArray(value)&&!isNumberPress)return value?.onKeyDown?.({event,player:this.#media.player,remote:this.#media.remote}),void value?.callback?.(event,this.#media.remote);if(!method&&isNumberPress&&!function(event){for(const key of MODIFIER_KEYS)if(event[key.toLowerCase()+"Key"])return !0;return !1;}(event))return event.preventDefault(),event.stopPropagation(),void this.#media.remote.seek(this.$state.duration()/10*Number(event.key),event);if(method){switch(event.preventDefault(),event.stopPropagation(),method){case "seekForward":case "seekBackward":this.#seeking(event,method,"seekForward"===method
2);break;case "volumeUp":case "volumeDown":{const volumeSlider=this.el.querySelector("[data-media-volume-slider]");if(volumeSlider)volumeSlider.dispatchEvent(new KeyboardEvent("keydown",{key:"volumeUp"===method?"Up":"Down",shiftKey:event.shiftKey,trigger:event}));else{const value2=event.shiftKey?.1:.05;this.#media.remote.changeVolume(this.$state.volume()+("volumeUp"===method?+value2:-value2),event);}break;}case "toggleFullscreen":this.#media.remote.toggleFullscreen("prefer-media",event);break;case "speedUp":case "slowDown":{const playbackRate=this.$state.playbackRate();this.#media.remote.changePlaybackRate(Math.max(.25,Math.min(2,playbackRate+("speedUp"===method?.25:-.25))),event);break;}default:this.#media.remote[method]?.(event);}this.$state.lastKeyboardAction.set({action:method,event});}}#onPreventVideoKeys(event){event.target,0;}#getMatchingMethod(event){const keyShortcuts={...this.$props.keyShortcuts(),...this.#media.ariaKeys},method=Object.keys(keyShortcuts).find((method2)=>{const value=keyShortcuts[method2],keys=isArray(value)?value.join(" "):isString(value)?value:value?.keys,combinations=(isArray(keys)?keys:keys?.split(" "))?.map((key)=>function(key){return key.replace(/Shift\+(\d)/g,(_,num)=>SYMBOL_KEY_MAP[num-1]);}(key).replace(/Control/g,"Ctrl").split("+"));return combinations?.some((combo)=>{const modifierKeys=new Set(combo.filter((key)=>MODIFIER_KEYS.has(key)));for(const modKey of MODIFIER_KEYS){const modKeyProp=modKey.toLowerCase()+"Key";if(!modifierKeys.has(modKey)&&event[modKeyProp])return !1;}return combo.every((key)=>MODIFIER_KEYS.has(key)?event[key.toLowerCase()+"Key"]:event.key===key.replace("Space"," "));});});return {method,value:method?keyShortcuts[method]:null};}#seekTotal;#calcSeekAmount(event,type){const seekBy=event.shiftKey?10:5;return this.#seekTotal=Math.max(0,Math.min((this.#seekTotal??this.$state.currentTime())+("seekForward"===type?+seekBy:-seekBy),this.$state.duration()));}#timeSlider=null;#forwardTimeKeyboardEvent(event,forward){this.#timeSlider?.dispatchEvent(new KeyboardEvent(event.type,{key:forward?"Right":"Left",shiftKey:event.shiftKey,trigger:event}));}#seeking(event,type,forward){this.$state.canSeek()&&(this.#timeSlider||(this.#timeSlider=this.el.querySelector("[data-media-time-slider]")),this.#timeSlider?this.#forwardTimeKeyboardEvent(event,forward):this.#media.remote.seeking(this.#calcSeekAmount(event,type),event));}}const SYMBOL_KEY_MAP=["!","@","#","$","%","^","&","*","(",")"];class ARIAKeyShortcuts extends ViewController{#shortcut;constructor(shortcut){super(),this.#shortcut=shortcut;}onAttach(el){const {$props,ariaKeys}=useMediaContext(),keys=el.getAttribute("aria-keyshortcuts");if(keys)return void (ariaKeys[this.#shortcut]=keys);const shortcuts=$props.keyShortcuts()[this.#shortcut];if(shortcuts){const keys2=isArray(shortcuts)?shortcuts.join(" "):isString(shortcuts)?shortcuts:shortcuts?.keys;el.setAttribute("aria-keyshortcuts",isArray(keys2)?keys2.join(" "):keys2);}}}class MediaControls extends MediaPlayerController{#idleTimer=-2;#pausedTracking=!1;#hideOnMouseLeave=signal(!1);#isMouseOutside=signal(!1);#focusedItem=null;#canIdle=signal(!0);defaultDelay=2e3;get canIdle(){return this.#canIdle();}set canIdle(canIdle){this.#canIdle.set(canIdle);}get hideOnMouseLeave(){const {hideControlsOnMouseLeave}=this.$props;return this.#hideOnMouseLeave()||hideControlsOnMouseLeave();}set hideOnMouseLeave(hide){this.#hideOnMouseLeave.set(hide);}get showing(){return this.$state.controlsVisible();}show(delay=0,trigger){this.#clearIdleTimer(),this.#pausedTracking||this.#changeVisibility(!0,delay,trigger);}hide(delay=this.defaultDelay,trigger){this.#clearIdleTimer(),this.#pausedTracking||this.#changeVisibility(!1,delay,trigger);}pause(trigger){this.#pausedTracking=!0,this.#clearIdleTimer(),this.#changeVisibility(!0,0,trigger);}resume(trigger){this.#pausedTracking=!1,this.$state.paused()||this.#changeVisibility(!1,this.defaultDelay,trigger);}onConnect(){effect(this.#init.bind(this));}#init(){const {viewType}=this.$state;if(!this.el||!this.#canIdle())return;if("audio"===viewType())return void this.show();effect(this.#watchMouse.bind(this)),effect(this.#watchPaused.bind(this));const onPlay=this.#onPlay.bind(this),onPause=this.#onPause.bind(this),onEnd=this.#onEnd.bind(this);new EventsController(this.el).add("can-play",(event)=>this.show(0,event)).add("play",onPlay).add("pause",onPause).add("end",onEnd).add("auto-play-fail",onPause);}#watchMouse(){if(!this.el)return;const {started,pointer,paused}=this.$state;if(!started()||"fine"!==pointer())return;const events=new EventsController(this.el),shouldHideOnMouseLeave=this.hideOnMouseLeave;shouldHideOnMouseLeave&&this.#isMouseOutside()||effect(()=>{paused()||events.add("pointermove",this.#onStopIdle.bind(this));}),shouldHideOnMouseLeave&&events.add("mouseenter",this.#onMouseEnter.bind(this)).add("mouseleave",this.#onMouseLeave.bind(this));}#watchPaused(){const {paused,started,autoPlayError}=this.$state;if(paused()||autoPlayError()&&!started())return;const onStopIdle=this.#onStopIdle.bind(this);effect(()=>{if(!this.el)return;const isTouch="coarse"===this.$state.pointer(),events=new EventsController(this.el),eventTypes=[isTouch?"touchend":"pointerup","keydown"];for(const eventType of eventTypes)events.add(eventType,onStopIdle,{passive:!1});});}#onPlay(event){event.triggers.hasType("ended")||(this.show(0,event),this.hide(void 0,event));}#onPause(event){this.show(0,event);}#onEnd(event){const {loop}=this.$state;loop()&&this.hide(0,event);}#onMouseEnter(event){this.#isMouseOutside.set(!1),this.show(0,event),this.hide(void 0,event);}#onMouseLeave(event){this.#isMouseOutside.set(!0),this.hide(0,event);}
2#clearIdleTimer(){window.clearTimeout(this.#idleTimer),this.#idleTimer=-1;}#onStopIdle(event){event.MEDIA_GESTURE||this.#pausedTracking||isTouchPinchEvent(event)||(isKeyboardEvent(event)&&("Escape"===event.key?(this.el?.focus(),this.#focusedItem=null):this.#focusedItem&&(event.preventDefault(),requestAnimationFrame(()=>{this.#focusedItem?.focus(),this.#focusedItem=null;}))),this.show(0,event),this.hide(this.defaultDelay,event));}#changeVisibility(visible,delay,trigger){0!==delay?this.#idleTimer=window.setTimeout(()=>{this.scope&&this.#onChange(visible&&!this.#pausedTracking,trigger);},delay):this.#onChange(visible,trigger);}#onChange(visible,trigger){this.$state.controlsVisible()!==visible&&(this.$state.controlsVisible.set(visible),!visible&&document.activeElement&&this.el?.contains(document.activeElement)&&(this.#focusedItem=document.activeElement,requestAnimationFrame(()=>{this.el?.focus({preventScroll:!0});})),this.dispatch("controls-change",{detail:visible,trigger}));}}class AudioProviderLoader{name="audio";target;canPlay(src){return !!function({src,type}){return isString(src)?AUDIO_EXTENSIONS.test(src)||AUDIO_TYPES.has(type)||src.startsWith("blob:")&&"audio/object"===type:"audio/object"===type;}(src);}mediaType(){return "audio";}async load(ctx){throw Error("[vidstack] can not load audio provider server-side");}}class VideoProviderLoader{name="video";target;canPlay(src){return !!function(src){return isString(src.src)?VIDEO_EXTENSIONS.test(src.src)||VIDEO_TYPES.has(src.type)||src.src.startsWith("blob:")&&"video/object"===src.type||isHLSSrc(src)&&!0:"video/object"===src.type;}(src);}mediaType(){return "video";}async load(ctx){throw Error("[vidstack] can not load video provider server-side");}}class HLSProviderLoader extends VideoProviderLoader{static supported=!1;name="hls";canPlay(src){return HLSProviderLoader.supported&&isHLSSrc(src);}async load(context){throw Error("[vidstack] can not load hls provider server-side");}}function coerceToError(error){return error instanceof Error?error:Error("string"==typeof error?error:JSON.stringify(error));}class DASHProviderLoader extends VideoProviderLoader{static supported=!1;name="dash";canPlay(src){return DASHProviderLoader.supported&&isDASHSrc(src);}async load(context){throw Error("[vidstack] can not load dash provider server-side");}}class VimeoProviderLoader{name="vimeo";target;preconnect(){const connections=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(const url of connections);}canPlay(src){return isString(src.src)&&"video/vimeo"===src.type;}mediaType(){return "video";}async load(ctx){throw Error("[vidstack] can not load vimeo provider server-side");}async loadPoster(src,ctx,abort){const {resolveVimeoVideoId,getVimeoVideoInfo}=await Promise.resolve().then(function(){return vidstackKrOAtKMi;});if(!isString(src.src))return null;const {videoId,hash}=resolveVimeoVideoId(src.src);return videoId?getVimeoVideoInfo(videoId,abort,hash).then((info)=>info?info.poster:null):null;}}class YouTubeProviderLoader{name="youtube";target;preconnect(){const connections=["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"];for(const url of connections);}canPlay(src){return isString(src.src)&&"video/youtube"===src.type;}mediaType(){return "video";}async load(ctx){throw Error("[vidstack] can not load youtube provider server-side");}async loadPoster(src,ctx,abort){const {findYouTubePoster,resolveYouTubeVideoId}=await Promise.resolve().then(function(){return vidstackDm1xEU9Q;}),videoId=isString(src.src)&&resolveYouTubeVideoId(src.src);return videoId?findYouTubePoster(videoId,abort):null;}}const MEDIA_ATTRIBUTES=Symbol(0),mediaAttributes=["autoPlay","canAirPlay","canFullscreen","canGoogleCast","canLoad","canLoadPoster","canPictureInPicture","canPlay","canSeek","ended","fullscreen","isAirPlayConnected","isGoogleCastConnected","live","liveEdge","loop","mediaType","muted","paused","pictureInPicture","playing","playsInline","remotePlaybackState","remotePlaybackType","seeking","started","streamType","viewType","waiting"],mediaPlayerProps={artist:"",artwork:null,autoplay:!1,autoPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,currentTime:0,crossorigin:null,crossOrigin:null,duration:-1,fullscreenOrientation:"landscape",googleCast:{},load:"visible",posterLoad:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playsInl
2ine:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:!1,src:"",title:"",controlsDelay:2e3,hideControlsOnMouseLeave:!1,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:{togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"j J ArrowLeft",seekForward:"l L ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:">",slowDown:"<"},storage:null};class MediaLoadController extends MediaPlayerController{#type;#callback;constructor(type,callback){super(),this.#type=type,this.#callback=callback;}async onAttach(el){}}class MediaPlayerDelegate{#handle;#media;constructor(handle,media){this.#handle=handle,this.#media=media;}notify(type,...init){}async ready(info,trigger){}async #attemptAutoplay(trigger){const {player,$state:{autoPlaying,muted}}=this.#media;autoPlaying.set(!0);const attemptEvent=new DOMEvent("auto-play-attempt",{trigger});try{await player.play(attemptEvent);}catch(error){}}}class Queue{#queue=new Map();enqueue(key,item){this.#queue.set(key,item);}serve(key){const value=this.peek(key);return this.#queue.delete(key),value;}peek(key){return this.#queue.get(key);}delete(key){this.#queue.delete(key);}clear(){this.#queue.clear();}}class RequestQueue{#serving=!1;#pending=deferredPromise();#queue=new Map();get size(){return this.#queue.size;}get isServing(){return this.#serving;}async waitForFlush(){this.#serving||await this.#pending.promise;}enqueue(key,callback){this.#serving?callback():(this.#queue.delete(key),this.#queue.set(key,callback));}serve(key){this.#queue.get(key)?.(),this.#queue.delete(key);}start(){this.#flush(),this.#serving=!0,this.#queue.size>0&&this.#flush();}stop(){this.#serving=!1;}reset(){this.stop(),this.#queue.clear(),this.#release();}#flush(){for(const key of this.#queue.keys())this.serve(key);this.#release();}#release(){this.#pending.resolve(),this.#pending=deferredPromise();}}function $ariaBool(signal){return ()=>signal()?"true":"false";}class MediaRequestManager extends MediaPlayerController{#stateMgr;#request;#media;controls;#fullscreen;#orientation;#$provider;#providerQueue=new RequestQueue();constructor(stateMgr,request,media){super(),this.#stateMgr=stateMgr,this.#request=request,this.#media=media,this.#$provider=media.$provider,this.controls=new MediaControls(),this.#fullscreen=new FullscreenController(),this.#orientation=new ScreenOrientationController();}onAttach(){this.listen("fullscreen-change",this.#onFullscreenChange.bind(this));}onConnect(el){const names=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),events=new EventsController(el),handleRequest=this.#handleRequest.bind(this);for(const name of names)name.startsWith("media-")&&events.add(name,handleRequest);this.#attachLoadPlayListener(),effect(this.#watchProvider.bind(this)),effect(this.#watchControlsDelayChange.bind(this)),effect(this.#watchAudioGainSupport.bind(this)),effect(this.#watchAirPlaySupport.bind(this)),effect(this.#watchGoogleCastSupport.bind(this)),effect(this.#watchFullscreenSupport.bind(this)),effect(this.#watchPiPSupport.bind(this));}onDestroy(){try{const destroyEvent=this.createEvent("destroy"),{pictureInPicture,fullscreen}=this.$state;fullscreen()&&this.exitFullscreen("prefer-media",destroyEvent),pictureInPicture()&&this.exitPictureInPicture(destroyEvent);}catch(e){}this.#providerQueue.reset();}#attachLoadPlayListener(){const {load}=this.$props,{canLoad}=this.$state;if("play"!==load()||canLoad())return;const off=this.listen("media-play-request",(event)=>{this.#handleLoadPlayStrategy(event),off();});}#watchProvider(){const provider=this.#$provider(),canPlay=this.$state.canPlay();return provider&&canPlay&&this.#providerQueue.start(),()=>{this.#providerQueue.stop();};}#handleRequest(event){event.stopPropagation(),event.defaultPrevented||this[event.type]&&(peek(this.#$provider)?this[event.type](event):this.#providerQueue.enqueue(event.type,()=>{peek(this.#$provider)&&this[event.type](event);}));}async play(trigger){}#handleLoadPlayStrategy(trigger){const {load}=this.$props,{canLoad}=this.$state;if("play"===load()&&!canLoad()){const event=this.createEvent("media-start-loading",{trigger});return this.dispatchEvent(event),this.#providerQueue.enqueue("media-play-request",async()=>{try{await this.play(event);}catch(error){}}),!0;}return !1;}async pause(trigger){}setAudioGain(gain,trigger){const {audioGain,canSetAudioGain}=this.$state;if(audioGain()===gain)return;const provider=this.#$provider();if(!provider?.audioGain||!canSetAudioGain())throw Error("[vidstack] audio gain api not available");trigger&&this.#request.queue.enqueue("media-audio-gain-change-request",trigger),provider.audioGain.setGain(gain);}seekToLiveEdge(trigger){}#wasPIPActive=!1;async enterFullscreen(target="prefer-media",trigger){}async exitFullscreen(target="prefer-media",trigger){}#getFullscreenAdapter(target){const provider=peek(this.#$provider);return "prefer-media"===target&&this.#fullscreen.supported||"media"===target?this.#fullscreen:provider?.fullscreen;}async enterPictureInPicture(trigger){}async exitPictureInPicture(trigger){}#throwIfPIPNotSupported(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support");}
2#watchControlsDelayChange(){this.controls.defaultDelay=this.$props.controlsDelay();}#watchAudioGainSupport(){const {canSetAudioGain}=this.$state,supported=!!this.#$provider()?.audioGain?.supported;canSetAudioGain.set(supported);}#watchAirPlaySupport(){const {canAirPlay}=this.$state,supported=!!this.#$provider()?.airPlay?.supported;canAirPlay.set(supported);}#watchGoogleCastSupport(){const {canGoogleCast,source}=this.$state;canGoogleCast.set(false);}#watchFullscreenSupport(){const {canFullscreen}=this.$state,supported=this.#fullscreen.supported||!!this.#$provider()?.fullscreen?.supported;canFullscreen.set(supported);}#watchPiPSupport(){const {canPictureInPicture}=this.$state,supported=!!this.#$provider()?.pictureInPicture?.supported;canPictureInPicture.set(supported);}async "media-airplay-request"(event){try{await this.requestAirPlay(event);}catch(error){}}async requestAirPlay(trigger){try{const adapter=this.#$provider()?.airPlay;if(!adapter?.supported)throw Error("No AirPlay adapter.");return trigger&&this.#request.queue.enqueue("media-airplay-request",trigger),await adapter.prompt();}catch(error){throw this.#request.queue.delete("media-airplay-request"),error;}}async "media-google-cast-request"(event){try{await this.requestGoogleCast(event);}catch(error){}}#googleCastLoader;async requestGoogleCast(trigger){try{const {canGoogleCast}=this.$state;if(!peek(canGoogleCast)){const error=Error("Cast not available.");throw error.code="CAST_NOT_AVAILABLE",error;}if(!this.#googleCastLoader){const $module=await Promise.resolve().then(function(){return vidstackDUl5U76j;});this.#googleCastLoader=new $module.GoogleCastLoader();}await this.#googleCastLoader.prompt(this.#media),trigger&&this.#request.queue.enqueue("media-google-cast-request",trigger);const isConnecting="disconnected"!==peek(this.$state.remotePlaybackState);isConnecting&&this.$state.savedState.set({paused:peek(this.$state.paused),currentTime:peek(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(isConnecting?this.#googleCastLoader:null);}catch(error){throw this.#request.queue.delete("media-google-cast-request"),error;}}"media-clip-start-change-request"(event){const {clipStartTime}=this.$state;clipStartTime.set(event.detail);}"media-clip-end-change-request"(event){const {clipEndTime}=this.$state;clipEndTime.set(event.detail),this.dispatch("duration-change",{detail:event.detail,trigger:event});}"media-duration-change-request"(event){const {providedDuration,clipEndTime}=this.$state;providedDuration.set(event.detail),clipEndTime()<=0&&this.dispatch("duration-change",{detail:event.detail,trigger:event});}"media-audio-track-change-request"(event){const {logger,audioTracks}=this.#media;if(audioTracks.readonly)return;const track=audioTracks[event.detail];if(track){const key=event.type;this.#request.queue.enqueue(key,event),track.selected=!0;}}async "media-enter-fullscreen-request"(event){try{await this.enterFullscreen(event.detail,event);}catch(error){this.#onFullscreenError(error,event);}}async "media-exit-fullscreen-request"(event){try{await this.exitFullscreen(event.detail,event);}catch(error){this.#onFullscreenError(error,event);}}async #onFullscreenChange(event){const lockType=peek(this.$props.fullscreenOrientation),isFullscreen=event.detail;if(!isUndefined(lockType)&&"none"!==lockType&&this.#orientation.supported)if(isFullscreen){if(this.#orientation.locked)return;this.dispatch("media-orientation-lock-request",{detail:lockType,trigger:event});}else this.#orientation.locked&&this.dispatch("media-orientation-unlock-request",{trigger:event});}#onFullscreenError(error,request){this.#stateMgr.handle(this.createEvent("fullscreen-error",{detail:coerceToError(error)}));}async "media-orientation-lock-request"(event){const key=event.type;try{this.#request.queue.enqueue(key,event),await this.#orientation.lock(event.detail);}catch(error){this.#request.queue.delete(key);}}async "media-orientation-unlock-request"(event){const key=event.type;try{this.#request.queue.enqueue(key,event),await this.#orientation.unlock();}catch(error){this.#request.queue.delete(key);}}async "media-enter-pip-request"(event){try{await this.enterPictureInPicture(event);}catch(error){this.#onPictureInPictureError(error,event);}}async "media-exit-pip-request"(event){try{await this.exitPictureInPicture(event);}catch(error){this.#onPictureInPictureError(error,event);}}#onPictureInPictureError(error,request){this.#stateMgr.handle(this.createEvent("picture-in-picture-error",{detail:coerceToError(error)}));}"media-live-edge-request"(event){const {live,liveEdge,canSeek}=this.$state;if(live()&&!liveEdge()&&canSeek()){this.#request.queue.enqueue("media-seek-request",event);try{this.seekToLiveEdge();}catch(error){this.#request.queue.delete("media-seek-request");}}}async "media-loop-request"(event){try{this.#request.looping=!0,this.#request.replaying=!0,await this.play(event);}catch(error){this.#request.looping=!1;}}"media-user-loop-change-request"(event){this.$state.userPrefersLoop.set(event.detail);}
2async "media-pause-request"(event){if(!this.$state.paused())try{await this.pause(event);}catch(error){}}async "media-play-request"(event){if(this.$state.paused())try{await this.play(event);}catch(e){}}"media-rate-change-request"(event){const {playbackRate,canSetPlaybackRate}=this.$state;if(playbackRate()===event.detail||!canSetPlaybackRate())return;const provider=this.#$provider();provider?.setPlaybackRate&&(this.#request.queue.enqueue("media-rate-change-request",event),provider.setPlaybackRate(event.detail));}"media-audio-gain-change-request"(event){try{this.setAudioGain(event.detail,event);}catch(e){}}"media-quality-change-request"(event){const {qualities,storage,logger}=this.#media;if(qualities.readonly)return;this.#request.queue.enqueue("media-quality-change-request",event);const index=event.detail;if(index<0)qualities.autoSelect(event),event.isOriginTrusted&&storage?.setVideoQuality?.(null);else{const quality=qualities[index];quality&&(quality.selected=!0,event.isOriginTrusted&&storage?.setVideoQuality?.({id:quality.id,width:quality.width,height:quality.height,bitrate:quality.bitrate}));}}"media-pause-controls-request"(event){const key=event.type;this.#request.queue.enqueue(key,event),this.controls.pause(event);}"media-resume-controls-request"(event){const key=event.type;this.#request.queue.enqueue(key,event),this.controls.resume(event);}"media-seek-request"(event){const {canSeek,ended,live,seekableEnd,userBehindLiveEdge}=this.$state,seekTime=event.detail;ended()&&(this.#request.replaying=!0);const key=event.type;this.#request.seeking=!1,this.#request.queue.delete(key);const boundedTime=boundTime(seekTime,this.$state);Number.isFinite(boundedTime)&&canSeek()&&(this.#request.queue.enqueue(key,event),this.#$provider().setCurrentTime(boundedTime),live()&&event.isOriginTrusted&&Math.abs(seekableEnd()-boundedTime)>=2&&userBehindLiveEdge.set(!0));}"media-seeking-request"(event){const key=event.type;this.#request.queue.enqueue(key,event),this.$state.seeking.set(!0),this.#request.seeking=!0;}"media-start-loading"(event){if(this.$state.canLoad())return;const key=event.type;this.#request.queue.enqueue(key,event),this.#stateMgr.handle(this.createEvent("can-load"));}"media-poster-start-loading"(event){if(this.$state.canLoadPoster())return;const key=event.type;this.#request.queue.enqueue(key,event),this.#stateMgr.handle(this.createEvent("can-load-poster"));}"media-text-track-change-request"(event){const {index,mode}=event.detail,track=this.#media.textTracks[index];if(track){const key=event.type;this.#request.queue.enqueue(key,event),track.setMode(mode,event);}}"media-mute-request"(event){if(this.$state.muted())return;const key=event.type;this.#request.queue.enqueue(key,event),this.#$provider().setMuted(!0);}"media-unmute-request"(event){const {muted,volume}=this.$state;if(!muted())return;const key=event.type;this.#request.queue.enqueue(key,event),this.#media.$provider().setMuted(!1),0===volume()&&(this.#request.queue.enqueue(key,event),this.#$provider().setVolume(.25));}"media-volume-change-request"(event){const {muted,volume}=this.$state,newVolume=event.detail;if(volume()===newVolume)return;const key=event.type;this.#request.queue.enqueue(key,event),this.#$provider().setVolume(newVolume),newVolume>0&&muted()&&(this.#request.queue.enqueue(key,event),this.#$provider().setMuted(!1));}#logError(title,error,request){}}class MediaRequestContext{seeking=!1;looping=!1;replaying=!1;queue=new Queue();}class MediaStateManager extends MediaPlayerController{#request;#media;#trackedEvents=new Map();#clipEnded=!1;#playedIntervals=[];#playedInterval=[-1,-1];#firingWaiting=!1;#waitingTrigger;constructor(request,media){super(),this.#request=request,this.#media=media;}onAttach(el){el.setAttribute("aria-busy","true"),new EventsController(this).add("fullscreen-change",this["fullscreen-change"].bind(this)).add("fullscreen-error",this["fullscreen-error"].bind(this)).add("orientation-change",this["orientation-change"].bind(this));}onConnect(el){effect(this.#watchCanSetVolume.bind(this)),this.#addTextTrackListeners(),this.#addQualityListeners(),this.#addAudioTrackListeners(),this.#resumePlaybackOnConnect(),onDispose(this.#pausePlaybackOnDisconnect.bind(this));}onDestroy(){const {audioTracks,qualities,textTracks}=this.#media;audioTracks[ListSymbol_reset](),qualities[ListSymbol_reset](),textTracks[ListSymbol_reset](),this.#stopWatchingQualityResize();}handle(event){this.scope&&(event.type,untrack(()=>this[event.type]?.(event)));}#isPlayingOnDisconnect=!1;#resumePlaybackOnConnect(){this.#isPlayingOnDisconnect&&(requestAnimationFrame(()=>{this.scope&&this.#media.remote.play(new DOMEvent("dom-connect"));}),this.#isPlayingOnDisconnect=!1);}#pausePlaybackOnDisconnect(){this.#isPlayingOnDisconnect||(this.#isPlayingOnDisconnect=!this.$state.paused(),this.#media.$provider()?.pause());}
2#resetTracking(){this.#stopWaiting(),this.#clipEnded=!1,this.#request.replaying=!1,this.#request.looping=!1,this.#firingWaiting=!1,this.#waitingTrigger=void 0,this.#trackedEvents.clear();}#satisfyRequest(request,event){const requestEvent=this.#request.queue.serve(request);requestEvent&&(event.request=requestEvent,event.triggers.add(requestEvent));}#addTextTrackListeners(){this.#onTextTracksChange(),this.#onTextTrackModeChange();const textTracks=this.#media.textTracks;new EventsController(textTracks).add("add",this.#onTextTracksChange.bind(this)).add("remove",this.#onTextTracksChange.bind(this)).add("mode-change",this.#onTextTrackModeChange.bind(this));}#addQualityListeners(){const qualities=this.#media.qualities;new EventsController(qualities).add("add",this.#onQualitiesChange.bind(this)).add("remove",this.#onQualitiesChange.bind(this)).add("change",this.#onQualityChange.bind(this)).add("auto-change",this.#onAutoQualityChange.bind(this)).add("readonly-change",this.#onCanSetQualityChange.bind(this));}#addAudioTrackListeners(){const audioTracks=this.#media.audioTracks;new EventsController(audioTracks).add("add",this.#onAudioTracksChange.bind(this)).add("remove",this.#onAudioTracksChange.bind(this)).add("change",this.#onAudioTrackChange.bind(this));}#onTextTracksChange(event){const {textTracks}=this.$state;textTracks.set(this.#media.textTracks.toArray()),this.dispatch("text-tracks-change",{detail:textTracks(),trigger:event});}#onTextTrackModeChange(event){event&&this.#satisfyRequest("media-text-track-change-request",event);const current=this.#media.textTracks.selected,{textTrack}=this.$state;textTrack()!==current&&(textTrack.set(current),this.dispatch("text-track-change",{detail:current,trigger:event}));}#onAudioTracksChange(event){const {audioTracks}=this.$state;audioTracks.set(this.#media.audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:audioTracks(),trigger:event});}#onAudioTrackChange(event){const {audioTrack}=this.$state;audioTrack.set(this.#media.audioTracks.selected),event&&this.#satisfyRequest("media-audio-track-change-request",event),this.dispatch("audio-track-change",{detail:audioTrack(),trigger:event});}#onQualitiesChange(event){const {qualities}=this.$state;qualities.set(this.#media.qualities.toArray()),this.dispatch("qualities-change",{detail:qualities(),trigger:event});}#onQualityChange(event){const {quality}=this.$state;quality.set(this.#media.qualities.selected),event&&this.#satisfyRequest("media-quality-change-request",event),this.dispatch("quality-change",{detail:quality(),trigger:event});}#onAutoQualityChange(){const {qualities}=this.#media,isAuto=qualities.auto;this.$state.autoQuality.set(isAuto),isAuto||this.#stopWatchingQualityResize();}#stopQualityResizeEffect=null;#watchQualityResize(){this.#stopWatchingQualityResize(),this.#stopQualityResizeEffect=effect(()=>{const {qualities}=this.#media,{mediaWidth,mediaHeight}=this.$state,w=mediaWidth(),h=mediaHeight();if(0===w||0===h)return;let selectedQuality=null,minScore=1/0;for(const quality of qualities){const score=Math.abs(quality.width-w)+Math.abs(quality.height-h);score<minScore&&(minScore=score,selectedQuality=quality);}selectedQuality&&qualities[ListSymbol_select](selectedQuality,!0,new DOMEvent("resize",{detail:{width:w,height:h}}));});}#stopWatchingQualityResize(){this.#stopQualityResizeEffect?.(),this.#stopQualityResizeEffect=null;}#onCanSetQualityChange(){this.$state.canSetQuality.set(!this.#media.qualities.readonly);}#watchCanSetVolume(){const {canSetVolume,isGoogleCastConnected}=this.$state;isGoogleCastConnected()?canSetVolume.set(!1):canChangeVolume().then(canSetVolume.set);}"provider-change"(event){const prevProvider=this.#media.$provider(),newProvider=event.detail;prevProvider?.type!==newProvider?.type&&(prevProvider?.destroy?.(),prevProvider?.scope?.dispose(),this.#media.$provider.set(event.detail),prevProvider&&null===event.detail&&this.#resetMediaState(event));}"provider-loader-change"(event){}"auto-play"(event){this.$state.autoPlayError.set(null);}"auto-play-fail"(event){this.$state.autoPlayError.set(event.detail),this.#resetTracking();}"can-load"(event){this.$state.canLoad.set(!0),this.#trackedEvents.set("can-load",event),this.#media.textTracks[TextTrackSymbol_canLoad](),this.#satisfyRequest("media-start-loading",event);}"can-load-poster"(event){this.$state.canLoadPoster.set(!0),this.#trackedEvents.set("can-load-poster",event),this.#satisfyRequest("media-poster-start-loading",event);}"media-type-change"(event){const sourceChangeEvent=this.#trackedEvents.get("source-change");sourceChangeEvent&&event.triggers.add(sourceChangeEvent);const viewType=this.$state.viewType();this.$state.mediaType.set(event.detail);const providedViewType=this.$state.providedViewType(),currentViewType="unknown"===providedViewType?event.detail
2:providedViewType;viewType!==currentViewType&&this.$state.inferredViewType.set(currentViewType);}"stream-type-change"(event){const sourceChangeEvent=this.#trackedEvents.get("source-change");sourceChangeEvent&&event.triggers.add(sourceChangeEvent);const {streamType,inferredStreamType}=this.$state;inferredStreamType.set(event.detail),event.detail=streamType();}"rate-change"(event){const {storage}=this.#media,{canPlay}=this.$state;this.$state.playbackRate.set(event.detail),this.#satisfyRequest("media-rate-change-request",event),canPlay()&&storage?.setPlaybackRate?.(event.detail);}"remote-playback-change"(event){const {remotePlaybackState,remotePlaybackType}=this.$state,{type,state}=event.detail,isConnected="connected"===state;remotePlaybackType.set(type),remotePlaybackState.set(state);const key="airplay"===type?"media-airplay-request":"media-google-cast-request";if(isConnected)this.#satisfyRequest(key,event);else{const requestEvent=this.#request.queue.peek(key);requestEvent&&(event.request=requestEvent,event.triggers.add(requestEvent));}}"sources-change"(event){const prevSources=this.$state.sources(),newSources=event.detail;this.$state.sources.set(newSources),this.#onSourceQualitiesChange(prevSources,newSources,event);}#onSourceQualitiesChange(prevSources,newSources,trigger){let {qualities}=this.#media,added=!1,removed=!1;for(const prevSrc of prevSources){if(!isVideoQualitySrc(prevSrc))continue;const exists=newSources.some((s)=>s.src===prevSrc.src);if(!exists){const quality=qualities.getBySrc(prevSrc.src);quality&&(qualities[ListSymbol_remove](quality,trigger),removed=!0);}}removed&&!qualities.length&&(this.$state.savedState.set(null),qualities[ListSymbol_reset](trigger));for(const src of newSources){if(!isVideoQualitySrc(src)||qualities.getBySrc(src.src))continue;const quality={id:src.id??src.height+"p",bitrate:null,codec:null,...src,selected:!1};qualities[ListSymbol_add](quality,trigger),added=!0;}added&&!qualities[QualitySymbol_enableAuto]&&(this.#watchQualityResize(),qualities[QualitySymbol_enableAuto]=this.#watchQualityResize.bind(this),qualities[QualitySymbol_setAuto](!0,trigger));}"source-change"(event){event.isQualityChange="quality-change"===event.originEvent?.type;const source=event.detail;this.#resetMediaState(event,event.isQualityChange),this.#trackedEvents.set(event.type,event),this.$state.source.set(source),this.el?.setAttribute("aria-busy","true");}#resetMediaState(event,isSourceQualityChange=!1){const {audioTracks,qualities}=this.#media;if(!isSourceQualityChange)return this.#playedIntervals=[],this.#playedInterval=[-1,-1],audioTracks[ListSymbol_reset](event),qualities[ListSymbol_reset](event),softResetMediaState(this.$state,isSourceQualityChange),void this.#resetTracking();softResetMediaState(this.$state,isSourceQualityChange),this.#resetTracking();}abort(event){const sourceChangeEvent=this.#trackedEvents.get("source-change");sourceChangeEvent&&event.triggers.add(sourceChangeEvent);const canLoadEvent=this.#trackedEvents.get("can-load");canLoadEvent&&!event.triggers.hasType("can-load")&&event.triggers.add(canLoadEvent);}"load-start"(event){const sourceChangeEvent=this.#trackedEvents.get("source-change");sourceChangeEvent&&event.triggers.add(sourceChangeEvent);}error(event){this.$state.error.set(event.detail);const abortEvent=this.#trackedEvents.get("abort");abortEvent&&event.triggers.add(abortEvent);}"loaded-metadata"(event){const loadStartEvent=this.#trackedEvents.get("load-start");loadStartEvent&&event.triggers.add(loadStartEvent);}"loaded-data"(event){const loadStartEvent=this.#trackedEvents.get("load-start");loadStartEvent&&event.triggers.add(loadStartEvent);}"can-play"(event){const loadedMetadata=this.#trackedEvents.get("loaded-metadata");loadedMetadata&&event.triggers.add(loadedMetadata),this.#onCanPlayDetail(event.detail),this.el?.setAttribute("aria-busy","false");}"can-play-through"(event){this.#onCanPlayDetail(event.detail);const canPlay=this.#trackedEvents.get("can-play");canPlay&&event.triggers.add(canPlay);}#onCanPlayDetail(detail){const {seekable,buffered,intrinsicDuration,canPlay}=this.$state;canPlay.set(!0),buffered.set(detail.buffered),seekable.set(detail.seekable);const seekableEnd=getTimeRangesEnd(detail.seekable)??1/0;intrinsicDuration.set(seekableEnd);}"duration-change"(event){const {live,intrinsicDuration,providedDuration,clipEndTime,ended}=this.$state,time=event.detail;if(!live()){const duration=Number.isNaN(time)?0:time;intrinsicDuration.set(duration),ended()&&this.#onEndPrecisionChange(event);}(providedDuration()>0||clipEndTime()>0)&&event.stopImmediatePropagation();}progress(event){const {buffered,seekable}=this.$state,{buffered:newBuffered,seekable:newSeekable}=event.detail,newBufferedEnd=getTimeRangesEnd(newBuffered),hasBufferedLengthChanged=newBuffered.length!==buffered().length,hasBufferedEndChanged=newBufferedEnd!==getTimeRangesEnd(buffered()),newSeekableEnd=getTimeRangesEnd(newSeekable),hasSeekableLengthChanged=newSeekable.length!==seekable().length,hasSeekableEndChanged=newSeekableEnd!==getTimeRangesEnd(seekable());(hasBufferedLengthChanged||hasBufferedEndChanged)&&buffered.set(newBuffered),(hasSeekableLengthChanged||hasSeekableEndChanged)&&seekable.set(newSeekable);}play(event){const {paused,autoPlayError,ended,autoPlaying,playsInl
2ine,pointer,muted,viewType,live,userBehindLiveEdge}=this.$state;if(this.#resetPlaybackIfNeeded(),!paused())return void event.stopImmediatePropagation();event.autoPlay=autoPlaying();const waitingEvent=this.#trackedEvents.get("waiting");waitingEvent&&event.triggers.add(waitingEvent),this.#satisfyRequest("media-play-request",event),this.#trackedEvents.set("play",event),paused.set(!1),autoPlayError.set(null),event.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:muted()},trigger:event})),autoPlaying.set(!1)),(ended()||this.#request.replaying)&&(this.#request.replaying=!1,ended.set(!1),this.handle(this.createEvent("replay",{trigger:event}))),playsInline()||"video"!==viewType()||"coarse"!==pointer()||this.#media.remote.enterFullscreen("prefer-media",event),live()&&!userBehindLiveEdge()&&this.#media.remote.seekToLiveEdge(event);}#resetPlaybackIfNeeded(trigger){if(!peek(this.#media.$provider))return;const {ended,seekableStart,clipEndTime,currentTime,realCurrentTime,duration}=this.$state,shouldReset=ended()||realCurrentTime()<seekableStart()||clipEndTime()>0&&realCurrentTime()>=clipEndTime()||Math.abs(currentTime()-duration())<.1;return shouldReset&&this.dispatch("media-seek-request",{detail:seekableStart(),trigger}),shouldReset;}"play-fail"(event){const {muted,autoPlaying}=this.$state,playEvent=this.#trackedEvents.get("play");playEvent&&event.triggers.add(playEvent),this.#satisfyRequest("media-play-request",event);const {paused,playing}=this.$state;paused.set(!0),playing.set(!1),this.#resetTracking(),this.#trackedEvents.set("play-fail",event),event.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:muted(),error:event.detail},trigger:event})),autoPlaying.set(!1));}playing(event){const playEvent=this.#trackedEvents.get("play"),seekedEvent=this.#trackedEvents.get("seeked");playEvent?event.triggers.add(playEvent):seekedEvent&&event.triggers.add(seekedEvent),setTimeout(()=>this.#resetTracking(),0);const {paused,playing,live,liveSyncPosition,seekableEnd,started,currentTime,seeking,ended}=this.$state;if(paused.set(!1),playing.set(!0),seeking.set(!1),ended.set(!1),this.#request.looping)this.#request.looping=!1;else{if(live()&&!started()&&0===currentTime()){const end=liveSyncPosition()??seekableEnd()-2;Number.isFinite(end)&&this.#media.$provider().setCurrentTime(end);}this.started(event);}}started(event){const {started}=this.$state;started()||(started.set(!0),this.handle(this.createEvent("started",{trigger:event})));}pause(event){this.el?.isConnected||(this.#isPlayingOnDisconnect=!0),this.#satisfyRequest("media-pause-request",event);const seekedEvent=this.#trackedEvents.get("seeked");seekedEvent&&event.triggers.add(seekedEvent);const {paused,playing}=this.$state;paused.set(!0),playing.set(!1),this.#clipEnded&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:event})),this.#clipEnded=!1;},0),this.#resetTracking();}"time-change"(event){if(this.#request.looping)return void event.stopImmediatePropagation();let {waiting,played,clipEndTime,realCurrentTime,currentTime}=this.$state,newTime=event.detail,endTime=clipEndTime();realCurrentTime.set(newTime),this.#updatePlayed(),waiting.set(!1);for(const track of this.#media.textTracks)track[TextTrackSymbol_updateActiveCues](newTime,event);endTime>0&&newTime>=endTime&&(this.#clipEnded=!0,this.dispatch("media-pause-request",{trigger:event})),this.#saveTime(),this.dispatch("time-update",{detail:{currentTime:currentTime(),played:played()},trigger:event});}#updatePlayed(){const {currentTime,played,paused}=this.$state;paused()||(this.#playedInterval=updateTimeIntervals(this.#playedIntervals,this.#playedInterval,currentTime()),played.set(new TimeRange(this.#playedIntervals)));}#onEndPrecisionChange(trigger){const {clipStartTime,clipEndTime,duration}=this.$state;clipStartTime()>0||clipEndTime()>0||this.handle(this.createEvent("time-change",{detail:duration(),trigger}));}#saveTime(){const {storage}=this.#media,{canPlay,realCurrentTime}=this.$state;canPlay()&&storage?.setTime?.(realCurrentTime());}"audio-gain-change"(event){const {storage}=this.#media,{canPlay,audioGain}=this.$state;audioGain.set(event.detail),this.#satisfyRequest("media-audio-gain-change-request",event),canPlay()&&storage?.setAudioGain?.(audioGain());}"volume-change"(event){const {storage}=this.#media,{volume,muted,canPlay}=this.$state,detail=event.detail;volume.set(detail.volume),muted.set(detail.muted||0===detail.volume),this.#satisfyRequest("media-volume-change-request",event),this.#satisfyRequest(detail.muted?"media-mute-request":"media-unmute-request",event),canPlay()&&(storage?.setVolume?.(volume()),storage?.setMuted?.(muted()));}seeking=functionThrottle((event)=>{const {seeking,realCurrentTime,paused}=this.$state;seeking.set(!0),realCurrentTime.set(event.detail),this.#satisfyRequest("media-seeking-request",event),paused()&&(this.#waitingTrigger=event,this.#fireWaiting()),this.#playedInterval=[-1,-1];},150,{leading:!0});seeked(event){const {seeking,currentTime,realCurrentTime,paused,seekableEnd,ended,live}=this.$state;if(this.#request.seeking)seeking.set(!0),event.stopImmediatePropagation();else{if(seeking()){const waitingEvent=this.#trackedEvents.get("waiting");waitingEvent&&event.triggers.add(waitingEvent);const seekingEvent=this.#trackedEvents.get("seeking");seekingEvent&&!event.triggers.has(seekingEvent)&&event.triggers.add(seekingEvent),paused()&&this.#stopWaiting(
2),seeking.set(!1),realCurrentTime.set(event.detail),this.#satisfyRequest("media-seek-request",event);const origin=event?.originEvent;!origin?.isTrusted||origin instanceof MessageEvent||/seek/.test(origin.type)||this.started(event);}}live()||(Math.floor(currentTime())!==Math.floor(seekableEnd())?ended.set(!1):this.end(event));}waiting(event){this.#firingWaiting||this.#request.seeking||(event.stopImmediatePropagation(),this.#waitingTrigger=event,this.#fireWaiting());}#fireWaiting=functionDebounce(()=>{if(!this.#waitingTrigger)return;this.#firingWaiting=!0;const {waiting,playing}=this.$state;waiting.set(!0),playing.set(!1);const event=this.createEvent("waiting",{trigger:this.#waitingTrigger});this.#trackedEvents.set("waiting",event),this.dispatch(event),this.#waitingTrigger=void 0,this.#firingWaiting=!1;},300);end(event){const {loop,ended}=this.$state;!loop()&&ended()||(loop()?setTimeout(()=>{requestAnimationFrame(()=>{this.#resetPlaybackIfNeeded(event),this.dispatch("media-loop-request",{trigger:event});});},10):setTimeout(()=>this.#onEnded(event),0));}#onEnded(event){const {storage}=this.#media,{paused,seeking,ended,duration}=this.$state;this.#onEndPrecisionChange(event),paused()||this.dispatch("pause",{trigger:event}),seeking()&&this.dispatch("seeked",{detail:duration(),trigger:event}),ended.set(!0),this.#resetTracking(),storage?.setTime?.(duration(),!0),this.dispatch("ended",{trigger:event});}#stopWaiting(){this.#fireWaiting.cancel(),this.$state.waiting.set(!1);}"fullscreen-change"(event){const isFullscreen=event.detail;this.$state.fullscreen.set(isFullscreen),this.#satisfyRequest(isFullscreen?"media-enter-fullscreen-request":"media-exit-fullscreen-request",event);}"fullscreen-error"(event){this.#satisfyRequest("media-enter-fullscreen-request",event),this.#satisfyRequest("media-exit-fullscreen-request",event);}"orientation-change"(event){const isLocked=event.detail.lock;this.#satisfyRequest(isLocked?"media-orientation-lock-request":"media-orientation-unlock-request",event);}"picture-in-picture-change"(event){const isPiP=event.detail;this.$state.pictureInPicture.set(isPiP),this.#satisfyRequest(isPiP?"media-enter-pip-request":"media-exit-pip-request",event);}"picture-in-picture-error"(event){this.#satisfyRequest("media-enter-pip-request",event),this.#satisfyRequest("media-exit-pip-request",event);}"title-change"(event){event.trigger&&(event.stopImmediatePropagation(),this.$state.inferredTitle.set(event.detail));}"poster-change"(event){event.trigger&&(event.stopImmediatePropagation(),this.$state.inferredPoster.set(event.detail));}}class MediaStateSync extends MediaPlayerController{onSetup(){this.#init();}#init(){const providedProps={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},skip=new Set(["currentTime","paused","playbackRate","volume"]);for(const prop of Object.keys(this.$props))skip.has(prop)||this.$state[providedProps[prop]??prop]?.set(this.$props[prop]());this.$state.muted.set(this.$props.muted()||0===this.$props.volume());}#watchProvidedTypes(){const {viewType,streamType,title,poster,loop}=this.$props,$state=this.$state;$state.providedPoster.set(poster()),$state.providedStreamType.set(streamType()),$state.providedViewType.set(viewType()),$state.providedTitle.set(title()),$state.providedLoop.set(loop());}#watchLogLevel(){}#watchMetadata(){const {artist,artwork}=this.$props;this.$state.artist.set(artist()),this.$state.artwork.set(artwork());}#watchTitle(){const {title}=this.$state;this.dispatch("title-change",{detail:title()});}#watchAutoplay(){const autoPlay=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(autoPlay),this.dispatch("auto-play-change",{detail:autoPlay});}#watchLoop(){const loop=this.$state.loop();this.dispatch("loop-change",{detail:loop});}#watchControls(){const controls=this.$props.controls();this.$state.controls.set(controls);}#watchPoster(){const {poster}=this.$state;this.dispatch("poster-change",{detail:poster()});}#watchCrossOrigin(){const crossOrigin=this.$props.crossOrigin()??this.$props.crossorigin(),value=!0===crossOrigin?"":crossOrigin;this.$state.crossOrigin.set(value);}#watchDuration(){const {duration}=this.$props;this.dispatch("media-duration-change-request",{detail:duration()});}
2#watchPlaysInline(){const inline=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(inline),this.dispatch("plays-inline-change",{detail:inline});}#watchClipStartTime(){const {clipStartTime}=this.$props;this.dispatch("media-clip-start-change-request",{detail:clipStartTime()});}#watchClipEndTime(){const {clipEndTime}=this.$props;this.dispatch("media-clip-end-change-request",{detail:clipEndTime()});}#watchLive(){this.dispatch("live-change",{detail:this.$state.live()});}#watchLiveTolerance(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow());}#watchLiveEdge(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()});}}const actions=["play","pause","seekforward","seekbackward","seekto"];class NavigatorMediaSession extends MediaPlayerController{onConnect(){effect(this.#onMetadataChange.bind(this)),effect(this.#onPlaybackStateChange.bind(this));const handleAction=this.#handleAction.bind(this);for(const action of actions)navigator.mediaSession.setActionHandler(action,handleAction);onDispose(this.#onDisconnect.bind(this));}#onDisconnect(){for(const action of actions)navigator.mediaSession.setActionHandler(action,null);}#onMetadataChange(){const {title,artist,artwork,poster}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:title(),artist:artist(),artwork:artwork()??[{src:poster()}]});}#onPlaybackStateChange(){const {canPlay,paused}=this.$state;navigator.mediaSession.playbackState=canPlay()?paused()?"paused":"playing":"none";}#handleAction(details){const trigger=new DOMEvent("media-session-action",{detail:details});switch(details.action){case "play":this.dispatch("media-play-request",{trigger});break;case "pause":this.dispatch("media-pause-request",{trigger});break;case "seekto":case "seekforward":case "seekbackward":this.dispatch("media-seek-request",{detail:isNumber(details.seekTime)?details.seekTime:this.$state.currentTime()+(details.seekOffset??("seekforward"===details.action?10:-10)),trigger});}}}let $keyboard=signal(!1);class FocusVisibleController extends ViewController{#focused=signal(!1);onConnect(el){effect(()=>{const events=new EventsController(el);if(!$keyboard())return this.#focused.set(!1),updateFocusAttr(el,!1),void events.add("pointerenter",this.#onPointerEnter.bind(this)).add("pointerleave",this.#onPointerLeave.bind(this));const active=document.activeElement===el;this.#focused.set(active),updateFocusAttr(el,active),events.add("focus",this.#onFocus.bind(this)).add("blur",this.#onBlur.bind(this));});}focused(){return this.#focused();}#onFocus(){this.#focused.set(!0),updateFocusAttr(this.el,!0);}#onBlur(){this.#focused.set(!1),updateFocusAttr(this.el,!1);}#onPointerEnter(){updateHoverAttr(this.el,!0);}#onPointerLeave(){updateHoverAttr(this.el,!1);}}function updateFocusAttr(el,isFocused){setAttribute(el,"data-focus",isFocused),setAttribute(el,"data-hocus",isFocused);}function updateHoverAttr(el,isHovering){setAttribute(el,"data-hocus",isHovering),setAttribute(el,"data-hover",isHovering);}class MediaPlayer extends Component{static props=mediaPlayerProps;static state=mediaState;#media;#stateMgr;#requestMgr;canPlayQueue=new RequestQueue();remoteControl;get #provider(){return this.#media.$provider();}get #props(){return this.$props;}constructor(){super(),new MediaStateSync();const context={player:this,qualities:new VideoQualityList(),audioTracks:new AudioTrackList(),storage:null,$provider:signal(null),$providerSetup:signal(!1),$props:this.$props,$state:this.$state};context.remote=this.remoteControl=new MediaRemoteControl(void 0),context.remote.setPlayer(this),context.textTracks=new TextTrackList(),context.textTracks[TextTrackSymbol_crossOrigin]=this.$state.crossOrigin,context.textRenderers=new TextRenderers(context),context.ariaKeys={},this.#media=context,provideContext(mediaContext,context),this.orientation=new ScreenOrientationController(),new FocusVisibleController(),new MediaKeyboardController(context);const request=new MediaRequestContext();this.#stateMgr=new MediaStateManager(request,context),this.#requestMgr=new MediaRequestManager(this.#stateMgr,request,context),context.delegate=new MediaPlayerDelegate(this.#stateMgr.handle.bind(this.#stateMgr),context),context.notify=context.delegate.notify.bind(context.delegate),"undefined"!=typeof navigator&&"mediaSession" in navigator&&new NavigatorMediaSession(),new MediaLoadController("load",this.startLoading.bind(this)),new MediaLoadController("posterLoad",this.startLoadingPoster.bind(this));}onSetup(){this.#setupMediaAttributes(),effect(this.#watchCanPlay.bind(this)),effect(this.#watchMuted.bind(this)),effect(this.#watchPaused.bind(this)),effect(this.#watchVolume.bind(this)),effect(this.#watchCurrentTime.bind(this)),effect(this.#watchPlaysInline.bind(this)),effect(this.#watchPlaybackRate.bind(this));}onAttach(el){el.setAttribute("data-media-player",""),setAttributeIfEmpty(el,"tabindex","0"),setAttributeIfEmpty(el,"role","regi
2on"),effect(this.#watchStorage.bind(this)),this.#watchTitle(),this.#watchOrientation(),listenEvent(0,0,this.#onFindPlayer.bind(this));}onConnect(el){const pointerQuery=window.matchMedia("(pointer: coarse)");this.#onPointerChange(pointerQuery),pointerQuery.onchange=this.#onPointerChange.bind(this);const resize=new ResizeObserver(animationFrameThrottle(this.#onResize.bind(this)));resize.observe(el),effect(this.#onResize.bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),onDispose(()=>{resize.disconnect(),pointerQuery.onchange=null;});}onDestroy(){this.#media.player=null,this.canPlayQueue.reset();}#skipTitleUpdate=!1;#watchTitle(){this.$el;const {title,live,viewType,providedTitle}=this.$state,isLive=live(),type=(str=viewType()).charAt(0).toUpperCase()+str.slice(1),typeText="Unknown"!==type?`${isLive?"Live ":""}${type}`:isLive?"Live":"Media",currentTitle=title();var str;setAttribute(this.el,"aria-label",`${typeText} Player`+(currentTitle?` - ${currentTitle}`:""));}#watchOrientation(){const orientation=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(orientation),setAttribute(this.el,"data-orientation",orientation),this.#onResize();}#watchCanPlay(){this.$state.canPlay()&&this.#provider?this.canPlayQueue.start():this.canPlayQueue.stop();}#setupMediaAttributes(){if(MediaPlayer[MEDIA_ATTRIBUTES])return void this.setAttributes(MediaPlayer[MEDIA_ATTRIBUTES]);const $attrs={"data-load":function(){return this.$props.load();},"data-captions":function(){const track=this.$state.textTrack();return !!track&&isTrackCaptionKind(track);},"data-ios-controls":function(){return this.$state.iOSControls();},"data-controls":function(){return this.controls.showing;},"data-buffering":function(){const {canLoad,canPlay,waiting}=this.$state;return canLoad()&&(!canPlay()||waiting());},"data-error":function(){const {error}=this.$state;return !!error();},"data-autoplay-error":function(){const {autoPlayError}=this.$state;return !!autoPlayError();}},alias={autoPlay:"autoplay",canAirPlay:"can-airplay",canPictureInPicture:"can-pip",pictureInPicture:"pip",playsInline:"playsinline",remotePlaybackState:"remote-state",remotePlaybackType:"remote-type",isAirPlayConnected:"airplay",isGoogleCastConnected:"google-cast"};for(const prop2 of mediaAttributes)$attrs["data-"+(alias[prop2]??camelToKebabCase(prop2))]=function(){return this.$state[prop2]();};delete $attrs.title,MediaPlayer[MEDIA_ATTRIBUTES]=$attrs,this.setAttributes($attrs);}#onFindPlayer(event){event.detail(this);}#onResize(){}#onPointerChange(queryList){}get provider(){return this.#provider;}get controls(){return this.#requestMgr.controls;}set controls(controls){this.#props.controls.set(controls);}orientation;get title(){return peek(this.$state.title);}set title(newTitle){this.#skipTitleUpdate?this.#skipTitleUpdate=!1:this.#props.title.set(newTitle);}get qualities(){return this.#media.qualities;}get audioTracks(){return this.#media.audioTracks;}get textTracks(){return this.#media.textTracks;}get textRenderers(){return this.#media.textRenderers;}get duration(){return this.$state.duration();}set duration(duration){this.#props.duration.set(duration);}get paused(){return peek(this.$state.paused);}set paused(paused){this.#queuePausedUpdate(paused);}#watchPaused(){this.#queuePausedUpdate(this.$props.paused());}#queuePausedUpdate(paused){paused?this.canPlayQueue.enqueue("paused",()=>this.#requestMgr.pause()):this.canPlayQueue.enqueue("paused",()=>this.#requestMgr.play());}get muted(){return peek(this.$state.muted);}set muted(muted){this.#queueMutedUpdate(muted);}#watchMuted(){this.#queueMutedUpdate(this.$props.muted());}#queueMutedUpdate(muted){this.canPlayQueue.enqueue("muted",()=>{this.#provider&&this.#provider.setMuted(muted);});}get currentTime(){return peek(this.$state.currentTime);}set currentTime(time){this.#queueCurrentTimeUpdate(time);}#watchCurrentTime(){this.#queueCurrentTimeUpdate(this.$props.currentTime());}#queueCurrentTimeUpdate(time){this.canPlayQueue.enqueue("currentTime",()=>{const {currentTime}=this.$state;time!==peek(currentTime)&&peek(()=>
2{if(!this.#provider)return;const boundedTime=boundTime(time,this.$state);Number.isFinite(boundedTime)&&this.#provider.setCurrentTime(boundedTime);});});}get volume(){return peek(this.$state.volume);}set volume(volume){this.#queueVolumeUpdate(volume);}#watchVolume(){this.#queueVolumeUpdate(this.$props.volume());}#queueVolumeUpdate(volume){const clampedVolume=clampNumber(0,volume,1);this.canPlayQueue.enqueue("volume",()=>{this.#provider&&this.#provider.setVolume(clampedVolume);});}get playbackRate(){return peek(this.$state.playbackRate);}set playbackRate(rate){this.#queuePlaybackRateUpdate(rate);}#watchPlaybackRate(){this.#queuePlaybackRateUpdate(this.$props.playbackRate());}#queuePlaybackRateUpdate(rate){this.canPlayQueue.enqueue("rate",()=>{this.#provider&&this.#provider.setPlaybackRate?.(rate);});}#watchPlaysInline(){this.#queuePlaysInlineUpdate(this.$props.playsInline());}#queuePlaysInlineUpdate(inline){this.canPlayQueue.enqueue("playsinline",()=>{this.#provider&&this.#provider.setPlaysInline?.(inline);});}#watchStorage(){let storageValue=this.$props.storage(),storage=isString(storageValue)?new LocalMediaStorage():storageValue;if(storage?.onChange){const {source}=this.$state,playerId=isString(storageValue)?storageValue:this.el?.id,mediaId=computed(this.#computeMediaId.bind(this));effect(()=>storage.onChange(source(),mediaId(),playerId||void 0));}this.#media.storage=storage,this.#media.textTracks.setStorage(storage),onDispose(()=>{storage?.onDestroy?.(),this.#media.storage=null,this.#media.textTracks.setStorage(null);});}#computeMediaId(){const {clipStartTime,clipEndTime}=this.$props,{source}=this.$state,src=source();return src.src?`${src.src}:${clipStartTime()}:${clipEndTime()}`:null;}async play(trigger){return this.#requestMgr.play(trigger);}async pause(trigger){return this.#requestMgr.pause(trigger);}async enterFullscreen(target,trigger){return this.#requestMgr.enterFullscreen(target,trigger);}async exitFullscreen(target,trigger){return this.#requestMgr.exitFullscreen(target,trigger);}enterPictureInPicture(trigger){return this.#requestMgr.enterPictureInPicture(trigger);}exitPictureInPicture(trigger){return this.#requestMgr.exitPictureInPicture(trigger);}seekToLiveEdge(trigger){this.#requestMgr.seekToLiveEdge(trigger);}startLoading(trigger){this.#media.notify("can-load",void 0,trigger);}startLoadingPoster(trigger){this.#media.notify("can-load-poster",void 0,trigger);}requestAirPlay(trigger){return this.#requestMgr.requestAirPlay(trigger);}requestGoogleCast(trigger){return this.#requestMgr.requestGoogleCast(trigger);}setAudioGain(gain,trigger){return this.#requestMgr.setAudioGain(gain,trigger);}destroy(){super.destroy(),this.#media.remote.setPlayer(null),this.dispatch("destroy");}}const mediaplayer__proto=MediaPlayer.prototype;function resolveStreamTypeFromHLSManifest(manifestSrc,requestInit){return fetch(manifestSrc,requestInit).then((res)=>res.text()).then((manifest)=>{const renditionURI=function(manifest){const matches=manifest.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return matches?matches[0].split("\n")[1].trim():null;}(manifest);if(renditionURI)return resolveStreamTypeFromHLSManifest(/^https?:/.test(renditionURI)?renditionURI:new URL(renditionURI,manifestSrc).href,requestInit);const streamType=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(manifest)?"on-demand":"live";return "live"===streamType&&function(manifest){const lines=manifest.split("\n");for(const line of lines)if(line.startsWith("#EXT-X-TARGETDURATION")){const duration=parseFloat(line.split(":")[1]);if(!isNaN(duration))return duration;}return -1;}(manifest)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(manifest)||manifest.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":streamType;});}prop(mediaplayer__proto,"canPlayQueue"),prop(mediaplayer__proto,"remoteControl"),prop(mediaplayer__proto,"provider"),prop(mediaplayer__proto,"controls"),prop(mediaplayer__proto,"orientation"),prop(mediaplayer__proto,"title"),prop(mediaplayer__proto,"qualities"),prop(mediaplayer__proto,"audioTracks"),prop(mediaplayer__proto,"textTracks"),prop(mediaplayer__proto,"textRenderers"),prop(mediaplayer__proto,"duration"),prop(mediaplayer__proto,"paused"),prop(mediaplayer__proto,"muted"),prop(mediaplayer__proto,"currentTime"),prop(mediaplayer__proto,"volume"),prop(mediaplayer__proto,"playbackRate"),method(mediaplayer__proto,"play"),method(mediaplayer__proto,"pause"),method(mediaplayer__proto,"enterFullscreen"),method(mediaplayer__proto,"exitFullscreen"),method(mediaplayer__proto,"enterPictureInPicture"),method(mediaplayer__proto,"exitPictureInPicture"),method(mediaplayer__proto,"seekToLiveEdge"),method(mediaplayer__proto,"startLoading"),method(mediaplayer__proto,"startLoadingPoster"),method(mediaplayer__proto,"requestAirPlay"),method(mediaplayer__proto,"requestGoogleCast"),method(mediaplayer__proto,"setAudioGain");const sourceTypes=new Map();class SourceSelection{#initialize=!1;#loaders;#domSources;#media;#loader;constructor(domSources,media,loader,customLoaders=[]){this.#domSources=domSources,this.#media=media,this.#loader=loader;const DASH_LOADER=new DASHProviderLoader(),HLS_LOADER=new HLSProviderLoader(),VIDEO_LOADER=new VideoProviderLoader(),AUDIO_LOADER=new AudioProvi
2derLoader(),EMBED_LOADERS=[new YouTubeProviderLoader(),new VimeoProviderLoader()];this.#loaders=computed(()=>{const remoteLoader=media.$state.remotePlaybackLoader(),loaders=media.$props.preferNativeHLS()?[VIDEO_LOADER,AUDIO_LOADER,DASH_LOADER,HLS_LOADER,...EMBED_LOADERS,...customLoaders]:[HLS_LOADER,VIDEO_LOADER,AUDIO_LOADER,DASH_LOADER,...EMBED_LOADERS,...customLoaders];return remoteLoader?[remoteLoader,...loaders]:loaders;});const {$state}=media;$state.sources.set(normalizeSrc(media.$props.src()));for(const src of $state.sources()){const loader2=this.#loaders().find((loader3)=>loader3.canPlay(src));if(!loader2)continue;const mediaType=loader2.mediaType(src);media.$state.source.set(src),media.$state.mediaType.set(mediaType),media.$state.inferredViewType.set(mediaType),this.#loader.set(loader2),this.#initialize=!0;break;}}connect(){const loader=this.#loader();this.#initialize&&(this.#notifySourceChange(this.#media.$state.source(),loader),this.#notifyLoaderChange(loader),this.#initialize=!1),effect(this.#onSourcesChange.bind(this)),effect(this.#onSourceChange.bind(this)),effect(this.#onSetup.bind(this)),effect(this.#onLoadSource.bind(this)),effect(this.#onLoadPoster.bind(this));}#onSourcesChange(){this.#media.notify("sources-change",[...normalizeSrc(this.#media.$props.src()),...this.#domSources()]);}#onSourceChange(){const {$state}=this.#media,sources=$state.sources(),currentSource=peek($state.source),newSource=this.#findNewSource(currentSource,sources);if(sources[0]?.src&&!newSource.src&&!newSource.type){const {crossOrigin}=$state,credentials=getRequestCredentials(crossOrigin()),abort=new AbortController();return Promise.all(sources.map((source)=>isString(source.src)&&"?"===source.type?fetch(source.src,{method:"HEAD",credentials,signal:abort.signal}).then((res)=>(source.type=res.headers.get("content-type")||"??",sourceTypes.set(source.src,source.type),source)).catch(()=>source):source)).then((sources2)=>{if(abort.signal.aborted)return;const newSource2=this.#findNewSource(peek($state.source),sources2);tick(),newSource2.src||this.#media.notify("error",{message:"Failed to load resource.",code:4});}),()=>abort.abort();}tick();}#findNewSource(currentSource,sources){let newSource={src:"",type:""},newLoader=null,triggerEvent=new DOMEvent("sources-change",{detail:{sources}}),loaders=this.#loaders(),{started,paused,currentTime,quality,savedState}=this.#media.$state;for(const src of sources){const loader=loaders.find((loader2)=>loader2.canPlay(src));if(loader){newSource=src,newLoader=loader;break;}}if(isVideoQualitySrc(newSource)){const currentQuality=quality(),sourceQuality=sources.find((s)=>s.src===currentQuality?.src);peek(started)?savedState.set({paused:peek(paused),currentTime:peek(currentTime)}):savedState.set(null),sourceQuality&&(newSource=sourceQuality,triggerEvent=new DOMEvent("quality-change",{detail:{quality:currentQuality}}));}return isSameSrc(currentSource,newSource)||this.#notifySourceChange(newSource,newLoader,triggerEvent),newLoader!==peek(this.#loader)&&this.#notifyLoaderChange(newLoader,triggerEvent),newSource;}#notifySourceChange(src,loader,trigger){this.#media.notify("source-change",src,trigger),this.#media.notify("media-type-change",loader?.mediaType(src)||"unknown",trigger);}#notifyLoaderChange(loader,trigger){this.#media.$providerSetup.set(!1),this.#media.notify("provider-change",null,trigger),loader&&peek(()=>loader.preconnect?.(this.#media)),this.#loader.set(loader),this.#media.notify("provider-loader-change",loader,trigger);}#onSetup(){const provider=this.#media.$provider();if(provider&&!peek(this.#media.$providerSetup))return this.#media.$state.canLoad()?(scoped(()=>provider.setup(),provider.scope),void this.#media.$providerSetup.set(!0)):void peek(()=>provider.preconnect?.());}#onLoadSource(){if(!this.#media.$providerSetup())return;const provider=this.#media.$provider(),source=this.#media.$state.source(),crossOrigin=peek(this.#media.$state.crossOrigin);if(peek(this.#media.$props.preferNativeHLS),!isSameSrc(provider?.currentSrc,source)){if(this.#media.$state.canLoad()){const abort=new AbortController();return isHLSSrc(source)?resolveStreamTypeFromHLSManifest(source.src,{credentials:getRequestCredentials(crossOrigin),signal:abort.signal}).then((streamType)=>{this.#media.notify("stream-type-change",streamType);}).catch(noop):isDASHSrc(source)?(manifestSrc=source.src,requestInit={credentials:getRequestCredentials(crossOrigin),signal:abort.signal},fetch(manifestSrc,requestInit).then((res)=>res.text()).then((manifest)=>/type="static"/.test(manifest)?"on-demand":"live")).then((streamType)=>{this.#media.notify("stream-type-change",streamType);}).catch(noop):this.#media.notify("stream-type-change","on-demand"),peek(()=>{const preload=peek(this.#media.$state.preload);return provider?.loadSource(source,preload).catch((error)=>{});}),()=>abort.abort();}var manifestSrc,requestInit;try{isString(source.src)&&new URL(source.src).origin;}catch(error){}}}#onLoadPoster(){const loader=this.#loader(),{providedPoster,source,canLoadPoster}=this.#media.$state;if(!loader||!loader.loadPoster||!source()||!canLoadPoster()||providedPoster())return;const abort=new AbortController(),trigger=new DOMEvent("source-change",{detail:source});return loader.loadPoster(source(),this.#media,abort).then((url)=>{this.#media.notify("poster-change",url||"",trigger);}).catch(()=>{this.#media.notify("poster-change","",trigger);}),()=>{abort.abort();};}}function normalizeSrc(src){return (isArray(src)?src:[src]).map((src2)=>isString(src2)?{src:src2,type:inferType(src2)}:{...src2,type:inferType(src2.src,src2.type)});}function inferType(src,type){return isString(type)&&type.length?type:isString(src)&&sourceTypes.has(src)?sourceTypes.get(src):!type&&isHLSSrc({src,type:""})?"application/x-mpegurl":!type&&isDASHSrc({src,type:""}
2)?"application/dash+xml":!isString(src)||src.startsWith("blob:")?"video/object":src.includes("youtube")||src.includes("youtu.be")?"video/youtube":!src.includes("vimeo")||src.includes("progressive_redirect")||src.includes(".m3u8")?"?":"video/vimeo";}function isSameSrc(a,b){return a?.src===b?.src&&a?.type===b?.type;}class Tracks{#domTracks;#media;#prevTracks=[];constructor(domTracks,media){this.#domTracks=domTracks,this.#media=media,effect(this.#onTracksChange.bind(this));}#onTracksChange(){const newTracks=this.#domTracks();for(const oldTrack of this.#prevTracks)if(!newTracks.some((t)=>t.id===oldTrack.id)){const track=oldTrack.id&&this.#media.textTracks.getById(oldTrack.id);track&&this.#media.textTracks.remove(track);}for(const newTrack of newTracks){const id=newTrack.id||TextTrack.createId(newTrack);this.#media.textTracks.getById(id)||(newTrack.id=id,this.#media.textTracks.add(newTrack));}this.#prevTracks=newTracks;}}class MediaProvider extends Component{static props={loaders:[]};static state=new State({loader:null});#media;#sources;#domSources=signal([]);#domTracks=signal([]);#loader=null;onSetup(){this.#media=useMediaContext(),this.#sources=new SourceSelection(this.#domSources,this.#media,this.$state.loader,this.$props.loaders());}onAttach(el){el.setAttribute("data-media-provider","");}onConnect(el){this.#sources.connect(),new Tracks(this.#domTracks,this.#media);const resize=new ResizeObserver(animationFrameThrottle(this.#onResize.bind(this)));resize.observe(el);const mutations=new MutationObserver(this.#onMutation.bind(this));mutations.observe(el,{attributes:!0,childList:!0}),this.#onResize(),this.#onMutation(),onDispose(()=>{resize.disconnect(),mutations.disconnect();});}#loadRafId=-1;load(target){target?.setAttribute("aria-hidden","true"),window.cancelAnimationFrame(this.#loadRafId),this.#loadRafId=requestAnimationFrame(()=>this.#runLoader(target)),onDispose(()=>{window.cancelAnimationFrame(this.#loadRafId);});}#runLoader(target){if(!this.scope)return;const loader=this.$state.loader(),{$provider}=this.#media;this.#loader===loader&&loader?.target===target&&peek($provider)||(this.#destroyProvider(),this.#loader=loader,loader&&(loader.target=target||null),loader&&target&&loader.load(this.#media).then((provider)=>{this.scope&&peek(this.$state.loader)===loader&&this.#media.notify("provider-change",provider);}));}onDestroy(){this.#loader=null,this.#destroyProvider();}#destroyProvider(){this.#media?.notify("provider-change",null);}#onResize(){if(!this.el)return;const {player,$state}=this.#media,width=this.el.offsetWidth,height=this.el.offsetHeight;player&&($state.mediaWidth.set(width),$state.mediaHeight.set(height),player.el&&(setStyle(player.el,"--media-width",width+"px"),setStyle(player.el,"--media-height",height+"px")));}#onMutation(){const sources=[],tracks=[],children=this.el.children;for(const el of children)if(!el.hasAttribute("data-vds"))if(el instanceof HTMLSourceElement){const src={id:el.id,src:el.src,type:el.type};for(const prop of ["id","src","width","height","bitrate","codec"]){const value=el.getAttribute(`data-${prop}`);isString(value)&&(src[prop]=/id|src|codec/.test(prop)?value:Number(value));}sources.push(src);}else{if(el instanceof HTMLTrackElement){const track={src:el.src,kind:el.track.kind,language:el.srclang,label:el.label,default:el.default,type:el.getAttribute("data-type")};tracks.push({id:el.id||TextTrack.createId(track),...track});}}this.#domSources.set(sources),this.#domTracks.set(tracks),tick();}}function padNumberWithZeroes(num,expectedLength){const str=String(num),actualLength=str.length;if(actualLength<expectedLength)return `${"0".repeat(expectedLength-actualLength)}${num}`;return str;}function parseTime(duration){return {hours:Math.trunc(duration/3600),minutes:Math.trunc(duration%3600/60),seconds:Math.trunc(duration%60),fraction:Number((duration-Math.trunc(duration)).toPrecision(3))};}function formatTime(duration,{padHrs=null,padMins=null,showHrs=!1,showMs=!1}={}){const {hours,minutes,seconds,fraction}=parseTime(duration),paddedHours=padHrs?padNumberWithZeroes(hours,2):hours,time=`${padMins||isNull(padMins)&&duration>=3600?padNumberWithZeroes(minutes,2):minutes}:${padNumberWithZeroes(seconds,2)}${showMs&&fraction>0?`.${String(fraction).replace(/^0?\./,"")}`:""}`;return hours>0||showHrs?`${paddedHours}:${time}`:time;}function formatSpokenTime(duration){const spokenParts=[],{hours,minutes,seconds}=parseTime(duration);return hours>0&&spokenParts.push(`${hours} hour`),minutes>0&&spokenParts.push(`${minutes} min`),(seconds>
20||0===spokenParts.length)&&spokenParts.push(`${seconds} sec`),spokenParts.join(" ");}method(MediaProvider.prototype,"load");class Popper extends ViewController{#delegate;constructor(delegate){super(),this.#delegate=delegate,effect(this.#watchTrigger.bind(this));}onDestroy(){this.#stopAnimationEndListener?.(),this.#stopAnimationEndListener=null;}#watchTrigger(){const trigger=this.#delegate.trigger();if(!trigger)return void this.hide();const show=this.show.bind(this),hide=this.hide.bind(this);this.#delegate.listen(trigger,show,hide);}#showTimerId=-1;#hideRafId=-1;#stopAnimationEndListener=null;show(trigger){this.#cancelShowing(),window.cancelAnimationFrame(this.#hideRafId),this.#hideRafId=-1,this.#stopAnimationEndListener?.(),this.#stopAnimationEndListener=null,this.#showTimerId=window.setTimeout(()=>{this.#showTimerId=-1;const content=this.#delegate.content();content&&content.style.removeProperty("display"),peek(()=>this.#delegate.onChange(!0,trigger));},this.#delegate.showDelay?.()??0);}hide(trigger){this.#cancelShowing(),peek(()=>this.#delegate.onChange(!1,trigger)),this.#hideRafId=requestAnimationFrame(()=>{this.#cancelShowing(),this.#hideRafId=-1;const content=this.#delegate.content();if(content){const onHide=()=>{content.style.display="none",this.#stopAnimationEndListener=null;};if("none"!==getComputedStyle(content).animationName){this.#stopAnimationEndListener?.();const stop=listenEvent();this.#stopAnimationEndListener=stop;}else onHide();}});}#cancelShowing(){window.clearTimeout(this.#showTimerId),this.#showTimerId=-1;}}class ToggleButtonController extends ViewController{static props={disabled:!1};#delegate;constructor(delegate){super(),this.#delegate=delegate,new FocusVisibleController(),delegate.keyShortcut&&new ARIAKeyShortcuts(delegate.keyShortcut);}onSetup(){const {disabled}=this.$props;this.setAttributes({"data-pressed":this.#delegate.isPresssed,"aria-pressed":this.#isARIAPressed.bind(this),"aria-disabled":()=>disabled()?"true":null});}onAttach(el){setAttributeIfEmpty(el,"tabindex","0"),setAttributeIfEmpty(el,"role","button"),setAttributeIfEmpty(el,"type","button");}onConnect(el){const events=onPress(el,this.#onMaybePress.bind(this));for(const type of ["click","touchstart"])events.add(type,this.#onInteraction.bind(this),{passive:!0});}#isARIAPressed(){return ariaBool$1(this.#delegate.isPresssed());}#onPressed(event){isWriteSignal(this.#delegate.isPresssed)&&this.#delegate.isPresssed.set((p)=>!p);}#onMaybePress(event){if(this.$props.disabled()||this.el.hasAttribute("data-disabled"))return event.preventDefault(),void event.stopImmediatePropagation();event.preventDefault(),(this.#delegate.onPress??this.#onPressed).call(this,event);}#onInteraction(event){this.$props.disabled()&&(event.preventDefault(),event.stopImmediatePropagation());}}prop(class extends Component{static props={disabled:!1,defaultPressed:!1};#pressed=signal(!1);get pressed(){return this.#pressed();}constructor(){super(),new ToggleButtonController({isPresssed:this.#pressed});}}.prototype,"pressed");const sliderState=new State({min:0,max:100,value:0,step:1,pointerValue:0,focused:!1,dragging:!1,pointing:!1,hidden:!1,get active(){return this.dragging||this.focused||this.pointing;},get fillRate(){return calcRate(this.min,this.max,this.value);},get fillPercent(){return 100*this.fillRate;},get pointerRate(){return calcRate(this.min,this.max,this.pointerValue);},get pointerPercent(){return 100*this.pointerRate;}});function calcRate(min,max,value){const range=max-min;return range>0?(value-min)/range:0;}class IntersectionObserverController extends ViewController{#init;#observer;constructor(init){super(),this.#init=init;}onConnect(el){this.#observer=new IntersectionObserver((entries)=>{this.#init.callback?.(entries,this.#observer);},this.#init),this.#observer.observe(el),onDispose(this.#onDisconnect.bind(this));}#onDisconnect(){this.#observer?.disconnect(),this.#observer=void 0;}}const sliderContext=createContext(),sliderObserverContext=createContext();function getClampedValue(min,max,value,step){return clampNumber(min,round(value,(num=step,String(num).split(".")[1]?.length??0)),max);var num;}const SliderKeyDirection={Left:-1,ArrowLeft:-1,Up:1,ArrowUp:1,Right:1,ArrowRight:1,Down:-1,ArrowDown:-1};class SliderEventsController extends ViewController{#delegate;#media;#observer;constructor(delegate,media){super(),this.#delegate=delegate,this.#media=media;}onSetup(){hasProvidedContext(sliderObserverContext)&&(this.#observer=useContext(sliderObserverContext));}onConnect(el){effect(this.#attachEventListeners.bind(this,el)),effect(this.#attachPointerListeners.bind(this,el)),this.#delegate.swipeGesture&&effect(this.#watchSwipeGesture.bind(this));}#watchSwipeGesture(){const {pointer}=this.#media.$state;"coarse"===pointer()&&this.#delegate.swipeGesture()?(this.#provider=this.#media.player.el?.querySelector("media-provider,[data-media-provider]"),this.#provider&&new EventsController(this.#provider).add("touchstart",this.#onTouchStart.bind(this),{passive:!0}).add("touchmove",this.#onTouchMove.bind(this),{passive:!1})):this.#provider=null;}#provider=null;#touch=null;#touchStartValue=null;#onTouchStart(event){this.#touch=event.touches[0];}#onTouchMove(event){if(isNull(this.#touch)||isTouchPinchEvent(event))return;const touch=event.touches[0],xDiff=touch.clientX-this.#touch.clientX,yDiff=touch.clientY-this.#touch.clientY,isDragging=this.$state.dragging();!isDragging&&Math.abs(yDiff)>5||isDragging||(event.preventDefault(),Math.abs(xDiff)>20&&(this.#touch=touch,this.#touchStartValue=this.$state.value(),this.#onStartDragging(this.#touchStartValue,event)));}#attachEventListeners(el){const {hidden}=this.$props;listenEvent(0,0,this.#onFocus.bind(this)),hidden()||this.#delegate.isDisabled()||new EventsController(el).add("keyup",this.#onKeyUp.bind(this)).add("keydown",this.#onKeyDown.bind(this)).add("pointerenter",this.#onPointerEnter.bind(this)).add("pointermove",this.#onPointerMove.bind(this)).add("pointerleave",this.#onPointerLeave.bind(this)).add("pointerdown",this.#onPointerDown.bind(this));}#attachPointerListeners(el){!this.#delegate.isDisabled()&&this.$state.dragging()&&new EventsController(document).add("pointerup",this.#onDocumentPointerUp.bind(this),{capture:!0}).add("pointermove",this.#onDocumentPointerMove.bind(this)).add("touchmove",this.#onDocumentTouchMove.bind(this),{passive:!1});}#onFocus(){this.#updatePointerValue(this.$state.value());}
2#updateValue(newValue,trigger){const {value,min,max,dragging}=this.$state,clampedValue=Math.max(min(),Math.min(newValue,max()));value.set(clampedValue);const event=this.createEvent("value-change",{detail:clampedValue,trigger});if(this.dispatch(event),this.#delegate.onValueChange?.(event),dragging()){const event2=this.createEvent("drag-value-change",{detail:clampedValue,trigger});this.dispatch(event2),this.#delegate.onDragValueChange?.(event2);}}#updatePointerValue(value,trigger){const {pointerValue,dragging}=this.$state;pointerValue.set(value),this.dispatch("pointer-value-change",{detail:value,trigger}),dragging()&&this.#updateValue(value,trigger);}#getPointerValue(event){let thumbPositionRate,rect=this.el.getBoundingClientRect(),{min,max}=this.$state;if("vertical"===this.$props.orientation()){const {bottom:trackBottom,height:trackHeight}=rect;thumbPositionRate=(trackBottom-event.clientY)/trackHeight;}else if(this.#touch&&isNumber(this.#touchStartValue)){const {width}=this.#provider.getBoundingClientRect(),rate=(event.clientX-this.#touch.clientX)/width,range=max()-min(),diff=range*Math.abs(rate);thumbPositionRate=(rate<0?this.#touchStartValue-diff:this.#touchStartValue+diff)/range;}else{const {left:trackLeft,width:trackWidth}=rect;thumbPositionRate=(event.clientX-trackLeft)/trackWidth;}return Math.max(min(),Math.min(max(),this.#delegate.roundValue(function(min,max,rate,step){const stepRatio=(max-min)*clampNumber(0,rate,1)/step;return min+step*Math.round(stepRatio);}(min(),max(),thumbPositionRate,this.#delegate.getStep()))));}#onPointerEnter(event){this.$state.pointing.set(!0);}#onPointerMove(event){const {dragging}=this.$state;dragging()||this.#updatePointerValue(this.#getPointerValue(event),event);}#onPointerLeave(event){this.$state.pointing.set(!1);}#onPointerDown(event){if(0!==event.button)return;const value=this.#getPointerValue(event);this.#onStartDragging(value,event),this.#updatePointerValue(value,event);}#onStartDragging(value,trigger){const {dragging}=this.$state;if(dragging())return;dragging.set(!0),this.#media.remote.pauseControls(trigger);const event=this.createEvent("drag-start",{detail:value,trigger});this.dispatch(event),this.#delegate.onDragStart?.(event),this.#observer?.onDragStart?.();}#onStopDragging(value,trigger){const {dragging}=this.$state;if(!dragging())return;dragging.set(!1),this.#media.remote.resumeControls(trigger);const event=this.createEvent("drag-end",{detail:value,trigger});this.dispatch(event),this.#delegate.onDragEnd?.(event),this.#touch=null,this.#touchStartValue=null,this.#observer?.onDragEnd?.();}#lastDownKey;#repeatedKeys=!1;#onKeyDown(event){if(!Object.keys(SliderKeyDirection).includes(event.key))return;const {key}=event,jumpValue=this.#calcJumpValue(event);if(!isNull(jumpValue))return this.#updatePointerValue(jumpValue,event),void this.#updateValue(jumpValue,event);const newValue=this.#calcNewKeyValue(event);this.#repeatedKeys||(this.#repeatedKeys=key===this.#lastDownKey,!this.$state.dragging()&&this.#repeatedKeys&&this.#onStartDragging(newValue,event)),this.#updatePointerValue(newValue,event),this.#lastDownKey=key;}#onKeyUp(event){if(!Object.keys(SliderKeyDirection).includes(event.key)||!isNull(this.#calcJumpValue(event)))return;const newValue=this.#repeatedKeys?this.$state.pointerValue():this.#calcNewKeyValue(event);this.#updateValue(newValue,event),this.#onStopDragging(newValue,event),this.#lastDownKey="",this.#repeatedKeys=!1;}#calcJumpValue(event){let key=event.key,{min,max}=this.$state;return "Home"===key||"PageUp"===key?min():"End"===key||"PageDown"===key?max():!event.metaKey&&/^[0-9]$/.test(key)?(max()-min())/10*Number(key):null;}#calcNewKeyValue(event){const {key,shiftKey}=event;event.preventDefault(),event.stopPropagation();const {shiftKeyMultiplier}=this.$props,{min,max,value,pointerValue}=this.$state,step=this.#delegate.getStep(),keyStep=this.#delegate.getKeyStep(),diff=(shiftKey?keyStep*shiftKeyMultiplier():keyStep)*Number(SliderKeyDirection[key]),steps=((this.#repeatedKeys?pointerValue():this.#delegate.getValue?.()??value())+diff)/step;return Math.max(min(),Math.min(max(),Number((step*steps).toFixed(3))));}#onDocumentPointerUp(event){if(0!==event.button)return;event.preventDefault(),event.stopImmediatePropagation();const value=this.#getPointerValue(event);this.#updatePointerValue(value,event),this.#onStopDragging(value,event);}#onDocumentTouchMove(event){event.preventDefault();}#onDocumentPointerMove=functionThrottle((event)=>{this.#updatePointerValue(this.#getPointerValue(event),event);},20,{leading:!0});}const sliderValueFormatContext=createContext(()=>({}));class SliderController extends ViewController{static props={hidden:!1,disabled:!1,step:1,keyStep:1,orientation:"horizontal",shiftKeyMultiplier:5};#media;#delegate;#isVisible=signal(!0);#isIntersecting=signal(!0);constructor(delegate){super(),this.#delegate=delegate;}onSetup(){this.#media=useMediaContext();const focus=new FocusVisibleController();
2focus.attach(this),this.$state.focused=focus.focused.bind(focus),hasProvidedContext(sliderValueFormatContext)||provideContext(sliderValueFormatContext,{default:"value"}),provideContext(sliderContext,{orientation:this.$props.orientation,disabled:this.#delegate.isDisabled,preview:signal(null)}),effect(this.#watchValue.bind(this)),effect(this.#watchStep.bind(this)),effect(this.#watchDisabled.bind(this)),this.#setupAttrs(),new SliderEventsController(this.#delegate,this.#media).attach(this),new IntersectionObserverController({callback:this.#onIntersectionChange.bind(this)}).attach(this);}onAttach(el){setAttributeIfEmpty(el,"role","slider"),setAttributeIfEmpty(el,"tabindex","0"),setAttributeIfEmpty(el,"autocomplete","off"),this.#watchCSSVars();}onConnect(el){onDispose(observeVisibility(el,this.#isVisible.set)),effect(this.#watchHidden.bind(this));}#onIntersectionChange(entries){this.#isIntersecting.set(entries[0].isIntersecting);}#watchHidden(){const {hidden}=this.$props;this.$state.hidden.set(hidden()||!this.#isVisible()||!this.#isIntersecting.bind(this));}#watchValue(){const {dragging,value,min,max}=this.$state;peek(dragging)||value.set(getClampedValue(min(),max(),value(),this.#delegate.getStep()));}#watchStep(){this.$state.step.set(this.#delegate.getStep());}#watchDisabled(){if(!this.#delegate.isDisabled())return;const {dragging,pointing}=this.$state;dragging.set(!1),pointing.set(!1);}#getARIADisabled(){return ariaBool$1(this.#delegate.isDisabled());}#setupAttrs(){const {orientation}=this.$props,{dragging,active,pointing}=this.$state;this.setAttributes({"data-dragging":dragging,"data-pointing":pointing,"data-active":active,"aria-disabled":this.#getARIADisabled.bind(this),"aria-valuemin":this.#delegate.aria.valueMin??this.$state.min,"aria-valuemax":this.#delegate.aria.valueMax??this.$state.max,"aria-valuenow":this.#delegate.aria.valueNow,"aria-valuetext":this.#delegate.aria.valueText,"aria-orientation":orientation});}#watchCSSVars(){const {fillPercent,pointerPercent}=this.$state;this.#updateSliderVars(round(fillPercent(),3),round(pointerPercent(),3));}#updateSliderVars=animationFrameThrottle();}class Slider extends Component{static props={...SliderController.props,min:0,max:100,value:0};static state=sliderState;constructor(){super(),new SliderController({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.$props.disabled,aria:{valueNow:this.#getARIAValueNow.bind(this),valueText:this.#getARIAValueText.bind(this)}});}onSetup(){effect(this.#watchValue.bind(this)),effect(this.#watchMinMax.bind(this));}#getARIAValueNow(){const {value}=this.$state;return Math.round(value());}#getARIAValueText(){const {value,max}=this.$state;return round(value()/max()*100,2)+"%";}#watchValue(){const {value}=this.$props;this.$state.value.set(value());}#watchMinMax(){const {min,max}=this.$props;this.$state.min.set(min()),this.$state.max.set(max());}}class SliderVideo extends Component{static props={src:null,crossOrigin:null};static state=new State({video:null,src:null,crossOrigin:null,canPlay:!1,error:null,hidden:!1});#media;#slider;get video(){return this.$state.video();}onSetup(){this.#media=useMediaContext(),this.#slider=useState(Slider.state),this.#watchCrossOrigin(),this.setAttributes({"data-loading":this.#isLoading.bind(this),"data-hidden":this.$state.hidden,"data-error":this.#hasError.bind(this),"aria-hidden":$ariaBool(this.$state.hidden)});}onAttach(el){effect(this.#watchVideo.bind(this)),effect(this.#watchSrc.bind(this)),effect(this.#watchCrossOrigin.bind(this)),effect(this.#watchHidden.bind(this)),effect(this.#onSrcChange.bind(this)),effect(this.#onUpdateTime.bind(this));}#watchVideo(){const video=this.$state.video();video&&(video.readyState>=2&&this.#onCanPlay(),new EventsController(video).add("canplay",this.#onCanPlay.bind(this)).add("error",this.#onError.bind(this)));}#watchSrc(){const {src}=this.$state,{canLoad}=this.#media.$state;src.set(canLoad()?this.$props.src():null);}#watchCrossOrigin(){const {crossOrigin:crossOriginProp}=this.$props,{crossOrigin:crossOriginState}=this.$state,{crossOrigin:mediaCrossOrigin}=this.#media.$state,crossOrigin=null!==crossOriginProp()?crossOriginProp():mediaCrossOrigin();crossOriginState.set(!0===crossOrigin?"anonymous":crossOrigin);}#isLoading(){const {canPlay,hidden}=this.$state;return !canPlay()&&!hidden();}#hasError(){const {error}=this.$state;return !isNull(error);}#watchHidden(){const {src,hidden}
2=this.$state,{canLoad,duration}=this.#media.$state;hidden.set(canLoad()&&(!src()||this.#hasError()||!Number.isFinite(duration())));}#onSrcChange(){const {src,canPlay,error}=this.$state;src(),canPlay.set(!1),error.set(null);}#onCanPlay(event){const {canPlay,error}=this.$state;canPlay.set(!0),error.set(null),this.dispatch("can-play",{trigger:event});}#onError(event){const {canPlay,error}=this.$state;canPlay.set(!1),error.set(event),this.dispatch("error",{trigger:event});}#onUpdateTime(){const {video,canPlay}=this.$state,{duration}=this.#media.$state,{pointerRate}=this.#slider,media=video();canPlay()&&media&&Number.isFinite(duration())&&Number.isFinite(pointerRate())&&(media.currentTime=pointerRate()*duration());}}prop(SliderVideo.prototype,"video");method(class extends Component{static props={type:"pointer",format:null,showHours:!1,showMs:!1,padHours:null,padMinutes:null,decimalPlaces:2};#format;#text;#slider;onSetup(){this.#slider=useState(Slider.state),this.#format=useContext(sliderValueFormatContext),this.#text=computed(this.getValueText.bind(this));}getValueText(){const {type,format:$format,decimalPlaces,padHours,padMinutes,showHours,showMs}=this.$props,{value:sliderValue,pointerValue,min,max}=this.#slider,format=$format?.()??this.#format.default,value="current"===type()?sliderValue():pointerValue();if("percent"===format){const percent=value/(max()-min())*100;return (this.#format.percent??round)(percent,decimalPlaces())+"%";}return "time"===format?(this.#format.time??formatTime)(value,{padHrs:padHours(),padMins:padMinutes(),showHrs:showHours(),showMs:showMs()}):(this.#format.value?.(value)??value.toFixed(2))+"";}}.prototype,"getValueText");class TimeSlider extends Component{static props={...SliderController.props,step:.1,keyStep:5,shiftKeyMultiplier:2,pauseWhileDragging:!1,noSwipeGesture:!1,seekingRequestThrottle:100};static state=sliderState;#media;#dispatchSeeking;#chapter=signal(null);constructor(){super();const {noSwipeGesture}=this.$props;new SliderController({swipeGesture:()=>!noSwipeGesture(),getValue:this.#getValue.bind(this),getStep:this.#getStep.bind(this),getKeyStep:this.#getKeyStep.bind(this),roundValue:this.#roundValue,isDisabled:this.#isDisabled.bind(this),aria:{valueNow:this.#getARIAValueNow.bind(this),valueText:this.#getARIAValueText.bind(this)},onDragStart:this.#onDragStart.bind(this),onDragValueChange:this.#onDragValueChange.bind(this),onDragEnd:this.#onDragEnd.bind(this),onValueChange:this.#onValueChange.bind(this)});}onSetup(){this.#media=useMediaContext(),provideContext(sliderValueFormatContext,{default:"time",value:this.#formatValue.bind(this),time:this.#formatTime.bind(this)}),this.setAttributes({"data-chapters":this.#hasChapters.bind(this)}),this.setStyles({"--slider-progress":this.#calcBufferedPercent.bind(this)}),effect(this.#watchCurrentTime.bind(this)),effect(this.#watchSeekingThrottle.bind(this));}onAttach(el){el.setAttribute("data-media-time-slider",""),setAttributeIfEmpty(el,"aria-label","Seek");}onConnect(el){effect(this.#watchPreviewing.bind(this)),watchActiveTextTrack(this.#media.textTracks,"chapters",this.#chapter.set);}#calcBufferedPercent(){const {bufferedEnd,duration}=this.#media.$state;return round(100*Math.min(bufferedEnd()/Math.max(duration(),1),1),3)+"%";}#hasChapters(){const {duration}=this.#media.$state;return this.#chapter()?.cues.length&&Number.isFinite(duration())&&duration()>0;}#watchSeekingThrottle(){this.#dispatchSeeking=functionThrottle(this.#seeking.bind(this),this.$props.seekingRequestThrottle());}#watchCurrentTime(){if(this.$state.hidden())return;const {value,dragging}=this.$state,newValue=this.#getValue();peek(dragging)||(value.set(newValue),this.dispatch("value-change",{detail:newValue}));}#watchPreviewing(){const player=this.#media.player.el,{preview}=useContext(sliderContext);player&&preview()&&setAttribute(player,"data-preview",this.$state.active());}#seeking(time,event){this.#media.remote.seeking(time,event);}#seek(time,percent,event){this.#dispatchSeeking.cancel();const {live}=this.#media.$state;live()&&percent>=99?this.#media.remote.seekToLiveEdge(event):this.#media.remote.seek(time,event);}#playingBeforeDragStart=!1;#onDragStart(event){const {pauseWhileDragging}=this.$props;if(pauseWhileDragging()){const {paused}=this.#media.$state;this.#playingBeforeDragStart=!paused(),this.#media.remote.pause(event);}}#onDragValueChange(event){this.#dispatchSeeking(this.#percentToTime(event.detail),event);}#onDragEnd(event){const {seeking}=this.#media.$state;peek(seeking)||this.#seeking(this.#percentToTime(event.detail),event);const percent=event.detail;this.#seek(this.#percentToTime(percent),percent,event);const {pauseWhileDragging}=this.$props;pauseWhileDragging()&&this.#playingBeforeDragStart&&(this.#media.remote.play(event),this.#playingBeforeDragStart=!1);}#onValueChange(event){const {dragging}=this.$state;!dragging()&&event.trigger&&this.#onDragEnd(event);}#getValue(){const {currentTime}=this.#media.$state;return this.#timeToPercent(currentTime());}#getStep(){const value=this.$props.step()/this.#media.$state.duration()*100;return Number.isFinite(value)?value:1;}#getKeyStep(){const value=this.$props.keyStep()/this.#media.$state.duration()*100;return Number.isFinite(value)?value:1;}#roundValue(value){return round(value,3);}#isDisabled(){const {disabled}=this.$props,{canSeek}=this.#media.$state;return disabled()||!canSeek();}#getARIAValueNow(){const {value}=this.$state;return Math.round(value());}#getARIAValueText(){const time=this.#percentToTime(this.$state.value()),{duration}=this.#media.$state;return Number.isFinite(time)?`${formatSpokenTime(time)} out of ${formatSpokenTime(duration())}`:"live";}#percentToTime(percent){const {duration}=this.#media.$state;return round(percent/100*duration(),5);}#timeToPercent(time){const {liveEdge,duration}=this.#media.$state,rate=Math.max(0,Math.min(1,liveEdge()?1:Math.min(time,duration())/duration()));return Number.isNaN(rate)?0:Number.isFinite(rate)?100*rate:100;}#formatValue(percent){const time=this.#percentToTime(percent),{live,duration}=this.#media.$state;return Number.isFinite(time)?(live()?time-duration():time).toFixed(0):"LIVE";}#formatTime(percent,options){const time=this.#percentToTime(percent),{live,duration}=this.#media.$state,value=live()?time-duration():time;return Number.isFinite(time)?`${value<0?"-":""}${formatTime(Math.abs(value),options)}`:"LIVE";}}const sliderchapters__proto=class extends Component{static props={disabled:!1};#media;#sliderState;#updateScope;#titleRef=null;#refs=[];#$track=signal(null);#$cues=signal([]);#activeIndex=signal(-1);#activePointerIndex=signal(-1);#bufferedIndex=0;get cues(){return this.#$cues();}get activeCue(){return this.#$cues()[this.#activeIndex()]||null;}get activePointerCue(){return this.#$cues()[this.#activePointerIndex()]||null;}onSetup(){this.#media=useMediaContext(),this.#sliderState=useState(TimeSlider.state);}onAttach(el){watchActiveTextTrack(this.#media.textTracks,"chapters",this.#setTrack.bind(this)),effect(this.#watchSource.bind(this));}onConnect(){onDispose(()=>this.#reset.bind(this));}onDestroy(){this.#setTrack(null);}setRefs(refs){if(this.#refs=refs,this.#updateScope?.dispose(),1===this.#refs.length){const el=this.#refs[0];el.style.width="100%",el.style.setProperty("--chapter-fill","var(--slider-fill)"),el.style.setProperty("--chapter-progress","var(--slider-progress)");}else this.#refs.length>0&&scoped(()=>this.#watch(),this.#updateScope=new ScopeNode());}#setTrack(track){peek(this.#$track)!==track&&(this.#reset(),this.#$track.set(track));}#reset(){this.#refs=[],this.#$cues.set([]),this.#activeIndex.set(-1),this.#activePointerIndex.set(-1),this.#bufferedIndex=0,this.#updateScope?.dispose();}#watch(){this.#refs.length&&effect(this.#watchUpdates.bind(this));}#watchUpdates(){const {hidden}=this.#sliderState;hidden()||(effect(this.#watchContainerWidths.bind(this)),effect(this.#watchFillPercent.bind(this)),effect(this.#watchPointerPercent.bind(this)),effect(this.#watchBufferedPercent.bind(this)));}#watchContainerWidths(){const cues=this.#$cues();if(!cues.length)return;let cue,{seekableStart,seekableEnd}=this.#media.$state,startTime=seekableStart(),duration=(seekableEnd()||cues[cues.length-1].endTime)-startTime,remainingWidth=100;for(let i=0;i<cues.length;i++)if(cue=cues[i],this.#refs[i]){const width=i===cues.length-1?remainingWidth:round((cue.endTime-Math.max(startTime,cue.startTime))/duration*100,3);this.#refs[i].style.width=width+"%",remainingWidth-=width;}}#watchFillPercent(){let {liveEdge,seekableStart,seekableEnd}=this.#media.$state,{fillPercent,value}=this.#sliderState,cues=this.#$cues(),isLiveEdge=liveEdge(),prevActiveIndex=peek(this.#activeIndex),currentChapter=cues[prevActiveIndex],currentActiveIndex=isLiveEdge?this.#$cues.length-1:this.#findActiveChapterIndex(currentChapter&&currentChapter.startTime/seekableEnd()*100<=peek(value)?prevActiveIndex:0,fillPercent());isLiveEdge||!currentChapter?this.#updateFillPercents(0,cues.length,100):currentActiveIndex>prevActiveIndex?this.#updateFillPercents(prevActiveIndex,currentActiveIndex,100):currentActiveIndex<prevActiveIndex&&this.#updateFillPercents(currentActiveIndex+1,prevActiveIndex+1,0);const percent=isLiveEdge?100:this.#calcPercent(cues[currentActiveIndex],fillPercent(),seekableStart(),this.#getEndTime(cues));this.#updateFillPercent(this.#refs[currentActiveIndex],percent),this.#activeIndex.set(currentActiveIndex);}#watchPointerPercent(){let {hidden,pointerPercent}=this.#sliderState;if(hidden())return void this.#activePointerIndex.set(-1);const activeIndex=this.#findActiveChapterIndex(0,pointerPercent());this.#activePointerIndex.set(activeIndex);}#updateFillPercents(start,end,percent){for(let i=start;i<end;i++)this.#updateFillPercent(this.#refs[i],percent);}#updateFillPercent(ref,percent){ref&&(ref.style.setProperty("--chapter-fill",percent+"%"),setAttribute(ref,"data-active",percent>0&&percent<100),setAttribute(ref,"data-ended",100===percent));}#findActiveChapterIndex(startIndex,percent){let chapterPercent=0,cues=this.#$cues();if(0===percent)return 0;if(100===percent)return cues.length-1;let {seekableStart}=this.#media.$state,startTime=seekableStart(),endTime=this.#getEndTime(cues);for(let i=startIndex;i<cues.length;i++)if(chapterPercent=this.#calcPercent(cues[i],percent,startTime,endTime),chapterPercent>=0&&chapterPercent<100)return i;return 0;}#watchBufferedPercent(){this.#updateBufferedPercent(this.#bufferedPercent());}#updateBufferedPercent=animationFrameThrottle();#bufferedPercent=computed(this.#calcMediaBufferedPercent.bind(this));#calcMediaBufferedPercent(){const {bufferedEnd,duration}=this.#media.$state;return 100*round(Math.min(bufferedEnd()/Math.max(duration(),1),1),3);}#getEndTime(cues){const {seekableEnd}=this.#media.$state,endTime=seekableEnd();return Number.isFinite(endTime)?endTime:cues[cues.length-1]?.endTime||0;}#calcPercent(cue,percent,startTime,endTime){if(!cue)return 0;if(0===this.#$cues().length)return 0;const duration=endTime-startTime,cueStartTime=Math.max(0,cue.startTime-startTime),cueEndTime=Math.min(endTime,cue.endTime)-startTime,startRatio=cueStartTime/duration,startPercent=100*startRatio,endPercent=100*Math.min(1,startRatio+(cueEndTime-cueStartTime)/duration);return Math.max(0,round(percent>
2=endPercent?100:(percent-startPercent)/(endPercent-startPercent)*100,3));}#fillGaps(cues){let chapters=[],{seekableStart,seekableEnd,duration}=this.#media.$state,startTime=seekableStart(),endTime=seekableEnd();const firstCue=(cues=cues.filter((cue)=>cue.startTime<=endTime&&cue.endTime>=startTime))[0];firstCue&&firstCue.startTime>startTime&&chapters.push(new window.VTTCue(startTime,firstCue.startTime,""));for(let i=0;i<cues.length-1;i++){const currentCue=cues[i],nextCue=cues[i+1];if(chapters.push(currentCue),nextCue){const timeDiff=nextCue.startTime-currentCue.endTime;timeDiff>0&&chapters.push(new window.VTTCue(currentCue.endTime,currentCue.endTime+timeDiff,""));}}const lastCue=cues[cues.length-1];if(lastCue){chapters.push(lastCue);const endTime2=duration();endTime2>=0&&endTime2-lastCue.endTime>1&&chapters.push(new window.VTTCue(lastCue.endTime,duration(),""));}return chapters;}#watchSource(){const {source}=this.#media.$state;source(),this.#onTrackChange();}#onTrackChange(){if(!this.scope)return;const {disabled}=this.$props;if(disabled())return this.#$cues.set([]),this.#activeIndex.set(0),void (this.#bufferedIndex=0);const track=this.#$track();if(track){const onCuesChange=this.#onCuesChange.bind(this);onCuesChange(),new EventsController(track).add("add-cue",onCuesChange).add("remove-cue",onCuesChange),effect(this.#watchMediaDuration.bind(this));}return this.#titleRef=this.#findChapterTitleRef(),this.#titleRef&&effect(this.#onChapterTitleChange.bind(this)),()=>{this.#titleRef&&(this.#titleRef.textContent="",this.#titleRef=null);};}#watchMediaDuration(){this.#media.$state.duration(),this.#onCuesChange();}#onCuesChange=functionDebounce(()=>{const track=peek(this.#$track);this.scope&&track&&track.cues.length&&(this.#$cues.set(this.#fillGaps(track.cues)),this.#activeIndex.set(0),this.#bufferedIndex=0);},150,!0);#onChapterTitleChange(){const cue=this.activePointerCue||this.activeCue;this.#titleRef&&(this.#titleRef.textContent=cue?.text||"");}#findParentSlider(){let node=this.el;for(;node&&"slider"!==node.getAttribute("role");)node=node.parentElement;return node;}#findChapterTitleRef(){const slider=this.#findParentSlider();return slider?slider.querySelector('[data-part="chapter-title"]'):null;}}.prototype;prop(sliderchapters__proto,"cues"),prop(sliderchapters__proto,"activeCue"),prop(sliderchapters__proto,"activePointerCue"),method(sliderchapters__proto,"setRefs");const menuContext=createContext();function scrollIntoView(el,options){const scrolls=((e2,r2)=>{var i,s,d,h;if("undefined"==typeof document)return [];const {scrollMode:c,block:f,inline:u,boundary:a,skipOverflowHiddenElements:g}=r2,p="function"==typeof a?a:(t2)=>t2!==a;if(!t(e2))throw new TypeError("Invalid target");const m=document.scrollingElement||document.documentElement,w=[];let W=e2;for(;t(W)&&p(W);){if(W=l$1(W),W===m){w.push(W);break;}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W);}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(h=null==(d=window.visualViewport)?void 0:d.height)?h:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e2.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=((t2)=>{const e3=window.getComputedStyle(t2);return {top:parseFloat(e3.scrollMarginTop)||0,right:parseFloat(e3.scrollMarginRight)||0,bottom:parseFloat(e3.scrollMarginBottom)||0,left:parseFloat(e3.scrollMarginLeft)||0};})(e2);let k="start"===f||"nearest"===f?x-T:"end"===f?I+F:x+v/2-T+F,D="center"===u?R+E/2-V+B:"end"===u?C+B:R-V;const L=[];for(let t2=0;t2<w.length;t2++){const e3=w[t2],{height:l2,width:r3,top:i2,right:s2,bottom:d2,left:h2}=e3.getBoundingClientRect();if("if-needed"===c&&x>=0&&R>=0&&I<=H&&C<=b&&(e3===m&&!n(e3)||x>=i2&&I<=d2&&R>=h2&&C<=s2))return L;const a2=getComputedStyle(e3),g2=parseInt(a2.borderLeftWidth,10),p2=parseInt(a2.borderTopWidth,10),W2=parseInt(a2.borderRightWidth,10),T2=parseInt(a2.borderBottomWidth,10);let B2=0,F2=0;const V2="offsetWidth" in e3?e3.offsetWidth-e3.clientWidth-g2-W2:0,S="offsetHeight" in e3?e3.offsetHeight-e3.clientHeight-p2-T2:0,X="offsetWidth" in e3?0===e3.offsetWidth?0:r3/e3.offsetWidth:0,Y="offsetHeight" in e3?0===e3.offsetHeight?0:l2/e3.offsetHeight:0;if(m===e3)B2="start"===f?k:"end"===f?k-H:"nearest"===f?o$1(M,M+H,H,p2,T2,M+k,M+k+v,v):k-H/2,F2="start"===u?D:"center"===u?D-b/2:"end"===u?D-b:o$1(y,y+b,b,g2,W2,y+D,y+D+E,E),B2=Math.max(0,B2+M),F2=Math.max(0,F2+y);else{B2="start"===f?k-i2-p2:"end"===f?k-d2+T2+S:"nearest"===f?o$1(i2,d2,l2,p2,T2+S,k,k+v,v):k-(i2+l2/2)+S/2,F2="start"===u?D-h2-g2:"center"===u?D-(h2+r3/2)+V2/2:"end"===u?D-s2+W2+V2:o$1(h2,s2,r3,g2,W2+V2,D,D+E,E);const {scrollLeft:t3,scrollTop:n2}=e3;B2=0===Y?0:Math.max(0,Math.min(n2+B2/Y,e3.scrollHeight-l2/Y+S)),F2=0===X?0:Math.max(0,Math.min(t3+F2/X,e3.scrollWidth-r3/X+V2)),k+=n2-B2,D+=t3-F2;}L.push({el:e3,top:B2,left:F2});}return L;})(el,options);for(const {el:el2,top,left} of scrolls)el2.scroll({top,left,behavior:options.behavior});}const FOCUSABLE_ELEMENTS_SELECTOR=["a[href]","[tabindex]","input","select","button"].map((selector)=>`${selector}:not([aria-hidden='true'])`).join(","),VALID_KEYS=new Set(["Escape","Tab","ArrowUp","ArrowDown","Home","PageUp","End","PageDown","Enter"," "]);class MenuFocusController{#index=-1;#el=null;#elements=[];#delegate;get items(){return this.#elements;}constructor(delegate){this.#delegate=delegate;}attachMenu(el){listenEvent(0,0,this.#onFocus.bind(this)),this.#el=el,onDispose(()=>{this.#el=null;});}listen(){this.#el&&(this.update(),new EventsController(this.#el).add("keyup",this.#onKeyUp.bind(this)).add("keydown",this.#onKeyDown.bind(this)),onDispose(()=>{this.#index=-1,this.#elements=[];}));}update(){this.#index=0,this.#elements=this.#getFocusableElements();}scroll(index=this.#findActiveIndex()){const element=this.#elements[index];element&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{!function(el,options={}){scrollIntoView(el,{scrollMode:"if-needed",block:"center",inline:"center",...options});}
2(element,{behavior:"smooth",boundary:(el)=>!el.hasAttribute("data-root")});});});}focusActive(scroll=!0){const index=this.#findActiveIndex();this.#focusAt(index>=0?index:0,scroll);}#focusAt(index,scroll=!0){this.#index=index,this.#elements[index]?(this.#elements[index].focus({preventScroll:!0}),scroll&&this.scroll(index)):this.#el?.focus({preventScroll:!0});}#findActiveIndex(){return this.#elements.findIndex((el)=>document.activeElement===el||"menuitemradio"===el.getAttribute("role")&&"true"===el.getAttribute("aria-checked"));}#onFocus(){this.#index>=0||(this.update(),this.focusActive());}#validateKeyEvent(event){const el=event.target;if(function(event){return isKeyboardEvent(event)&&"Enter"===event.key;}(event)&&el instanceof Element){const role=el.getAttribute("role");return !/a|input|select|button/.test(el.localName)&&!role;}return VALID_KEYS.has(event.key);}#onKeyUp(event){this.#validateKeyEvent(event)&&(event.stopPropagation(),event.preventDefault());}#onKeyDown(event){if(this.#validateKeyEvent(event))switch(event.stopPropagation(),event.preventDefault(),event.key){case "Escape":this.#delegate.closeMenu(event);break;case "Tab":this.#focusAt(this.#nextIndex(event.shiftKey?-1:1));break;case "ArrowUp":this.#focusAt(this.#nextIndex(-1));break;case "ArrowDown":this.#focusAt(this.#nextIndex(1));break;case "Home":case "PageUp":this.#focusAt(0);break;case "End":case "PageDown":this.#focusAt(this.#elements.length-1);}}#nextIndex(delta){let index=this.#index;do index=(index+delta+this.#elements.length)%this.#elements.length;while(null===this.#elements[index]?.offsetParent);return index;}#getFocusableElements(){if(!this.#el)return [];const focusableElements=this.#el.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR),elements=[],is=(node)=>"menu"===node.getAttribute("role");for(const el of focusableElements)isHTMLElement(el)&&null!==el.offsetParent&&isElementParent(this.#el,el,is)&&elements.push(el);return elements;}}var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=(decorators,target,key,kind)=>{for(var decorator,result=__getOwnPropDesc$1(target,key),i=decorators.length-1;i>=0;i--)(decorator=decorators[i])&&(result=decorator(target,key,result)||result);return result&&__defProp$1(target,key,result),result;};let idCount=0;class Menu extends Component{static props={showDelay:0};#media;#menuId;#menuButtonId;#expanded=signal(!1);#disabled=signal(!1);#trigger=signal(null);#content=signal(null);#parentMenu;#submenus=new Set();#menuObserver=null;#popper;#focus;#isSliderActive=!1;#isTriggerDisabled=signal(!1);#transitionCallbacks=new Set();get triggerElement(){return this.#trigger();}get contentElement(){return this.#content();}get isSubmenu(){return !!this.#parentMenu;}constructor(){super();const {showDelay}=this.$props;this.#popper=new Popper({trigger:this.#trigger,content:this.#content,showDelay,listen:(trigger,show,hide)=>{onPress(trigger,(event)=>{this.#expanded()?hide(event):show(event);});const closeTarget=this.#getCloseTarget();closeTarget&&onPress(closeTarget,(event)=>{event.stopPropagation(),hide(event);});},onChange:this.#onExpandedChange.bind(this)});}onSetup(){this.#media=useMediaContext();const currentIdCount=++idCount;this.#menuId=`media-menu-${currentIdCount}`,this.#menuButtonId=`media-menu-button-${currentIdCount}`,this.#focus=new MenuFocusController({closeMenu:this.close.bind(this)}),hasProvidedContext(menuContext)&&(this.#parentMenu=useContext(menuContext)),this.#observeSliders(),this.setAttributes({"data-open":this.#expanded,"data-root":!this.isSubmenu,"data-submenu":this.isSubmenu,"data-disabled":this.#isDisabled.bind(this)}),provideContext(menuContext,{button:this.#trigger,content:this.#content,expanded:this.#expanded,hint:signal(""),submenu:!!this.#parentMenu,disable:this.#disable.bind(this),attachMenuButton:this.#attachMenuButton.bind(this),attachMenuItems:this.#attachMenuItems.bind(this),attachObserver:this.#attachObserver.bind(this),disableMenuButton:this.#disableMenuButton.bind(this),addSubmenu:this.#addSubmenu.bind(this),onTransitionEvent:(callback)=>{this.#transitionCallbacks.add(callback),onDispose(()=>{this.#transitionCallbacks.delete(callback);});}});}onAttach(el){el.style.setProperty("display","contents");}onConnect(el){effect(this.#watchExpanded.bind(this)),this.isSubmenu&&this.#parentMenu?.addSubmenu(this);}onDestroy(){this.#trigger.set(null),this.#content.set(null),this.#menuObserver=null,this.#transitionCallbacks.clear();}#observeSliders(){let sliderActiveTimer=-1,parentSliderObserver=hasProvidedContext(sliderObserverContext)?useContext(sliderObserverContext):null;provideContext(sliderObserverContext,{onDragStart:()=>{parentSliderObserver?.onDragStart?.(),window.clearTimeout(sliderActiveTimer),sliderActiveTimer=-1,this.#isSliderActive=!0;},onDragEnd:()=>{parentSliderObserver?.onDragEnd?.(),sliderActiveTimer=window.setTimeout(()=>{this.#isSliderActive=!1,sliderActiveTimer=-1;},300);}});}#watchExpanded(){const expanded=this.#isExpanded();this.isSubmenu||this.#onResize(),this.#updateMenuItemsHidden(expanded),expanded&&(effect(()=>{const {height}=this.#media.$state,content=this.#content();
2content&&setStyle(content,"--player-height",height()+"px");}),this.#focus.listen(),this.listen("pointerup",this.#onPointerUp.bind(this)),listenEvent(window,0,this.#onWindowPointerUp.bind(this)));}#attachMenuButton(button){const el=button.el,isMenuItem=this.isSubmenu,isARIADisabled=$ariaBool(this.#isDisabled.bind(this));setAttributeIfEmpty(el,"tabindex",isMenuItem?"-1":"0"),setAttributeIfEmpty(el,"role",isMenuItem?"menuitem":"button"),setAttribute(el,"id",this.#menuButtonId),setAttribute(el,"aria-haspopup","menu"),setAttribute(el,"aria-expanded","false"),setAttribute(el,"data-root",!this.isSubmenu),setAttribute(el,"data-submenu",this.isSubmenu);(()=>{setAttribute(el,"data-open",this.#expanded()),setAttribute(el,"aria-disabled",isARIADisabled());})(),this.#trigger.set(el),onDispose(()=>{this.#trigger.set(null);});}#attachMenuItems(items){const el=items.el;el.style.setProperty("display","none"),setAttribute(el,"id",this.#menuId),setAttributeIfEmpty(el,"role","menu"),setAttributeIfEmpty(el,"tabindex","-1"),setAttribute(el,"data-root",!this.isSubmenu),setAttribute(el,"data-submenu",this.isSubmenu),this.#content.set(el),onDispose(()=>this.#content.set(null));(()=>{setAttribute(el,"data-open",this.#expanded());})(),this.#focus.attachMenu(el),this.#updateMenuItemsHidden(!1);const onTransition=this.#onResizeTransition.bind(this);this.isSubmenu?this.#parentMenu?.onTransitionEvent(onTransition):(items.listen("transitionstart",onTransition),items.listen("transitionend",onTransition),items.listen("animationend",this.#onResize),items.listen("vds-menu-resize",this.#onResize));}#attachObserver(observer){this.#menuObserver=observer;}#updateMenuItemsHidden(expanded){const content=peek(this.#content);content&&setAttribute(content,"aria-hidden",ariaBool$1(!expanded));}#disableMenuButton(disabled){this.#isTriggerDisabled.set(disabled);}#wasKeyboardExpand=!1;#onExpandedChange(isExpanded,event){if(this.#wasKeyboardExpand=isKeyboardEvent(event),event?.stopPropagation(),this.#expanded()===isExpanded)return;if(this.#isDisabled())return void (isExpanded&&this.#popper.hide(event));this.el?.dispatchEvent(new Event("vds-menu-resize",{bubbles:!0,composed:!0}));const trigger=this.#trigger(),content=this.#content();if(trigger&&(setAttribute(trigger,"aria-controls",isExpanded&&this.#menuId),setAttribute(trigger,"aria-expanded",ariaBool$1(isExpanded))),content&&setAttribute(content,"aria-labelledby",isExpanded&&this.#menuButtonId),this.#expanded.set(isExpanded),this.#toggleMediaControls(event),tick(),this.#wasKeyboardExpand){isExpanded?content?.focus():trigger?.focus();for(const el of [this.el,content])el&&el.setAttribute("data-keyboard","");}else{for(const el of [this.el,content])el&&el.removeAttribute("data-keyboard");}if(this.dispatch(isExpanded?"open":"close",{trigger:event}),isExpanded)this.isSubmenu||this.#media.activeMenu===this||(this.#media.activeMenu?.close(event),this.#media.activeMenu=this),this.#menuObserver?.onOpen?.(event);else{if(this.isSubmenu){for(const el of this.#submenus)el.close(event);}else this.#media.activeMenu=null;this.#menuObserver?.onClose?.(event);}isExpanded&&requestAnimationFrame(this.#updateFocus.bind(this));}#updateFocus(){this.#isTransitionActive||this.#isSubmenuOpen||(this.#focus.update(),requestAnimationFrame(()=>{this.#wasKeyboardExpand?this.#focus.focusActive():this.#focus.scroll();}));}#isExpanded(){return !this.#isDisabled()&&this.#expanded();}#isDisabled(){return this.#disabled()||this.#isTriggerDisabled();}#disable(disabled){this.#disabled.set(disabled);}#onPointerUp(event){const content=this.#content();this.#isSliderActive||content&&isEventInside(content,event)||event.stopPropagation();}#onWindowPointerUp(event){const content=this.#content();this.#isSliderActive||content&&isEventInside(content,event)||this.close(event);}#getCloseTarget(){const target=this.el?.querySelector('[data-part="close-target"]');return this.el&&target&&isElementParent(this.el,target,(node)=>"menu"===node.getAttribute("role"))?target:null;}#toggleMediaControls(trigger){this.isSubmenu||(this.#expanded()?this.#media.remote.pauseControls(trigger):this.#media.remote.resumeControls(trigger));}#addSubmenu(menu){this.#submenus.add(menu),new EventsController(menu).add("open",this.#onSubmenuOpenBind).add("close",this.#onSubmenuCloseBind),onDispose(this.#removeSubmenuBind);}#removeSubmenuBind=this.#removeSubmenu.bind(this);#removeSubmenu(menu){this.#submenus.delete(menu);}#isSubmenuOpen=!1;#onSubmenuOpenBind=this.#onSubmenuOpen.bind(this);#onSubmenuOpen(event){this.#isSubmenuOpen=!0;const content=this.#content();this.isSubmenu&&this.triggerElement?.setAttribute("aria-hidden","true");for(const target of this.#submenus)if(target!==event.target){for(const el of [target.el,target.triggerElement])el?.setAttribute("aria-hidden","true");}if(content){const el=event.target.el;for(const child of content.children)child.contains(el)?child.setAttribute("data-open",""):child!==el&&child.setAttribute("data-hidden","");}}#onSubmenuCloseBind=this.#onSubmenuClose.bind(this);#onSubmenuClose(event){this.#isSubmenuOpen=!1;const content=this.#content();this.isSubmenu&&this.triggerElement?.setAttribute("aria-hidden","false");for(const target of this.#submenus){for(const el of [target.el,target.triggerElement])el?.setAttribute("aria-hidden","false");}if(content){for(const child of content.children)child.removeAttribute("data-open"),child.removeAttribute("data-hidden");}}#onResize=animationFrameThrottle();#isTransitionActive=!1;#onResizeTransition(event){const content=this.#content();content&&"height"===event.propertyName&&(this.#isTransitionActive="transitionstart"===event.type,setAttribute(content,"data-transition",this.#isTransitionActive?"height":null),this.#expanded()&&this.#updateFocus());for(const callback of this.#transitionCallbacks)callback(event);}open(trigger){peek(this.#expanded)||(this.#popper.show(trigger),tick());}close(trigger){peek(this.#expanded)&&(this.#popper.hide(trigger),tick());}}__decorateClass$1([prop],Menu.prototype,"triggerElement"),__decorateClass$1([prop],Menu.prototype,"contentElement"),__decorateClass$1([prop],Menu.prototype,"isSubmenu"),__decorateClass$1([method],Menu.prototype,"open"),__decorateClass$1([method],Menu.prototype,"close");prop(class extends Component{static props={disabled:!1};#menu;#hintEl=signal(null);get expanded(){return this.#menu?.expanded()??!1;}constructor(){super(),new FocusVisibleController();}onSetup(){this.#menu=useContext(menuContext);}onAttach(el){this.#menu.attachMenuButton(this),effect(this.#watchDisabled.bind(this)),setAttributeIfEmpty(el,"type","button");}onConnect(el){effect(this.#watchHintEl.bind(this)),this.#onMutation();const mutations=new MutationObserver(this.#onMutation.bind(this));mutations.observe(el,{attributeFilter:["data-part"],childList:!0,subtree:!0}),onDispose(()=>mutations.disconnect()),onPress(el,(trigger)=>{this.dispatch("select",{trigger});});}#watchDisabled(){this.#menu.disableMenuButton(this.$props.disabled());}#watchHintEl(){const el=this.#hintEl();el&&effect(()=>{const text=this.#menu.hint();text&&(el.textContent=text);});}#onMutation(){const hintEl=this.el?.querySelector('[data-part="hint"]');this.#hintEl.set(hintEl??null);}}.prototype,"expanded");const radioControllerContext=createContext();class RadioGroupController extends ViewController{#group=new Set();#value=signal("");#controller=null;onValueChange;get values(){return Array.from(this.#group).map((radio)=>
2radio.value());}get value(){return this.#value();}set value(value){this.#onChange(value);}onSetup(){provideContext(radioControllerContext,{add:this.#addRadio.bind(this),remove:this.#removeRadio.bind(this)});}onAttach(el){hasProvidedContext(menuContext)||setAttributeIfEmpty(el,"role","radiogroup"),this.setAttributes({value:this.#value});}onDestroy(){this.#group.clear();}#addRadio(radio){this.#group.has(radio)||(this.#group.add(radio),radio.onCheck=this.#onChangeBind,radio.check(radio.value()===this.#value()));}#removeRadio(radio){radio.onCheck=null,this.#group.delete(radio);}#onChangeBind=this.#onChange.bind(this);#onChange(newValue,trigger){const currentValue=peek(this.#value);if(!newValue||newValue===currentValue)return;const currentRadio=this.#findRadio(currentValue),newRadio=this.#findRadio(newValue);currentRadio?.check(!1,trigger),newRadio?.check(!0,trigger),this.#value.set(newValue),this.onValueChange?.(newValue,trigger);}#findRadio(newValue){for(const radio of this.#group)if(newValue===peek(radio.value))return radio;return null;}}const radiogroup__proto=class extends Component{static props={value:""};#controller;get values(){return this.#controller.values;}get value(){return this.#controller.value;}set value(newValue){this.#controller.value=newValue;}constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#watchValue();}#watchValue(){this.#controller.value=this.$props.value();}#onValueChange(value,trigger){const event=this.createEvent("change",{detail:value,trigger});this.dispatch(event);}}.prototype;prop(radiogroup__proto,"values"),prop(radiogroup__proto,"value");prop(class extends Component{static props={value:""};#checked=signal(!1);#controller={value:this.$props.value,check:this.#check.bind(this),onCheck:null};get checked(){return this.#checked();}constructor(){super(),new FocusVisibleController();}onSetup(){this.setAttributes({value:this.$props.value,"data-checked":this.#checked,"aria-checked":$ariaBool(this.#checked)});}onAttach(el){const isMenuItem=hasProvidedContext(menuContext);setAttributeIfEmpty(el,"tabindex",isMenuItem?"-1":"0"),setAttributeIfEmpty(el,"role",isMenuItem?"menuitemradio":"radio"),effect(this.#watchValue.bind(this));}onConnect(el){this.#addToGroup(),onPress(el,this.#onPress.bind(this)),onDispose(this.#onDisconnect.bind(this));}#onDisconnect(){scoped(()=>{useContext(radioControllerContext).remove(this.#controller);},this.connectScope);}#addToGroup(){useContext(radioControllerContext).add(this.#controller);}#watchValue(){const {value}=this.$props,newValue=value();peek(this.#checked)&&this.#controller.onCheck?.(newValue);}#onPress(event){peek(this.#checked)||(this.#onChange(!0,event),this.#onSelect(event),this.#controller.onCheck?.(peek(this.$props.value),event));}#check(value,trigger){peek(this.#checked)!==value&&this.#onChange(value,trigger);}#onChange(value,trigger){this.#checked.set(value),this.dispatch("change",{detail:value,trigger});}#onSelect(trigger){this.dispatch("select",{trigger});}}.prototype,"checked");var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(decorators,target,key,kind)=>{for(var decorator,result=__getOwnPropDesc(target,key),i=decorators.length-1;i>=0;i--)(decorator=decorators[i])&&(result=decorator(target,key,result)||result);return result&&__defProp(target,key,result),result;};class ChaptersRadioGroup extends Component{static props={thumbnails:null};#media;#menu;#controller;#track=signal(null);#cues=signal([]);get value(){return this.#controller.value;}get disabled(){return !this.#cues()?.length;}constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#media=useMediaContext(),hasProvidedContext(menuContext)&&(this.#menu=useContext(menuContext));const {thumbnails}=this.$props;this.setAttributes({"data-thumbnails":()=>!!thumbnails()});}onAttach(el){this.#menu?.attachObserver({onOpen:this.#onOpen.bind(this)});}getOptions(){const {seekableStart,seekableEnd}=this.#media.$state,startTime=seekableStart(),endTime=seekableEnd();return this.#cues().map((cue,i)=>({cue,value:i.toString(),label:cue.text,startTime:formatTime(Math.max(0,cue.startTime-startTime)),duration:formatSpokenTime(Math.min(endTime,cue.endTime)-Math.max(startTime,cue.startTime))}));}#onOpen(){peek(()=>this.#watchCurrentTime());}onConnect(el){effect(this.#watchCurrentTime.bind(this)),effect(this.#watchControllerDisabled.bind(this)),effect(this.#watchTrack.bind(this)),watchActiveTextTrack(this.#media.textTracks,"chapters",this.#track.set);}#watchTrack(){const track=this.#track();if(!track)return;const onCuesChange=this.#onCuesChange.bind(this,track);return onCuesChange(),new EventsController(track).add("add-cue",onCuesChange).add("remove-cue",onCuesChange),()=>{this.#cues.set([]);};}#onCuesChange(track){const {seekableStart,seekableEnd}=this.#media.$state,startTime=seekableStart(),endTime=seekableEnd();this.#cues.set([...track.cues].filter((cue)=>cue.startTime<=endTime&&cue.endTime>=startTime));}#watchCurrentTime(){if(!this.#menu?.expanded())return;if(!this.#track())return void (this.#controller.value="-1");const {realCurrentTime,seekableStart,seekableEnd}=this.#media.$state,startTime=seekableStart(),endTime=seekableEnd(),time=realCurrentTime(),activeCueIndex=this.#cues().findIndex((cue)=>isCueActive(cue,time));this.#controller.value=activeCueIndex.toString(),activeCueIndex>=0&&(()=>{if(!this.connectScope)return;const cue=this.#cues()[activeCueIndex],radio=this.el.querySelector("[aria-checked='true']"),
2cueStartTime=Math.max(startTime,cue.startTime),duration=Math.min(endTime,cue.endTime)-cueStartTime,playedPercent=Math.max(0,time-cueStartTime)/duration*100;radio&&setStyle(radio,"--progress",round(playedPercent,3)+"%");})();}#watchControllerDisabled(){this.#menu?.disable(this.disabled);}#onValueChange(value,trigger){if(this.disabled||!trigger)return;const index=+value,cues=this.#cues(),{clipStartTime}=this.#media.$state;isNumber(index)&&cues?.[index]&&(this.#controller.value=index.toString(),this.#media.remote.seek(cues[index].startTime-clipStartTime(),trigger),this.dispatch("change",{detail:cues[index],trigger}));}}__decorateClass([prop],ChaptersRadioGroup.prototype,"value"),__decorateClass([prop],ChaptersRadioGroup.prototype,"disabled"),__decorateClass([method],ChaptersRadioGroup.prototype,"getOptions");const audioradiogroup__proto=class extends Component{static props={emptyLabel:"Default"};#menu;#media;#controller;get value(){return this.#controller.value;}get disabled(){const {audioTracks}=this.#media.$state;return audioTracks().length<=1;}constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#media=useMediaContext(),hasProvidedContext(menuContext)&&(this.#menu=useContext(menuContext));}onConnect(el){effect(this.#watchValue.bind(this)),effect(this.#watchControllerDisabled.bind(this)),effect(this.#watchHintText.bind(this));}getOptions(){const {audioTracks}=this.#media.$state;return audioTracks().map((track)=>({track,label:track.label,value:track.label.toLowerCase()}));}#watchValue(){this.#controller.value=this.#getValue();}#watchHintText(){const {emptyLabel}=this.$props,{audioTrack}=this.#media.$state,track=audioTrack();this.#menu?.hint.set(track?.label??emptyLabel());}#watchControllerDisabled(){this.#menu?.disable(this.disabled);}#getValue(){const {audioTrack}=this.#media.$state,track=audioTrack();return track?track.label.toLowerCase():"";}#onValueChange(value,trigger){if(this.disabled)return;const index=this.#media.audioTracks.toArray().findIndex((track)=>track.label.toLowerCase()===value);if(index>=0){const track=this.#media.audioTracks[index];this.#media.remote.changeAudioTrack(index,trigger),this.dispatch("change",{detail:track,trigger});}}}.prototype;prop(audioradiogroup__proto,"value"),prop(audioradiogroup__proto,"disabled"),method(audioradiogroup__proto,"getOptions");const DEFAULT_AUDIO_GAINS=[1,1.25,1.5,1.75,2,2.5,3,4];const audiogainradiogroup__proto=class extends Component{static props={normalLabel:"Disabled",gains:DEFAULT_AUDIO_GAINS};#media;#menu;#controller;get value(){return this.#controller.value;}get disabled(){const {gains}=this.$props,{canSetAudioGain}=this.#media.$state;return !canSetAudioGain()||0===gains().length;}constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#media=useMediaContext(),hasProvidedContext(menuContext)&&(this.#menu=useContext(menuContext));}onConnect(el){effect(this.#watchValue.bind(this)),effect(this.#watchHintText.bind(this)),effect(this.#watchControllerDisabled.bind(this));}getOptions(){const {gains,normalLabel}=this.$props;return gains().map((gain)=>({label:1===gain||null===gain?normalLabel:String(100*gain)+"%",value:gain.toString()}));}#watchValue(){this.#controller.value=this.#getValue();}#watchHintText(){const {normalLabel}=this.$props,{audioGain}=this.#media.$state,gain=audioGain();this.#menu?.hint.set(1===gain||null==gain?normalLabel():String(100*gain)+"%");}#watchControllerDisabled(){this.#menu?.disable(this.disabled);}#getValue(){const {audioGain}=this.#media.$state;return audioGain()?.toString()??"1";}#onValueChange(value,trigger){if(this.disabled)return;const gain=+value;this.#media.remote.changeAudioGain(gain,trigger),this.dispatch("change",{detail:gain,trigger});}}.prototype;prop(audiogainradiogroup__proto,"value"),prop(audiogainradiogroup__proto,"disabled"),method(audiogainradiogroup__proto,"getOptions");const captionsradiogroup__proto=class extends Component{static props={offLabel:"Off"};#media;#menu;#controller;get value(){return this.#controller.value;}get disabled(){const {hasCaptions}=this.#media.$state;return !hasCaptions();}constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#media=useMediaContext(),hasProvidedContext(menuContext)&&(this.#menu=useContext(menuContext));}onConnect(el){super.onConnect?.(el),effect(this.#watchValue.bind(this)),effect(this.#watchControllerDisabled.bind(this)),effect(this.#watchHintText.bind(this));}getOptions(){const {offLabel}=this.$props,{textTracks}=this.#media.$state;return [{value:"off",label:offLabel},...textTracks().filter(isTrackCaptionKind).map((track)=>({track,label:track.label,value:this.#getTrackValue(track)}))];}#watchValue(){this.#controller.value=this.#getValue();}#watchHintText(){const {offLabel}=this.$props,{textTrack}=this.#media.$state,track=textTrack();this.#menu?.hint.set(track&&isTrackCaptionKind(track)&&"showing"===track.mode?track.label:offLabel());}#watchControllerDisabled(){this.#menu?.disable(this.disabled);}#getValue(){const {textTrack}=this.#media.$state,track=textTrack();return track&&isTrackCaptionKind(track)&&"showing"===track.mode?this.#getTrackValue(track):"off";}#onValueChange(value,trigger){if(this.disabled)return;if("off"===value){const track=this.#media.textTracks.selected;if(track){const index2=this.#media.textTracks.indexOf(track);this.#media.remote.changeTextTrackMode(index2,"disabled",trigger),this.dispatch("change",{detail:null,trigger});}return;}const index=this.#media.textTracks.toArray().findIndex((track)=>this.#getTrackValue(track)===value);if(index>=0){const track=this.#media.textTracks[index];this.#media.remote.changeTextTrackMode(index,"showing",trigger),this.dispatch("change",{detail:track,trigger});}}#getTrackValue(track){return track.id+":"+track.kind+"-"+track.label.toLowerCase();}}.prototype;prop(captionsradiogroup__proto,"value"),prop(captionsradiogroup__proto,"disabled"),method(captionsradiogroup__proto,"getOptions");const DEFAULT_PLAYBACK_RATES=[.25,.5,.75,1,1.25,1.5,1.75,2];const speedradiogroup__proto=class extends Component{static props={normalLabel:"Normal",rates:DEFAULT_PLAYBACK_RATES};#media;#menu;#controller;get value(){return this.#controller.value;}get disabled(){const {rates}=this.$props,{canSetPlaybackRate}=this.#media.$state;return !canSetPlaybackRate()||0===rates().length;}constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#media=useMediaContext(),hasProvidedContext(menuContext)&&(this.#menu=useContext(menuContext));}onConnect(el){effect(this.#watchValue.bind(this)),effect(this.#watchHintText.bind(this)),effect(this.#watchControllerDisabled.bind(this));}getOptions(){const {rates,normalLabel}=this.$props;return rates().map((rate)=>({label:1===rate?normalLabel:rate+"×",value:rate.toString()}));}#watchValue(){this.#controller.value=this.#getValue();}#watchHintText(){const {normalLabel}=this.$props,{playbackRate}=this.#media.$state,rate=playbackRate();this.#menu?.hint.set(1===rate?normalLabel():rate+"×");}#watchControllerDisabled(){this.#menu?.disable(this.disabled);}#getValue(){const {playbackRate}=this.#media.$state;return playbackRate().toString();}#onValueChange(value,trigger){if(this.disabled)return;const rate=+value;this.#media.remote.changePlaybackRate(rate,trigger),this.dispatch("change",{detail:rate,trigger});}}.prototype;prop(speedradiogroup__proto,"value"),prop(speedradiogroup__proto,"disabled"),method(speedradiogroup__proto,"getOptions");const qualityradiogroup__proto=class extends Component{static props={autoLabel:"Auto",hideBitrate:!1,sort:"descending"};#media;#menu;#controller;get value(){return this.#controller.value;}get disabled(){const {canSetQuality,qualities}=this.#media.$state;return !canSetQuality()||qualities().length<=1;}#sortedQualities=computed(()=>{const {sort}=this.$props,{qualities}=this.#media.$state;return function(qualities,desc){return [...qualities].sort(desc?compareVideoQualityDesc:compareVideoQualityAsc);}
2(qualities(),"descending"===sort());});constructor(){super(),this.#controller=new RadioGroupController(),this.#controller.onValueChange=this.#onValueChange.bind(this);}onSetup(){this.#media=useMediaContext(),hasProvidedContext(menuContext)&&(this.#menu=useContext(menuContext));}onConnect(el){effect(this.#watchValue.bind(this)),effect(this.#watchControllerDisabled.bind(this)),effect(this.#watchHintText.bind(this));}getOptions(){const {autoLabel,hideBitrate}=this.$props;return [{value:"auto",label:autoLabel},...this.#sortedQualities().map((quality)=>{const bitrate=quality.bitrate&&quality.bitrate>=0?`${round(quality.bitrate/1e6,2)} Mbps`:null;return {quality,label:quality.height+"p",value:this.#getQualityId(quality),bitrate:()=>hideBitrate()?null:bitrate};})];}#watchValue(){this.#controller.value=this.#getValue();}#watchHintText(){const {autoLabel}=this.$props,{autoQuality,quality}=this.#media.$state,qualityText=quality()?quality().height+"p":"";this.#menu?.hint.set(autoQuality()?autoLabel()+(qualityText?` (${qualityText})`:""):qualityText);}#watchControllerDisabled(){this.#menu?.disable(this.disabled);}#onValueChange(value,trigger){if(this.disabled)return;if("auto"===value)return this.#media.remote.changeQuality(-1,trigger),void this.dispatch("change",{detail:"auto",trigger});const {qualities}=this.#media.$state,index=peek(qualities).findIndex((quality)=>this.#getQualityId(quality)===value);if(index>=0){const quality=peek(qualities)[index];this.#media.remote.changeQuality(index,trigger),this.dispatch("change",{detail:quality,trigger});}}#getValue(){const {quality,autoQuality}=this.#media.$state;if(autoQuality())return "auto";const currentQuality=quality();return currentQuality?this.#getQualityId(currentQuality):"auto";}#getQualityId(quality){return quality.height+"_"+quality.bitrate;}}.prototype;prop(qualityradiogroup__proto,"value"),prop(qualityradiogroup__proto,"disabled"),method(qualityradiogroup__proto,"getOptions");signal(null);const h=(i)=>NodeList.prototype.isPrototypeOf(i)||HTMLCollection.prototype.isPrototypeOf(i)?Array.from(i):"string"==typeof i||i instanceof String?document.querySelectorAll(i):[i];const s=new class{constructor(){this.positions={top:0,bottom:0,height:0};}setViewportTop(t){return this.positions.top=t?t.scrollTop:window.pageYOffset,this.positions;}setViewportBottom(){return this.positions.bottom=this.positions.top+this.positions.height,this.positions;}setViewportAll(t){return this.positions.top=t?t.scrollTop:window.pageYOffset,this.positions.height=t?t.clientHeight:document.documentElement.clientHeight,this.positions.bottom=this.positions.top+this.positions.height,this.positions;}}(),r=(()=>{const i="transform webkitTransform mozTransform oTransform msTransform".split(" ");let t,e=0;for(;void 0===t;)t=void 0!==document.createElement("div").style[i[e]]?i[e]:void 0,e+=1;return t;})();class f{constructor(t,e,n=!1){var i;this.element=t,this.elementContainer=t,this.settings=e,this.isVisible=!0,this.isInit=!1,this.oldTranslateValue=-1,this.prefersReducedMotion=n,this.init=this.init.bind(this),this.customWrapper=this.settings.customWrapper&&this.element.closest(this.settings.customWrapper)?this.element.closest(this.settings.customWrapper):null,!this.prefersReducedMotion&&("img"!==(i=t).tagName.toLowerCase()&&"picture"!==i.tagName.toLowerCase()||i&&i.complete&&!(typeof i.naturalWidth<"u"&&0===i.naturalWidth)?this.init():this.element.addEventListener("load",()=>{setTimeout(()=>{this.init(!0);},50);}));}init(t){this.prefersReducedMotion||this.isInit||(t&&(this.rangeMax=null),!this.element.closest(".simpleParallax")&&(!1===this.settings.overflow&&this.wrapElement(this.element),this.setTransformCSS(),this.getElementOffset(),this.intersectionObserver(),this.getTranslateValue(),this.animate(),this.settings.delay>0?setTimeout(()=>{this.setTransitionCSS(),this.elementContainer.classList.add("simple-parallax-initialized");},10):this.elementContainer.classList.add("simple-parallax-initialized"),this.isInit=!0));}wrapElement(){const t=this.element.closest("picture")||this.element;let e=this.customWrapper||document.createElement("div");e.classList.add("simpleParallax"),e.style.overflow="hidden",this.customWrapper||(t.parentNode.insertBefore(e,t),e.appendChild(t)),this.elementContainer=e;}unWrapElement(){const t=this.elementContainer;this.customWrapper?(t.classList.remove("simpleParallax"),t.style.overflow=""):t.replaceWith(...t.childNodes);}setTransformCSS(){!1===this.settings.overflow&&(this.element.style[r]=`scale(${this.settings.scale})`),this.element.style.willChange="transform";}setTransitionCSS(){this.element.style.transition=`transform ${this.settings.delay}s ${this.settings.transition}`;}unSetStyle(){this.element.style.willChange="",this.element.style[r]="",this.element.style.transition="";}getElementOffset(){const t=this.elementContainer.getBoundingClientRect();if(this.elementHeight=t.height,this.elementTop=t.top+s.positions.top,this.settings.customContainer){const e=this.settings.customContainer.getBoundingClientRect();this.elementTop=t.top-e.top+s.positions.top;}this.elementBottom=this.elementHeight+this.elementTop;}buildThresholdList(){const t=[];for(let e=1;e<=this.elementHeight;e++){const n=e/this.elementHeight;t.push(n);}return t;}intersectionObserver(){const t={root:null,threshold:this.buildThresholdList()};this.observer=new IntersectionObserver(this.intersectionObserverCallback.bind(this),t),this.observer.observe(this.element);}intersectionObserverCallback(t){t.forEach((e)=>{e.isIntersecting?this.isVisible=!0:this.isVisible=!1;});}checkIfVisible(){return this.elementBottom>s.positions.top&&this.elementTop<s.positions.bottom;}getRangeMax(){const t=this.element.clientHeight;this.rangeMax=t*this.settings.scale-t;}getTranslateValue(){let t=((s.positions.bottom-this.elementTop)/((s.positions.height+this.elementHeight)/100)).toFixed(1);return t=Math.min(100,Math.max(0,t)),0!==this.settings.maxTransition&&t>this.settings.maxTransition&&(t=this.settings.maxTransition),this.oldPercentage!==t&&(this.rangeMax||this.getRangeMax(),this.translateValue=(t/100*this.rangeMax-this.rangeMax/2).toFixed(0),this.oldTranslateValue!==this.translateValue)&&(this.oldPercentage=t,this.oldTranslateValue=this.translateValue,!0);}animate(){let n,t=0,e=0;(this.settings.orientation.includes("left")||this.settings.orientation.includes("right"))&&(e=`${this.settings.orientation.includes("left")?-1*this.translateValue:this.translateValue}px`),(this.settings.orientation.includes("up")||this.settings.orientation.includes("down"))&&(t=`${this.settings.orientation.includes("up")?-1*this.translateValue:this.translateValue}px`),n=!1===this.settings.overflow?`translate3d(${e}, ${t}, 0) scale(${this.settings.scale})`:`translate3d(${e}, ${t}, 0)`,this.element.style[r]=n;}}let l,u,a=!1,o=[];class g{constructor(t,e){t&&Element.prototype.closest&&"IntersectionObserver" in window&&(this.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.reducedMotionMediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),this.handleReducedMotionChange=this.handleReducedMotionChange.bind(this),this.reducedMotionMediaQuery.addEventListener("change",this.handleReducedMotionChange),!this.prefersReducedMotion&&(this.elements=h(t),this.defaults={delay:0,orientation:"up",scale:1.3,overflow:!1,transition:"cubic-bezier(0,0,0,1)",customContainer:"",customWrapper:"",maxTransition:0},this.settings=Object.assign(this.defaults,e),this.settings.customContainer&&([this.customContainer]=h(this.settings.customContainer)),this.lastPosition=-1,this.resizeIsDone=this.resizeIsDone.bind(this),this.refresh=this.refresh.bind(this),this.proceedRequestAnimationFrame=this.proceedRequestAnimationFrame.bind(this),this.init()));}handleReducedMotionChange(t){this.prefersReducedMotion=t.matches,this.prefersReducedMotion?this.destroy():this.init();}init(){this.prefersReducedMotion||(s.setViewportAll(this.customContainer),o=[...this.elements.map((t)=>new f(t,this.settings,this.prefersReducedMotion)),...o],a||(this.proceedRequestAnimationFrame(),window.addEventListener("resize",this.resizeIsDone),a=!0));}resizeIsDone(){clearTimeout(u),u=setTimeout(this.refresh,200);}
2proceedRequestAnimationFrame(){s.setViewportTop(this.customContainer),this.lastPosition!==s.positions.top?(s.setViewportBottom(),o.forEach((t)=>{this.proceedElement(t);}),l=window.requestAnimationFrame(this.proceedRequestAnimationFrame),this.lastPosition=s.positions.top):l=window.requestAnimationFrame(this.proceedRequestAnimationFrame);}proceedElement(t){let e=!1;e=this.customContainer?t.checkIfVisible():t.isVisible,e&&t.getTranslateValue()&&t.animate();}refresh(){s.setViewportAll(this.customContainer),o.forEach((t)=>{t.getElementOffset(),t.getRangeMax();}),this.lastPosition=-1;}destroy(){this.reducedMotionMediaQuery&&this.reducedMotionMediaQuery.removeEventListener("change",this.handleReducedMotionChange);const t=[];o=o.filter((e)=>this.elements&&this.elements.includes(e.element)?(t.push(e),!1):e),t.forEach((e)=>{e.unSetStyle(),this.settings&&!1===this.settings.overflow&&e.unWrapElement();}),o.length||(window.cancelAnimationFrame(l),window.removeEventListener("resize",this.refresh),a=!1);}}var dataName,dataExpression;dataName="media",dataExpression=({options,hasParallax,attribution,showBackgroundVideoToggle})=>({player:null,playerContainer:null,hasAutoplay:options?.autoplay,showBackgroundVideoToggle:showBackgroundVideoToggle??!1,hasReceivedFocus:!1,hasVideoStarted:!1,hasVideoError:!1,hasUserPausedVideo:!1,isBackgroundVideoPaused:!options?.autoplay,isBackgroundVideoTogglePending:!1,quarterDone:0,halfDone:0,threeQuartersDone:0,lastTime:0,shouldPlay:!1,isOnViewport:!1,title:"",buttonTitle:"",init(){this.$nextTick(async()=>{await this.setupPlayer();}),attribution&&this.setAttributionHeight(),this.$watch("isOnViewport",(value)=>{value&&hasParallax&&this.setTranslateParallax();}),this.$watch("shouldPlay",(value)=>{this.handleVideoPlaying(value);});},async setupPlayer(){this.player=this.$refs.video,this.player&&(this.title=this.player.title,this.buttonTitle=this.title?`Play video: ${this.title}`:"Play video",this.syncBackgroundVideoState(),this.player.addEventListener("provider-change",(event)=>{let provider=event.detail;isYouTubeProvider(provider)?(provider.cookies=!0,provider=Object.assign(provider,options.youtube)):isVimeoProvider(provider)&&(provider.cookies=!0,provider.byline=!1,provider.portrait=!1,provider.title=!1,provider=Object.assign(provider,options.vimeo)),event.detail=provider;}),this.player.addEventListener("provider-setup",(event)=>{const provider=event.detail;if(!0===options?.disable_pip&&"VIDEO"===provider?.media?.tagName){const videoEl=provider.media;videoEl.setAttribute("disablepictureinpicture","true"),videoEl.disablePictureInPicture=!0;}if(!isYouTubeProvider(provider)&&!isVimeoProvider(provider))return;const configured=Array.isArray(options?.allow)?options.allow:[];if(configured.length&&provider.iframe){const allow=["autoplay","fullscreen",...configured];provider.iframe.setAttribute("allow",allow.join("; "));}}),this.player.addEventListener("loaded-metadata",()=>{this.title||(this.title=this.player.title,this.buttonTitle=this.title?`Play video: ${this.title}`:"Play video");}),this.player.addEventListener("play",()=>{this.isBackgroundVideoPaused=!1,this.isBackgroundVideoTogglePending=!1,this.hasAutoplay||(0===this.quarterDone&&(this.quarterDone=.25*this.player.duration,this.halfDone=.5*this.player.duration,this.threeQuartersDone=.75*this.player.duration),this.hasVideoStarted&&this.$dispatch("analytics",{mediaAction:"play"})),this.hasReceivedFocus||this.hasAutoplay||(this.hasReceivedFocus=!0),this.hasVideoStarted=!0;}),this.player.addEventListener("playing",()=>{this.isBackgroundVideoPaused=!1,this.isBackgroundVideoTogglePending=!1;}),this.player.addEventListener("pause",()=>{this.isBackgroundVideoPaused=!0,this.isBackgroundVideoTogglePending=!1,this.hasAutoplay||this.$dispatch("analytics",{mediaAction:"pause"});}),this.player.addEventListener("ended",()=>{const isLooping=this.player.loop||this.player.hasAttribute("loop");this.isBackgroundVideoPaused=!isLooping,this.isBackgroundVideoTogglePending=!1,this.hasAutoplay||this.$dispatch("analytics",{mediaAction:"complete"});}),this.player.addEventListener("play-fail",(event)=>{this.displayError(event.detail);}),this.player.addEventListener("error",(event)=>{this.displayError(event.detail);}),this.player.addEventListener("time-update",(event)=>{if(!this.hasAutoplay){const currentTime=event.detail.currentTime;this.lastTime<this.threeQuartersDone&&currentTime>=this.threeQuartersDone?this.$dispatch("analytics",{mediaAction:"75% progress"}):this.lastTime<this.halfDone&&currentTime>=this.halfDone?this.$dispatch("analytics",{mediaAction:"50% progress"}):this.lastTime<this.quarterDone&&currentTime>=this.quarterDone&&this.$dispatch("analytics",{mediaAction:"25% progress"}),this.lastTime=currentTime;}}));}
2,syncBackgroundVideoState(){this.player&&(this.isBackgroundVideoPaused=!!this.player.paused);},async toggleBackgroundVideo(){if(this.player&&!this.isBackgroundVideoTogglePending)if(this.isBackgroundVideoTogglePending=!0,this.syncBackgroundVideoState(),this.isBackgroundVideoPaused){this.hasUserPausedVideo=!1;try{await this.player.play(),this.isBackgroundVideoPaused=!1;}catch(error){console.error("[media] background video play failed",error),this.syncBackgroundVideoState();}finally{this.isBackgroundVideoTogglePending=!1;}}else{this.hasUserPausedVideo=!0;try{this.player.pause(),this.isBackgroundVideoPaused=!0;}catch(error){console.error("[media] background video pause failed",error),this.syncBackgroundVideoState();}finally{this.isBackgroundVideoTogglePending=!1;}}},displayError(error){console.error(error),this.hasVideoError=!0;},async handleVideoPlaying(shouldPlay){if(this.player)if(shouldPlay){if(this.hasUserPausedVideo)return;try{await this.player.play();}catch(error){const playWhenReady=()=>{this.hasUserPausedVideo||this.player.play(),this.player.removeEventListener("can-play",playWhenReady);};this.player.addEventListener("can-play",playWhenReady,{once:!0});}}else try{this.player.pause();}catch(error){console.warn("[media] pause failed",error);}},computedDuration(){const e=this.player.duration;return `${Math.floor(e%3600/60).toString().padStart(2,"0")}:${Math.floor(e%60).toString().padStart(2,"0")}`;},setTranslateParallax(){new g(this.$refs.parallaxImg,{scale:1.15});},setAttributionHeight(){const height=this.$refs.attribution.offsetHeight,wrapper=this.$el.closest(".mf-attribution-wrapper");wrapper&&wrapper.style.setProperty("--attribution-height",`${height}px`);}}),window.hasOwnProperty("Alpine")&&!window.Alpine._datas.includes(dataName)?Alpine.data(dataName,dataExpression):document.addEventListener("alpine:init",()=>{Alpine.data(dataName,dataExpression);});const ParseErrorCode={LoadFail:0,BadSignature:1,BadTimestamp:2,BadSettingValue:3,BadFormat:4,UnknownSetting:5};class ParseError extends Error{code;line;constructor(init){super(init.reason),this.code=init.code,this.line=init.line;}}const LINE_TERMINATOR_RE=/\r?\n|\r/gm;class TextLineTransformStream{writable;readable;constructor(encoding){const transformer=new TextStreamLineIterator(encoding);this.writable=new WritableStream({write(chunk){transformer.transform(chunk);},close(){transformer.close();}}),this.readable=new ReadableStream({start(controller){transformer.onLine=(line)=>controller.enqueue(line),transformer.onClose=()=>controller.close();}});}}class TextStreamLineIterator{a="";b;onLine;onClose;constructor(encoding){this.b=new TextDecoder(encoding);}transform(chunk){this.a+=this.b.decode(chunk,{stream:!0});const lines=this.a.split(LINE_TERMINATOR_RE);this.a=lines.pop()||"";for(let i=0;i<lines.length;i++)this.onLine(lines[i].trim());}close(){this.a&&this.onLine(this.a.trim()),this.a="",this.onClose();}}async function parseTextStream(stream,options){const type=options?.type??"vtt";let factory,result;if("string"==typeof type)switch(type){case "srt":factory=(await Promise.resolve().then(function(){return srtParser;})).default;break;case "ssa":case "ass":factory=(await Promise.resolve().then(function(){return ssaParser;})).default;break;default:factory=(await Promise.resolve().then(function(){return vttParser;})).default;}else factory=type;const reader=stream.getReader(),parser=factory(),errors=!!options?.strict||!!options?.errors;await parser.init({strict:!1,...options,errors,type,cancel(){reader.cancel(),result=parser.done(!0);}});let i=1;for(;;){const {value,done}=await reader.read();if(done){parser.parse("",i),result=parser.done(!1);break;}parser.parse(value,i),i++;}return result;}async function parseByteStream(stream,{encoding="utf-8",...options}={}){return parseTextStream(stream.pipeThrough(new TextLineTransformStream(encoding)),options);}class TextCue extends EventTarget{id="";startTime;endTime;text;pauseOnExit=!1;constructor(startTime,endTime,text){super(),this.startTime=startTime,this.endTime=endTime,this.text=text;}addEventListener(type,listener,options){super.addEventListener(type,listener,options);}removeEventListener(type,listener,options){super.removeEventListener(type,listener,options);}}const IS_SERVER="undefined"==typeof document,CueBase=IS_SERVER?TextCue:window.VTTCue;class VTTCue extends CueBase{region=null;vertical="";snapToLines=!0;line="auto";lineAlign="start";position="auto";positionAlign="auto";size=100;align="center";style;}class VTTRegion{id="";width=100;lines=3;regionAnchorX=0;regionAnchorY=100;viewportAnchorX=0;viewportAnchorY=100;scroll="";}function toNumber(text){const num=parseInt(text,10);return Number.isNaN(num)?null:num;}function toPercentage(text){const num=parseInt(text.replace("%",""),10);return !Number.isNaN(num)&&num>=0&&num<=100?num:null;}function toCoords(text){if(!text.includes(","))return null;const [x,y]=text.split(",").map(toPercentage);return null!==x&&null!==y?[x,y]:null;}function toFloat(text){const num=parseFloat(text);return Number.isNaN(num)?null:num;}const SETTING_SEP_RE=/[:=]/,SETTING_LINE_RE=/^[\s\t]*(region|vertical|line|position|size|align)[:=]/,REGION_BLOCK_START_RE=/^REGION:?[\s\t]+/,SPACE_RE=/[\s\t]+/,TIMESTAMP_SEP_RE=/[\s\t]*-->[\s\t]+/,ALIGN_RE=/start|center|end|left|right/,LINE_ALIGN_RE=/start|center|end/,POS_ALIGN_RE=/line-(?:left|right)|center|auto/,TIMESTAMP_RE=/^(?:(\d{1,2}):)?(\d{2}):(\d{2})(?:\.(\d{1,3}))?$/;var VTTBlock=((VTTBlock2)=>(VTTBlock2[VTTBlock2.None=0]="None",VTTBlock2[VTTBlock2.Header=1]="Header",VTTBlock2[VTTBlock2.Cue=2]="Cue",VTTBlock2[VTTBlock2.Region=3]="Region",VTTBlock2[VTTBlock2.Note=4]="Note",VTTBlock2))(VTTBlock||{});class VTTParser{h;e=0;i={};j={};l=[];c=null;d=null;m=[];f;n="";
2async init(init){this.h=init,init.strict&&(this.e=1),init.errors&&(this.f=(await Promise.resolve().then(function(){return errors;})).ParseErrorBuilder);}parse(line,lineCount){if(""===line)this.c?(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null):this.d?(this.j[this.d.id]=this.d,this.h.onRegion?.(this.d),this.d=null):1===this.e&&(this.k(line,lineCount),this.h.onHeaderMetadata?.(this.i)),this.e=0;else if(this.e)switch(this.e){case 1:this.k(line,lineCount);break;case 2:if(this.c){const hasText=this.c.text.length>0;!hasText&&SETTING_LINE_RE.test(line)?this.o(line.split(SPACE_RE),lineCount):this.c.text+=(hasText?"\n":"")+line;}break;case 3:this.p(line.split(SPACE_RE),lineCount);}else if(line.startsWith("NOTE"))this.e=4;else if(line.startsWith("REGION"))this.e=3,this.d=new VTTRegion(),this.p(line.replace(REGION_BLOCK_START_RE,"").split(SPACE_RE),lineCount);else if(line.includes("--\x3e")){const result=this.q(line,lineCount);result&&(this.c=new VTTCue(result[0],result[1],""),this.c.id=this.n,this.o(result[2],lineCount)),this.e=2;}else 1===lineCount&&this.k(line,lineCount);this.n=line;}done(){return {metadata:this.i,cues:this.l,regions:Object.values(this.j),errors:this.m};}k(line,lineCount){if(lineCount>1){if(SETTING_SEP_RE.test(line)){const [key,value]=line.split(SETTING_SEP_RE);key&&(this.i[key]=(value||"").replace(SPACE_RE,""));}}else line.startsWith("WEBVTT")?this.e=1:this.g(this.f?.r());}q(line,lineCount){const [startTimeText,trailingText=""]=line.split(TIMESTAMP_SEP_RE),[endTimeText,...settingsText]=trailingText.split(SPACE_RE),startTime=parseVTTTimestamp(startTimeText),endTime=parseVTTTimestamp(endTimeText);if(null!==startTime&&null!==endTime&&endTime>startTime)return [startTime,endTime,settingsText];null===startTime&&this.g(this.f?.s(startTimeText,lineCount)),null===endTime&&this.g(this.f?.t(endTimeText,lineCount)),null!=startTime&&null!==endTime&&endTime>startTime&&this.g(this.f?.u(startTime,endTime,lineCount));}p(settings,line){let badValue;for(let i=0;i<settings.length;i++)if(SETTING_SEP_RE.test(settings[i])){badValue=!1;const [name,value]=settings[i].split(SETTING_SEP_RE);switch(name){case "id":this.d.id=value;break;case "width":{const width=toPercentage(value);null!==width?this.d.width=width:badValue=!0;break;}case "lines":{const lines=toNumber(value);null!==lines?this.d.lines=lines:badValue=!0;break;}case "regionanchor":{const region=toCoords(value);null!==region?(this.d.regionAnchorX=region[0],this.d.regionAnchorY=region[1]):badValue=!0;break;}case "viewportanchor":{const viewport=toCoords(value);null!==viewport?(this.d.viewportAnchorX=viewport[0],this.d.viewportAnchorY=viewport[1]):badValue=!0;break;}case "scroll":"up"===value?this.d.scroll="up":badValue=!0;break;default:this.g(this.f?.v(name,value,line));}badValue&&this.g(this.f?.w(name,value,line));}}o(settings,line){let badValue;for(let i=0;i<settings.length;i++)if(badValue=!1,SETTING_SEP_RE.test(settings[i])){const [name,value]=settings[i].split(SETTING_SEP_RE);switch(name){case "region":{const region=this.j[value];region&&(this.c.region=region);break;}case "vertical":"lr"===value||"rl"===value?(this.c.vertical=value,this.c.region=null):badValue=!0;break;case "line":{const [linePos,lineAlign]=value.split(",");if(linePos.includes("%")){const percentage=toPercentage(linePos);null!==percentage?(this.c.line=percentage,this.c.snapToLines=!1):badValue=!0;}else{const number=toFloat(linePos);null!==number?this.c.line=number:badValue=!0;}LINE_ALIGN_RE.test(lineAlign)?this.c.lineAlign=lineAlign:lineAlign&&(badValue=!0),"auto"!==this.c.line&&(this.c.region=null);break;}case "position":{const [colPos,colAlign]=value.split(","),position=toPercentage(colPos);null!==position?this.c.position=position:badValue=!0,colAlign&&POS_ALIGN_RE.test(colAlign)?this.c.positionAlign=colAlign:colAlign&&(badValue=!0);break;}case "size":{const size=toPercentage(value);null!==size?(this.c.size=size,size<100&&(this.c.region=null)):badValue=!0;break;}case "align":ALIGN_RE.test(value)?this.c.align=value:badValue=!0;break;default:this.g(this.f?.x(name,value,line));}badValue&&this.g(this.f?.y(name,value,line));}}g(error){if(error){if(this.m.push(error),this.h.strict)throw this.h.cancel(),error;this.h.onError?.(error);}}}function parseVTTTimestamp(timestamp){const match=timestamp.match(TIMESTAMP_RE);if(!match)return null;const hours=match[1]?parseInt(match[1],10):0,minutes=parseInt(match[2],10),seconds=parseInt(match[3],10),milliseconds=match[4]?parseInt(match[4].padEnd(3,"0"),10):0;return hours<0||minutes<0||seconds<0||milliseconds<0||minutes>59||seconds>59?null:3600*hours+60*minutes+seconds+milliseconds/1e3;}var vttParser=Object.freeze({__proto__:null,VTTBlock,VTTParser,default:function(){return new VTTParser();},parseVTTTimestamp});const DIGIT_RE=/[0-9]/,MULTI_SPACE_RE=/[\s\t]+/,TAG_NAME={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span",timestamp:"span"},HTML_ENTITIES={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&nbsp;":" ","&lrm;":"‎","&rlm;":"‏"},HTML_ENTITY_RE=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,COLORS=new Set(["white","lime","cyan","red","yellow","magenta","blue","black"]),BLOCK_TYPES=new Set(Object.keys(TAG_NAME));function tokenizeVTTCue(cue){let node,buffer="",mode=1,result=[],stack=[];for(let i=0;i<cue.text.length;i++){const char=cue.text[i];switch(mode){case 1:"<"===char?(addText(),mode=2):buffer+=char;break;case 2:switch(char){case "\n":case "\t":case " ":addNode(),mode=4;break;case ".":addNode(),mode=3;break;case "/":mode=5;break;case ">":addNode(),mode=1;break;default:!buffer&&DIGIT_RE.test(char)&&(mode=6),buffer+=char;}break;case 3:switch(char){case "\t":case " ":case "\n":addClass(),node&&node.class?.trim(),mode=4;break;case ".":addClass();break;case ">":addClass(),node&&node.class?.trim(),mode=1;break;default:buffer+=char;}break;case 4:">"===char?(buffer=buffer.replace(MULTI_SPACE_RE," "),"v"===node?.type?node.voice=replaceHTMLEntities(buffer):"lang"===node?.type&&(node.lang=replaceHTMLEntities(buffer)),buffer="",mode=1):buffer+=char;break;case 5:">"===char&&(buffer="",node=stack.pop(),mode=1);break;case 6:if(">"===char){const time=parseVTTTimestamp(buffer);
2null!==time&&time>=cue.startTime&&time<=cue.endTime&&(buffer="timestamp",addNode(),node.time=time),buffer="",mode=1;}else buffer+=char;}}function addNode(){if(BLOCK_TYPES.has(buffer)){const parent=node;node={tagName:TAG_NAME[type=buffer],type,children:[]},parent?(stack[stack.length-1]!==parent&&stack.push(parent),parent.children.push(node)):result.push(node);}var type;buffer="",mode=1;}function addClass(){if(node&&buffer){const color=buffer.replace("bg_","");COLORS.has(color)?node[buffer.startsWith("bg_")?"bgColor":"color"]=color:node.class=node.class?node.class+" "+buffer:buffer;}buffer="";}function addText(){if(!buffer)return;const text={type:"text",data:replaceHTMLEntities(buffer)};node?node.children.push(text):result.push(text),buffer="";}return 1===mode&&addText(),result;}function replaceHTMLEntities(text){return text.replace(HTML_ENTITY_RE,(entity)=>HTML_ENTITIES[entity]||"'");}function setCSSVar(el,name,value){el.style.setProperty(`--${name}`,value+"");}function setDataAttr(el,name,value=!0){el.setAttribute(`data-${name}`,!0===value?"":value+"");}function setPartAttr(el,name){el.setAttribute("data-part",name);}function renderVTTCueString(cue,currentTime=0){return renderVTTTokensString(tokenizeVTTCue(cue),currentTime);}function renderVTTTokensString(tokens,currentTime=0){let attrs,result="";for(const token of tokens)if("text"===token.type)result+=token.data;else{const isTimestamp="timestamp"===token.type;attrs={},attrs.class=token.class,attrs.title="v"===token.type&&token.voice,attrs.lang="lang"===token.type&&token.lang,attrs["data-part"]="v"===token.type&&"voice",isTimestamp&&(attrs["data-part"]="timed",attrs["data-time"]=token.time,attrs["data-future"]=token.time>currentTime,attrs["data-past"]=token.time<currentTime),attrs.style=`${token.color?`color: ${token.color};`:""}${token.bgColor?`background-color: ${token.bgColor};`:""}`;const attributes=Object.entries(attrs).filter((v)=>v[1]).map((v)=>`${v[0]}="${!0===v[1]?"":v[1]}"`).join(" ");result+=`<${token.tagName}${attributes?" "+attributes:""}>${renderVTTTokensString(token.children)}</${token.tagName}>`;}return result;}function updateTimedVTTCueNodes(root,currentTime){if(!IS_SERVER){for(const el of root.querySelectorAll('[data-part="timed"]')){const time=Number(el.getAttribute("data-time"));Number.isNaN(time)||(time>currentTime?setDataAttr(el,"future"):el.removeAttribute("data-future"),time<currentTime?setDataAttr(el,"past"):el.removeAttribute("data-past"));}}}const STARTING_BOX=Symbol(0);function createBox(box){return box instanceof HTMLElement?{top:box.offsetTop,width:box.clientWidth,height:box.clientHeight,left:box.offsetLeft,right:box.offsetLeft+box.clientWidth,bottom:box.offsetTop+box.clientHeight}:{...box};}function moveBox(box,axis,delta){switch(axis){case "+x":box.left+=delta,box.right+=delta;break;case "-x":box.left-=delta,box.right-=delta;break;case "+y":box.top+=delta,box.bottom+=delta;break;case "-y":box.top-=delta,box.bottom-=delta;}}function isBoxCollision(a,b){return a.left<=b.right&&a.right>=b.left&&a.top<=b.bottom&&a.bottom>=b.top;}function isAnyBoxCollision(box,boxes){for(let i=0;i<boxes.length;i++)if(isBoxCollision(box,boxes[i]))return boxes[i];return null;}function isWithinBox(container,box){return box.top>=0&&box.bottom<=container.height&&box.left>=0&&box.right<=container.width;}function isBoxOutOfBounds(container,box,axis){switch(axis){case "+x":return box.left<0;case "-x":return box.right>container.width;case "+y":return box.top<0;case "-y":return box.bottom>container.height;}}function calcBoxIntersectPercentage(container,box){return Math.max(0,Math.min(container.width,box.right)-Math.max(0,box.left))*Math.max(0,Math.min(container.height,box.bottom)-Math.max(0,box.top))/(container.height*container.width);}function createCSSBox(container,box){return {top:box.top/container.height,left:box.left/container.width,right:(container.width-box.right)/container.width,bottom:(container.height-box.bottom)/container.height};}function resolveRelativeBox(container,box){return box.top=box.top*container.height,box.left=box.left*container.width,box.right=container.width-box.right*container.width,box.bottom=container.height-box.bottom*container.height,box;}const BOX_SIDES=["top","left","right","bottom"];function setBoxCSSVars(el,container,box,prefix){const cssBox=createCSSBox(container,box);for(const side of BOX_SIDES)setCSSVar(el,`${prefix}-${side}`,100*cssBox[side]+"%");}function avoidBoxCollisions(container,box,boxes,axis){let positionedBox,percentage=1,startBox={...box};for(let i=0;i<axis.length;i++){for(;isBoxOutOfBounds(container,box,axis[i])||isWithinBox(container,box)&&isAnyBoxCollision(box,boxes);)moveBox(box,axis[i],1);if(isWithinBox(container,box))return box;const intersection=calcBoxIntersectPercentage(container,box);percentage>intersection&&(positionedBox={...box},percentage=intersection),box={...startBox};}return positionedBox||startBox;}const POSITION_OVERRIDE=Symbol(0);function positionCue(container,cue,displayEl,boxes){let displayBox,cueEl=displayEl.firstElementChild,line=function(cue){if("auto"===cue.line)return cue.snapToLines?-1:100;return cue.line;}(cue),axis=[];if(displayEl[STARTING_BOX]||(displayEl[STARTING_BOX]=function(container,cueEl){const box=createBox(cueEl),pos=function(el){const positions={};for(const side of BOX_SIDES)positions[side]=parseFloat(el.style.getPropertyValue(`--cue-${side}`));return positions;}(cueEl);cueEl[POSITION_OVERRIDE]=!1,pos.top&&(box.top=pos.top,box.bottom=pos.top+box.height,cueEl[POSITION_OVERRIDE]="top");if(pos.bottom){const bottom=container.height-pos.bottom;box.top=bottom-box.height,box.bottom=bottom,cueEl[POSITION_OVERRIDE]="bottom";}pos.left&&(box.left=pos.left);pos.right&&(box.right=container.width-pos.right);return createCSSBox(container,box);}(container,displayEl)),displayBox=resolveRelativeBox(container,{...displayEl[STARTING_BOX]}),displayEl[POSITION_OVERRIDE])axis=["top"===displayEl[POSITION_OVERRIDE]?"+y":"-y","+x","-x"];else if(cue.snapToLines){let size;switch(cue.vertical){case "":axis=["+y","-y"],size="height";break;case "rl":axis=["+x","-x"],size="width";break;case "lr":axis=["-x","+x"],size="width";}let step=parseFloat(getComputedStyle(cueEl).lineHeight)||0,position=step*Math.round(line),maxPosition=container[size]+step,initialAxis=axis[0];Math.abs(position)>maxPosition&&(position=position<0?-1:1,position*=Math.ceil(maxPosition/step)*step),line<0&&(position+=""===cue.vertical?container.height:container.width,axis=axis.reverse()),moveBox(displayBox,initialAxis,position);}else{const isHorizontal=""===cue.vertical,posAxis=isHorizontal?"+y":"+x",size=isHorizontal?displayBox.height:displayBox.width;moveBox(displayBox,posAxis,(isHorizontal?container.height:container.width)*line/100),moveBox(displayBox,posAxis,"center"===cue.lineAlign?size/2:"end"===cue.lineAlign?size:0),axis=isHorizontal?["-y","+y","-x","+x"]:["-x","+x","-y","+y"];}
2return displayBox=avoidBoxCollisions(container,displayBox,boxes,axis),setBoxCSSVars(displayEl,container,displayBox,"cue"),displayBox;}const REGION_AXIS=["-y","+y","-x","+x"];function positionRegion(container,region,regionEl,boxes){let cues=Array.from(regionEl.querySelectorAll('[data-part="cue-display"]')),height=0,limit=Math.max(0,cues.length-region.lines);for(let i=cues.length-1;i>=limit;i--)height+=cues[i].offsetHeight;setCSSVar(regionEl,"region-height",height+"px"),regionEl[STARTING_BOX]||(regionEl[STARTING_BOX]=createCSSBox(container,createBox(regionEl)));let box={...regionEl[STARTING_BOX]};return box=resolveRelativeBox(container,box),box.width=regionEl.clientWidth,box.height=height,box.right=box.left+box.width,box.bottom=box.top+height,box=avoidBoxCollisions(container,box,boxes,REGION_AXIS),setBoxCSSVars(regionEl,container,box,"region"),box;}var prod=Object.freeze({__proto__:null,CaptionsRenderer:class{overlay;z;A=0;C="ltr";B=[];D=!1;E;j=new Map();l=new Map();get dir(){return this.C;}set dir(dir){this.C=dir,setDataAttr(this.overlay,"dir",dir);}get currentTime(){return this.A;}set currentTime(time){this.A=time,this.update();}constructor(overlay,init){this.overlay=overlay,this.dir=init?.dir??"ltr",overlay.setAttribute("translate","yes"),overlay.setAttribute("aria-live","off"),overlay.setAttribute("aria-atomic","true"),setPartAttr(overlay,"captions"),this.G(),this.E=new ResizeObserver(this.I.bind(this)),this.E.observe(overlay);}changeTrack({regions,cues}){this.reset(),this.J(regions);for(const cue of cues)this.l.set(cue,null);this.update();}addCue(cue){this.l.set(cue,null),this.update();}removeCue(cue){this.l.delete(cue),this.update();}update(forceUpdate=!1){this.H(forceUpdate);}reset(){this.l.clear(),this.j.clear(),this.B=[],this.overlay.textContent="";}destroy(){this.reset(),this.E.disconnect();}I(){this.D=!0,this.K();}K=function(fn,delay){let args,timeout=null;function run(){clear(),fn(...args),args=void 0;}function clear(){clearTimeout(timeout),timeout=null;}return function(){args=[].slice.call(arguments),clear(),timeout=setTimeout(run,delay);};}(()=>{this.D=!1,this.G();for(const el of this.j.values())el[STARTING_BOX]=null;for(const el of this.l.values())el&&(el[STARTING_BOX]=null);this.H(!0);},50);G(){this.z=createBox(this.overlay),setCSSVar(this.overlay,"overlay-width",this.z.width+"px"),setCSSVar(this.overlay,"overlay-height",this.z.height+"px");}H(forceUpdate=!1){if(!this.l.size||this.D)return;let cue,activeCues=[...this.l.keys()].filter((cue2)=>this.A>=cue2.startTime&&this.A<=cue2.endTime).sort((cueA,cueB)=>cueA.startTime!==cueB.startTime?cueA.startTime-cueB.startTime:cueA.endTime-cueB.endTime),activeRegions=activeCues.map((cue2)=>cue2.region);for(let i=0;i<this.B.length;i++){if(cue=this.B[i],activeCues[i]===cue)continue;if(cue.region&&!activeRegions.includes(cue.region)){const regionEl=this.j.get(cue.region.id);regionEl&&(regionEl.removeAttribute("data-active"),forceUpdate=!0);}const cueEl=this.l.get(cue);cueEl&&(cueEl.remove(),forceUpdate=!0);}for(let i=0;i<activeCues.length;i++){cue=activeCues[i];let cueEl=this.l.get(cue);cueEl||this.l.set(cue,cueEl=this.L(cue));const regionEl=this.F(cue)&&this.j.get(cue.region.id);regionEl&&!regionEl.hasAttribute("data-active")&&(requestAnimationFrame(()=>setDataAttr(regionEl,"active")),forceUpdate=!0),cueEl.isConnected||((regionEl||this.overlay).append(cueEl),forceUpdate=!0);}if(forceUpdate){const boxes=[],seen=new Set();for(let i=activeCues.length-1;i>=0;i--){if(cue=activeCues[i],seen.has(cue.region||cue))continue;const isRegion=this.F(cue),el=isRegion?this.j.get(cue.region.id):this.l.get(cue);isRegion?boxes.push(positionRegion(this.z,cue.region,el,boxes)):boxes.push(positionCue(this.z,cue,el,boxes)),seen.add(isRegion?cue.region:cue);}}updateTimedVTTCueNodes(this.overlay,this.A),this.B=activeCues;}J(regions){if(regions){for(const region of regions){const el=this.M(region);this.j.set(region.id,el),this.overlay.append(el);}}}M(region){const el=document.createElement("div");return setPartAttr(el,"region"),setDataAttr(el,"id",region.id),setDataAttr(el,"scroll",region.scroll),setCSSVar(el,"region-width",region.width+"%"),setCSSVar(el,"region-anchor-x",regi
2on.regionAnchorX),setCSSVar(el,"region-anchor-y",region.regionAnchorY),setCSSVar(el,"region-viewport-anchor-x",region.viewportAnchorX),setCSSVar(el,"region-viewport-anchor-y",region.viewportAnchorY),setCSSVar(el,"region-lines",region.lines),el;}L(cue){const display=document.createElement("div"),position=function(cue){if("auto"===cue.position)switch(cue.align){case "start":case "left":return 0;case "right":case "end":return 100;default:return 50;}return cue.position;}(cue),positionAlignment=function(cue,dir){if("auto"===cue.positionAlign)switch(cue.align){case "start":return "ltr"===dir?"line-left":"line-right";case "end":return "ltr"===dir?"line-right":"line-left";case "center":return "center";default:return `line-${cue.align}`;}return cue.positionAlign;}(cue,this.C);if(setPartAttr(display,"cue-display"),""!==cue.vertical&&setDataAttr(display,"vertical"),setCSSVar(display,"cue-text-align",cue.align),cue.style){for(const prop of Object.keys(cue.style))display.style.setProperty(prop,cue.style[prop]);}if(this.F(cue))setCSSVar(display,"cue-offset",position-("line-right"===positionAlignment?100:"center"===positionAlignment?50:0)+"%");else{if(setCSSVar(display,"cue-writing-mode",""===cue.vertical?"horizontal-tb":"lr"===cue.vertical?"vertical-lr":"vertical-rl"),!cue.style?.["--cue-width"]){let maxSize=position;"line-left"===positionAlignment?maxSize=100-position:"center"===positionAlignment&&position<=50?maxSize=2*position:"center"===positionAlignment&&position>50&&(maxSize=2*(100-position));const size=cue.size<maxSize?cue.size:maxSize;""===cue.vertical?setCSSVar(display,"cue-width",size+"%"):setCSSVar(display,"cue-height",size+"%");}}const el=document.createElement("div");return setPartAttr(el,"cue"),cue.id&&setDataAttr(el,"id",cue.id),el.innerHTML=renderVTTCueString(cue),display.append(el),display;}F(cue){return cue.region&&100===cue.size&&""===cue.vertical&&"auto"===cue.line;}},ParseError,ParseErrorCode,TextCue,VTTCue,VTTRegion,createVTTCueTemplate:function(cue){if(IS_SERVER)throw Error("[media-captions] called `createVTTCueTemplate` on the server - use `renderVTTCueString`");const template=document.createElement("template");return template.innerHTML=renderVTTCueString(cue),{cue,content:template.content};},parseByteStream,parseResponse:async function(response,options){const res=await response;if(!res.ok||!res.body){let error;return {metadata:{},cues:[],regions:[],errors:[error]};}const contentType=res.headers.get("content-type")||"",type=contentType.match(/text\/(.*?)(?:;|$)/)?.[1],encoding=contentType.match(/charset=(.*?)(?:;|$)/)?.[1];return parseByteStream(res.body,{type,encoding,...options});},parseText:async function(text,options){return parseTextStream(new ReadableStream({start(controller){const lines=text.split(LINE_TERMINATOR_RE);for(const line of lines)controller.enqueue(line);controller.close();}}),options);},parseTextStream,parseVTTTimestamp,renderVTTCueString,renderVTTTokensString,tokenizeVTTCue,updateTimedVTTCueNodes});const videoIdRE$1=/(?:https:\/\/)?(?:player\.)?vimeo(?:\.com)?\/(?:video\/)?(\d+)(?:(?:\?hash=|\?h=|\/)(.*))?/,infoCache=new Map(),pendingFetch$1=new Map();var vidstackKrOAtKMi=Object.freeze({__proto__:null,getVimeoVideoInfo:async function(videoId,abort,videoHash){if(infoCache.has(videoId))return infoCache.get(videoId);if(pendingFetch$1.has(videoId))return pendingFetch$1.get(videoId);let oembedSrc=`https://vimeo.com/api/oembed.json?url=https://player.vimeo.com/video/${videoId}`;videoHash&&(oembedSrc=oembedSrc.concat(`?h=${videoHash}`));const promise=window.fetch(oembedSrc,{mode:"cors",signal:abort.signal}).then((response)=>response.json()).then((data)=>{const thumbnailId=data?.thumbnail_url?.match(/vimeocdn.com\/video\/(.*)?_/)?.[1],poster=thumbnailId?`https://i.vimeocdn.com/video/${thumbnailId}_1920x1080.webp`:"",info={title:data?.title??"",duration:data?.duration??0,poster,pro:"basic"!==data.account_type};return infoCache.set(videoId,info),info;}).finally(()=>pendingFetch$1.delete(videoId));return pendingFetch$1.set(videoId,promise),promise;},resolveVimeoVideoId:function(src){const matches=src.match(videoIdRE$1);return {videoId:matches?.[1],hash:matches?.[2]};}});const videoIdRE=/(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)(?:\/shorts)?\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11}
2)/,posterCache=new Map(),pendingFetch=new Map();function resolveYouTubePosterURL(videoId,size,webp){return `https://i.ytimg.com/${webp?"vi_webp":"vi"}/${videoId}/${size}.${webp?"webp":"jpg"}`;}var vidstackDm1xEU9Q=Object.freeze({__proto__:null,findYouTubePoster:async function(videoId,abort){if(posterCache.has(videoId))return posterCache.get(videoId);if(pendingFetch.has(videoId))return pendingFetch.get(videoId);const pending=new Promise(async(resolve)=>{const sizes=["maxresdefault","sddefault","hqdefault"];for(const size of sizes){for(const webp of [!0,!1]){const url=resolveYouTubePosterURL(videoId,size,webp);if((await fetch(url,{mode:"no-cors",signal:abort.signal})).status<400)return posterCache.set(videoId,url),void resolve(url);}}}).catch(()=>"").finally(()=>pendingFetch.delete(videoId));return pendingFetch.set(videoId,pending),pending;},resolveYouTubeVideoId:function(src){return src.match(videoIdRE)?.[1];}});function isCastConnected(){return getCastContext().getCastState()===cast.framework.CastState.CONNECTED;}function getCastContext(){return window.cast.framework.CastContext.getInstance();}var vidstackDUl5U76j=Object.freeze({__proto__:null,GoogleCastLoader:class{name="google-cast";target;#player;get cast(){return getCastContext();}mediaType(){return "video";}canPlay(src){return false;}async prompt(ctx){let loadEvent,openEvent,errorEvent;try{loadEvent=await this.#loadCastFramework(ctx),this.#player||(this.#player=new cast.framework.RemotePlayer(),new cast.framework.RemotePlayerController(this.#player)),openEvent=ctx.player.createEvent("google-cast-prompt-open",{trigger:loadEvent}),ctx.player.dispatchEvent(openEvent),this.#notifyRemoteStateChange(ctx,"connecting",openEvent),await this.#showPrompt(peek(ctx.$props.googleCast)),ctx.$state.remotePlaybackInfo.set({deviceName:getCastContext().getCurrentSession()?.getCastDevice().friendlyName}),isCastConnected()&&this.#notifyRemoteStateChange(ctx,"connected",openEvent);}catch(code){const error=code instanceof Error?code:this.#createError((code+"").toUpperCase(),"Prompt failed.");throw errorEvent=ctx.player.createEvent("google-cast-prompt-error",{detail:error,trigger:openEvent??loadEvent,cancelable:!0}),ctx.player.dispatch(errorEvent),this.#notifyRemoteStateChange(ctx,isCastConnected()?"connected":"disconnected",errorEvent),error;}finally{ctx.player.dispatch("google-cast-prompt-close",{trigger:errorEvent??openEvent??loadEvent});}}async load(ctx){throw Error("[vidstack] can not load google cast provider server-side");}async #loadCastFramework(ctx){if(window.cast?.framework)return;const loadStartEvent=ctx.player.createEvent("google-cast-load-start");ctx.player.dispatch(loadStartEvent),await function(src){if(pendingRequests[src])return pendingRequests[src].promise;const promise=deferredPromise();if(!isNull(document.querySelector(`script[src="${src}"]`)))return promise.resolve(),promise.promise;pendingRequests[src]=promise;const script=document.createElement("script");return script.src=src,script.onload=()=>{promise.resolve(),delete pendingRequests[src];},script.onerror=()=>{promise.reject(),delete pendingRequests[src];},setTimeout(()=>document.head.append(script),0),promise.promise;}("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"),await customElements.whenDefined("google-cast-launcher");const loadedEvent=ctx.player.createEvent("google-cast-loaded",{trigger:loadStartEvent});if(ctx.player.dispatch(loadedEvent),!window.chrome?.cast?.isAvailable)throw this.#createError("CAST_NOT_AVAILABLE","Google Cast not available on this platform.");return loadedEvent;}async #showPrompt(options){this.#setOptions(options);const errorCode=await this.cast.requestSession();if(errorCode)throw this.#createError(errorCode.toUpperCase(),`Google Cast Error Code: ${errorCode}`);}#setOptions(options){this.cast?.setOptions({language:"en-US",autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,receiverApplicationId:chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,resumeSavedSession:!0,androidReceiverCompatible:!0,...options});}#notifyRemoteStateChange(ctx,state,trigger){const detail={type:"google-cast",state};ctx.notify("remote-playback-change",detail,trigger);}#createError(code,message){const error=Error(message);return error.code=code,error;}}});const MILLISECOND_SEP_RE=/,/g;class SRTParser extends VTTParser{parse(line,lineCount){if(""===line)this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null),this.e=VTTBlock.None;else if(this.e===VTTBlock.Cue)this.c.text+=(this.c.text?"\n":"")+line;else{if(line.includes("--\x3e")){const result=this.q(line,lineCount);result&&(this.c=new VTTCue(result[0],result[1],result[2].join(" ")),this.c.id=this.n,this.e=VTTBlock.Cue);}}this.n=line;}q(line,lineCount){return super.q(line.replace(MILLISECOND_SEP_RE,"."),lineCount);}}var srtParser=Object.freeze({__proto__:null,SRTParser,default:function(){return new SRTParser();}});const FORMAT_START_RE=/^Format:[\s\t]*/,STYLE_START_RE=/^Style:[\s\t]*/,DIALOGUE_START_RE=/^Dialogue:[\s\t]*/,FORMAT_SPLIT_RE=/[\s\t]*,[\s\t]*/,STYLE_FUNCTION_RE=/\{[^}]+\}/g,NEW_LINE_RE=/\\N/g,STYLES_SECTION_START_RE=/^\[(.*)[\s\t]?Styles\]$/,EVENTS_SECTION_START_RE=/^\[(.*)[\s\t]?Events\]$/;class SSAParser{h;O=0;c=null;l=[];m=[];N=null;f;P={};async init(init){this.h=init,init.errors&&(this.f=(await Promise.resolve().then(function(){return errors;})).ParseErrorBuilder);}parse(line,lineCount){if(this.O)switch(this.O){case 1:if(""===line)this.O=0;else if(STYLE_START_RE.test(line))if(this.N){const styles=line.replace(STYLE_START_RE,"").split(FORMAT_SPLIT_RE);this.S(styles);}else this.g(this.f?.T("Style",lineCount));else FORMAT_START_RE.test(line)?this.N=line.replace(FORMAT_START_RE,"").split(FORMAT_SPLIT_RE):EVENTS_SECTION_START_RE.test(line)&&(this.N=null,this.O=2);break;case 2:if(""===line)this.Q();else if(DIALOGUE_START_RE.test(line))if(this.Q(),this.N){const dialogue=line.replace(DIALOGUE_START_RE,"").split(FORMAT_SPLIT_RE),cue=this.U(dialogue,lineCount);cue&&(this.c=cue);}else this.g(this.f?.T("Dialogue",lineCount));else this.c?this.c.text+="\n"+line.replace(STYLE_FUNCTION_RE,"").replace(NEW_LINE_RE,"\n"):FORMAT_START_RE.test(line)?this.N=line.replace(FORMAT_START_RE,"").split(FORMAT_SPLIT_RE):STYLES_SECTION_START_RE.test(line)?(this.N=null,this.O=1):EVENTS_SECTION_START_RE.test(line)&&(this.N=null);}else ""===line||(STYLES_SECTION_START_RE.test(line)?(this.N=null,this.O=1):EVENTS_SECTION_START_RE.test(line)&&(this.N=null,this.O=2));}done(){return {metadata:{},cues:this.l,regions:[],errors:this.m};}Q(){this.c&&(this.l.push(this.c),this.h.onCue?.(this.c),this.c=null);}S(values){let outlineX,marginV,outlineColor,bgColor,name="Default",styles={},align="center",vertical="bottom",outlineY=1.2,borderStyle=3,transform=[];for(let i=0;i<this.N.length;i++){const field=this.N[i],value=values[i];switch(field){case "Name":name=value;break;case "Fontname":styles["font-family"]=value;break;case "Fontsize":styles["font-size"]=`calc(${value} / var(--overlay-height))`;break;case "PrimaryColour":{const color=parseColor(value);color&&(styles["--cue-color"]=color);break;}case "BorderStyle":borderStyle=parseInt(value,10);break;case "BackColour":bgColor=parseColor(value);break;case "OutlineColour":{const _outlineColor=parseColor(value);_outlineColor&&(outlineColor=_outlineColor);break;}case "Bold":parseInt(value)&&(styles["font-weight"]="bold");break;case "Italic":parseInt(value)&&(styles["font-style"]="italic");break;case "Underline":parseInt(value)&&(styles["text-decoration"]="underline");break;case "StrikeOut":parseInt(value)&&(styles["text-decoration"]="line-through");break;case "Spacing":styles["letter-spacing"]=value+"px";break;case "AlphaLevel":styles.opacity=parseFloat(value);break;
2case "ScaleX":transform.push(`scaleX(${parseFloat(value)/100})`);break;case "ScaleY":transform.push(`scaleY(${parseFloat(value)/100})`);break;case "Angle":transform.push(`rotate(${value}deg)`);break;case "Shadow":outlineY=1.2*parseInt(value,10);break;case "MarginL":styles["--cue-width"]="auto",styles["--cue-left"]=parseFloat(value)+"px";break;case "MarginR":styles["--cue-width"]="auto",styles["--cue-right"]=parseFloat(value)+"px";break;case "MarginV":marginV=parseFloat(value);break;case "Outline":outlineX=parseInt(value,10);break;case "Alignment":{const alignment=parseInt(value,10);switch(alignment>=4&&(vertical=alignment>=7?"top":"center"),alignment%3){case 1:align="start";break;case 2:align="center";break;case 3:align="end";}}}}if(styles.R=vertical,styles["--cue-white-space"]="normal",styles["--cue-line-height"]="normal",styles["--cue-text-align"]=align,"center"===vertical?(styles["--cue-top"]="50%",transform.push("translateY(-50%)")):styles[`--cue-${vertical}`]=(marginV||0)+"px",1===borderStyle&&(styles["--cue-padding-y"]="0"),(1===borderStyle||bgColor)&&(styles["--cue-bg-color"]=1===borderStyle?"none":bgColor),3===borderStyle&&outlineColor&&(styles["--cue-outline"]=`${outlineX}px solid ${outlineColor}`),1===borderStyle&&"number"==typeof outlineX){const color=bgColor??"#000";styles["--cue-text-shadow"]=[outlineColor&&buildTextShadow(1.2*outlineX,1.2*outlineY,outlineColor),outlineColor?buildTextShadow(outlineX*(outlineX/2),outlineY*(outlineX/2),color):buildTextShadow(outlineX,outlineY,color)].filter(Boolean).join(", ");}transform.length&&(styles["--cue-transform"]=transform.join(" ")),this.P[name]=styles;}U(values,lineCount){const fields=this.V(values),timestamp=this.q(fields.Start,fields.End,lineCount);if(!timestamp)return;const cue=new VTTCue(timestamp[0],timestamp[1],""),styles={...this.P[fields.Style]||{}},voice=fields.Name?`<v ${fields.Name}>`:"",vertical=styles.R,marginLeft=fields.MarginL&&parseFloat(fields.MarginL),marginRight=fields.MarginR&&parseFloat(fields.MarginR),marginV=fields.MarginV&&parseFloat(fields.MarginV);return marginLeft&&(styles["--cue-width"]="auto",styles["--cue-left"]=marginLeft+"px"),marginRight&&(styles["--cue-width"]="auto",styles["--cue-right"]=marginRight+"px"),marginV&&"center"!==vertical&&(styles[`--cue-${vertical}`]=marginV+"px"),cue.text=voice+values.slice(this.N.length-1).join(", ").replace(STYLE_FUNCTION_RE,"").replace(NEW_LINE_RE,"\n"),delete styles.R,Object.keys(styles).length&&(cue.style=styles),cue;}V(values){const fields={};for(let i=0;i<this.N.length;i++)fields[this.N[i]]=values[i];return fields;}q(startTimeText,endTimeText,lineCount){const startTime=parseVTTTimestamp(startTimeText),endTime=parseVTTTimestamp(endTimeText);if(null!==startTime&&null!==endTime&&endTime>startTime)return [startTime,endTime];null===startTime&&this.g(this.f?.s(startTimeText,lineCount)),null===endTime&&this.g(this.f?.t(endTimeText,lineCount)),null!=startTime&&null!==endTime&&endTime>startTime&&this.g(this.f?.u(startTime,endTime,lineCount));}g(error){if(error){if(this.m.push(error),this.h.strict)throw this.h.cancel(),error;this.h.onError?.(error);}}}function parseColor(color){const abgr=parseInt(color.replace("&H",""),16);if(abgr>=0)return "rgba("+[255&abgr,abgr>>8&255,abgr>>16&255,(abgr>>24&255^255)/255].join(",")+")";return null;}function buildTextShadow(x,y,color){const noOfShadows=Math.ceil(2*Math.PI*x);let textShadow="";for(let i=0;i<noOfShadows;i++){const theta=2*Math.PI*i/noOfShadows;textShadow+=x*Math.cos(theta)+"px "+y*Math.sin(theta)+"px 0 "+color+(i==noOfShadows-1?"":",");}return textShadow;}var ssaParser=Object.freeze({__proto__:null,SSAParser,default:function(){return new SSAParser();}});const ParseErrorBuilder={r:()=>new ParseError({code:ParseErrorCode.BadSignature,reason:"missing WEBVTT file header",line:1}),s:(startTime,line)=>new ParseError({code:ParseErrorCode.BadTimestamp,reason:`cue start timestamp \`${startTime}\` is invalid on line ${line}`,line}),t:(endTime,line)=>new ParseError({code:ParseErrorCode.BadTimestamp,reason:`cue end timestamp \`${endTime}\` is invalid on line ${line}`,line}),u:(startTime,endTime,line)=>new ParseError({code:ParseErrorCode.BadTimestamp,reason:`cue end timestamp \`${endTime}\` is greater than start \`${startTime}\` on line ${line}`,line}),y:(name,value,line)=>new ParseError({code:ParseErrorCode.BadSettingValue,reason:`invali
2d value for cue setting \`${name}\` on line ${line} (value: ${value})`,line}),x:(name,value,line)=>new ParseError({code:ParseErrorCode.UnknownSetting,reason:`unknown cue setting \`${name}\` on line ${line} (value: ${value})`,line}),w:(name,value,line)=>new ParseError({code:ParseErrorCode.BadSettingValue,reason:`invalid value for region setting \`${name}\` on line ${line} (value: ${value})`,line}),v:(name,value,line)=>new ParseError({code:ParseErrorCode.UnknownSetting,reason:`unknown region setting \`${name}\` on line ${line} (value: ${value})`,line}),T:(type,line)=>new ParseError({code:ParseErrorCode.BadFormat,reason:`format missing for \`${type}\` block on line ${line}`,line})};var errors=Object.freeze({__proto__:null,ParseErrorBuilder});}();;
3!function(){"use strict";var dataName,dataExpression;dataName="progressIndicator",dataExpression=({percentage,animated})=>({value:0,tick:null,init(){animated||(this.value=Math.min(percentage,100));},startCounting(value=percentage){this.tick&&window.cancelAnimationFrame(this.tick);const start=this.value,end=Math.min(value,100),delta=end/100*1e3;let startTimestamp=null;const step=(timestamp)=>{startTimestamp||(startTimestamp=timestamp);const progress=Math.min((timestamp-startTimestamp)/delta,1);this.value=Math.round(progress*(end-start)+start),progress<1?this.tick=window.requestAnimationFrame(step):window.cancelAnimationFrame(this.tick);};this.tick=window.requestAnimationFrame(step);},animateTo(value){this.startCounting(value);}}),window.hasOwnProperty("Alpine")&&!window.Alpine._datas.includes(dataName)?Alpine.data(dataName,dataExpression):document.addEventListener("alpine:init",()=>{Alpine.data(dataName,dataExpression);});}();;
4var alpineAnalytics=function(exports){"use strict";const analyticsHierarchy=["analyticsClickText","analyticsComponentType"];function buildAnalyticsData(el){let element=el;const data={},findPageSlot=currentElement=>{let parent=currentElement.parentElement;for(;parent;){if(parent.hasAttribute("data-analytics-page-slot"))return parent;parent=parent.parentElement}return null},mapClickSlot=parentPageSlot=>{const slotElements=parentPageSlot.querySelectorAll("[data-analytics-click-slot]"),slotMap=new Map;let maxSlotValue=0;return Array.from(slotElements).forEach(element=>{const slotValue=element.getAttribute("data-analytics-click-slot").trim();if(""!==slotValue){const numericValue=parseInt(slotValue)||0;slotMap.set(element,numericValue),maxSlotValue=Math.max(maxSlotValue,numericValue)}}),Array.from(slotElements).forEach(element=>{""!==element.getAttribute("data-analytics-click-slot").trim()||slotMap.has(element)||(maxSlotValue++,slotMap.set(element,maxSlotValue))}),slotMap};for(analyticsHierarchy.forEach(attribute=>{data[attribute]=[]});element;)if(element.dataset){if(Object.entries(element.dataset).forEach(([key,value])=>{if(key.startsWith("analytics")){if("analyticsClickSlot"===key&&""===value.trim()){const container=findPageSlot(element);if(container){value=mapClickSlot(container).get(element).toString()}}Array.isArray(data[key])?data[key].push(value):data[key]=value}}),data.hasOwnProperty("analyticsStopTraversal")){delete data.analyticsStopTraversal;break}if(data.analyticsNavigationType)break;element=element.parentElement}else element=element.parentElement;return analyticsHierarchy.forEach(attribute=>{data[attribute].length<1?delete data[attribute]:data[attribute]=data[attribute].reverse().join(" > ")}),Object.entries(data).forEach(([key,value])=>{const newKey=[key[9].toLowerCase(),key.substring(10)].join("");data[newKey]=value.slice(-80),data[newKey]=data[newKey].trim().replace(/[\r\n]+/g," "),delete data[key]}),"e_componentClick"!==data.event&&(delete data.itemTitle,"e_searchClick"!==data.event&&delete data.componentType),el.href&&(data.clickURL=/^https?:\/\//i.test(el.href)?el.href:`${window.location.origin}${el.href.startsWith("/")?el.href:`/${el.href}`}`),data}function _analyticsDirective(el,{modifiers:modifiers,expression:expression},{evaluateLater:evaluateLater,cleanup:cleanup}){const _delayedExpression=evaluateLater(expression||"{}"),_pushAnalyticsObject=(extra={})=>{_delayedExpression(result=>{const data=buildAnalyticsData(el);globalThis.dataLayer=globalThis.dataLayer||[],globalThis.dataLayer.push({...result,...extra,...data})})},_clickListener=ev=>
4{_pushAnalyticsObject()},_analyticsListener=ev=>{_pushAnalyticsObject(ev.detail)};modifiers.includes("manual")||el.addEventListener("click",_clickListener),el.addEventListener("analytics",_analyticsListener),cleanup(()=>{modifiers.includes("manual")||el.removeEventListener("click",_clickListener),el.removeEventListener("analytics",_analyticsListener)})}return exports.buildAnalyticsData=buildAnalyticsData,exports.default=function(Alpine){Alpine.directive("analytics",_analyticsDirective)},Object.defineProperty(exports,"__esModule",{value:!0}),exports}({});
5;
6!function(){"use strict";var reactive,effect,release,raw,flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(callback){!function(job){queue.includes(job)||queue.push(job);flushing||flushPending||(flushPending=!0,queueMicrotask(flushJobs))}(callback)}function dequeueJob(job){let index=queue.indexOf(job);-1!==index&&index>lastFlushedIndex&&queue.splice(index,1)}function flushJobs(){flushPending=!1,flushing=!0;for(let i=0;i<queue.length;i++)queue[i](),lastFlushedIndex=i;queue.length=0,lastFlushedIndex=-1,flushing=!1}var shouldSchedule=!0;function overrideEffect(override){effect=override}function watch(getter,callback){let oldValue,firstTime=!0,effectReference=effect(()=>{let value=getter();JSON.stringify(value),firstTime?oldValue=value:queueMicrotask(()=>{callback(value,oldValue),oldValue=value}),firstTime=!1});return()=>release(effectReference)}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElRemoved(el,callback){"function"==typeof callback?(el._x_cleanups||(el._x_cleanups=[]),el._x_cleanups.push(callback)):(callback=el,onElRemoveds.push(callback))}function onAttributesAdded(callback){onAttributeAddeds.push(callback)}function onAttributeRemoved(el,name,callback){el._x_attributeCleanups||(el._x_attributeCleanups={}),el._x_attributeCleanups[name]||(el._x_attributeCleanups[name]=[]),el._x_attributeCleanups[name].push(callback)}function cleanupAttributes(el,names){el._x_attributeCleanups&&Object.entries(el._x_attributeCleanups).forEach(([name,value])=>{(void 0===names||names.includes(name))&&(value.forEach(i=>i()),delete el._x_attributeCleanups[name])})}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){!function(){let records=observer.takeRecords();queuedMutations.push(()=>records.length>0&&onMutate(records));let queueLengthWhenTriggered=queuedMutations.length;queueMicrotask(()=>{if(queuedMutations.length===queueLengthWhenTriggered)for(;queuedMutations.length>0;)queuedMutations.shift()()})}(),observer.disconnect(),currentlyObserving=!1}var queuedMutations=[];function mutateDom(callback){if(!currentlyObserving)return callback();stopObservingMutations();let result=callback();return startObservingMutations(),result}var isCollecting=!1,deferredMutations=[];function onMutate(mutations){if(isCollecting)return void(deferredMutations=deferredMutations.concat(mutations));let addedNodes=[],removedNodes=new Set,addedAttributes=new Map,removedAttributes=new Map;for(let i=0;i<mutations.length;i++)if(!mutations[i].target._x_ignoreMutationObserver&&("childList"===mutations[i].type&&(mutations[i].removedNodes.forEach(node=>{1===node.nodeType&&node._x_marker&&removedNodes.add(node)}),mutations[i].addedNodes.forEach(node=>{1===node.nodeType&&(removedNodes.has(node)?removedNodes.delete(node):node._x_marker||addedNodes.push(node))})),"attributes"===mutations[i].type)){let el=mutations[i].target,name=mutations[i].attributeName,oldValue=mutations[i].oldValue,add2=()=>{addedAttributes.has(el)||addedAttributes.set(el,[]),addedAttributes.get(el).push({name:name,value:el.getAttribute(name)})},remove=()=>{removedAttributes.has(el)||removedAttributes.set(el,[]),removedAttributes.get(el).push(name)};el.hasAttribute(name)&&null===oldValue?add2():el.hasAttribute(name)?(remove(),add2()):remove()}removedAttributes.forEach((attrs,el)=>{cleanupAttributes(el,attrs)}
6),addedAttributes.forEach((attrs,el)=>{onAttributeAddeds.forEach(i=>i(el,attrs))});for(let node of removedNodes)addedNodes.some(i=>i.contains(node))||onElRemoveds.forEach(i=>i(node));for(let node of addedNodes)node.isConnected&&onElAddeds.forEach(i=>i(node));addedNodes=null,removedNodes=null,addedAttributes=null,removedAttributes=null}function scope(node){return mergeProxies(closestDataStack(node))}function addScopeToNode(node,data2,referenceNode){return node._x_dataStack=[data2,...closestDataStack(referenceNode||node)],()=>{node._x_dataStack=node._x_dataStack.filter(i=>i!==data2)}}function closestDataStack(node){return node._x_dataStack?node._x_dataStack:"function"==typeof ShadowRoot&&node instanceof ShadowRoot?closestDataStack(node.host):node.parentNode?closestDataStack(node.parentNode):[]}function mergeProxies(objects){return new Proxy({objects:objects},mergeProxyTrap)}var mergeProxyTrap={ownKeys:({objects:objects})=>Array.from(new Set(objects.flatMap(i=>Object.keys(i)))),has:({objects:objects},name)=>name!=Symbol.unscopables&&objects.some(obj=>Object.prototype.hasOwnProperty.call(obj,name)||Reflect.has(obj,name)),get:({objects:objects},name,thisProxy)=>"toJSON"==name?collapseProxies:Reflect.get(objects.find(obj=>Reflect.has(obj,name))||{},name,thisProxy),set({objects:objects},name,value,thisProxy){const target=objects.find(obj=>Object.prototype.hasOwnProperty.call(obj,name))||objects[objects.length-1],descriptor=Object.getOwnPropertyDescriptor(target,name);return descriptor?.set&&descriptor?.get?descriptor.set.call(thisProxy,value)||!0:Reflect.set(target,name,value)}};function collapseProxies(){return Reflect.ownKeys(this).reduce((acc,key)=>(acc[key]=Reflect.get(this,key),acc),{})}function initInterceptors(data2){let recurse=(obj,basePath="")=>{Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key,{value:value,enumerable:enumerable}])=>{if(!1===enumerable||void 0===value)return;if("object"==typeof value&&null!==value&&value.__v_skip)return;let path=""===basePath?key:`${basePath}.${key}`;var val;"object"==typeof value&&null!==value&&value._x_interceptor?obj[key]=value.initialize(data2,path,key):"object"!=typeof(val=value)||Array.isArray(val)||null===val||value===obj||value instanceof Element||recurse(value,path)})};return recurse(data2)}function interceptor(callback,mutateObj=()=>{}){let obj={initialValue:void 0,_x_interceptor:!0,initialize(data2,path,key){return callback(this.initialValue,()=>function(obj,path){return path.split(".").reduce((carry,segment)=>carry[segment],obj)}(data2,path),value=>set(data2,path,value),path,key)}};return mutateObj(obj),initialValue=>{if("object"==typeof initialValue&&null!==initialValue&&initialValue._x_interceptor){let initialize=obj.initialize.bind(obj);obj.initialize=(data2,path,key)=>{let innerValue=initialValue.initialize(data2,path,key);return obj.initialValue=innerValue,initialize(data2,path,key)}}else obj.initialValue=initialValue;return obj}}function set(obj,path,value){if("string"==typeof path&&(path=path.split(".")),1!==path.length){if(0===path.length)throw error;return obj[path[0]]||(obj[path[0]]={}),set(obj[path[0]],path.slice(1),value)}obj[path[0]]=value}var magics={};function magic(name,callback){magics[name]=callback}function injectMagics(obj,el){let memoizedUtilities=function(el){let[utilities,cleanup2]=getElementBoundUtilities(el),utils={interceptor:interceptor,...utilities};return onElRemoved(el,cleanup2),utils}(el);return Object.entries(magics).forEach(([name,callback])=>{Object.defineProperty(obj,`$${name}`,{get:()=>callback(el,memoizedUtilities),enumerable:!1})}),obj}function tryCatch(el,expression,callback,...args){try{return callback(...args)}catch(e){handleError(e,el,expression)}}function handleError(...args){return errorHandler(...args)}var errorHandler=function(error2,el,expression=void 0){error2=Object.assign(error2??{message:"No error message given."},{el:el,expression:expression}),console.warn(`Alpine Expression Error: ${error2.message}\n\n${expression?'Expression: "'+expression+'"\n\n':""}`,el),setTimeout(()=>{throw error2},0)};var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(callback){let cache=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let result=callback();return shouldAutoEvaluateFunctions=cache,result}function evaluate(el,expression,extras={}){let result;return evaluateLater(el,expression)(value=>result=value,extras),result}function evaluateLater(...args){return theEvaluatorFunction(...args)}var theRawEvaluatorFunction,theEvaluatorFunction=normalEvaluator;function normalEvaluator(el,expression){let overriddenMagics={};injectMagics(overriddenMagics,el);let dataStack=[overriddenMagics,...closestDataStack(el)],evaluator="function"==typeof expression?function(dataStack,func){return(receiver=()=>{},{scope:scope2={},params:params=[],context:context}={})=>
6{if(!shouldAutoEvaluateFunctions)return void runIfTypeOfFunction(receiver,func,mergeProxies([scope2,...dataStack]),params);runIfTypeOfFunction(receiver,func.apply(mergeProxies([scope2,...dataStack]),params))}}(dataStack,expression):function(dataStack,expression,el){let func=function(expression,el){if(evaluatorMemo[expression])return evaluatorMemo[expression];let AsyncFunction=Object.getPrototypeOf(async function(){}).constructor,rightSideSafeExpression=/^[\n\s]*if.*\(.*\)/.test(expression.trim())||/^(let|const)\s/.test(expression.trim())?`(async()=>{ ${expression} })()`:expression;const safeAsyncFunction=()=>{try{let func2=new AsyncFunction(["__self","scope"],`with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);return Object.defineProperty(func2,"name",{value:`[Alpine] ${expression}`}),func2}catch(error2){return handleError(error2,el,expression),Promise.resolve()}};let func=safeAsyncFunction();return evaluatorMemo[expression]=func,func}(expression,el);return(receiver=()=>{},{scope:scope2={},params:params=[],context:context}={})=>{func.result=void 0,func.finished=!1;let completeScope=mergeProxies([scope2,...dataStack]);if("function"==typeof func){let promise=func.call(context,func,completeScope).catch(error2=>handleError(error2,el,expression));func.finished?(runIfTypeOfFunction(receiver,func.result,completeScope,params,el),func.result=void 0):promise.then(result=>{runIfTypeOfFunction(receiver,result,completeScope,params,el)}).catch(error2=>handleError(error2,el,expression)).finally(()=>func.result=void 0)}}}(dataStack,expression,el);return tryCatch.bind(null,el,expression,evaluator)}var evaluatorMemo={};function runIfTypeOfFunction(receiver,value,scope2,params,el){if(shouldAutoEvaluateFunctions&&"function"==typeof value){let result=value.apply(scope2,params);result instanceof Promise?result.then(i=>runIfTypeOfFunction(receiver,i,scope2,params)).catch(error2=>handleError(error2,el,value)):receiver(result)}else"object"==typeof value&&value instanceof Promise?value.then(i=>receiver(i)):receiver(value)}var prefixAsString="x-";function prefix(subject=""){return prefixAsString+subject}var directiveHandlers={};function directive(name,callback){return directiveHandlers[name]=callback,{before(directive2){if(!directiveHandlers[directive2])return void console.warn(String.raw`Cannot find directive \`${directive2}\`. \`${name}\` will use the default order of execution`);const pos=directiveOrder.indexOf(directive2);directiveOrder.splice(pos>=0?pos:directiveOrder.indexOf("DEFAULT"),0,name)}}}function directives(el,attributes,originalAttributeOverride){if(attributes=Array.from(attributes),el._x_virtualDirectives){let vAttributes=Object.entries(el._x_virtualDirectives).map(([name,value])=>({name:name,value:value})),staticAttributes=attributesOnly(vAttributes);vAttributes=vAttributes.map(attribute=>staticAttributes.find(attr=>attr.name===attribute.name)?{name:`x-bind:${attribute.name}`,value:`"${attribute.value}"`}:attribute),attributes=attributes.concat(vAttributes)}let transformedAttributeMap={},directives2=attributes.map(toTransformedAttributes((newName,oldName)=>transformedAttributeMap[newName]=oldName)).filter(outNonAlpineAttributes).map(function(transformedAttributeMap,originalAttributeOverride){return({name:name,value:value})=>{let typeMatch=name.match(alpineAttributeRegex()),valueMatch=name.match(/:([a-zA-Z0-9\-_:]+)/),modifiers=name.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],original=originalAttributeOverride||transformedAttributeMap[name]||name;return{type:typeMatch?typeMatch[1]:null,value:valueMatch?valueMatch[1]:null,modifiers:modifiers.map(i=>i.replace(".","")),expression:value,original:original}}}(transformedAttributeMap,originalAttributeOverride)).sort(byPriority);return directives2.map(directive2=>function(el,directive2){let noop=()=>{},handler4=directiveHandlers[directive2.type]||noop,[utilities,cleanup2]=getElementBoundUtilities(el);onAttributeRemoved(el,directive2.original,cleanup2);let fullHandler=()=>{el._x_ignore||el._x_ignoreSelf||(handler4.inline&&handler4.inline(el,directive2,utilities),handler4=handler4.bind(handler4,el,directive2,utilities),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(handler4):handler4())};return fullHandler.runCleanups=cleanup2,fullHandler}(el,directive2))}function attributesOnly(attributes){return Array.from(attributes).map(toTransformedAttributes()).filter(attr=>!outNonAlpineAttributes(attr))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function getElementBoundUtilities(el){let cleanups=[],[effect3,cleanupEffect]=function(el){let cleanup2=()=>{};return[callback=>{let effectReference=effect(callback);return el._x_effects||(el._x_effects=new Set,el._x_runEffects=()=>
6{el._x_effects.forEach(i=>i())}),el._x_effects.add(effectReference),cleanup2=()=>{void 0!==effectReference&&(el._x_effects.delete(effectReference),release(effectReference))},effectReference},()=>{cleanup2()}]}(el);cleanups.push(cleanupEffect);return[{Alpine:alpine_default,effect:effect3,cleanup:callback=>cleanups.push(callback),evaluateLater:evaluateLater.bind(evaluateLater,el),evaluate:evaluate.bind(evaluate,el)},()=>cleanups.forEach(i=>i())]}var startingWith=(subject,replacement)=>({name:name,value:value})=>(name.startsWith(subject)&&(name=name.replace(subject,replacement)),{name:name,value:value});function toTransformedAttributes(callback=()=>{}){return({name:name,value:value})=>{let{name:newName,value:newValue}=attributeTransformers.reduce((carry,transform)=>transform(carry),{name:name,value:value});return newName!==name&&callback(newName,name),{name:newName,value:newValue}}}var attributeTransformers=[];function mapAttributes(callback){attributeTransformers.push(callback)}function outNonAlpineAttributes({name:name}){return alpineAttributeRegex().test(name)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(a,b){let typeA=-1===directiveOrder.indexOf(a.type)?DEFAULT:a.type,typeB=-1===directiveOrder.indexOf(b.type)?DEFAULT:b.type;return directiveOrder.indexOf(typeA)-directiveOrder.indexOf(typeB)}function dispatch(el,name,detail={}){el.dispatchEvent(new CustomEvent(name,{detail:detail,bubbles:!0,composed:!0,cancelable:!0}))}function walk(el,callback){if("function"==typeof ShadowRoot&&el instanceof ShadowRoot)return void Array.from(el.children).forEach(el2=>walk(el2,callback));let skip=!1;if(callback(el,()=>skip=!0),skip)return;let node=el.firstElementChild;for(;node;)walk(node,callback),node=node.nextElementSibling}function warn(message,...args){console.warn(`Alpine Warning: ${message}`,...args)}var started=!1;var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(fn=>fn())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(fn=>fn())}function addRootSelector(selectorCallback){rootSelectorCallbacks.push(selectorCallback)}function addInitSelector(selectorCallback){initSelectorCallbacks.push(selectorCallback)}function closestRoot(el,includeInitSelectors=!1){return findClosest(el,element=>{if((includeInitSelectors?allSelectors():rootSelectors()).some(selector=>element.matches(selector)))return!0})}function findClosest(el,callback){if(el){if(callback(el))return el;if(el._x_teleportBack&&(el=el._x_teleportBack),el.parentNode instanceof ShadowRoot)return findClosest(el.parentNode.host,callback);if(el.parentElement)return findClosest(el.parentElement,callback)}}var initInterceptors2=[];var markerDispenser=1;function initTree(el,walker=walk,intercept=()=>{}){findClosest(el,i=>i._x_ignore)||function(callback){isDeferringHandlers=!0;let key=Symbol();currentHandlerStackKey=key,directiveHandlerStacks.set(key,[]);let flushHandlers=()=>{for(;directiveHandlerStacks.get(key).length;)directiveHandlerStacks.get(key).shift()();directiveHandlerStacks.delete(key)};callback(flushHandlers),isDeferringHandlers=!1,flushHandlers()}(()=>{walker(el,(el2,skip)=>{el2._x_marker||(intercept(el2,skip),initInterceptors2.forEach(i=>i(el2,skip)),directives(el2,el2.attributes).forEach(handle=>handle()),el2._x_ignore||(el2._x_marker=markerDispenser++),el2._x_ignore&&skip())})})}function destroyTree(root,walker=walk){walker(root,el=>{!function(el){for(el._x_effects?.forEach(dequeueJob);el._x_cleanups?.length;)el._x_cleanups.pop()()}(el),cleanupAttributes(el),delete el._x_marker})}var tickStack=[],isHolding=!1;function nextTick(callback=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(res=>{tickStack.push(()=>{callback(),res()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function setClasses(el,value){return Array.isArray(value)?setClassesFromString(el,value.join(" ")):"object"==typeof value&&null!==value?function(el,classObject){let split=classString=>
6classString.split(" ").filter(Boolean),forAdd=Object.entries(classObject).flatMap(([classString,bool])=>!!bool&&split(classString)).filter(Boolean),forRemove=Object.entries(classObject).flatMap(([classString,bool])=>!bool&&split(classString)).filter(Boolean),added=[],removed=[];return forRemove.forEach(i=>{el.classList.contains(i)&&(el.classList.remove(i),removed.push(i))}),forAdd.forEach(i=>{el.classList.contains(i)||(el.classList.add(i),added.push(i))}),()=>{removed.forEach(i=>el.classList.add(i)),added.forEach(i=>el.classList.remove(i))}}(el,value):"function"==typeof value?setClasses(el,value()):setClassesFromString(el,value)}function setClassesFromString(el,classString){return classString=!0===classString?classString="":classString||"",classes=classString.split(" ").filter(i=>!el.classList.contains(i)).filter(Boolean),el.classList.add(...classes),()=>{el.classList.remove(...classes)};var classes}function setStyles(el,value){return"object"==typeof value&&null!==value?function(el,value){let previousStyles={};return Object.entries(value).forEach(([key,value2])=>{previousStyles[key]=el.style[key],key.startsWith("--")||(key=key.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),el.style.setProperty(key,value2)}),setTimeout(()=>{0===el.style.length&&el.removeAttribute("style")}),()=>{setStyles(el,previousStyles)}}(el,value):function(el,value){let cache=el.getAttribute("style",value);return el.setAttribute("style",value),()=>{el.setAttribute("style",cache||"")}}(el,value)}function once(callback,fallback=()=>{}){let called=!1;return function(){called?fallback.apply(this,arguments):(called=!0,callback.apply(this,arguments))}}function registerTransitionObject(el,setFunction,defaultValue={}){el._x_transition||(el._x_transition={enter:{during:defaultValue,start:defaultValue,end:defaultValue},leave:{during:defaultValue,start:defaultValue,end:defaultValue},in(before=()=>{},after=()=>{}){transition(el,setFunction,{during:this.enter.during,start:this.enter.start,end:this.enter.end},before,after)},out(before=()=>{},after=()=>{}){transition(el,setFunction,{during:this.leave.during,start:this.leave.start,end:this.leave.end},before,after)}})}function closestHide(el){let parent=el.parentNode;if(parent)return parent._x_hidePromise?parent:closestHide(parent)}function transition(el,setFunction,{during:during,start:start2,end:end}={},before=()=>{},after=()=>{}){if(el._x_transitioning&&el._x_transitioning.cancel(),0===Object.keys(during).length&&0===Object.keys(start2).length&&0===Object.keys(end).length)return before(),void after();let undoStart,undoDuring,undoEnd;!function(el,stages){let interrupted,reachedBefore,reachedEnd,finish=once(()=>{mutateDom(()=>{interrupted=!0,reachedBefore||stages.before(),reachedEnd||(stages.end(),releaseNextTicks()),stages.after(),el.isConnected&&stages.cleanup(),delete el._x_transitioning})});el._x_transitioning={beforeCancels:[],beforeCancel(callback){this.beforeCancels.push(callback)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();finish()}),finish:finish},mutateDom(()=>{stages.start(),stages.during()}),isHolding=!0,requestAnimationFrame(()=>{if(interrupted)return;let duration=1e3*Number(getComputedStyle(el).transitionDuration.replace(/,.*/,"").replace("s","")),delay=1e3*Number(getComputedStyle(el).transitionDelay.replace(/,.*/,"").replace("s",""));0===duration&&(duration=1e3*Number(getComputedStyle(el).animationDuration.replace("s",""))),mutateDom(()=>{stages.before()}),reachedBefore=!0,requestAnimationFrame(()=>{interrupted||(mutateDom(()=>{stages.end()}),releaseNextTicks(),setTimeout(el._x_transitioning.finish,duration+delay),reachedEnd=!0)})})}(el,{start(){undoStart=setFunction(el,start2)},during(){undoDuring=setFunction(el,during)},before:before,end(){undoStart(),undoEnd=setFunction(el,end)},after:after,cleanup(){undoDuring(),undoEnd()}})}function modifierValue$1(modifiers,key,fallback){if(-1===modifiers.indexOf(key))return fallback;const rawValue=modifiers[modifiers.indexOf(key)+1];if(!rawValue)return fallback;if("scale"===key&&isNaN(rawValue))return fallback;if("duration"===key||"delay"===key){let match=rawValue.match(/([0-9]+)ms/);if(match)return match[1]}return"origin"===key&&["top","right","left","center","bottom"].includes(modifiers[modifiers.indexOf(key)+2])?[rawValue,modifiers[modifiers.indexOf(key)+2]].join(" "):rawValue}directive("transition",(el,{value:value,modifiers:modifiers,expression:expression},{evaluate:evaluate2})=>{"function"==typeof expression&&(expression=evaluate2(expression)),!1!==expression&&(expression&&"boolean"!=typeof expression?function(el,classString,stage){registerTransitionObject(el,setClasses,"");let directiveStorageMap={enter:classes=>{el._x_transition.enter.during=classes},"enter-start":classes=>{el._x_transition.enter.start=classes},"enter-end":classes=>
6{el._x_transition.enter.end=classes},leave:classes=>{el._x_transition.leave.during=classes},"leave-start":classes=>{el._x_transition.leave.start=classes},"leave-end":classes=>{el._x_transition.leave.end=classes}};directiveStorageMap[stage](classString)}(el,expression,value):function(el,modifiers,stage){registerTransitionObject(el,setStyles);let doesntSpecify=!modifiers.includes("in")&&!modifiers.includes("out")&&!stage,transitioningIn=doesntSpecify||modifiers.includes("in")||["enter"].includes(stage),transitioningOut=doesntSpecify||modifiers.includes("out")||["leave"].includes(stage);modifiers.includes("in")&&!doesntSpecify&&(modifiers=modifiers.filter((i,index)=>index<modifiers.indexOf("out")));modifiers.includes("out")&&!doesntSpecify&&(modifiers=modifiers.filter((i,index)=>index>modifiers.indexOf("out")));let wantsAll=!modifiers.includes("opacity")&&!modifiers.includes("scale"),wantsOpacity=wantsAll||modifiers.includes("opacity"),wantsScale=wantsAll||modifiers.includes("scale"),opacityValue=wantsOpacity?0:1,scaleValue=wantsScale?modifierValue$1(modifiers,"scale",95)/100:1,delay=modifierValue$1(modifiers,"delay",0)/1e3,origin=modifierValue$1(modifiers,"origin","center"),property="opacity, transform",durationIn=modifierValue$1(modifiers,"duration",150)/1e3,durationOut=modifierValue$1(modifiers,"duration",75)/1e3,easing="cubic-bezier(0.4, 0.0, 0.2, 1)";transitioningIn&&(el._x_transition.enter.during={transformOrigin:origin,transitionDelay:`${delay}s`,transitionProperty:property,transitionDuration:`${durationIn}s`,transitionTimingFunction:easing},el._x_transition.enter.start={opacity:opacityValue,transform:`scale(${scaleValue})`},el._x_transition.enter.end={opacity:1,transform:"scale(1)"});transitioningOut&&(el._x_transition.leave.during={transformOrigin:origin,transitionDelay:`${delay}s`,transitionProperty:property,transitionDuration:`${durationOut}s`,transitionTimingFunction:easing},el._x_transition.leave.start={opacity:1,transform:"scale(1)"},el._x_transition.leave.end={opacity:opacityValue,transform:`scale(${scaleValue})`})}(el,modifiers,value))}),window.Element.prototype._x_toggleAndCascadeWithTransitions=function(el,value,show,hide){const nextTick2="visible"===document.visibilityState?requestAnimationFrame:setTimeout;let clickAwayCompatibleShow=()=>nextTick2(show);value?el._x_transition&&(el._x_transition.enter||el._x_transition.leave)?el._x_transition.enter&&(Object.entries(el._x_transition.enter.during).length||Object.entries(el._x_transition.enter.start).length||Object.entries(el._x_transition.enter.end).length)?el._x_transition.in(show):clickAwayCompatibleShow():el._x_transition?el._x_transition.in(show):clickAwayCompatibleShow():(el._x_hidePromise=el._x_transition?new Promise((resolve,reject)=>{el._x_transition.out(()=>{},()=>resolve(hide)),el._x_transitioning&&el._x_transitioning.beforeCancel(()=>reject({isFromCancelledTransition:!0}))}):Promise.resolve(hide),queueMicrotask(()=>{let closest=closestHide(el);closest?(closest._x_hideChildren||(closest._x_hideChildren=[]),closest._x_hideChildren.push(el)):nextTick2(()=>{let hideAfterChildren=el2=>{let carry=Promise.all([el2._x_hidePromise,...(el2._x_hideChildren||[]).map(hideAfterChildren)]).then(([i])=>i?.());return delete el2._x_hidePromise,delete el2._x_hideChildren,carry};hideAfterChildren(el).catch(e=>{if(!e.isFromCancelledTransition)throw e})})}))};var isCloning=!1;function skipDuringClone(callback,fallback=()=>{}){return(...args)=>isCloning?fallback(...args):callback(...args)}var interceptors=[];function interceptClone(callback){interceptors.push(callback)}var isCloningLegacy=!1;function dontRegisterReactiveSideEffects(callback){let cache=effect;overrideEffect((callback2,el)=>{let storedEffect=cache(callback2);return release(storedEffect),()=>{}}),callback(),overrideEffect(cache)}function bind(el,name,value,modifiers=[]){switch(el._x_bindings||(el._x_bindings=reactive({})),el._x_bindings[name]=value,name=modifiers.includes("camel")?name.toLowerCase().replace(/-(\w)/g,(match,char)=>char.toUpperCase()):name){case"value":!function(el,value){if(isRadio$1(el))void 0===el.attributes.value&&(el.value=value),window.fromModel&&(el.checked="boolean"==typeof value?safeParseBoolean(el.value)===value:checkedAttrLooseCompare(el.value,value));else if(isCheckbox(el))Number.isInteger(value)?el.value=value:Array.isArray(value)||"boolean"==typeof value||[null,void 0].includes(value)?Array.isArray(value)?el.checked=value.some(val=>checkedAttrLooseCompare(val,el.value)):el.checked=!!value:el.value=String(value);else if("SELECT"===el.tagName)!function(el,value){const arrayWrappedValue=[].concat(value).map(value2=>value2+"");
6Array.from(el.options).forEach(option=>{option.selected=arrayWrappedValue.includes(option.value)})}(el,value);else{if(el.value===value)return;el.value=void 0===value?"":value}}(el,value);break;case"style":!function(el,value){el._x_undoAddedStyles&&el._x_undoAddedStyles();el._x_undoAddedStyles=setStyles(el,value)}(el,value);break;case"class":!function(el,value){el._x_undoAddedClasses&&el._x_undoAddedClasses();el._x_undoAddedClasses=setClasses(el,value)}(el,value);break;case"selected":case"checked":!function(el,name,value){bindAttribute(el,name,value),function(el,propName,value){el[propName]!==value&&(el[propName]=value)}(el,name,value)}(el,name,value);break;default:bindAttribute(el,name,value)}}function bindAttribute(el,name,value){[null,void 0,!1].includes(value)&&function(name){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(name)}(name)?el.removeAttribute(name):(isBooleanAttr(name)&&(value=name),function(el,attrName,value){el.getAttribute(attrName)!=value&&el.setAttribute(attrName,value)}(el,name,value))}function checkedAttrLooseCompare(valueA,valueB){return valueA==valueB}function safeParseBoolean(rawValue){return!![1,"1","true","on","yes",!0].includes(rawValue)||![0,"0","false","off","no",!1].includes(rawValue)&&(rawValue?Boolean(rawValue):null)}var booleanAttributes=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function isBooleanAttr(attrName){return booleanAttributes.has(attrName)}function getAttributeBinding(el,name,fallback){let attr=el.getAttribute(name);return null===attr?"function"==typeof fallback?fallback():fallback:""===attr||(isBooleanAttr(name)?!![name,"true"].includes(attr):attr)}function isCheckbox(el){return"checkbox"===el.type||"ui-checkbox"===el.localName||"ui-switch"===el.localName}function isRadio$1(el){return"radio"===el.type||"ui-radio"===el.localName}function debounce(func,wait){let timeout;return function(){const context=this,args=arguments;clearTimeout(timeout),timeout=setTimeout(function(){timeout=null,func.apply(context,args)},wait)}}function throttle(func,limit){let inThrottle;return function(){let context=this,args=arguments;inThrottle||(func.apply(context,args),inThrottle=!0,setTimeout(()=>inThrottle=!1,limit))}}function entangle({get:outerGet,set:outerSet},{get:innerGet,set:innerSet}){let outerHash,firstRun=!0,reference=effect(()=>{let outer=outerGet(),inner=innerGet();if(firstRun)innerSet(cloneIfObject(outer)),firstRun=!1;else{let outerHashLatest=JSON.stringify(outer),innerHashLatest=JSON.stringify(inner);outerHashLatest!==outerHash?innerSet(cloneIfObject(outer)):outerHashLatest!==innerHashLatest&&outerSet(cloneIfObject(inner))}outerHash=JSON.stringify(outerGet()),JSON.stringify(innerGet())});return()=>{release(reference)}}function cloneIfObject(value){return"object"==typeof value?JSON.parse(JSON.stringify(value)):value}var stores={},isReactive=!1;var binds={};function applyBindingsObject(el,obj,original){let cleanupRunners=[];for(;cleanupRunners.length;)cleanupRunners.pop()();let attributes=Object.entries(obj).map(([name,value])=>({name:name,value:value})),staticAttributes=attributesOnly(attributes);return attributes=attributes.map(attribute=>staticAttributes.find(attr=>attr.name===attribute.name)?{name:`x-bind:${attribute.name}`,value:`"${attribute.value}"`}:attribute),directives(el,attributes,original).map(handle=>{cleanupRunners.push(handle.runCleanups),handle()}),()=>{for(;cleanupRunners.length;)cleanupRunners.pop()()}}var datas={};var alpine_default={get reactive(){return reactive},get release(){return release},get effect(){return effect},get raw(){return raw},version:"3.15.3",flushAndStopDeferringMutations:function(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]},dontAutoEvaluateFunctions:dontAutoEvaluateFunctions,disableEffectScheduling:function(callback){shouldSchedule=!1,callback(),shouldSchedule=!0},startObservingMutations:startObservingMutations,stopObservingMutations:stopObservingMutations,setReactivityEngine:function(engine){reactive=engine.reactive,release=engine.release,effect=callback=>engine.effect(callback,{scheduler:task=>{shouldSchedule?scheduler(task):task()}}),raw=engine.raw},onAttributeRemoved:onAttributeRemoved,onAttributesAdded:onAttributesAdded,closestDataStack:closestDataStack,skipDuringClone:skipDuringClone,onlyDuringClone:function(callback){return(...args)=>isCloning&&callback(...args)},addRootSelector:addRootSelector,addInitSelector:addInitSelector,setErrorHandler:function(handler4){errorHandler=handler4},interceptClone:interceptClone,addScopeToNode:addScopeToNode,deferMutations:function(){isCollecting=!0},mapAttributes:mapAttributes,evaluateLater:evaluateLater,interceptInit:function(callback){initInterceptors2.push(callback)},initInterceptors:initInterceptors,injectMagics:injectMagics,setEvaluator:function(newEvaluator){theEvaluatorFunction=newEvaluator},setRawEvaluator:function(newEvaluator){theRawEvaluatorFunction=newEvaluator},mergeProxies:mergeProxies,extractProp:function(el,name,fallback,extract=!0){if(el._x_bindings&&void 0!==el._x_bindings[name])return el._x_bindings[name];if(el._x_inlineBindings&&void 0!==el._x_inlineBindings[name]){let binding=el._x_inlineBindings[name];return binding.extract=extract,dontAutoEvaluateFunctions(()=>evaluate(el,binding.expression))}return getAttributeBinding(el,name,fallback)},findClosest:findClosest,onElRemoved:onElRemoved,closestRoot:closestRoot,destroyTree:destroyTree,interceptor:interceptor,transition:transition,setStyles:setStyles,mutateDom:mutateDom,directive:directive,entangle:entangle,throttle:throttle,debounce:debounce,evaluate:evaluate,evaluateRaw:function(...args){return theRawEvaluatorFunction(...args)},initTree:initTree,nextTick:nextTick,prefixed:prefix,prefix:function(newPrefix){prefixAsString=newPrefix},plugin:function(callback){(Array.isArray(callback)?callback:[callback]).forEac
6h(i=>i(alpine_default))},magic:magic,store:function(name,value){if(isReactive||(stores=reactive(stores),isReactive=!0),void 0===value)return stores[name];stores[name]=value,initInterceptors(stores[name]),"object"==typeof value&&null!==value&&value.hasOwnProperty("init")&&"function"==typeof value.init&&stores[name].init()},start:function(){var callback;started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),callback=el=>initTree(el,walk),onElAddeds.push(callback),onElRemoved(el=>destroyTree(el)),onAttributesAdded((el,attrs)=>{directives(el,attrs).forEach(handle=>handle())}),Array.from(document.querySelectorAll(allSelectors().join(","))).filter(el=>!closestRoot(el.parentElement,!0)).forEach(el=>{initTree(el)}),dispatch(document,"alpine:initialized"),setTimeout(()=>{[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([plugin2,directive2,selectors])=>{var name;name=directive2,Object.keys(directiveHandlers).includes(name)||selectors.some(selector=>{if(document.querySelector(selector))return warn(`found "${selector}", but missing ${plugin2} plugin`),!0})})})},clone:function(oldEl,newEl){newEl._x_dataStack||(newEl._x_dataStack=oldEl._x_dataStack),isCloning=!0,isCloningLegacy=!0,dontRegisterReactiveSideEffects(()=>{!function(el){let hasRunThroughFirstEl=!1;initTree(el,(el2,callback)=>{walk(el2,(el3,skip)=>{if(hasRunThroughFirstEl&&function(el){return rootSelectors().some(selector=>el.matches(selector))}(el3))return skip();hasRunThroughFirstEl=!0,callback(el3,skip)})})}(newEl)}),isCloning=!1,isCloningLegacy=!1},cloneNode:function(from,to){interceptors.forEach(i=>i(from,to)),isCloning=!0,dontRegisterReactiveSideEffects(()=>{initTree(to,(el,callback)=>{callback(el,()=>{})})}),isCloning=!1},bound:function(el,name,fallback){return el._x_bindings&&void 0!==el._x_bindings[name]?el._x_bindings[name]:getAttributeBinding(el,name,fallback)},$data:scope,watch:watch,walk:walk,data:function(name,callback){datas[name]=callback},bind:function(name,bindings){let getBindings="function"!=typeof bindings?()=>bindings:bindings;return name instanceof Element?applyBindingsObject(name,getBindings()):(binds[name]=getBindings,()=>{})}};function makeMap(str,expectsLowerCase){const map=Object.create(null),list=str.split(",");for(let i=0;i<list.length;i++)map[list[i]]=!0;return val=>!!map[val]}var activeEffect,EMPTY_OBJ=Object.freeze({}),hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(val,key)=>hasOwnProperty.call(val,key),isArray=Array.isArray,isMap=val=>"[object Map]"===toTypeString(val),isSymbol=val=>"symbol"==typeof val,isObject=val=>null!==val&&"object"==typeof val,objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),toRawType=value=>toTypeString(value).slice(8,-1),isIntegerKey=key=>"string"==typeof key&&"NaN"!==key&&"-"!==key[0]&&""+parseInt(key,10)===key,capitalize=(fn=>{const cache=Object.create(null);return str=>cache[str]||(cache[str]=fn(str))})(str=>str.charAt(0).toUpperCase()+str.slice(1)),hasChanged=(value,oldValue)=>value!==oldValue&&(value==value||oldValue==oldValue),targetMap=new WeakMap,effectStack=[],ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");var uid=0;function cleanup(effect3){const{deps:deps}=effect3;if(deps.length){for(let i=0;i<deps.length;i++)deps[i].delete(effect3);deps.length=0}}var shouldTrack=!0,trackStack=[];function resetTracking(){const last=trackStack.pop();shouldTrack=void 0===last||last}function track(target,type,key){if(!shouldTrack||void 0===activeEffect)return;let depsMap=targetMap.get(target);depsMap||targetMap.set(target,depsMap=new Map);let dep=depsMap.get(key);dep||depsMap.set(key,dep=new Set),dep.has(activeEffect)||(dep.add(activeEffect),activeEffect.deps.push(dep),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target:target,type:type,key:key}))}function trigger(target,type,key,newValue,oldValue,oldTarget){const depsMap=targetMap.get(target);if(!depsMap)return;const effects=new Set,add2=effectsToAdd=>
6{effectsToAdd&&effectsToAdd.forEach(effect3=>{(effect3!==activeEffect||effect3.allowRecurse)&&effects.add(effect3)})};if("clear"===type)depsMap.forEach(add2);else if("length"===key&&isArray(target))depsMap.forEach((dep,key2)=>{("length"===key2||key2>=newValue)&&add2(dep)});else switch(void 0!==key&&add2(depsMap.get(key)),type){case"add":isArray(target)?isIntegerKey(key)&&add2(depsMap.get("length")):(add2(depsMap.get(ITERATE_KEY)),isMap(target)&&add2(depsMap.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray(target)||(add2(depsMap.get(ITERATE_KEY)),isMap(target)&&add2(depsMap.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(target)&&add2(depsMap.get(ITERATE_KEY))}effects.forEach(effect3=>{effect3.options.onTrigger&&effect3.options.onTrigger({effect:effect3,target:target,key:key,type:type,newValue:newValue,oldValue:oldValue,oldTarget:oldTarget}),effect3.options.scheduler?effect3.options.scheduler(effect3):effect3()})}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(key=>Symbol[key]).filter(isSymbol)),get2=createGetter(),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const instrumentations={};return["includes","indexOf","lastIndexOf"].forEach(key=>{instrumentations[key]=function(...args){const arr=toRaw(this);for(let i=0,l=this.length;i<l;i++)track(arr,"get",i+"");const res=arr[key](...args);return-1===res||!1===res?arr[key](...args.map(toRaw)):res}}),["push","pop","shift","unshift","splice"].forEach(key=>{instrumentations[key]=function(...args){trackStack.push(shouldTrack),shouldTrack=!1;const res=toRaw(this)[key].apply(this,args);return resetTracking(),res}}),instrumentations}function createGetter(isReadonly=!1,shallow=!1){return function(target,key,receiver){if("__v_isReactive"===key)return!isReadonly;if("__v_isReadonly"===key)return isReadonly;if("__v_raw"===key&&receiver===(isReadonly?shallow?shallowReadonlyMap:readonlyMap:shallow?shallowReactiveMap:reactiveMap).get(target))return target;const targetIsArray=isArray(target);if(!isReadonly&&targetIsArray&&hasOwn(arrayInstrumentations,key))return Reflect.get(arrayInstrumentations,key,receiver);const res=Reflect.get(target,key,receiver);if(isSymbol(key)?builtInSymbols.has(key):isNonTrackableKeys(key))return res;if(isReadonly||track(target,"get",key),shallow)return res;if(isRef(res)){return!targetIsArray||!isIntegerKey(key)?res.value:res}return isObject(res)?isReadonly?readonly(res):reactive2(res):res}}function createSetter(shallow=!1){return function(target,key,value,receiver){let oldValue=target[key];if(!shallow&&(value=toRaw(value),oldValue=toRaw(oldValue),!isArray(target)&&isRef(oldValue)&&!isRef(value)))return oldValue.value=value,!0;const hadKey=isArray(target)&&isIntegerKey(key)?Number(key)<target.length:hasOwn(target,key),result=Reflect.set(target,key,value,receiver);return target===toRaw(receiver)&&(hadKey?hasChanged(value,oldValue)&&trigger(target,"set",key,value,oldValue):trigger(target,"add",key,value)),result}}var mutableHandlers={get:get2,set:createSetter(),deleteProperty:function(target,key){const hadKey=hasOwn(target,key),oldValue=target[key],result=Reflect.deleteProperty(target,key);return result&&hadKey&&trigger(target,"delete",key,void 0,oldValue),result},has:function(target,key){const result=Reflect.has(target,key);return isSymbol(key)&&builtInSymbols.has(key)||track(target,"has",key),result},ownKeys:function(target){return track(target,"iterate",isArray(target)?"length":ITERATE_KEY),Reflect.ownKeys(target)}},readonlyHandlers={get:readonlyGet,set:(target,key)=>(console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`,target),!0),deleteProperty:(target,key)=>(console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`,target),!0)},toReactive=value=>isObject(value)?reactive2(value):value,toReadonly=value=>isObject(value)?readonly(value):value,toShallow=value=>value,getProto=v=>Reflect.getPrototypeOf(v);function get$1(target,key,isReadonly=!1,isShallow=!1){const rawTarget=toRaw(target=target.__v_raw),rawKey=toRaw(key);key!==rawKey&&!isReadonly&&track(rawTarget,"get",key),!isReadonly&&track(rawTarget,"get",rawKey);const{has:has2}=getProto(rawTarget),wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;return has2.call(rawTarget,key)?wrap(target.get(key)):has2.call(rawTarget,rawKey)?wrap(target.get(rawKey)):void(target!==rawTarget&&target.get(key))}function has$1(key,isReadonly=!1){const target=this.__v_raw,rawTarget=toRaw(target),rawKey=toRaw(key);return key!==rawKey&&!isReadonly&&track(rawTarget,"has",key),!isReadonly&&track(rawTarget,"has",rawKey
6),key===rawKey?target.has(key):target.has(key)||target.has(rawKey)}function size(target,isReadonly=!1){return target=target.__v_raw,!isReadonly&&track(toRaw(target),"iterate",ITERATE_KEY),Reflect.get(target,"size",target)}function add(value){value=toRaw(value);const target=toRaw(this);return getProto(target).has.call(target,value)||(target.add(value),trigger(target,"add",value,value)),this}function set$1(key,value){value=toRaw(value);const target=toRaw(this),{has:has2,get:get3}=getProto(target);let hadKey=has2.call(target,key);hadKey?checkIdentityKeys(target,has2,key):(key=toRaw(key),hadKey=has2.call(target,key));const oldValue=get3.call(target,key);return target.set(key,value),hadKey?hasChanged(value,oldValue)&&trigger(target,"set",key,value,oldValue):trigger(target,"add",key,value),this}function deleteEntry(key){const target=toRaw(this),{has:has2,get:get3}=getProto(target);let hadKey=has2.call(target,key);hadKey?checkIdentityKeys(target,has2,key):(key=toRaw(key),hadKey=has2.call(target,key));const oldValue=get3?get3.call(target,key):void 0,result=target.delete(key);return hadKey&&trigger(target,"delete",key,void 0,oldValue),result}function clear(){const target=toRaw(this),hadItems=0!==target.size,oldTarget=isMap(target)?new Map(target):new Set(target),result=target.clear();return hadItems&&trigger(target,"clear",void 0,void 0,oldTarget),result}function createForEach(isReadonly,isShallow){return function(callback,thisArg){const observed=this,target=observed.__v_raw,rawTarget=toRaw(target),wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;return!isReadonly&&track(rawTarget,"iterate",ITERATE_KEY),target.forEach((value,key)=>callback.call(thisArg,wrap(value),wrap(key),observed))}}function createIterableMethod(method,isReadonly,isShallow){return function(...args){const target=this.__v_raw,rawTarget=toRaw(target),targetIsMap=isMap(rawTarget),isPair="entries"===method||method===Symbol.iterator&&targetIsMap,isKeyOnly="keys"===method&&targetIsMap,innerIterator=target[method](...args),wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;return!isReadonly&&track(rawTarget,"iterate",isKeyOnly?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:value,done:done}=innerIterator.next();return done?{value:value,done:done}:{value:isPair?[wrap(value[0]),wrap(value[1])]:wrap(value),done:done}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(type){return function(...args){{const key=args[0]?`on key "${args[0]}" `:"";console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`,toRaw(this))}return"delete"!==type&&this}}function createInstrumentations(){const mutableInstrumentations2={get(key){return get$1(this,key)},get size(){return size(this)},has:has$1,add:add,set:set$1,delete:deleteEntry,clear:clear,forEach:createForEach(!1,!1)},shallowInstrumentations2={get(key){return get$1(this,key,!1,!0)},get size(){return size(this)},has:has$1,add:add,set:set$1,delete:deleteEntry,clear:clear,forEach:createForEach(!1,!0)},readonlyInstrumentations2={get(key){return get$1(this,key,!0)},get size(){return size(this,!0)},has(key){return has$1.call(this,key,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},shallowReadonlyInstrumentations2={get(key){return get$1(this,key,!0,!0)},get size(){return size(this,!0)},has(key){return has$1.call(this,key,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(method=>{mutableInstrumentations2[method]=createIterableMethod(method,!1,!1),readonlyInstrumentations2[method]=createIterableMethod(method,!0,!1),shallowInstrumentations2[method]=createIterableMethod(method,!1,!0),shallowReadonlyInstrumentations2[method]=createIterableMethod(method,!0,!0)}),[mutableInstrumentations2,readonlyInstrumentations2,shallowInstrumentations2,shallowReadonlyInstrumentations2]}var[mutableInstrumentations,readonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(isReadonly,shallow){const instrumentations=isReadonly?readonlyInstrumentations:mutableInstrumentations;return(target,key,receiver)=>"__v_isReactive"===key?!isReadonly:"__v_isReadonly"===key?isReadonly:"__v_raw"===key?target:Reflect.get(hasOwn(instrumentations,key)&&key in target?instrumentations:target,key,receiver)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0)};function checkIdentityKeys(target,has2,key){const rawKey=toRaw(key);if(rawKey!==key&&has2.call(target,rawKey)){const type=toRawType(target);console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${"Map"===type?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function reactive2(target){return target&&target.__v_isReadonly?target:createReactiveObject(target,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(target){return createReactiveObject(target,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(target,isReadonly,baseHandlers,collectionHandlers,proxyMap){if
6(!isObject(target))return console.warn(`value cannot be made reactive: ${String(target)}`),target;if(target.__v_raw&&(!isReadonly||!target.__v_isReactive))return target;const existingProxy=proxyMap.get(target);if(existingProxy)return existingProxy;const targetType=(value=target).__v_skip||!Object.isExtensible(value)?0:function(rawType){switch(rawType){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(toRawType(value));var value;if(0===targetType)return target;const proxy=new Proxy(target,2===targetType?collectionHandlers:baseHandlers);return proxyMap.set(target,proxy),proxy}function toRaw(observed){return observed&&toRaw(observed.__v_raw)||observed}function isRef(r){return Boolean(r&&!0===r.__v_isRef)}magic("nextTick",()=>nextTick),magic("dispatch",el=>dispatch.bind(dispatch,el)),magic("watch",(el,{evaluateLater:evaluateLater2,cleanup:cleanup2})=>(key,callback)=>{let evaluate2=evaluateLater2(key),unwatch=watch(()=>{let value;return evaluate2(i=>value=i),value},callback);cleanup2(unwatch)}),magic("store",function(){return stores}),magic("data",el=>scope(el)),magic("root",el=>closestRoot(el)),magic("refs",el=>(el._x_refs_proxy||(el._x_refs_proxy=mergeProxies(function(el){let refObjects=[];return findClosest(el,i=>{i._x_refs&&refObjects.push(i._x_refs)}),refObjects}(el))),el._x_refs_proxy));var globalIdMemo={};function findAndIncrementId(name){return globalIdMemo[name]||(globalIdMemo[name]=0),++globalIdMemo[name]}function warnMissingPluginMagic(name,magicName,slug){magic(magicName,el=>warn(`You can't use [$${magicName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`,el))}magic("id",(el,{cleanup:cleanup2})=>(name,key=null)=>function(el,cacheKey,cleanup2,callback){el._x_id||(el._x_id={});if(el._x_id[cacheKey])return el._x_id[cacheKey];let output=callback();return el._x_id[cacheKey]=output,cleanup2(()=>{delete el._x_id[cacheKey]}),output}(el,`${name}${key?`-${key}`:""}`,cleanup2,()=>{let root=function(el,name){return findClosest(el,element=>{if(element._x_ids&&element._x_ids[name])return!0})}(el,name),id=root?root._x_ids[name]:findAndIncrementId(name);return key?`${name}-${id}-${key}`:`${name}-${id}`})),interceptClone((from,to)=>{from._x_id&&(to._x_id=from._x_id)}),magic("el",el=>el),warnMissingPluginMagic("Focus","focus","focus"),warnMissingPluginMagic("Persist","persist","persist"),directive("modelable",(el,{expression:expression},{effect:effect3,evaluateLater:evaluateLater2,cleanup:cleanup2})=>{let func=evaluateLater2(expression),innerGet=()=>{let result;return func(i=>result=i),result},evaluateInnerSet=evaluateLater2(`${expression} = __placeholder`),innerSet=val=>evaluateInnerSet(()=>{},{scope:{__placeholder:val}}),initialValue=innerGet();innerSet(initialValue),queueMicrotask(()=>{if(!el._x_model)return;el._x_removeModelListeners.default();let outerGet=el._x_model.get,outerSet=el._x_model.set,releaseEntanglement=entangle({get:()=>outerGet(),set(value){outerSet(value)}},{get:()=>innerGet(),set(value){innerSet(value)}});cleanup2(releaseEntanglement)})}),directive("teleport",(el,{modifiers:modifiers,expression:expression},{cleanup:cleanup2})=>{"template"!==el.tagName.toLowerCase()&&warn("x-teleport can only be used on a <template> tag",el);let target=getTarget(expression),clone2=el.content.cloneNode(!0).firstElementChild;el._x_teleport=clone2,clone2._x_teleportBack=el,el.setAttribute("data-teleport-template",!0),clone2.setAttribute("data-teleport-target",!0),el._x_forwardEvents&&el._x_forwardEvents.forEach(eventName=>{clone2.addEventListener(eventName,e=>{e.stopPropagation(),el.dispatchEvent(new e.constructor(e.type,e))})}),addScopeToNode(clone2,{},el);let placeInDom=(clone3,target2,modifiers2)=>{modifiers2.includes("prepend")?target2.parentNode.insertBefore(clone3,target2):modifiers2.includes("append")?target2.parentNode.insertBefore(clone3,target2.nextSibling):target2.appendChild(clone3)};mutateDom(()=>{placeInDom(clone2,target,modifiers),skipDuringClone(()=>{initTree(clone2)})()}),el._x_teleportPutBack=()=>{let target2=getTarget(expression);mutateDom(()=>{placeInDom(el._x_teleport,target2,modifiers)})},cleanup2(()=>mutateDom(()=>{clone2.remove(),destroyTree(clone2)}))});var teleportContainerDuringClone=document.createElement("div");function getTarget(expression){let target=skipDuringClone(()=>document.querySelector(expression),()=>teleportContainerDuringClone)();return target||warn(`Cannot find x-teleport element for selector: "${expression}"`),target}var handler=()=>{};function on(el,event,modifiers,callback){let listenerTarget=el,handler4=e=>callback(e),options={},wrapHandler=(callback2,wrapper)=>e=>wrapper(callback2,e);if(modifiers.includes("dot")&&(event=event.replace(/-/g,".")),modifiers.includes("camel")&&(event=function(subject){return subject.toLowerCase().replace(/-(\w)/g,(match,char)=>char.toUpperCase())}(event)),modifiers.includes("passive")&&(options.passive=!0),modifiers.includes("capture")&&(options.capture=!0),modifiers.includes("window")&&(listenerTarget=window),modifiers.includes("document")&&(listenerTarget=document),modifiers.includes("debounce")){let nextModifier=modifiers[modifiers.indexOf("debounce")+1]||"invalid-wait",wait=isNumeric(nextModifier.split("ms")[0])?Number(nextModifier.split("ms")[0]):250;handler4=debounce(handler4,wait)}if(modifiers.includes("throttle")){let nextModifier=modifiers[modifiers.indexOf("throttle")+1]||"invalid-wait",wait=isNumeric(nextModifier.split("ms")[0])?Number(nextModifier.split("ms")[0]):250;handler4=throttle(handler4,wait)}return modifiers.includes("prevent")&&(handler4=wrapHandler(handler4,(next,e)=>{e.preventDefault(),next(e)})),modifiers.includes("stop")&&(handler4=wrapHandler(handler4,(next,e)=>{e.stopPropagation(),next(e)})),modifiers.includes("once")&&(handler4=wrapHandler(handler4,(next,e)=>{next(e),listenerTarget.removeEventListener(event,handler4,options)})),(modifiers.includes("away")||modifiers.includes("outside"))&&(listenerTarget=document,handler4=wrapHandler(handler4,(next,e)=>{el.contains(e.target)||!1!==e.target.isConnected&&(el.offsetWidth<1&&el.offsetHeight<1||!1!==el._x_isShown&&next(e))})),modifiers.includes("self")&&(handler4=wrapHandler(handler4,(next,e)=>{e.target===el&&next(e)})),(function(event){return["keydown","keyup"].includes(event)}(event)||isClickEvent(event))&&(handler4=wrapHandler(handler4,(next,e)=>{(function(e,modifiers){let keyModifiers=modifiers.filter(i=>!["window","document","prevent","stop","once","capture","self","away","outside","passive","preserve-scroll"].includes(i));if(keyModifiers.includes("debounce")){let debounceIndex=keyModifiers.indexOf("debounce");keyModifiers.splice(debounceIndex,isNumeric((keyModifiers[debounceIndex+1]||"invalid-wait").split("ms")[0])?2:1)}if(keyModifiers.includes("throttle")){let debounceIndex=keyModifiers.indexOf("throttle");keyModifiers.splice(debounceIndex,isNumeric((keyModifiers[debounceIndex+1]||"invalid-wait").split("ms")[0])?2:1)}if(0===keyModifiers.length)return!1;if(1===keyModifiers.length&&keyToModifiers(e.key).includes(keyModifiers[0]))return!1;const selectedSystemKeyModifiers=["ctrl","shift","alt","meta","cmd","super"].filter(modifier=>keyModifiers.includes(modifier));if(keyModifiers=keyModifiers.filter(i=>!selectedSystemKeyModifiers.includes(i)),selectedSystemKeyModifiers.length>0){if(selectedSystemKeyModifiers.filter(modifier=>("cmd"!==modifier&&"super"!==modifier||(modifier="meta"),e[`${modifier}Key`])).length===selectedSystemKeyModifiers.length){if(isClickEvent(e.type))return!1;if(keyToModifiers(e.key).includes(keyModifiers[0]))return!1}}return!0})(e,modifiers)||next(e)})),listenerTarget.addEventListener(event,handler4,options),()=>{listenerTarget.removeEventListener(event,handler4,options)}}function isNumeric(subject){return!Array.isArray(subject)&&!isNaN(subject)}function isClickEvent(event){return["contextmenu","click","mouse"].some(i=>event.includes(i))}function keyToModifiers(key){if(!key)return[];var subject;key=[" ","_"].includes(subject=key)?subject:subject.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase();
6let modifierToKeyMap={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return modifierToKeyMap[key]=key,Object.keys(modifierToKeyMap).map(modifier=>{if(modifierToKeyMap[modifier]===key)return modifier}).filter(modifier=>modifier)}function getInputValue(el,modifiers,event,currentValue){return mutateDom(()=>{if(event instanceof CustomEvent&&void 0!==event.detail)return null!==event.detail&&void 0!==event.detail?event.detail:event.target.value;if(isCheckbox(el)){if(Array.isArray(currentValue)){let newValue=null;return newValue=modifiers.includes("number")?safeParseNumber(event.target.value):modifiers.includes("boolean")?safeParseBoolean(event.target.value):event.target.value,event.target.checked?currentValue.includes(newValue)?currentValue:currentValue.concat([newValue]):currentValue.filter(el2=>!(el2==newValue))}return event.target.checked}if("select"===el.tagName.toLowerCase()&&el.multiple)return modifiers.includes("number")?Array.from(event.target.selectedOptions).map(option=>safeParseNumber(option.value||option.text)):modifiers.includes("boolean")?Array.from(event.target.selectedOptions).map(option=>safeParseBoolean(option.value||option.text)):Array.from(event.target.selectedOptions).map(option=>option.value||option.text);{let newValue;return newValue=isRadio$1(el)?event.target.checked?event.target.value:currentValue:event.target.value,modifiers.includes("number")?safeParseNumber(newValue):modifiers.includes("boolean")?safeParseBoolean(newValue):modifiers.includes("trim")?newValue.trim():newValue}})}function safeParseNumber(rawValue){let number=rawValue?parseFloat(rawValue):null;return subject=number,Array.isArray(subject)||isNaN(subject)?rawValue:number;var subject}function isGetterSetter(value){return null!==value&&"object"==typeof value&&"function"==typeof value.get&&"function"==typeof value.set}handler.inline=(el,{modifiers:modifiers},{cleanup:cleanup2})=>{modifiers.includes("self")?el._x_ignoreSelf=!0:el._x_ignore=!0,cleanup2(()=>{modifiers.includes("self")?delete el._x_ignoreSelf:delete el._x_ignore})},directive("ignore",handler),directive("effect",skipDuringClone((el,{expression:expression},{effect:effect3})=>{effect3(evaluateLater(el,expression))})),directive("model",(el,{modifiers:modifiers,expression:expression},{effect:effect3,cleanup:cleanup2})=>{let scopeTarget=el;modifiers.includes("parent")&&(scopeTarget=el.parentNode);let evaluateSet,evaluateGet=evaluateLater(scopeTarget,expression);evaluateSet="string"==typeof expression?evaluateLater(scopeTarget,`${expression} = __placeholder`):"function"==typeof expression&&"string"==typeof expression()?evaluateLater(scopeTarget,`${expression()} = __placeholder`):()=>{};let getValue=()=>{let result;return evaluateGet(value=>result=value),isGetterSetter(result)?result.get():result},setValue=value=>{let result;evaluateGet(value2=>result=value2),isGetterSetter(result)?result.set(value):evaluateSet(()=>{},{scope:{__placeholder:value}})};"string"==typeof expression&&"radio"===el.type&&mutateDom(()=>{el.hasAttribute("name")||el.setAttribute("name",expression)});let event="select"===el.tagName.toLowerCase()||["checkbox","radio"].includes(el.type)||modifiers.includes("lazy")?"change":"input",removeListener=isCloning?()=>{}:on(el,event,modifiers,e=>{setValue(getInputValue(el,modifiers,e,getValue()))});if(modifiers.includes("fill")&&([void 0,null,""].includes(getValue())||isCheckbox(el)&&Array.isArray(getValue())||"select"===el.tagName.toLowerCase()&&el.multiple)&&setValue(getInputValue(el,modifiers,{target:el},getValue())),el._x_removeModelListeners||(el._x_removeModelListeners={}),el._x_removeModelListeners.default=removeListener,cleanup2(()=>el._x_removeModelListeners.default()),el.form){let removeResetListener=on(el.form,"reset",[],e=>{nextTick(()=>el._x_model&&el._x_model.set(getInputValue(el,modifiers,{target:el},getValue())))});cleanup2(()=>removeResetListener())}el._x_model={get:()=>getValue(),set(value){setValue(value)}},el._x_forceModelUpdate=value=>{void 0===value&&"string"==typeof expression&&expression.match(/\./)&&(value=""),window.fromModel=!0,mutateDom(()=>bind(el,"value",value)),delete window.fromModel},effect3(()=>{let value=getValue();modifiers.includes("unintrusive")&&document.activeElement.isSameNode(el)||el._x_forceModelUpdate(value)})}),directive("cloak",el=>queueMicrotask(()=>mutateDom(()=>el.removeAttribute(prefix("cloak"))))),addInitSelector(()=>`[${prefix("init")}]`),directive("init",skipDuringClone((el,{expression:expression},{evaluate:evaluate2})=>"string"==typeof expression?!!expression.trim()&&evaluate2(expression,{},!1):evaluate2(expression,{},!1))),directive("text",(el,{expression:expression},{effect:effect3,evaluateLater:evaluateLater2})=>{let evaluate2=evaluateLater2(expression);effect3(()=>{evaluate2(value=>{mutateDom(()=>{el.textContent=value})})})}),directive("html",(el,{expression:expression},{effect:effect3,evaluateLater:evaluateLater2})=>{let evaluate2=evaluateLater2(expression);effect3(()=>{evaluate2(value=>{mutateDom(()=>{el.innerHTML=value,el._x_ignoreSelf=!0,initTree(el),delete el._x_ignoreSelf})})})}),mapAttributes(startingWith(":",prefix("bind:")));var handler2=(el,{value:value,modifiers:modifiers,expression:expression,original:original},{effect:effect3,cleanup:cleanup2})=>{if(!value){let bindingProviders={};
6return obj=bindingProviders,Object.entries(binds).forEach(([name,callback])=>{Object.defineProperty(obj,name,{get:()=>(...args)=>callback(...args)})}),void evaluateLater(el,expression)(bindings=>{applyBindingsObject(el,bindings,original)},{scope:bindingProviders})}var obj;if("key"===value)return function(el,expression){el._x_keyExpression=expression}(el,expression);if(el._x_inlineBindings&&el._x_inlineBindings[value]&&el._x_inlineBindings[value].extract)return;let evaluate2=evaluateLater(el,expression);effect3(()=>evaluate2(result=>{void 0===result&&"string"==typeof expression&&expression.match(/\./)&&(result=""),mutateDom(()=>bind(el,value,result,modifiers))})),cleanup2(()=>{el._x_undoAddedClasses&&el._x_undoAddedClasses(),el._x_undoAddedStyles&&el._x_undoAddedStyles()})};function getIterationScopeVariables(iteratorNames,item,index,items){let scopeVariables={};if(/^\[.*\]$/.test(iteratorNames.item)&&Array.isArray(item)){iteratorNames.item.replace("[","").replace("]","").split(",").map(i=>i.trim()).forEach((name,i)=>{scopeVariables[name]=item[i]})}else if(/^\{.*\}$/.test(iteratorNames.item)&&!Array.isArray(item)&&"object"==typeof item){iteratorNames.item.replace("{","").replace("}","").split(",").map(i=>i.trim()).forEach(name=>{scopeVariables[name]=item[name]})}else scopeVariables[iteratorNames.item]=item;return iteratorNames.index&&(scopeVariables[iteratorNames.index]=index),iteratorNames.collection&&(scopeVariables[iteratorNames.collection]=items),scopeVariables}function handler3(){}function warnMissingPluginDirective(name,directiveName,slug){directive(directiveName,el=>warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`,el))}handler2.inline=(el,{value:value,modifiers:modifiers,expression:expression})=>{value&&(el._x_inlineBindings||(el._x_inlineBindings={}),el._x_inlineBindings[value]={expression:expression,extract:!1})},directive("bind",handler2),addRootSelector(()=>`[${prefix("data")}]`),directive("data",(el,{expression:expression},{cleanup:cleanup2})=>{if(function(el){return!!isCloning&&(!!isCloningLegacy||el.hasAttribute("data-has-alpine-state"))}(el))return;expression=""===expression?"{}":expression;let magicContext={};injectMagics(magicContext,el);let dataProviderContext={};var obj,context;obj=dataProviderContext,context=magicContext,Object.entries(datas).forEach(([name,callback])=>{Object.defineProperty(obj,name,{get:()=>(...args)=>callback.bind(context)(...args),enumerable:!1})});let data2=evaluate(el,expression,{scope:dataProviderContext});void 0!==data2&&!0!==data2||(data2={}),injectMagics(data2,el);let reactiveData=reactive(data2);initInterceptors(reactiveData);let undo=addScopeToNode(el,reactiveData);reactiveData.init&&evaluate(el,reactiveData.init),cleanup2(()=>{reactiveData.destroy&&evaluate(el,reactiveData.destroy),undo()})}),interceptClone((from,to)=>{from._x_dataStack&&(to._x_dataStack=from._x_dataStack,to.setAttribute("data-has-alpine-state",!0))}),directive("show",(el,{modifiers:modifiers,expression:expression},{effect:effect3})=>{let evaluate2=evaluateLater(el,expression);el._x_doHide||(el._x_doHide=()=>{mutateDom(()=>{el.style.setProperty("display","none",modifiers.includes("important")?"important":void 0)})}),el._x_doShow||(el._x_doShow=()=>{mutateDom(()=>{1===el.style.length&&"none"===el.style.display?el.removeAttribute("style"):el.style.removeProperty("display")})});let oldValue,hide=()=>{el._x_doHide(),el._x_isShown=!1},show=()=>{el._x_doShow(),el._x_isShown=!0},clickAwayCompatibleShow=()=>setTimeout(show),toggle=once(value=>value?show():hide(),value=>{"function"==typeof el._x_toggleAndCascadeWithTransitions?el._x_toggleAndCascadeWithTransitions(el,value,show,hide):value?clickAwayCompatibleShow():hide()}),firstTime=!0;effect3(()=>evaluate2(value=>{(firstTime||value!==oldValue)&&(modifiers.includes("immediate")&&(value?clickAwayCompatibleShow():hide()),toggle(value),oldValue=value,firstTime=!1)}))}),directive("for",(el,{expression:expression},{effect:effect3,cleanup:cleanup2})=>{let iteratorNames=function(expression){let forIteratorRE=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,stripParensRE=/^\s*\(|\)\s*$/g,forAliasRE=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,inMatch=expression.match(forAliasRE);if(!inMatch)return;let res={};res.items=inMatch[2].trim();let item=inMatch[1].replace(stripParensRE,"").trim(),iteratorMatch=item.match(forIteratorRE);iteratorMatch?(res.item=item.replace(forIteratorRE,"").trim(),res.index=iteratorMatch[1].trim(),iteratorMatch[2]&&(res.collection=iteratorMatch[2].trim())):res.item=item;return res}(expression),evaluateItems=evaluateLater(el,iteratorNames.items),evaluateKey=evaluateLater(el,el._x_keyExpression||"index");el._x_prevKeys=[],el._x_lookup={},effect3(()=>function(el,iteratorNames,evaluateItems,evaluateKey){let isObject2=i=>"object"==typeof i&&!Array.isArray(i),templateEl=el;evaluateItems(items=>{var subject;subject=items,!Array.isArray(subject)&&!isNaN(subject)&&items>=0&&(items=Array.from(Array(items).keys(),i=>i+1)),void 0===items&&(items=[]);let lookup=el._x_lookup,prevKeys=el._x_prevKeys,scopes=[],keys=[];if(isObject2(items))items=Object.entries(items).map(([key,value])=>{let scope2=getIterationScopeVariables(iteratorNames,value,key,items);evaluateKey(value2=>{keys.includes(value2)&&warn("Duplicate key on x-for",el),keys.push(value2)},{scope:{index:key,...scope2}}),scopes.push(scope2)});else for(let i=0;i<items.length;i++){let scope2=getIterationScopeVariables(iteratorNames,items[i],i,items);evaluateKey(value=>{keys.includes(value)&&warn("Duplicate key on x-for",el),keys.push(value)},{scope:{index:i,...scope2}}),scopes.push(scope2)}let adds=[],moves=[],removes=[],sames=[];for(let i=0;i<prevKeys.length;i++){let key=prevKeys[i];-1===keys.indexOf(key)&&removes.push(key)}prevKeys=prevKeys.filter(key=>!removes.includes(key));let lastKey="template";for(let i=0;i<keys.length;i++){let key=keys[i],prevIndex=prevKeys.indexOf(key);if(-1===prevIndex)prevKeys.splice(i,0,key),adds.push([lastKey,i]);else if(prevIndex!==i){let keyInSpot=prevKeys.splice(i,1)[0],keyForSpot=prevKeys.splice(prevIndex-1,1)[0];prevKeys.splice(i,0,keyForSpot),prevKeys.splice(prevIndex,0,keyInSpot),moves.push([keyInSpot,keyForSpot])}else sames.push(key);lastKey=key}for(let i=0;i<removes.length;i++){let key=removes[i];
6key in lookup&&(mutateDom(()=>{destroyTree(lookup[key]),lookup[key].remove()}),delete lookup[key])}for(let i=0;i<moves.length;i++){let[keyInSpot,keyForSpot]=moves[i],elInSpot=lookup[keyInSpot],elForSpot=lookup[keyForSpot],marker=document.createElement("div");mutateDom(()=>{elForSpot||warn('x-for ":key" is undefined or invalid',templateEl,keyForSpot,lookup),elForSpot.after(marker),elInSpot.after(elForSpot),elForSpot._x_currentIfEl&&elForSpot.after(elForSpot._x_currentIfEl),marker.before(elInSpot),elInSpot._x_currentIfEl&&elInSpot.after(elInSpot._x_currentIfEl),marker.remove()}),elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)])}for(let i=0;i<adds.length;i++){let[lastKey2,index]=adds[i],lastEl="template"===lastKey2?templateEl:lookup[lastKey2];lastEl._x_currentIfEl&&(lastEl=lastEl._x_currentIfEl);let scope2=scopes[index],key=keys[index],clone2=document.importNode(templateEl.content,!0).firstElementChild,reactiveScope=reactive(scope2);addScopeToNode(clone2,reactiveScope,templateEl),clone2._x_refreshXForScope=newScope=>{Object.entries(newScope).forEach(([key2,value])=>{reactiveScope[key2]=value})},mutateDom(()=>{lastEl.after(clone2),skipDuringClone(()=>initTree(clone2))()}),"object"==typeof key&&warn("x-for key cannot be an object, it must be a string or an integer",templateEl),lookup[key]=clone2}for(let i=0;i<sames.length;i++)lookup[sames[i]]._x_refreshXForScope(scopes[keys.indexOf(sames[i])]);templateEl._x_prevKeys=keys})}(el,iteratorNames,evaluateItems,evaluateKey)),cleanup2(()=>{Object.values(el._x_lookup).forEach(el2=>mutateDom(()=>{destroyTree(el2),el2.remove()})),delete el._x_prevKeys,delete el._x_lookup})}),handler3.inline=(el,{expression:expression},{cleanup:cleanup2})=>{let root=closestRoot(el);root._x_refs||(root._x_refs={}),root._x_refs[expression]=el,cleanup2(()=>delete root._x_refs[expression])},directive("ref",handler3),directive("if",(el,{expression:expression},{effect:effect3,cleanup:cleanup2})=>{"template"!==el.tagName.toLowerCase()&&warn("x-if can only be used on a <template> tag",el);let evaluate2=evaluateLater(el,expression);effect3(()=>evaluate2(value=>{value?(()=>{if(el._x_currentIfEl)return el._x_currentIfEl;let clone2=el.content.cloneNode(!0).firstElementChild;addScopeToNode(clone2,{},el),mutateDom(()=>{el.after(clone2),skipDuringClone(()=>initTree(clone2))()}),el._x_currentIfEl=clone2,el._x_undoIf=()=>{mutateDom(()=>{destroyTree(clone2),clone2.remove()}),delete el._x_currentIfEl}})():el._x_undoIf&&(el._x_undoIf(),delete el._x_undoIf)})),cleanup2(()=>el._x_undoIf&&el._x_undoIf())}),directive("id",(el,{expression:expression},{evaluate:evaluate2})=>{evaluate2(expression).forEach(name=>function(el,name){el._x_ids||(el._x_ids={}),el._x_ids[name]||(el._x_ids[name]=findAndIncrementId(name))}(el,name))}),interceptClone((from,to)=>{from._x_ids&&(to._x_ids=from._x_ids)}),mapAttributes(startingWith("@",prefix("on:"))),directive("on",skipDuringClone((el,{value:value,modifiers:modifiers,expression:expression},{cleanup:cleanup2})=>{let evaluate2=expression?evaluateLater(el,expression):()=>{};"template"===el.tagName.toLowerCase()&&(el._x_forwardEvents||(el._x_forwardEvents=[]),el._x_forwardEvents.includes(value)||el._x_forwardEvents.push(value));let removeListener=on(el,value,modifiers,e=>{evaluate2(()=>{},{scope:{$event:e},params:[e]})});cleanup2(()=>removeListener())})),warnMissingPluginDirective("Collapse","collapse","collapse"),warnMissingPluginDirective("Intersect","intersect","intersect"),warnMissingPluginDirective("Focus","trap","focus"),warnMissingPluginDirective("Mask","mask","mask"),alpine_default.setEvaluator(normalEvaluator),alpine_default.setRawEvaluator(function(el,expression,extras={}){let overriddenMagics={};injectMagics(overriddenMagics,el);let dataStack=[overriddenMagics,...closestDataStack(el)],scope2=mergeProxies([extras.scope??{},...dataStack]),params=extras.params??[];if(expression.includes("await")){return new(0,Object.getPrototypeOf(async function(){}).constructor)(["scope"],`with (scope) { let __result = ${/^[\n\s]*if.*\(.*\)/.test(expression.trim())||/^(let|const)\s/.test(expression.trim())?`(async()=>{ ${expression} })()`:expression}; return __result }`).call(extras.context,scope2)}{let rightSideSafeExpression=/^[\n\s]*if.*\(.*\)/.test(expression.trim())||/^(let|const)\s/.test(expression.trim())?`(()=>{ ${expression} })()`:expression,result=new Function(["scope"],`with (scope) { let __result = ${rightSideSafeExpression}; return __result }`).call(extras.context,scope2);return"function"==typeof result&&shouldAutoEvaluateFunctions?result.apply(scope2,params):result}}),alpine_default.setReactivityEngine({reactive:reactive2,effect:function(fn,options=EMPTY_OBJ){(function(fn){return fn&&!0===fn._isEffect})(fn)&&(fn=fn.raw);const effect3=function(fn,options){const effect3=function(){if(!effect3.active)return fn();if(!effectStack.includes(effect3)){cleanup(effect3);try{return trackStack.push(shouldTrack),shouldTrack=!0,effectStack.push(effect3),activeEffect=effect3,fn()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return effect3.id=uid++,effect3.allowRecurse=!!options.allowRecurse,effect3._isEffect=!0,effect3.active=!0,effect3.raw=fn,effect3.deps=[],effect3.options=options,effect3}(fn,options);return options.lazy||effect3(),effect3},release:function(effect3){effect3.active&&(cleanup(effect3),effect3.options.onStop&&effect3.options.onStop(),effect3.active=!1)},raw:toRaw});var module_default$5=alpine_default,candidateSelectors=["input","select","textarea","a[href]","button","[tabindex]:not
6(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],candidateSelector=candidateSelectors.join(","),NoElement="undefined"==typeof Element,matches=NoElement?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,getRootNode=!NoElement&&Element.prototype.getRootNode?function(element){return element.getRootNode()}:function(element){return element.ownerDocument},getCandidates=function(el,includeContainer,filter){var candidates=Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));return includeContainer&&matches.call(el,candidateSelector)&&candidates.unshift(el),candidates=candidates.filter(filter)},getCandidatesIteratively=function getCandidatesIteratively2(elements,includeContainer,options){for(var candidates=[],elementsToCheck=Array.from(elements);elementsToCheck.length;){var element=elementsToCheck.shift();if("SLOT"===element.tagName){var assigned=element.assignedElements(),nestedCandidates=getCandidatesIteratively2(assigned.length?assigned:element.children,!0,options);options.flatten?candidates.push.apply(candidates,nestedCandidates):candidates.push({scope:element,candidates:nestedCandidates})}else{matches.call(element,candidateSelector)&&options.filter(element)&&(includeContainer||!elements.includes(element))&&candidates.push(element);var shadowRoot=element.shadowRoot||"function"==typeof options.getShadowRoot&&options.getShadowRoot(element),validShadowRoot=!options.shadowRootFilter||options.shadowRootFilter(element);if(shadowRoot&&validShadowRoot){var _nestedCandidates=getCandidatesIteratively2(!0===shadowRoot?element.children:shadowRoot.children,!0,options);options.flatten?candidates.push.apply(candidates,_nestedCandidates):candidates.push({scope:element,candidates:_nestedCandidates})}else elementsToCheck.unshift.apply(elementsToCheck,element.children)}}return candidates},getTabindex=function(node,isScope){return node.tabIndex<0&&(isScope||/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName)||node.isContentEditable)&&isNaN(parseInt(node.getAttribute("tabindex"),10))?0:node.tabIndex},sortOrderedTabbables=function(a,b){return a.tabIndex===b.tabIndex?a.documentOrder-b.documentOrder:a.tabIndex-b.tabIndex},isInput=function(node){return"INPUT"===node.tagName},isNonTabbableRadio=function(node){return function(node){return isInput(node)&&"radio"===node.type}(node)&&!function(node){if(!node.name)return!0;var radioSet,radioScope=node.form||getRootNode(node),queryRadios=function(name){return radioScope.querySelectorAll('input[type="radio"][name="'+name+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)radioSet=queryRadios(window.CSS.escape(node.name));else try{radioSet=queryRadios(node.name)}catch(err){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",err.message),!1}var checked=function(nodes,form){for(var i=0;i<nodes.length;i++)if(nodes[i].checked&&nodes[i].form===form)return nodes[i]}(radioSet,node.form);return!checked||checked===node}(node)},isZeroArea=function(node){var _node$getBoundingClie=node.getBoundingClientRect(),width=_node$getBoundingClie.width,height=_node$getBoundingClie.height;return 0===width&&0===height},isNodeMatchingSelectorFocusable=function(options,node){return!(node.disabled||function(node){return isInput(node)&&"hidden"===node.type}(node)||function(node,_ref){var displayCheck=_ref.displayCheck,getShadowRoot=_ref.getShadowRoot;if("hidden"===getComputedStyle(node).visibility)return!0;var nodeUnderDetails=matches.call(node,"details>summary:first-of-type")?node.parentElement:node;if(matches.call(nodeUnderDetails,"details:not([open]) *"))return!0;var nodeRootHost=getRootNode(node).host,nodeIsAttached=(null==nodeRootHost?void 0:nodeRootHost.ownerDocument.contains(nodeRootHost))||node.ownerDocument.contains(node);if(displayCheck&&"full"!==displayCheck){if("non-zero-area"===displayCheck)return isZeroArea(node)}else{if("function"==typeof getShadowRoot){for(var originalNode=node;node;){var parentElement=node.parentElement,rootNode=getRootNode(node);if(parentElement&&!parentElement.shadowRoot&&!0===getShadowRoot(parentElement))return isZeroArea(node);node=node.assignedSlot?node.assignedSlot:parentElement||rootNode===node.ownerDocument?parentElement:rootNode.host}node=originalNode}if(nodeIsAttached)return!node.getClientRects().length}return!1}(node,options)||function(node){return"DETAILS"===node.tagName&&Array.prototype.slice.apply(node.children).some(function(child){return"SUMMARY"===child.tagName})}
6(node)||function(node){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName))for(var parentNode=node.parentElement;parentNode;){if("FIELDSET"===parentNode.tagName&&parentNode.disabled){for(var i=0;i<parentNode.children.length;i++){var child=parentNode.children.item(i);if("LEGEND"===child.tagName)return!!matches.call(parentNode,"fieldset[disabled] *")||!child.contains(node)}return!0}parentNode=parentNode.parentElement}return!1}(node))},isNodeMatchingSelectorTabbable=function(options,node){return!(isNonTabbableRadio(node)||getTabindex(node)<0||!isNodeMatchingSelectorFocusable(options,node))},isValidShadowRootTabbable=function(shadowHostNode){var tabIndex=parseInt(shadowHostNode.getAttribute("tabindex"),10);return!!(isNaN(tabIndex)||tabIndex>=0)},sortByOrder=function sortByOrder2(candidates){var regularTabbables=[],orderedTabbables=[];return candidates.forEach(function(item,i){var isScope=!!item.scope,element=isScope?item.scope:item,candidateTabindex=getTabindex(element,isScope),elements=isScope?sortByOrder2(item.candidates):element;0===candidateTabindex?isScope?regularTabbables.push.apply(regularTabbables,elements):regularTabbables.push(element):orderedTabbables.push({documentOrder:i,tabIndex:candidateTabindex,item:item,isScope:isScope,content:elements})}),orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc,sortable){return sortable.isScope?acc.push.apply(acc,sortable.content):acc.push(sortable.content),acc},[]).concat(regularTabbables)},tabbable=function(el,options){var candidates;return candidates=(options=options||{}).getShadowRoot?getCandidatesIteratively([el],options.includeContainer,{filter:isNodeMatchingSelectorTabbable.bind(null,options),flatten:!1,getShadowRoot:options.getShadowRoot,shadowRootFilter:isValidShadowRootTabbable}):getCandidates(el,options.includeContainer,isNodeMatchingSelectorTabbable.bind(null,options)),sortByOrder(candidates)},focusable=function(el,options){return(options=options||{}).getShadowRoot?getCandidatesIteratively([el],options.includeContainer,{filter:isNodeMatchingSelectorFocusable.bind(null,options),flatten:!0,getShadowRoot:options.getShadowRoot}):getCandidates(el,options.includeContainer,isNodeMatchingSelectorFocusable.bind(null,options))},isTabbable=function(node,options){if(options=options||{},!node)throw new Error("No node provided");return!1!==matches.call(node,candidateSelector)&&isNodeMatchingSelectorTabbable(options,node)},focusableCandidateSelector=candidateSelectors.concat("iframe").join(","),isFocusable=function(node,options){if(options=options||{},!node)throw new Error("No node provided");return!1!==matches.call(node,focusableCandidateSelector)&&isNodeMatchingSelectorFocusable(options,node)};function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var trapQueue,activeFocusTraps=(trapQueue=[],{activateTrap:function(trap){if(trapQueue.length>0){var activeTrap=trapQueue[trapQueue.length-1];activeTrap!==trap&&activeTrap.pause()}var trapIndex=trapQueue.indexOf(trap);-1===trapIndex||trapQueue.splice(trapIndex,1),trapQueue.push(trap)},deactivateTrap:function(trap){var trapIndex=trapQueue.indexOf(trap);-1!==trapIndex&&trapQueue.splice(trapIndex,1),trapQueue.length>0&&trapQueue[trapQueue.length-1].unpause()}}),delay=function(fn){return setTimeout(fn,0)},findIndex=function(arr,fn){var idx=-1;return arr.every(function(value,i){return!fn(value)||(idx=i,!1)}),idx},valueOrHandler=function(value){for(var _len=arguments.length,params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];return"function"==typeof value?value.apply(void 0,params):value},getActualTarget=function(event){return event.target.shadowRoot&&"function"==typeof event.composedPath?event.composedPath()[0]:event.target},createFocusTrap=function(elements,userOptions){var trap,doc=(null==userOptions?void 0:userOptions.document)||document,config=_objectSpread2
6({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},userOptions),state={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},getOption=function(configOverrideOptions,optionName,configOptionName){return configOverrideOptions&&void 0!==configOverrideOptions[optionName]?configOverrideOptions[optionName]:config[configOptionName||optionName]},findContainerIndex=function(element){return state.containerGroups.findIndex(function(_ref){var container=_ref.container,tabbableNodes=_ref.tabbableNodes;return container.contains(element)||tabbableNodes.find(function(node){return node===element})})},getNodeForOption=function(optionName){var optionValue=config[optionName];if("function"==typeof optionValue){for(var _len2=arguments.length,params=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)params[_key2-1]=arguments[_key2];optionValue=optionValue.apply(void 0,params)}if(!0===optionValue&&(optionValue=void 0),!optionValue){if(void 0===optionValue||!1===optionValue)return optionValue;throw new Error("`".concat(optionName,"` was specified but was not a node, or did not return a node"))}var node=optionValue;if("string"==typeof optionValue&&!(node=doc.querySelector(optionValue)))throw new Error("`".concat(optionName,"` as selector refers to no known node"));return node},getInitialFocusNode=function(){var node=getNodeForOption("initialFocus");if(!1===node)return!1;if(void 0===node)if(findContainerIndex(doc.activeElement)>=0)node=doc.activeElement;else{var firstTabbableGroup=state.tabbableGroups[0];node=firstTabbableGroup&&firstTabbableGroup.firstTabbableNode||getNodeForOption("fallbackFocus")}if(!node)throw new Error("Your focus-trap needs to have at least one focusable element");return node},updateTabbableNodes=function(){if(state.containerGroups=state.containers.map(function(container){var tabbableNodes=tabbable(container,config.tabbableOptions),focusableNodes=focusable(container,config.tabbableOptions);return{container:container,tabbableNodes:tabbableNodes,focusableNodes:focusableNodes,firstTabbableNode:tabbableNodes.length>0?tabbableNodes[0]:null,lastTabbableNode:tabbableNodes.length>0?tabbableNodes[tabbableNodes.length-1]:null,nextTabbableNode:function(node){var forward=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],nodeIdx=focusableNodes.findIndex(function(n){return n===node});if(!(nodeIdx<0))return forward?focusableNodes.slice(nodeIdx+1).find(function(n){return isTabbable(n,config.tabbableOptions)}):focusableNodes.slice(0,nodeIdx).reverse().find(function(n){return isTabbable(n,config.tabbableOptions)})}}}),state.tabbableGroups=state.containerGroups.filter(function(group){return group.tabbableNodes.length>0}),state.tabbableGroups.length<=0&&!getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},tryFocus=function tryFocus2(node){!1!==node&&node!==doc.activeElement&&(node&&node.focus?(node.focus({preventScroll:!!config.preventScroll}),state.mostRecentlyFocusedNode=node,function(node){return node.tagName&&"input"===node.tagName.toLowerCase()&&"function"==typeof node.select}(node)&&node.select()):tryFocus2(getInitialFocusNode()))},getReturnFocusNode=function(previousActiveElement){var node=getNodeForOption("setReturnFocus",previousActiveElement);return node||!1!==node&&previousActiveElement},checkPointerDown=function(e){var target=getActualTarget(e);findContainerIndex(target)>=0||(valueOrHandler(config.clickOutsideDeactivates,e)?trap.deactivate({returnFocus:config.returnFocusOnDeactivate&&!isFocusable(target,config.tabbableOptions)}):valueOrHandler(config.allowOutsideClick,e)||e.preventDefault())},checkFocusIn=function(e){var target=getActualTarget(e),targetContained=findContainerIndex(target)>=0;targetContained||target instanceof Document?targetContained&&(state.mostRecentlyFocusedNode=target):(e.stopImmediatePropagation(),tryFocus(state.mostRecentlyFocusedNode||getInitialFocusNode()))},checkKey=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.ke
6yCode}(e)&&!1!==valueOrHandler(config.escapeDeactivates,e))return e.preventDefault(),void trap.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var target=getActualTarget(e);updateTabbableNodes();var destinationNode=null;if(state.tabbableGroups.length>0){var containerIndex=findContainerIndex(target),containerGroup=containerIndex>=0?state.containerGroups[containerIndex]:void 0;if(containerIndex<0)destinationNode=e.shiftKey?state.tabbableGroups[state.tabbableGroups.length-1].lastTabbableNode:state.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var startOfGroupIndex=findIndex(state.tabbableGroups,function(_ref2){var firstTabbableNode=_ref2.firstTabbableNode;return target===firstTabbableNode});if(startOfGroupIndex<0&&(containerGroup.container===target||isFocusable(target,config.tabbableOptions)&&!isTabbable(target,config.tabbableOptions)&&!containerGroup.nextTabbableNode(target,!1))&&(startOfGroupIndex=containerIndex),startOfGroupIndex>=0){var destinationGroupIndex=0===startOfGroupIndex?state.tabbableGroups.length-1:startOfGroupIndex-1;destinationNode=state.tabbableGroups[destinationGroupIndex].lastTabbableNode}}else{var lastOfGroupIndex=findIndex(state.tabbableGroups,function(_ref3){var lastTabbableNode=_ref3.lastTabbableNode;return target===lastTabbableNode});if(lastOfGroupIndex<0&&(containerGroup.container===target||isFocusable(target,config.tabbableOptions)&&!isTabbable(target,config.tabbableOptions)&&!containerGroup.nextTabbableNode(target))&&(lastOfGroupIndex=containerIndex),lastOfGroupIndex>=0){var _destinationGroupIndex=lastOfGroupIndex===state.tabbableGroups.length-1?0:lastOfGroupIndex+1;destinationNode=state.tabbableGroups[_destinationGroupIndex].firstTabbableNode}}}else destinationNode=getNodeForOption("fallbackFocus");destinationNode&&(e.preventDefault(),tryFocus(destinationNode))}(e)},checkClick=function(e){var target=getActualTarget(e);findContainerIndex(target)>=0||valueOrHandler(config.clickOutsideDeactivates,e)||valueOrHandler(config.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},addListeners=function(){if(state.active)return activeFocusTraps.activateTrap(trap),state.delayInitialFocusTimer=config.delayInitialFocus?delay(function(){tryFocus(getInitialFocusNode())}):tryFocus(getInitialFocusNode()),doc.addEventListener("focusin",checkFocusIn,!0),doc.addEventListener("mousedown",checkPointerDown,{capture:!0,passive:!1}),doc.addEventListener("touchstart",checkPointerDown,{capture:!0,passive:!1}),doc.addEventListener("click",checkClick,{capture:!0,passive:!1}),doc.addEventListener("keydown",checkKey,{capture:!0,passive:!1}),trap},removeListeners=function(){if(state.active)return doc.removeEventListener("focusin",checkFocusIn,!0),doc.removeEventListener("mousedown",checkPointerDown,!0),doc.removeEventListener("touchstart",checkPointerDown,!0),doc.removeEventListener("click",checkClick,!0),doc.removeEventListener("keydown",checkKey,!0),trap};return(trap={get active(){return state.active},get paused(){return state.paused},activate:function(activateOptions){if(state.active)return this;var onActivate=getOption(activateOptions,"onActivate"),onPostActivate=getOption(activateOptions,"onPostActivate"),checkCanFocusTrap=getOption(activateOptions,"checkCanFocusTrap");checkCanFocusTrap||updateTabbableNodes(),state.active=!0,state.paused=!1,state.nodeFocusedBeforeActivation=doc.activeElement,onActivate&&onActivate();var finishActivation=function(){checkCanFocusTrap&&updateTabbableNodes(),addListeners(),onPostActivate&&onPostActivate()};return checkCanFocusTrap?(checkCanFocusTrap(state.containers.concat()).then(finishActivation,finishActivation),this):(finishActivation(),this)},deactivate:function(deactivateOptions){if(!state.active)return this;var options=_objectSpread2({onDeactivate:config.onDeactivate,onPostDeactivate:config.onPostDeactivate,checkCanReturnFocus:config.checkCanReturnFocus},deactivateOptions);clearTimeout(state.delayInitialFocusTimer),state.delayInitialFocusTimer=void 0,removeListeners(),state.active=!1,state.paused=!1,activeFocusTraps.deactivateTrap(trap);var onDeactivate=getOption(options,"onDeactivate"),onPostDeactivate=getOption(options,"onPostDeactivate"),checkCanReturnFocus=getOption(options,"checkCanReturnFocus"),returnFocus=getOption(options,"returnFocus","returnFocusOnDeactivate");onDeactivate&&onDeactivate();var finishDeactivation=function(){delay(function(){returnFocus&&tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)),onPostDeactivate&&onPostDeactivate()})};return returnFocus&&checkCanReturnFocus?(checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation,finishDeactivation),this):(finishDeactivation(),this)},pause:function(){return state.paused||!state.active||(state.paused=!0,removeListeners()),this},unpause:function(){return state.paused&&state.active?(state.paused=!1,updateTabbableNodes(),addListeners(),this):this},updateContainerElements:function(containerElements){var elementsAsArray=[].concat(containerElements).filter(
6Boolean);return state.containers=elementsAsArray.map(function(element){return"string"==typeof element?doc.querySelector(element):element}),state.active&&updateTabbableNodes(),this}}).updateContainerElements(elements),trap};function setInert(el){let undos=[];return crawlSiblingsUp(el,sibling=>{let cache=sibling.hasAttribute("aria-hidden");sibling.setAttribute("aria-hidden","true"),undos.push(()=>cache||sibling.removeAttribute("aria-hidden"))}),()=>{for(;undos.length;)undos.pop()()}}function crawlSiblingsUp(el,callback){!el.isSameNode(document.body)&&el.parentNode&&Array.from(el.parentNode.children).forEach(sibling=>{sibling.isSameNode(el)?crawlSiblingsUp(el.parentNode,callback):callback(sibling)})}var module_default$4=function(Alpine){let lastFocused,currentFocused;window.addEventListener("focusin",()=>{lastFocused=currentFocused,currentFocused=document.activeElement}),Alpine.magic("focus",el=>{let within=el;return{__noscroll:!1,__wrapAround:!1,within(el2){return within=el2,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable:el2=>isFocusable(el2),previouslyFocused:()=>lastFocused,lastFocused:()=>lastFocused,focused:()=>currentFocused,focusables:()=>Array.isArray(within)?within:focusable(within,{displayCheck:"none"}),all(){return this.focusables()},isFirst(el2){let els=this.all();return els[0]&&els[0].isSameNode(el2)},isLast(el2){let els=this.all();return els.length&&els.slice(-1)[0].isSameNode(el2)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let list=this.all(),current=document.activeElement;if(-1!==list.indexOf(current))return this.__wrapAround&&list.indexOf(current)===list.length-1?list[0]:list[list.indexOf(current)+1]},getPrevious(){let list=this.all(),current=document.activeElement;if(-1!==list.indexOf(current))return this.__wrapAround&&0===list.indexOf(current)?list.slice(-1)[0]:list[list.indexOf(current)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(el2){el2&&setTimeout(()=>{el2.hasAttribute("tabindex")||el2.setAttribute("tabindex","0"),el2.focus({preventScroll:this.__noscroll})})}}}),Alpine.directive("trap",Alpine.skipDuringClone((el,{expression:expression,modifiers:modifiers},{effect:effect,evaluateLater:evaluateLater,cleanup:cleanup})=>{let evaluator=evaluateLater(expression),oldValue=!1,options={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>el},undoInert=()=>{};if(modifiers.includes("noautofocus"))options.initialFocus=!1;else{let autofocusEl=el.querySelector("[autofocus]");autofocusEl&&(options.initialFocus=autofocusEl)}modifiers.includes("inert")&&(options.onPostActivate=()=>{Alpine.nextTick(()=>{undoInert=setInert(el)})});let trap=createFocusTrap(el,options),undoDisableScrolling=()=>{};const releaseFocus=()=>{undoInert(),undoInert=()=>{},undoDisableScrolling(),undoDisableScrolling=()=>{},trap.deactivate({returnFocus:!modifiers.includes("noreturn")})};effect(()=>evaluator(value=>{oldValue!==value&&(value&&!oldValue&&(modifiers.includes("noscroll")&&(undoDisableScrolling=function(){let overflow=document.documentElement.style.overflow,paddingRight=document.documentElement.style.paddingRight,scrollbarWidth=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${scrollbarWidth}px`,()=>{document.documentElement.style.overflow=overflow,document.documentElement.style.paddingRight=paddingRight}}()),setTimeout(()=>{trap.activate()},15)),!value&&oldValue&&releaseFocus(),oldValue=!!value)})),cleanup(releaseFocus)},(el,{expression:expression,modifiers:modifiers},{evaluate:evaluate})=>{modifiers.includes("inert")&&evaluate(expression)&&setInert(el)}))};
7/*! Bundled license information:
8
9  tabbable/dist/index.esm.js:
10    (*!
11    * tabbable 5.3.3
12    * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
13    *)
14
15  focus-trap/dist/focus-trap.esm.js:
16    (*!
17    * focus-trap 6.9.4
18    * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
19    *)
20  */function getThreshold(modifiers){if(modifiers.includes("full"))return.99;if(modifiers.includes("half"))return.5;if(!modifiers.includes("threshold"))return 0;let threshold=modifiers[modifiers.indexOf("threshold")+1];return"100"===threshold?1:"0"===threshold?0:Number(`.${threshold}`)}function getLengthValue(rawValue){let match=rawValue.match(/^(-?[0-9]+)(px|%)?$/);return match?match[1]+(match[2]||"px"):void 0}function getRootMargin(modifiers){const index=modifiers.indexOf("margin");if(-1===index)return"0px 0px 0px 0px";let values=[];for(let i=1;i<5;i++)values.push(getLengthValue(modifiers[index+i]||""));return values=values.filter(v=>void 0!==v),values.length?values.join(" ").trim():"0px 0px 0px 0px"}var module_default$3=function(Alpine){Alpine.directive("intersect",Alpine.skipDuringClone((el,{value:value,expression:expression,modifiers:modifiers},{evaluateLater:evaluateLater,cleanup:cleanup})=>{let evaluate=evaluateLater(expression),options={rootMargin:getRootMargin(modifiers),threshold:getThreshold(modifiers)},observer=new IntersectionObserver(entries=>
20{entries.forEach(entry=>{entry.isIntersecting!==("leave"===value)&&(evaluate(),modifiers.includes("once")&&observer.disconnect())})},options);observer.observe(el),cleanup(()=>{observer.disconnect()})}))};function modifierValue(modifiers,key,fallback){if(-1===modifiers.indexOf(key))return fallback;const rawValue=modifiers[modifiers.indexOf(key)+1];if(!rawValue)return fallback;if("duration"===key){let match=rawValue.match(/([0-9]+)ms/);if(match)return match[1]}if("min"===key){let match=rawValue.match(/([0-9]+)px/);if(match)return match[1]}return rawValue}var module_default$2=function(Alpine){function collapse(el,{modifiers:modifiers}){let duration=modifierValue(modifiers,"duration",250)/1e3,floor=modifierValue(modifiers,"min",0),fullyHide=!modifiers.includes("min");el._x_isShown||(el.style.height=`${floor}px`),!el._x_isShown&&fullyHide&&(el.hidden=!0),el._x_isShown||(el.style.overflow="hidden");let setFunction=(el2,styles)=>{let revertFunction=Alpine.setStyles(el2,styles);return styles.height?()=>{}:revertFunction},transitionStyles={transitionProperty:"height",transitionDuration:`${duration}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};el._x_transition={in(before=()=>{},after=()=>{}){fullyHide&&(el.hidden=!1),fullyHide&&(el.style.display=null);let current=el.getBoundingClientRect().height;el.style.height="auto";let full=el.getBoundingClientRect().height;current===full&&(current=floor),Alpine.transition(el,Alpine.setStyles,{during:transitionStyles,start:{height:current+"px"},end:{height:full+"px"}},()=>el._x_isShown=!0,()=>{Math.abs(el.getBoundingClientRect().height-full)<1&&(el.style.overflow=null)})},out(before=()=>{},after=()=>{}){let full=el.getBoundingClientRect().height;Alpine.transition(el,setFunction,{during:transitionStyles,start:{height:full+"px"},end:{height:floor+"px"}},()=>el.style.overflow="hidden",()=>{el._x_isShown=!1,el.style.height==`${floor}px`&&fullyHide&&(el.style.display="none",el.hidden=!0)})}}}Alpine.directive("collapse",collapse),collapse.inline=(el,{modifiers:modifiers})=>{modifiers.includes("min")&&(el._x_doShow=()=>{},el._x_doHide=()=>{})}};var module_default$1=function(Alpine){const data=Alpine.reactive({screensize:window.innerWidth}),breakpoints=window.AlpineMagicHelpersConfig&&window.AlpineMagicHelpersConfig.breakpoints?window.AlpineMagicHelpersConfig.breakpoints:{xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};let update;window.addEventListener("resize",()=>{clearTimeout(update),update=setTimeout(()=>{data.screensize=window.innerWidth},150)}),Alpine.magic("screen",el=>breakpoint=>{const width=data.screensize;if(Number.isInteger(breakpoint))return breakpoint<=width;if(void 0===breakpoints[breakpoint])throw Error("Undefined $screen property: "+breakpoint+". Supported properties: "+Object.keys(breakpoints).join(", "));return breakpoints[breakpoint]<=width})},__create=Object.create,__defProp=Object.defineProperty,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__commonJS=(callback,module)=>()=>(module||callback((module={exports:{}}).exports,module),module.exports),__toModule=module=>{return((target,module,desc)=>{if(module&&"object"==typeof module||"function"==typeof module)for(let key of __getOwnPropNames(module))__hasOwnProp.call(target,key)||"default"===key||__defProp(target,key,{get:()=>module[key],enumerable:!(desc=__getOwnPropDesc(module,key))||desc.enumerable});return target})((target=__defProp(null!=module?__create(__getProtoOf(module)):{},"default",module&&module.__esModule&&"default"in module?{get:()=>module.default,enumerable:!0}:{value:module,enumerable:!0}),__defProp(target,"__esModule",{value:!0})),module);var target},require_popper=__commonJS(exports$1=>{function getBoundingClientRect(element){var rect=element.getBoundingClientRect();return{width:rect.width,height:rect.height,top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left,x:rect.left,y:rect.top}}function getWindow(node){if(null==node)return window;if("[object Window]"!==node.toString()){var ownerDocument=node.ownerDocument;return ownerDocument&&ownerDocument.defaultView||window}return node}function getWindowScroll(node){var win=getWindow(node);return{scrollLeft:win.pageXOffset,scrollTop:win.pageYOffset}}function isElement(node){return node instanceof getWindow(node).Element||node instanceof Element}function isHTMLElement(node){return node instanceof getWindow(node).HTMLElement||node instanceof HTMLElement}function isShadowRoot(node){return"undefined"!=typeof ShadowRoot&&(node instanceof getWindow(node).ShadowRoot||node instanceof ShadowRoot)}function getNodeName(element){return element?(element.nodeName||"").toLowerCase():null}function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement}function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function isScrollParent(element){var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX)}
20function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){void 0===isFixed&&(isFixed=!1);var node,element,documentElement=getDocumentElement(offsetParent),rect=getBoundingClientRect(elementOrVirtualElement),isOffsetParentAnElement=isHTMLElement(offsetParent),scroll={scrollLeft:0,scrollTop:0},offsets={x:0,y:0};return(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)&&(("body"!==getNodeName(offsetParent)||isScrollParent(documentElement))&&(scroll=(node=offsetParent)!==getWindow(node)&&isHTMLElement(node)?{scrollLeft:(element=node).scrollLeft,scrollTop:element.scrollTop}:getWindowScroll(node)),isHTMLElement(offsetParent)?((offsets=getBoundingClientRect(offsetParent)).x+=offsetParent.clientLeft,offsets.y+=offsetParent.clientTop):documentElement&&(offsets.x=getWindowScrollBarX(documentElement))),{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height}}function getLayoutRect(element){var clientRect=getBoundingClientRect(element),width=element.offsetWidth,height=element.offsetHeight;return Math.abs(clientRect.width-width)<=1&&(width=clientRect.width),Math.abs(clientRect.height-height)<=1&&(height=clientRect.height),{x:element.offsetLeft,y:element.offsetTop,width:width,height:height}}function getParentNode(element){return"html"===getNodeName(element)?element:element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element)}function getScrollParent(node){return["html","body","#document"].indexOf(getNodeName(node))>=0?node.ownerDocument.body:isHTMLElement(node)&&isScrollParent(node)?node:getScrollParent(getParentNode(node))}function listScrollParents(element,list){var _element$ownerDocumen;void 0===list&&(list=[]);var scrollParent=getScrollParent(element),isBody=scrollParent===(null==(_element$ownerDocumen=element.ownerDocument)?void 0:_element$ownerDocumen.body),win=getWindow(scrollParent),target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent,updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode(target)))}function isTableElement(element){return["table","td","th"].indexOf(getNodeName(element))>=0}function getTrueOffsetParent(element){return isHTMLElement(element)&&"fixed"!==getComputedStyle(element).position?element.offsetParent:null}function getOffsetParent(element){for(var window2=getWindow(element),offsetParent=getTrueOffsetParent(element);offsetParent&&isTableElement(offsetParent)&&"static"===getComputedStyle(offsetParent).position;)offsetParent=getTrueOffsetParent(offsetParent);return offsetParent&&("html"===getNodeName(offsetParent)||"body"===getNodeName(offsetParent)&&"static"===getComputedStyle(offsetParent).position)?window2:offsetParent||function(element){var isFirefox=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&isHTMLElement(element)&&"fixed"===getComputedStyle(element).position)return null;for(var currentNode=getParentNode(element);isHTMLElement(currentNode)&&["html","body"].indexOf(getNodeName(currentNode))<0;){var css=getComputedStyle(currentNode);if("none"!==css.transform||"none"!==css.perspective||"paint"===css.contain||-1!==["transform","perspective"].indexOf(css.willChange)||isFirefox&&"filter"===css.willChange||isFirefox&&css.filter&&"none"!==css.filter)return currentNode;currentNode=currentNode.parentNode}return null}(element)||window2}Object.defineProperty(exports$1,"__esModule",{value:!0});var top="top",bottom="bottom",right="right",left="left",basePlacements=[top,bottom,right,left],variationPlacements=basePlacements.reduce(function(acc,placement){return acc.concat([placement+"-start",placement+"-end"])},[]),placements=[].concat(basePlacements,["auto"]).reduce(function(acc,placement){return acc.concat([placement,placement+"-start",placement+"-end"])},[]),modifierPhases=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function order(modifiers){var map=new Map,visited=new Set,result=[];
20function sort(modifier){visited.add(modifier.name),[].concat(modifier.requires||[],modifier.requiresIfExists||[]).forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);depModifier&&sort(depModifier)}}),result.push(modifier)}return modifiers.forEach(function(modifier){map.set(modifier.name,modifier)}),modifiers.forEach(function(modifier){visited.has(modifier.name)||sort(modifier)}),result}function format(str){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return[].concat(args).reduce(function(p,c){return p.replace(/%s/,c)},str)}var INVALID_MODIFIER_ERROR='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',VALID_PROPERTIES=["name","enabled","phase","fn","effect","requires","options"];function getBasePlacement(placement){return placement.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function contains(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child))return!0;if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent.isSameNode(next))return!0;next=next.parentNode||next.host}while(next)}return!1}function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height})}function getClientRectFromMixedType(element,clippingParent){return"viewport"===clippingParent?rectToClientRect(function(element){var win=getWindow(element),html=getDocumentElement(element),visualViewport=win.visualViewport,width=html.clientWidth,height=html.clientHeight,x=0,y=0;return visualViewport&&(width=visualViewport.width,height=visualViewport.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(x=visualViewport.offsetLeft,y=visualViewport.offsetTop)),{width:width,height:height,x:x+getWindowScrollBarX(element),y:y}}(element)):isHTMLElement(clippingParent)?function(element){var rect=getBoundingClientRect(element);return rect.top=rect.top+element.clientTop,rect.left=rect.left+element.clientLeft,rect.bottom=rect.top+element.clientHeight,rect.right=rect.left+element.clientWidth,rect.width=element.clientWidth,rect.height=element.clientHeight,rect.x=rect.left,rect.y=rect.top,rect}(clippingParent):rectToClientRect(function(element){var _element$ownerDocumen,html=getDocumentElement(element),winScroll=getWindowScroll(element),body=null==(_element$ownerDocumen=element.ownerDocument)?void 0:_element$ownerDocumen.body,width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0),height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0),x=-winScroll.scrollLeft+getWindowScrollBarX(element),y=-winScroll.scrollTop;return"rtl"===getComputedStyle(body||html).direction&&(x+=max(html.clientWidth,body?body.clientWidth:0)-width),{width:width,height:height,x:x,y:y}}(getDocumentElement(element)))}function getClippingRect(element,boundary,rootBoundary){var mainClippingParents="clippingParents"===boundary?function(element){var clippingParents2=listScrollParents(getParentNode(element)),clipperElement=["absolute","fixed"].indexOf(getComputedStyle(element).position)>=0&&isHTMLElement(element)?getOffsetParent(element):element;return isElement(clipperElement)?clippingParents2.filter(function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&"body"!==getNodeName(clippingParent)}):[]}(element):[].concat(boundary),clippingParents2=[].concat(mainClippingParents,[rootBoundary]),firstClippingParent=clippingParents2[0],clippingRect=clippingParents2.reduce(function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent);return accRect.top=max(rect.top,accRect.top),accRect.right=min(rect.right,accRect.right),accRect.bottom=min(rect.bottom,accRect.bottom),accRect.left=max(rect.left,accRect.left),accRect},getClientRectFromMixedType(element,firstClippingParent));return clippingRect.width=clippingRect.right-clippingRect.left,clippingRect.height=clippingRect.bottom-clippingRect.top,clippingRect.x=clippingRect.left,clippingRect.y=clippingRect.top,clippingRect}function getVariation(placement){return placement.split("-")[1]}function getMainAxisFromPlacement(placement){return["top","bottom"].indexOf(placement)>=0?"x":"y"}function computeOffsets(_ref){var offsets,reference2=_ref.reference,element=_ref.element,placement=_ref.placement,basePlacement=placement?getBasePlacement(placement):null,variation=placement?getVariation(placement):null,commonX=reference2.x+reference2.width/2-element.width/2,commonY=reference2.y+reference2.height/2-element.height/2;switch(basePlacement){case top:offsets={x:commonX,y:reference2.y-element.height};break;case bottom:offsets={x:commonX,y:reference2.y+reference2.height};break;case right:offsets={x:reference2.x+reference2.width,y:commonY};break;case left:offsets={x:reference2.x-element.width,y:commonY};break;default:offsets={x:reference2.x,y:reference2.y}}var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(null!=mainAxis){var len="y"===mainAxis?"height":"width";switch(variation){case"start":offsets[mainAxis]=offsets[mainAxis]-(reference2[len]/2-element[len]/2);break;case"end":offsets[mainAxis]=offsets[mainAxis]+(reference2[len]/2-element[len]/2)}}return offsets}
vendor: 4,640 bytes, line 20
20function mergePaddingObject(paddingObject){return Object.assign({},{top:0,right:0,bottom:0,left:0},paddingObject)}function expandToHashMap(value,keys){return keys.reduce(function(hashMap,key){return hashMap[key]=value,hashMap},{})}function detectOverflow(state,options){void 0===options&&(options={});var _options=options,_options$placement=_options.placement,placement=void 0===_options$placement?state.placement:_options$placement,_options$boundary=_options.boundary,boundary=void 0===_options$boundary?"clippingParents":_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=void 0===_options$rootBoundary?"viewport":_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=void 0===_options$elementConte?"popper":_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=void 0!==_options$altBoundary&&_options$altBoundary,_options$padding=_options.padding,padding=void 0===_options$padding?0:_options$padding,paddingObject=mergePaddingObject("number"!=typeof padding?padding:expandToHashMap(padding,basePlacements)),altContext="popper"===elementContext?"reference":"popper",referenceElement=state.elements.reference,popperRect=state.rects.popper,element=state.elements[altBoundary?altContext:elementContext],clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary),referenceClientRect=getBoundingClientRect(referenceElement),popperOffsets2=computeOffsets({reference:referenceClientRect,element:popperRect,placement:placement}),popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets2)),elementClientRect="popper"===elementContext?popperClientRect:referenceClientRect,overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right},offsetData=state.modifiersData.offset;if("popper"===elementContext&&offsetData){var offset2=offsetData[placement];Object.keys(overflowOffsets).forEach(function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1,axis=[top,bottom].indexOf(key)>=0?"y":"x";overflowOffsets[key]+=offset2[axis]*multiply})}return overflowOffsets}var INVALID_ELEMENT_ERROR="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return!args.some(function(element){return!(element&&"function"==typeof element.getBoundingClientRect)})}function popperGenerator(generatorOptions){void 0===generatorOptions&&(generatorOptions={});var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers2=void 0===_generatorOptions$def?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=void 0===_generatorOptions$def2?DEFAULT_OPTIONS:_generatorOptions$def2;return function(reference2,popper2,options){void 0===options&&(options=defaultOptions);var fn,pending,state={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference2,popper:popper2},attributes:{},styles:{}},effectCleanupFns=[],isDestroyed=!1,instance={state:state,setOptions:function(options2){cleanupModifierEffects(),state.options=Object.assign({},defaultOptions,state.options,options2),state.scrollParents={reference:isElement(reference2)?listScrollParents(reference2):reference2.contextElement?listScrollParents(reference2.contextElement):[],popper:listScrollParents(popper2)};var orderedModifiers=function(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce(function(acc,phase){return acc.concat(orderedModifiers.filter(function(modifier){return modifier.phase===phase}))},[])}(function(modifiers){var merged=modifiers.reduce(function(merged2,current){var existing=merged2[current.name];return merged2[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current,merged2},{});return Object.keys(merged).map(function(key){return merged[key]})}([].concat(defaultModifiers2,state.options.modifiers)));(state.orderedModifiers=orderedModifiers.filter(function(m){return m.enabled}
20),function(modifiers){modifiers.forEach(function(modifier){Object.keys(modifier).forEach(function(key){switch(key){case"name":"string"!=typeof modifier.name&&console.error(format(INVALID_MODIFIER_ERROR,String(modifier.name),'"name"','"string"','"'+String(modifier.name)+'"'));break;case"enabled":"boolean"!=typeof modifier.enabled&&console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"enabled"','"boolean"','"'+String(modifier.enabled)+'"'));case"phase":modifierPhases.indexOf(modifier.phase)<0&&console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"phase"',"either "+modifierPhases.join(", "),'"'+String(modifier.phase)+'"'));break;case"fn":"function"!=typeof modifier.fn&&console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"fn"','"function"','"'+String(modifier.fn)+'"'));break;case"effect":"function"!=typeof modifier.effect&&console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"effect"','"function"','"'+String(modifier.fn)+'"'));break;case"requires":Array.isArray(modifier.requires)||console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requires"','"array"','"'+String(modifier.requires)+'"'));break;case"requiresIfExists":Array.isArray(modifier.requiresIfExists)||console.error(format(INVALID_MODIFIER_ERROR,modifier.name,'"requiresIfExists"','"array"','"'+String(modifier.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+modifier.name+'" modifier, valid properties are '+VALID_PROPERTIES.map(function(s){return'"'+s+'"'}).join(", ")+'; but "'+key+'" was provided.')}modifier.requires&&modifier.requires.forEach(function(requirement){null==modifiers.find(function(mod){return mod.name===requirement})&&console.error(format('Popper: modifier "%s" requires "%s", but "%s" modifier is not available',String(modifier.name),requirement,requirement))})})})}((arr=[].concat(orderedModifiers,state.options.modifiers),fn=function(_ref){return _ref.name},identifiers=new Set,arr.filter(function(item){var identifier=fn(item);if(!identifiers.has(identifier))return identifiers.add(identifier),!0}))),"auto"===getBasePlacement(state.options.placement))&&(state.orderedModifiers.find(function(_ref2){return"flip"===_ref2.name})||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" ")));var arr,fn,identifiers,_getComputedStyle=getComputedStyle(popper2);return[_getComputedStyle.marginTop,_getComputedStyle.marginRight,_getComputedStyle.marginBottom,_getComputedStyle.marginLeft].some(function(margin){return parseFloat(margin)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" ")),state.orderedModifiers.forEach(function(_ref3){var name=_ref3.name,_ref3$options=_ref3.options,options2=void 0===_ref3$options?{}:_ref3$options,effect2=_ref3.effect;if("function"==typeof effect2){var cleanupFn=effect2({state:state,name:name,instance:instance,options:options2}),noopFn=function(){};effectCleanupFns.push(cleanupFn||noopFn)}}),instance.update()},forceUpdate:function(){if(!isDestroyed){var _state$elements=state.elements,reference3=_state$elements.reference,popper3=_state$elements.popper;if(areValidElements(reference3,popper3)){state.rects={reference:getCompositeRect(reference3,getOffsetParent(popper3),"fixed"===state.options.strategy),popper:getLayoutRect(popper3)},state.reset=!1,state.placement=state.options.placement,state.orderedModifiers.forEach(function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data)});for(var __debug_loops__=0,index=0;index<state.orderedModifiers.length;index++){if((__debug_loops__+=1)>100){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}if(!0!==state.reset){var _state$orderedModifie=state.orderedModifiers[index],fn=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=void 0===_state$orderedModifie2?{}:_state$orderedModifie2,name=_state$orderedModifie.name;"function"==typeof fn&&(state=fn({state:state,options:_options,name:name,instance:instance})||state)}else state.reset=!1,index=-1}}else console.error(INVALID_ELEMENT_ERROR)}},update:(fn=function(){return new Promise(function(resolve){instance.forceUpdate(),resolve(state)})},function(){return pending||(pending=new Promise(function(resolve){Promise.resolve().then(function(){pending=void 0,resolve(fn())})}
20)),pending}),destroy:function(){cleanupModifierEffects(),isDestroyed=!0}};if(!areValidElements(reference2,popper2))return console.error(INVALID_ELEMENT_ERROR),instance;function cleanupModifierEffects(){effectCleanupFns.forEach(function(fn){return fn()}),effectCleanupFns=[]}return instance.setOptions(options).then(function(state2){!isDestroyed&&options.onFirstUpdate&&options.onFirstUpdate(state2)}),instance}}var passive={passive:!0};var eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options,_options$scroll=options.scroll,scroll=void 0===_options$scroll||_options$scroll,_options$resize=options.resize,resize=void 0===_options$resize||_options$resize,window2=getWindow(state.elements.popper),scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);return scroll&&scrollParents.forEach(function(scrollParent){scrollParent.addEventListener("scroll",instance.update,passive)}),resize&&window2.addEventListener("resize",instance.update,passive),function(){scroll&&scrollParents.forEach(function(scrollParent){scrollParent.removeEventListener("scroll",instance.update,passive)}),resize&&window2.removeEventListener("resize",instance.update,passive)}},data:{}};var popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:function(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,placement:state.placement})},data:{}},unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mapToStyles(_ref2){var _Object$assign2,popper2=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets,_ref3=!0===roundOffsets?function(_ref){var x=_ref.x,y=_ref.y,dpr=window.devicePixelRatio||1;return{x:round(round(x*dpr)/dpr)||0,y:round(round(y*dpr)/dpr)||0}}(offsets):"function"==typeof roundOffsets?roundOffsets(offsets):offsets,_ref3$x=_ref3.x,x=void 0===_ref3$x?0:_ref3$x,_ref3$y=_ref3.y,y=void 0===_ref3$y?0:_ref3$y,hasX=offsets.hasOwnProperty("x"),hasY=offsets.hasOwnProperty("y"),sideX=left,sideY=top,win=window;if(adaptive){var offsetParent=getOffsetParent(popper2),heightProp="clientHeight",widthProp="clientWidth";offsetParent===getWindow(popper2)&&"static"!==getComputedStyle(offsetParent=getDocumentElement(popper2)).position&&(heightProp="scrollHeight",widthProp="scrollWidth"),placement===top&&(sideY=bottom,y-=offsetParent[heightProp]-popperRect.height,y*=gpuAcceleration?1:-1),placement===left&&(sideX=right,x-=offsetParent[widthProp]-popperRect.width,x*=gpuAcceleration?1:-1)}var _Object$assign,commonStyles=Object.assign({position:position},adaptive&&unsetSides);return gpuAcceleration?Object.assign({},commonStyles,((_Object$assign={})[sideY]=hasY?"0":"",_Object$assign[sideX]=hasX?"0":"",_Object$assign.transform=(win.devicePixelRatio||1)<2?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign)):Object.assign({},commonStyles,((_Object$assign2={})[sideY]=hasY?y+"px":"",_Object$assign2[sideX]=hasX?x+"px":"",_Object$assign2.transform="",_Object$assign2))}var computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(_ref4){var state=_ref4.state,options=_ref4.options,_options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=void 0===_options$gpuAccelerat||_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=void 0===_options$adaptive||_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=void 0===_options$roundOffsets||_options$roundOffsets,transitionProperty=getComputedStyle(state.elements.popper).transitionProperty||"";adaptive&&["transform","top","right","bottom","left"].some(function(property){return transitionProperty.indexOf(property)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var commonStyles={placement:getBasePlacement(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration};null!=state.modifiersData.popperOffsets&&(state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.o
vendor: 4,547 bytes, line 20
20ptions.strategy,adaptive:adaptive,roundOffsets:roundOffsets})))),null!=state.modifiersData.arrow&&(state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:roundOffsets})))),state.attributes.popper=Object.assign({},state.attributes.popper,{"data-popper-placement":state.placement})},data:{}};var applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:function(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{},attributes=state.attributes[name]||{},element=state.elements[name];isHTMLElement(element)&&getNodeName(element)&&(Object.assign(element.style,style),Object.keys(attributes).forEach(function(name2){var value=attributes[name2];!1===value?element.removeAttribute(name2):element.setAttribute(name2,!0===value?"":value)}))})},effect:function(_ref2){var state=_ref2.state,initialStyles={popper:{position:state.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(state.elements.popper.style,initialStyles.popper),state.styles=initialStyles,state.elements.arrow&&Object.assign(state.elements.arrow.style,initialStyles.arrow),function(){Object.keys(state.elements).forEach(function(name){var element=state.elements[name],attributes=state.attributes[name]||{},style=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]).reduce(function(style2,property){return style2[property]="",style2},{});isHTMLElement(element)&&getNodeName(element)&&(Object.assign(element.style,style),Object.keys(attributes).forEach(function(attribute){element.removeAttribute(attribute)}))})}},requires:["computeStyles"]};var offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name,_options$offset=options.offset,offset2=void 0===_options$offset?[0,0]:_options$offset,data=placements.reduce(function(acc,placement){return acc[placement]=function(placement,rects,offset2){var basePlacement=getBasePlacement(placement),invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1,_ref="function"==typeof offset2?offset2(Object.assign({},rects,{placement:placement})):offset2,skidding=_ref[0],distance=_ref[1];return skidding=skidding||0,distance=(distance||0)*invertDistance,[left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance}}(placement,state.rects,offset2),acc},{}),_data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;null!=state.modifiersData.popperOffsets&&(state.modifiersData.popperOffsets.x+=x,state.modifiersData.popperOffsets.y+=y),state.modifiersData[name]=data}},hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,function(matched){return hash$1[matched]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,function(matched){return hash[matched]})}var flip$1={name:"flip",enabled:!0,phase:"main",fn:function(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(!state.modifiersData[name]._skip){for(var _options$mainAxis=options.mainAxis,checkMainAxis=void 0===_options$mainAxis||_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=void 0===_options$altAxis||_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=void 0===_options$flipVariatio||_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements,preferredPlacement=state.options.placement,basePlacement=getBasePlacement(preferredPlacement),fallbackPlacements=specifiedFallbackPlacements||(basePlacement===preferredPlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:function(placement){if("auto"===getBasePlacement(placement))return[];var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)]}(preferredPlacement)),placements2=[preferredPlacement].concat(fallbackPlacements).reduce(function(acc,placement2){return acc.concat("auto"===getBasePlacement(placement2)?function(state,options){void 0===options&&(options={});
vendor: 4,716 bytes, line 20
20var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=void 0===_options$allowedAutoP?placements:_options$allowedAutoP,variation=getVariation(placement),placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement2){return getVariation(placement2)===variation}):basePlacements,allowedPlacements=placements$1.filter(function(placement2){return allowedAutoPlacements.indexOf(placement2)>=0});0===allowedPlacements.length&&(allowedPlacements=placements$1,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var overflows=allowedPlacements.reduce(function(acc,placement2){return acc[placement2]=detectOverflow(state,{placement:placement2,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement2)],acc},{});return Object.keys(overflows).sort(function(a,b){return overflows[a]-overflows[b]})}(state,{placement:placement2,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement2)},[]),referenceRect=state.rects.reference,popperRect=state.rects.popper,checksMap=new Map,makeFallbackChecks=!0,firstFittingPlacement=placements2[0],i=0;i<placements2.length;i++){var placement=placements2[i],_basePlacement=getBasePlacement(placement),isStartVariation="start"===getVariation(placement),isVertical=[top,bottom].indexOf(_basePlacement)>=0,len=isVertical?"width":"height",overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding}),mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;referenceRect[len]>popperRect[len]&&(mainVariationSide=getOppositePlacement(mainVariationSide));var altVariationSide=getOppositePlacement(mainVariationSide),checks=[];if(checkMainAxis&&checks.push(overflow[_basePlacement]<=0),checkAltAxis&&checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0),checks.every(function(check){return check})){firstFittingPlacement=placement,makeFallbackChecks=!1;break}checksMap.set(placement,checks)}if(makeFallbackChecks)for(var _loop=function(_i2){var fittingPlacement=placements2.find(function(placement2){var checks2=checksMap.get(placement2);if(checks2)return checks2.slice(0,_i2).every(function(check){return check})});if(fittingPlacement)return firstFittingPlacement=fittingPlacement,"break"},_i=flipVariations?3:1;_i>0;_i--){if("break"===_loop(_i))break}state.placement!==firstFittingPlacement&&(state.modifiersData[name]._skip=!0,state.placement=firstFittingPlacement,state.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function within(min$1,value,max$1){return max(min$1,min(value,max$1))}var preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:function(_ref){var state=_ref.state,options=_ref.options,name=_ref.name,_options$mainAxis=options.mainAxis,checkMainAxis=void 0===_options$mainAxis||_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=void 0!==_options$altAxis&&_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=void 0===_options$tether||_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=void 0===_options$tetherOffset?0:_options$tetherOffset,overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary}),basePlacement=getBasePlacement(state.placement),variation=getVariation(state.placement),isBasePlacement=!variation,mainAxis=getMainAxisFromPlacement(basePlacement),altAxis="x"===mainAxis?"y":"x",popperOffsets2=state.modifiersData.popperOffsets,referenceRect=state.rects.reference,popperRect=state.rects.popper,tetherOffsetValue="function"==typeof tetherOffset?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset,data={x:0,y:0};if(popperOffsets2){if(checkMainAxis||checkAltAxis){var mainSide="y"===mainAxis?top:left,altSide="y"===mainAxis?bottom:right,len="y"===mainAxis?"height":"width",offset2=popperOffsets2[mainAxis],min$1=popperOffsets2[mainAxis]+overflow[mainSide],max$1=popperOffsets2[mainAxis]-overflow[altSide],additive=tether?-popperRect[len]/2:0,minLen="start"===variation?referenceRect[len]:p
20opperRect[len],maxLen="start"===variation?-popperRect[len]:-referenceRect[len],arrowElement=state.elements.arrow,arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0},arrowPaddingObject=state.modifiersData["arrow#persistent"]?state.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},arrowPaddingMin=arrowPaddingObject[mainSide],arrowPaddingMax=arrowPaddingObject[altSide],arrowLen=within(0,referenceRect[len],arrowRect[len]),minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-tetherOffsetValue:minLen-arrowLen-arrowPaddingMin-tetherOffsetValue,maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+tetherOffsetValue:maxLen+arrowLen+arrowPaddingMax+tetherOffsetValue,arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow),clientOffset=arrowOffsetParent?"y"===mainAxis?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0,offsetModifierValue=state.modifiersData.offset?state.modifiersData.offset[state.placement][mainAxis]:0,tetherMin=popperOffsets2[mainAxis]+minOffset-offsetModifierValue-clientOffset,tetherMax=popperOffsets2[mainAxis]+maxOffset-offsetModifierValue;if(checkMainAxis){var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset2,tether?max(max$1,tetherMax):max$1);popperOffsets2[mainAxis]=preventedOffset,data[mainAxis]=preventedOffset-offset2}if(checkAltAxis){var _mainSide="x"===mainAxis?top:left,_altSide="x"===mainAxis?bottom:right,_offset=popperOffsets2[altAxis],_min=_offset+overflow[_mainSide],_max=_offset-overflow[_altSide],_preventedOffset=within(tether?min(_min,tetherMin):_min,_offset,tether?max(_max,tetherMax):_max);popperOffsets2[altAxis]=_preventedOffset,data[altAxis]=_preventedOffset-_offset}}state.modifiersData[name]=data}},requiresIfExists:["offset"]};var arrow$1={name:"arrow",enabled:!0,phase:"main",fn:function(_ref){var _state$modifiersData$,state=_ref.state,name=_ref.name,options=_ref.options,arrowElement=state.elements.arrow,popperOffsets2=state.modifiersData.popperOffsets,basePlacement=getBasePlacement(state.placement),axis=getMainAxisFromPlacement(basePlacement),len=[left,right].indexOf(basePlacement)>=0?"height":"width";if(arrowElement&&popperOffsets2){var paddingObject=function(padding,state){return mergePaddingObject("number"!=typeof(padding="function"==typeof padding?padding(Object.assign({},state.rects,{placement:state.placement})):padding)?padding:expandToHashMap(padding,basePlacements))}(options.padding,state),arrowRect=getLayoutRect(arrowElement),minProp="y"===axis?top:left,maxProp="y"===axis?bottom:right,endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets2[axis]-state.rects.popper[len],startDiff=popperOffsets2[axis]-state.rects.reference[axis],arrowOffsetParent=getOffsetParent(arrowElement),clientSize=arrowOffsetParent?"y"===axis?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0,centerToReference=endDiff/2-startDiff/2,min2=paddingObject[minProp],max2=clientSize-arrowRect[len]-paddingObject[maxProp],center=clientSize/2-arrowRect[len]/2+centerToReference,offset2=within(min2,center,max2),axisProp=axis;state.modifiersData[name]=((_state$modifiersData$={})[axisProp]=offset2,_state$modifiersData$.centerOffset=offset2-center,_state$modifiersData$)}},effect:function(_ref2){var state=_ref2.state,_options$element=_ref2.options.element,arrowElement=void 0===_options$element?"[data-popper-arrow]":_options$element;null!=arrowElement&&("string"!=typeof arrowElement||(arrowElement=state.elements.popper.querySelector(arrowElement)))&&(isHTMLElement(arrowElement)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),contains(state.elements.popper,arrowElement)?state.elements.arrow=arrowElement:console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getSideOffsets(overflow,rect,preventedOffsets){return void 0===preventedOffsets&&(preventedOffsets={x:0,y:0}),{top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x}}function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some(function(side){return overflow[side]>=0})}var hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(_ref){var state=_ref.state,name=_ref.name,referenceRect=state.rects.reference,popperRect=state.rects.popper,preventedOffsets=state.modifiersData.preventOverflow,referenceOverflow=detectOverflow(state,{elementContext:"reference"}),popperAltOverflow=detectOverflow(state,{altBoundary:!0}),referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect),popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets),isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets),hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped},state.attributes.popper=Object.assign({},state.attributes.popper,{"data-popper-reference-hidden":isReferenceHidden,"data-popper-escaped":hasPopperEscaped})}}
20,createPopper$1=popperGenerator({defaultModifiers:[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1]}),defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers:defaultModifiers});exports$1.applyStyles=applyStyles$1,exports$1.arrow=arrow$1,exports$1.computeStyles=computeStyles$1,exports$1.createPopper=createPopper,exports$1.createPopperLite=createPopper$1,exports$1.defaultModifiers=defaultModifiers,exports$1.detectOverflow=detectOverflow,exports$1.eventListeners=eventListeners,exports$1.flip=flip$1,exports$1.hide=hide$1,exports$1.offset=offset$1,exports$1.popperGenerator=popperGenerator,exports$1.popperOffsets=popperOffsets$1,exports$1.preventOverflow=preventOverflow$1}),require_tippy_cjs=__commonJS(exports$1=>{Object.defineProperty(exports$1,"__esModule",{value:!0});var core=require_popper(),TOUCH_OPTIONS={passive:!0,capture:!0};function getValueAtIndexOrReturn(value,index,defaultValue){if(Array.isArray(value)){var v=value[index];return null==v?Array.isArray(defaultValue)?defaultValue[index]:defaultValue:v}return value}function isType(value,type){var str={}.toString.call(value);return 0===str.indexOf("[object")&&str.indexOf(type+"]")>-1}function invokeWithArgsOrReturn(value,args){return"function"==typeof value?value.apply(void 0,args):value}function debounce(fn,ms){return 0===ms?fn:function(arg){clearTimeout(timeout),timeout=setTimeout(function(){fn(arg)},ms)};var timeout}function removeProperties(obj,keys){var clone=Object.assign({},obj);return keys.forEach(function(key){delete clone[key]}),clone}function normalizeToArray(value){return[].concat(value)}function pushIfUnique(arr,value){-1===arr.indexOf(value)&&arr.push(value)}function getBasePlacement(placement){return placement.split("-")[0]}function arrayFrom(value){return[].slice.call(value)}function div(){return document.createElement("div")}function isElement(value){return["Element","Fragment"].some(function(type){return isType(value,type)})}function isMouseEvent(value){return isType(value,"MouseEvent")}function isReferenceElement(value){return!(!value||!value._tippy||value._tippy.reference!==value)}function getArrayOfElements(value){return isElement(value)?[value]:function(value){return isType(value,"NodeList")}(value)?arrayFrom(value):Array.isArray(value)?value:arrayFrom(document.querySelectorAll(value))}function setTransitionDuration(els,value){els.forEach(function(el){el&&(el.style.transitionDuration=value+"ms")})}function setVisibilityState(els,state){els.forEach(function(el){el&&el.setAttribute("data-state",state)})}function getOwnerDocument(elementOrElements){var _element$ownerDocumen,element=normalizeToArray(elementOrElements)[0];return(null==element||null==(_element$ownerDocumen=element.ownerDocument)?void 0:_element$ownerDocumen.body)?element.ownerDocument:document}function updateTransitionEndListener(box,action,listener){var method=action+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(event){box[method](event,listener)})}var currentInput={isTouch:!1},lastMouseMoveTime=0;function onDocumentTouchStart(){currentInput.isTouch||(currentInput.isTouch=!0,window.performance&&document.addEventListener("mousemove",onDocumentMouseMove))}function onDocumentMouseMove(){var now=performance.now();now-lastMouseMoveTime<20&&(currentInput.isTouch=!1,document.removeEventListener("mousemove",onDocumentMouseMove)),lastMouseMoveTime=now}function onWindowBlur(){var activeElement=document.activeElement;if(isReferenceElement(activeElement)){var instance=activeElement._tippy;activeElement.blur&&!instance.state.isVisible&&activeElement.blur()}}var visitedMessages,ua="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",isIE=/MSIE |Trident\//.test(ua);function createMemoryLeakWarning(method){return[method+"() was called on a"+("destroy"===method?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function clean(value){return value.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function getDevMessage(message){return clean("\n  %ctippy.js\n\n  %c"+clean(message)+"\n\n  %c👷‍ This is a development-only message. It will be removed in production.\n  ")}function getFormattedMessage(message){return[getDevMessage(message),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function warnWhen(condition,message){var _console;condition&&!visitedMessages.has(message)&&(visitedMessages.add(message),(_console=console).warn.apply(_console,getFormattedMessage(message)))}function errorWhen(condition,message){var _console2;condition&&!visitedMessages.has(message)&&(visitedMessages.add(message),(_console2=console).error.apply(_console2,getFormattedMessage(message)))}visitedMessages=new Set;var pluginProps={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},defaultProps=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},pluginProps,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),defaultKeys=Object.keys(defaultProps);function getExtendedPassedProps(passedProps){var pluginProps2=(passedProps.plugins||[]).reduce(function(acc,plugin){var name=plugin.name,defaultValue=plugin.defaultValue;return name&&(acc[name]=void 0!==passedProps[name]?passedProps[name]:defaultValue),acc},{});return Object.assign({},passedProps,{},pluginProps2)}function evaluateProps(reference,props){var out=Object.assign({},props,{content:invokeWithArgsOrReturn(props.content,[reference])},props.ignoreAttributes?{}:function(reference,plugins){return(plugins?Object.keys(getExtendedPassedProps(Object.assign({},defaultProps,{plugins:plugins}))):defaultKeys).reduce(function(acc,key){var valueAsString=(reference.getAttribute("data-tippy-"+key)||"").trim();if(!valueAsString)return acc;if("content"===key)acc[key]=valueAsString;else try{acc[key]=JSON.parse(valueAsString)}catch(e){acc[key]=valueAsString}return acc},{})}(reference,props.plugins));return out.aria=Object.assign({},defaultProps.aria,{},out.aria),out.aria={expanded:"auto"===out.aria.expanded?props.interactive:out.aria.expanded,content:"auto"===out.aria.content?props.interactive?null:"describedby":out.aria.content},out}function validateProps(partialProps,plugins){void 0===partialProps&&(partialProps={}
20),void 0===plugins&&(plugins=[]),Object.keys(partialProps).forEach(function(prop){var obj,key,nonPluginProps=removeProperties(defaultProps,Object.keys(pluginProps)),didPassUnknownProp=(obj=nonPluginProps,key=prop,!{}.hasOwnProperty.call(obj,key));didPassUnknownProp&&(didPassUnknownProp=0===plugins.filter(function(plugin){return plugin.name===prop}).length),warnWhen(didPassUnknownProp,["`"+prop+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}function dangerouslySetInnerHTML(element,html){element.innerHTML=html}function createArrowElement(value){var arrow=div();return!0===value?arrow.className="tippy-arrow":(arrow.className="tippy-svg-arrow",isElement(value)?arrow.appendChild(value):dangerouslySetInnerHTML(arrow,value)),arrow}function setContent(content,props){isElement(props.content)?(dangerouslySetInnerHTML(content,""),content.appendChild(props.content)):"function"!=typeof props.content&&(props.allowHTML?dangerouslySetInnerHTML(content,props.content):content.textContent=props.content)}function getChildren(popper){var box=popper.firstElementChild,boxChildren=arrayFrom(box.children);return{box:box,content:boxChildren.find(function(node){return node.classList.contains("tippy-content")}),arrow:boxChildren.find(function(node){return node.classList.contains("tippy-arrow")||node.classList.contains("tippy-svg-arrow")}),backdrop:boxChildren.find(function(node){return node.classList.contains("tippy-backdrop")})}}function render(instance){var popper=div(),box=div();box.className="tippy-box",box.setAttribute("data-state","hidden"),box.setAttribute("tabindex","-1");var content=div();function onUpdate(prevProps,nextProps){var _getChildren=getChildren(popper),box2=_getChildren.box,content2=_getChildren.content,arrow=_getChildren.arrow;nextProps.theme?box2.setAttribute("data-theme",nextProps.theme):box2.removeAttribute("data-theme"),"string"==typeof nextProps.animation?box2.setAttribute("data-animation",nextProps.animation):box2.removeAttribute("data-animation"),nextProps.inertia?box2.setAttribute("data-inertia",""):box2.removeAttribute("data-inertia"),box2.style.maxWidth="number"==typeof nextProps.maxWidth?nextProps.maxWidth+"px":nextProps.maxWidth,nextProps.role?box2.setAttribute("role",nextProps.role):box2.removeAttribute("role"),prevProps.content===nextProps.content&&prevProps.allowHTML===nextProps.allowHTML||setContent(content2,instance.props),nextProps.arrow?arrow?prevProps.arrow!==nextProps.arrow&&(box2.removeChild(arrow),box2.appendChild(createArrowElement(nextProps.arrow))):box2.appendChild(createArrowElement(nextProps.arrow)):arrow&&box2.removeChild(arrow)}return content.className="tippy-content",content.setAttribute("data-state","hidden"),setContent(content,instance.props),popper.appendChild(box),box.appendChild(content),onUpdate(instance.props,instance.props),{popper:popper,onUpdate:onUpdate}}render.$$tippy=!0;var idCounter=1,mouseMoveListeners=[],mountedInstances=[];function createTippy(reference,passedProps){var obj,showTimeout,hideTimeout,scheduleHideAnimationFrame,lastTriggerEvent,currentTransitionEndListener,onFirstUpdate,currentTarget,arr,props=evaluateProps(reference,Object.assign({},defaultProps,{},getExtendedPassedProps((obj=passedProps,Object.keys(obj).reduce(function(acc,key){return void 0!==obj[key]&&(acc[key]=obj[key]),acc},{}))))),isVisibleFromClick=!1,didHideDueToDocumentMouseDown=!1,didTouchMove=!1,ignoreOnFirstUpdate=!1,listeners=[],debouncedOnMouseMove=debounce(onMouseMove,props.interactiveDebounce),id=idCounter++,plugins=(arr=props.plugins).filter(function(item,index){return arr.indexOf(item)===index}),instance={id:id,reference:reference,popper:div(),popperInstance:null,props:props,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:plugins,clearDelayTimeouts:function(){clearTimeout(showTimeout),clearTimeout(hideTimeout),cancelAnimationFrame(scheduleHideAnimationFrame)},setProps:function(partialProps){if(warnWhen(instance.state.isDestroyed,createMemoryLeakWarning("setProps")),instance.state.isDestroyed)return;invokeHook("onBeforeUpdate",[instance,partialProps]),removeListeners();var prevProps=instance.props,nextProps=evaluateProps(reference,Object.assign({},instance.props,{},partialProps,{ignoreAttributes:!0}));instance.props=nextProps,addListeners(),prevProps.interactiveDebounce!==nextProps.interactiveDebounce&&(cleanupInteractiveMouseListeners(),debouncedOnMouseMove=debounce(onMouseMove,nextProps.interactiveDebounce));prevProps.triggerTarget&&!nextProps.triggerTarget?normalizeToArray(prevProps.triggerTarget).forEach(function(node){node.removeAttribute("aria-expanded")}):nextProps.triggerTarget&&reference.removeAttribute("aria-expanded");handleAriaExpandedAttribute(),handleStyles(),onUpdate&&onUpdate(prevProps,nextProps);instance.popperInstance&&(createPopperInstance(),getNestedPopperTree().forEac
20h(function(nestedPopper){requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate)}));invokeHook("onAfterUpdate",[instance,partialProps])},setContent:function(content){instance.setProps({content:content})},show:function(){warnWhen(instance.state.isDestroyed,createMemoryLeakWarning("show"));var isAlreadyVisible=instance.state.isVisible,isDestroyed=instance.state.isDestroyed,isDisabled=!instance.state.isEnabled,isTouchAndTouchDisabled=currentInput.isTouch&&!instance.props.touch,duration=getValueAtIndexOrReturn(instance.props.duration,0,defaultProps.duration);if(isAlreadyVisible||isDestroyed||isDisabled||isTouchAndTouchDisabled)return;if(getCurrentTarget().hasAttribute("disabled"))return;if(invokeHook("onShow",[instance],!1),!1===instance.props.onShow(instance))return;instance.state.isVisible=!0,getIsDefaultRenderFn()&&(popper.style.visibility="visible");handleStyles(),addDocumentPress(),instance.state.isMounted||(popper.style.transition="none");if(getIsDefaultRenderFn()){var _getDefaultTemplateCh2=getDefaultTemplateChildren();setTransitionDuration([_getDefaultTemplateCh2.box,_getDefaultTemplateCh2.content],0)}onFirstUpdate=function(){var _instance$popperInsta2;if(instance.state.isVisible&&!ignoreOnFirstUpdate){if(ignoreOnFirstUpdate=!0,popper.offsetHeight,popper.style.transition=instance.props.moveTransition,getIsDefaultRenderFn()&&instance.props.animation){var _getDefaultTemplateCh3=getDefaultTemplateChildren(),_box=_getDefaultTemplateCh3.box,_content=_getDefaultTemplateCh3.content;setTransitionDuration([_box,_content],duration),setVisibilityState([_box,_content],"visible")}handleAriaContentAttribute(),handleAriaExpandedAttribute(),pushIfUnique(mountedInstances,instance),null==(_instance$popperInsta2=instance.popperInstance)||_instance$popperInsta2.forceUpdate(),instance.state.isMounted=!0,invokeHook("onMount",[instance]),instance.props.animation&&getIsDefaultRenderFn()&&function(duration,callback){onTransitionEnd(duration,callback)}(duration,function(){instance.state.isShown=!0,invokeHook("onShown",[instance])})}},function(){var parentNode,appendTo=instance.props.appendTo,node=getCurrentTarget();parentNode=instance.props.interactive&&appendTo===defaultProps.appendTo||"parent"===appendTo?node.parentNode:invokeWithArgsOrReturn(appendTo,[node]);parentNode.contains(popper)||parentNode.appendChild(popper);createPopperInstance(),warnWhen(instance.props.interactive&&appendTo===defaultProps.appendTo&&node.nextElementSibling!==popper,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){warnWhen(instance.state.isDestroyed,createMemoryLeakWarning("hide"));var isAlreadyHidden=!instance.state.isVisible,isDestroyed=instance.state.isDestroyed,isDisabled=!instance.state.isEnabled,duration=getValueAtIndexOrReturn(instance.props.duration,1,defaultProps.duration);if(isAlreadyHidden||isDestroyed||isDisabled)return;if(invokeHook("onHide",[instance],!1),!1===instance.props.onHide(instance))return;instance.state.isVisible=!1,instance.state.isShown=!1,ignoreOnFirstUpdate=!1,isVisibleFromClick=!1,getIsDefaultRenderFn()&&(popper.style.visibility="hidden");if(cleanupInteractiveMouseListeners(),removeDocumentPress(),handleStyles(),getIsDefaultRenderFn()){var _getDefaultTemplateCh4=getDefaultTemplateChildren(),box=_getDefaultTemplateCh4.box,content=_getDefaultTemplateCh4.content;instance.props.animation&&(setTransitionDuration([box,content],duration),setVisibilityState([box,content],"hidden"))}handleAriaContentAttribute(),handleAriaExpandedAttribute(),instance.props.animation?getIsDefaultRenderFn()&&function(duration,callback){onTransitionEnd(duration,function(){!instance.state.isVisible&&popper.parentNode&&popper.parentNode.contains(popper)&&callback()})}(duration,instance.unmount):instance.unmount()},hideWithInteractivity:function(event){warnWhen(instance.state.isDestroyed,createMemoryLeakWarning("hideWithInteractivity")),getDocument().addEventListener("mousemove",debouncedOnMouseMove),pushIfUnique(mouseMoveListeners,debouncedOnMouseMove),debouncedOnMouseMove(event)},enable:function(){instance.state.isEnabled=!0},disable:function(){instance.hide(),instance.state.isEnabled=!1},unmount:function(){warnWhen(instance.state.isDestroyed,createMemoryLeakWarning("unmount")),instance.state.isVisible&&instance.hide();if(!instance.state.isMounted)return;
20destroyPopperInstance(),getNestedPopperTree().forEach(function(nestedPopper){nestedPopper._tippy.unmount()}),popper.parentNode&&popper.parentNode.removeChild(popper);mountedInstances=mountedInstances.filter(function(i){return i!==instance}),instance.state.isMounted=!1,invokeHook("onHidden",[instance])},destroy:function(){if(warnWhen(instance.state.isDestroyed,createMemoryLeakWarning("destroy")),instance.state.isDestroyed)return;instance.clearDelayTimeouts(),instance.unmount(),removeListeners(),delete reference._tippy,instance.state.isDestroyed=!0,invokeHook("onDestroy",[instance])}};if(!props.render)return errorWhen(!0,"render() function has not been supplied."),instance;var _props$render=props.render(instance),popper=_props$render.popper,onUpdate=_props$render.onUpdate;popper.setAttribute("data-tippy-root",""),popper.id="tippy-"+instance.id,instance.popper=popper,reference._tippy=instance,popper._tippy=instance;var pluginsHooks=plugins.map(function(plugin){return plugin.fn(instance)}),hasAriaExpanded=reference.hasAttribute("aria-expanded");return addListeners(),handleAriaExpandedAttribute(),handleStyles(),invokeHook("onCreate",[instance]),props.showOnCreate&&scheduleShow(),popper.addEventListener("mouseenter",function(){instance.props.interactive&&instance.state.isVisible&&instance.clearDelayTimeouts()}),popper.addEventListener("mouseleave",function(event){instance.props.interactive&&instance.props.trigger.indexOf("mouseenter")>=0&&(getDocument().addEventListener("mousemove",debouncedOnMouseMove),debouncedOnMouseMove(event))}),instance;function getNormalizedTouchSettings(){var touch=instance.props.touch;return Array.isArray(touch)?touch:[touch,0]}function getIsCustomTouchBehavior(){return"hold"===getNormalizedTouchSettings()[0]}function getIsDefaultRenderFn(){var _instance$props$rende;return!!(null==(_instance$props$rende=instance.props.render)?void 0:_instance$props$rende.$$tippy)}function getCurrentTarget(){return currentTarget||reference}function getDocument(){var parent=getCurrentTarget().parentNode;return parent?getOwnerDocument(parent):document}function getDefaultTemplateChildren(){return getChildren(popper)}function getDelay(isShow){return instance.state.isMounted&&!instance.state.isVisible||currentInput.isTouch||lastTriggerEvent&&"focus"===lastTriggerEvent.type?0:getValueAtIndexOrReturn(instance.props.delay,isShow?0:1,defaultProps.delay)}function handleStyles(){popper.style.pointerEvents=instance.props.interactive&&instance.state.isVisible?"":"none",popper.style.zIndex=""+instance.props.zIndex}function invokeHook(hook,args,shouldInvokePropsHook){var _instance$props;(void 0===shouldInvokePropsHook&&(shouldInvokePropsHook=!0),pluginsHooks.forEach(function(pluginHooks){pluginHooks[hook]&&pluginHooks[hook].apply(void 0,args)}),shouldInvokePropsHook)&&(_instance$props=instance.props)[hook].apply(_instance$props,args)}function handleAriaContentAttribute(){var aria=instance.props.aria;if(aria.content){var attr="aria-"+aria.content,id2=popper.id;normalizeToArray(instance.props.triggerTarget||reference).forEach(function(node){var currentValue=node.getAttribute(attr);if(instance.state.isVisible)node.setAttribute(attr,currentValue?currentValue+" "+id2:id2);else{var nextValue=currentValue&&currentValue.replace(id2,"").trim();nextValue?node.setAttribute(attr,nextValue):node.removeAttribute(attr)}})}}function handleAriaExpandedAttribute(){!hasAriaExpanded&&instance.props.aria.expanded&&normalizeToArray(instance.props.triggerTarget||reference).forEach(function(node){instance.props.interactive?node.setAttribute("aria-expanded",instance.state.isVisible&&node===getCurrentTarget()?"true":"false"):node.removeAttribute("aria-expanded")})}function cleanupInteractiveMouseListeners(){getDocument().removeEventListener("mousemove",debouncedOnMouseMove),mouseMoveListeners=mouseMoveListeners.filter(function(listener){return listener!==debouncedOnMouseMove})}function onDocumentPress(event){if(!(currentInput.isTouch&&(didTouchMove||"mousedown"===event.type)||instance.props.interactive&&popper.contains(event.target))){if(getCurrentTarget().contains(event.target)){if(currentInput.isTouch)return;if(instance.state.isVisible&&instance.props.trigger.indexOf("click")>=0)return}else invokeHook("onClickOutside",[instance,event]);!0===instance.props.hideOnClick&&(instance.clearDelayTimeouts(),instance.hide(),didHideDueToDocumentMouseDown=!0,setTimeout(function(){didHideDueToDocumentMouseDown=!1}),instance.state.isMounted||removeDocumentPress())}}function onTouchMove(){didTouchMove=!0}function onTouchStart(){didTouchMove=!1}function addDocumentPress(){var doc=getDocument();doc.addEventListener("mousedown",onDocumentPress,!0),doc.addEventListener("touchend",onDocumentPress,TOUCH_OPTIONS),doc.addEventListener("touchstart",onTouchStart,TOUCH_OPTIONS),doc.addEventListener("touchmove",onTouchMove,TOUCH_OPTIONS)}function removeDocumentPress(){var doc=getDocument();doc.removeEventListener("mousedown",onDocumentPress,!0),doc.removeEventListener("touchend",onDocumentPress,TOUCH_OPTIONS),doc.removeEventListener("touchstart",onTouchStart,TOUCH_OPTIONS),doc.removeEventListener("touchmove",onTouchMove,TOUCH_OPTIONS)}function onTransitionEnd(duration,callback){var box=getDefaultTemplateChildren().box;function listener(event){event.target===box&&(updateTransitionEndListener(box,"remove",listener),callback())}if(0===duration)return callback();updateTransitionEndListener(box,"remove",currentTransitionEndListener),updateTransitionEndListener(box,"add",listener),currentTransitionEndListener=listener}function on(eventType,handler,options){void 0===options&&(options=!1),normalizeToArray(instance.props.triggerTarget||reference).forEach(function(node){node.addEventListener(eventType,handler,options),listeners.push({node:node,eventType:eventType,handler:handler,options:options})})}function addListeners(){var value;getIsCustomTouchBehavior()&&(on("touchstart",onTrigger,{passive:!0}),on("touchend",onMouseLeave,{passive:!0}
vendor: 4,501 bytes, line 20
20)),(value=instance.props.trigger,value.split(/\s+/).filter(Boolean)).forEach(function(eventType){if("manual"!==eventType)switch(on(eventType,onTrigger),eventType){case"mouseenter":on("mouseleave",onMouseLeave);break;case"focus":on(isIE?"focusout":"blur",onBlurOrFocusOut);break;case"focusin":on("focusout",onBlurOrFocusOut)}})}function removeListeners(){listeners.forEach(function(_ref){var node=_ref.node,eventType=_ref.eventType,handler=_ref.handler,options=_ref.options;node.removeEventListener(eventType,handler,options)}),listeners=[]}function onTrigger(event){var _lastTriggerEvent,shouldScheduleClickHide=!1;if(instance.state.isEnabled&&!isEventListenerStopped(event)&&!didHideDueToDocumentMouseDown){var wasFocused="focus"===(null==(_lastTriggerEvent=lastTriggerEvent)?void 0:_lastTriggerEvent.type);lastTriggerEvent=event,currentTarget=event.currentTarget,handleAriaExpandedAttribute(),!instance.state.isVisible&&isMouseEvent(event)&&mouseMoveListeners.forEach(function(listener){return listener(event)}),"click"===event.type&&(instance.props.trigger.indexOf("mouseenter")<0||isVisibleFromClick)&&!1!==instance.props.hideOnClick&&instance.state.isVisible?shouldScheduleClickHide=!0:scheduleShow(event),"click"===event.type&&(isVisibleFromClick=!shouldScheduleClickHide),shouldScheduleClickHide&&!wasFocused&&scheduleHide(event)}}function onMouseMove(event){var target=event.target,isCursorOverReferenceOrPopper=getCurrentTarget().contains(target)||popper.contains(target);"mousemove"===event.type&&isCursorOverReferenceOrPopper||function(popperTreeData,event){var clientX=event.clientX,clientY=event.clientY;return popperTreeData.every(function(_ref){var popperRect=_ref.popperRect,popperState=_ref.popperState,interactiveBorder=_ref.props.interactiveBorder,basePlacement=getBasePlacement(popperState.placement),offsetData=popperState.modifiersData.offset;if(!offsetData)return!0;var topDistance="bottom"===basePlacement?offsetData.top.y:0,bottomDistance="top"===basePlacement?offsetData.bottom.y:0,leftDistance="right"===basePlacement?offsetData.left.x:0,rightDistance="left"===basePlacement?offsetData.right.x:0,exceedsTop=popperRect.top-clientY+topDistance>interactiveBorder,exceedsBottom=clientY-popperRect.bottom-bottomDistance>interactiveBorder,exceedsLeft=popperRect.left-clientX+leftDistance>interactiveBorder,exceedsRight=clientX-popperRect.right-rightDistance>interactiveBorder;return exceedsTop||exceedsBottom||exceedsLeft||exceedsRight})}(getNestedPopperTree().concat(popper).map(function(popper2){var _instance$popperInsta,state2=null==(_instance$popperInsta=popper2._tippy.popperInstance)?void 0:_instance$popperInsta.state;return state2?{popperRect:popper2.getBoundingClientRect(),popperState:state2,props:props}:null}).filter(Boolean),event)&&(cleanupInteractiveMouseListeners(),scheduleHide(event))}function onMouseLeave(event){isEventListenerStopped(event)||instance.props.trigger.indexOf("click")>=0&&isVisibleFromClick||(instance.props.interactive?instance.hideWithInteractivity(event):scheduleHide(event))}function onBlurOrFocusOut(event){instance.props.trigger.indexOf("focusin")<0&&event.target!==getCurrentTarget()||instance.props.interactive&&event.relatedTarget&&popper.contains(event.relatedTarget)||scheduleHide(event)}function isEventListenerStopped(event){return!!currentInput.isTouch&&getIsCustomTouchBehavior()!==event.type.indexOf("touch")>=0}function createPopperInstance(){destroyPopperInstance();var _instance$props2=instance.props,popperOptions=_instance$props2.popperOptions,placement=_instance$props2.placement,offset=_instance$props2.offset,getReferenceClientRect=_instance$props2.getReferenceClientRect,moveTransition=_instance$props2.moveTransition,arrow=getIsDefaultRenderFn()?getChildren(popper).arrow:null,computedReference=getReferenceClientRect?{getBoundingClientRect:getReferenceClientRect,contextElement:getReferenceClientRect.contextElement||getCurrentTarget()}:reference,modifiers=[{name:"offset",options:{offset:offset}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!moveTransition}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(_ref2){var state2=_ref2.state;if(getIsDefaultRenderFn()){var box=getDefaultTemplateChildren().box;["placement","reference-hidden","escaped"].forEach(function(attr){"placement"===attr?box.setAttribute("data-placement",state2.placement):state2.attributes.popper["data-
20popper-"+attr]?box.setAttribute("data-"+attr,""):box.removeAttribute("data-"+attr)}),state2.attributes.popper={}}}}];getIsDefaultRenderFn()&&arrow&&modifiers.push({name:"arrow",options:{element:arrow,padding:3}}),modifiers.push.apply(modifiers,(null==popperOptions?void 0:popperOptions.modifiers)||[]),instance.popperInstance=core.createPopper(computedReference,popper,Object.assign({},popperOptions,{placement:placement,onFirstUpdate:onFirstUpdate,modifiers:modifiers}))}function destroyPopperInstance(){instance.popperInstance&&(instance.popperInstance.destroy(),instance.popperInstance=null)}function getNestedPopperTree(){return arrayFrom(popper.querySelectorAll("[data-tippy-root]"))}function scheduleShow(event){instance.clearDelayTimeouts(),event&&invokeHook("onTrigger",[instance,event]),addDocumentPress();var delay=getDelay(!0),_getNormalizedTouchSe=getNormalizedTouchSettings(),touchValue=_getNormalizedTouchSe[0],touchDelay=_getNormalizedTouchSe[1];currentInput.isTouch&&"hold"===touchValue&&touchDelay&&(delay=touchDelay),delay?showTimeout=setTimeout(function(){instance.show()},delay):instance.show()}function scheduleHide(event){if(instance.clearDelayTimeouts(),invokeHook("onUntrigger",[instance,event]),instance.state.isVisible){if(!(instance.props.trigger.indexOf("mouseenter")>=0&&instance.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(event.type)>=0&&isVisibleFromClick)){var delay=getDelay(!1);delay?hideTimeout=setTimeout(function(){instance.state.isVisible&&instance.hide()},delay):scheduleHideAnimationFrame=requestAnimationFrame(function(){instance.hide()})}}else removeDocumentPress()}}function tippy2(targets,optionalProps){void 0===optionalProps&&(optionalProps={});var plugins=defaultProps.plugins.concat(optionalProps.plugins||[]);!function(targets){var didPassFalsyValue=!targets,didPassPlainObject="[object Object]"===Object.prototype.toString.call(targets)&&!targets.addEventListener;errorWhen(didPassFalsyValue,["tippy() was passed","`"+String(targets)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),errorWhen(didPassPlainObject,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(targets),validateProps(optionalProps,plugins),document.addEventListener("touchstart",onDocumentTouchStart,TOUCH_OPTIONS),window.addEventListener("blur",onWindowBlur);var passedProps=Object.assign({},optionalProps,{plugins:plugins}),elements=getArrayOfElements(targets),isSingleContentElement=isElement(passedProps.content),isMoreThanOneReferenceElement=elements.length>1;warnWhen(isSingleContentElement&&isMoreThanOneReferenceElement,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "));var instances=elements.reduce(function(acc,reference){var instance=reference&&createTippy(reference,passedProps);return instance&&acc.push(instance),acc},[]);return isElement(targets)?instances[0]:instances}tippy2.defaultProps=defaultProps,tippy2.setDefaultProps=function(partialProps){validateProps(partialProps,[]),Object.keys(partialProps).forEach(function(key){defaultProps[key]=partialProps[key]})},tippy2.currentInput=currentInput;var applyStylesModifier=Object.assign({},core.applyStyles,{effect:function(_ref){var state=_ref.state,initialStyles={popper:{position:state.o
vendor: 5,591 bytes, line 20
20ptions.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper),state.styles=initialStyles,state.elements.arrow&&Object.assign(state.elements.arrow.style,initialStyles.arrow)}}),BUBBLING_EVENTS_MAP={mouseover:"mouseenter",focusin:"focus",click:"click"};var animateFill={name:"animateFill",defaultValue:!1,fn:function(instance){var _instance$props$rende;if(!(null==(_instance$props$rende=instance.props.render)?void 0:_instance$props$rende.$$tippy))return errorWhen(instance.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var _getChildren=getChildren(instance.popper),box=_getChildren.box,content=_getChildren.content,backdrop=instance.props.animateFill?function(){var backdrop=div();return backdrop.className="tippy-backdrop",setVisibilityState([backdrop],"hidden"),backdrop}():null;return{onCreate:function(){backdrop&&(box.insertBefore(backdrop,box.firstElementChild),box.setAttribute("data-animatefill",""),box.style.overflow="hidden",instance.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(backdrop){var transitionDuration=box.style.transitionDuration,duration=Number(transitionDuration.replace("ms",""));content.style.transitionDelay=Math.round(duration/10)+"ms",backdrop.style.transitionDuration=transitionDuration,setVisibilityState([backdrop],"visible")}},onShow:function(){backdrop&&(backdrop.style.transitionDuration="0ms")},onHide:function(){backdrop&&setVisibilityState([backdrop],"hidden")}}}};var mouseCoords={clientX:0,clientY:0},activeInstances=[];function storeMouseCoords(_ref){var clientX=_ref.clientX,clientY=_ref.clientY;mouseCoords={clientX:clientX,clientY:clientY}}var followCursor2={name:"followCursor",defaultValue:!1,fn:function(instance){var reference=instance.reference,doc=getOwnerDocument(instance.props.triggerTarget||reference),isInternalUpdate=!1,wasFocusEvent=!1,isUnmounted=!0,prevProps=instance.props;function getIsInitialBehavior(){return"initial"===instance.props.followCursor&&instance.state.isVisible}function addListener(){doc.addEventListener("mousemove",onMouseMove)}function removeListener(){doc.removeEventListener("mousemove",onMouseMove)}function unsetGetReferenceClientRect(){isInternalUpdate=!0,instance.setProps({getReferenceClientRect:null}),isInternalUpdate=!1}function onMouseMove(event){var isCursorOverReference=!event.target||reference.contains(event.target),followCursor3=instance.props.followCursor,clientX=event.clientX,clientY=event.clientY,rect=reference.getBoundingClientRect(),relativeX=clientX-rect.left,relativeY=clientY-rect.top;!isCursorOverReference&&instance.props.interactive||instance.setProps({getReferenceClientRect:function(){var rect2=reference.getBoundingClientRect(),x=clientX,y=clientY;"initial"===followCursor3&&(x=rect2.left+relativeX,y=rect2.top+relativeY);var top="horizontal"===followCursor3?rect2.top:y,right="vertical"===followCursor3?rect2.right:x,bottom="horizontal"===followCursor3?rect2.bottom:y,left="vertical"===followCursor3?rect2.left:x;return{width:right-left,height:bottom-top,top:top,right:right,bottom:bottom,left:left}}})}function create(){instance.props.followCursor&&(activeInstances.push({instance:instance,doc:doc}),function(doc){doc.addEventListener("mousemove",storeMouseCoords)}(doc))}function destroy(){activeInstances=activeInstances.filter(function(data){return data.instance!==instance}),0===activeInstances.filter(function(data){return data.doc===doc}).length&&function(doc){doc.removeEventListener("mousemove",storeMouseCoords)}(doc)}return{onCreate:create,onDestroy:destroy,onBeforeUpdate:function(){prevProps=instance.props},onAfterUpdate:function(_,_ref2){var followCursor3=_ref2.followCursor;isInternalUpdate||void 0!==followCursor3&&prevProps.followCursor!==followCursor3&&(destroy(),followCursor3?(create(),!instance.state.isMounted||wasFocusEvent||getIsInitialBehavior()||addListener()):(removeListener(),unsetGetReferenceClientRect()))},onMount:function(){instance.props.followCursor&&!wasFocusEvent&&(isUnmounted&&(onMouseMove(mouseCoords),isUnmounted=!1),getIsInitialBehavior()||addListener())},onTrigger:function(_,event){isMouseEvent(event)&&(mouseCoords={clientX:event.clientX,clientY:event.clientY}),wasFocusEvent="focus"===event.type},onHidden:function(){instance.props.followCursor&&(unsetGetReferenceClientRect(),removeListener(),isUnmounted=!0)}}}};var inlinePositioning={name:"inlinePositioning",defaultValue:!1,fn:function(instance){var placement,reference=instance.reference;var cursorRectIndex=-1,isInternalUpdate=!1,modifier={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(_ref2){var state=_ref2.state;instance.props.inlinePositioning&&(placement!==state.placement&&instance.setProps({getReferenceClientRect:function(){return function(currentBasePlacement,boundingRect,clientRects,cursorRectIndex){if(clientRects.length<2||null===currentBasePlacement)return boundingRect;if(2===clientRects.length&&cursorRectIndex>=0&&clientRects[0].left>clientRects[1].right)return clientRects[cursorRectIndex]||boundingRect;switch(currentBasePlacement){case"top":case"bottom":var firstRect=clientRects[0],lastRect=clientRects[clientRects.length-1],isTop="top"===currentBasePlacement,top=firstRect.top,bottom=lastRect.bottom,left=isTop?firstRect.left:lastRect.left,right=isTop?firstRect.right:lastRect.right;return{top:top,bottom:bottom,left:left,right:right,width:right-left,height:bottom-top};case"left":case"right":var minLeft=Math.min.apply(Math,clientRects.map(function(rects){return rects.left}
20)),maxRight=Math.max.apply(Math,clientRects.map(function(rects){return rects.right})),measureRects=clientRects.filter(function(rect){return"left"===currentBasePlacement?rect.left===minLeft:rect.right===maxRight}),_top=measureRects[0].top,_bottom=measureRects[measureRects.length-1].bottom;return{top:_top,bottom:_bottom,left:minLeft,right:maxRight,width:maxRight-minLeft,height:_bottom-_top};default:return boundingRect}}(getBasePlacement(state.placement),reference.getBoundingClientRect(),arrayFrom(reference.getClientRects()),cursorRectIndex)}}),placement=state.placement)}};function addModifier(){var partialProps;isInternalUpdate||(partialProps=function(props,modifier){var _props$popperOptions;return{popperOptions:Object.assign({},props.popperOptions,{modifiers:[].concat(((null==(_props$popperOptions=props.popperOptions)?void 0:_props$popperOptions.modifiers)||[]).filter(function(_ref){return _ref.name!==modifier.name}),[modifier])})}}(instance.props,modifier),isInternalUpdate=!0,instance.setProps(partialProps),isInternalUpdate=!1)}return{onCreate:addModifier,onAfterUpdate:addModifier,onTrigger:function(_,event){if(isMouseEvent(event)){var rects=arrayFrom(instance.reference.getClientRects()),cursorRect=rects.find(function(rect){return rect.left-2<=event.clientX&&rect.right+2>=event.clientX&&rect.top-2<=event.clientY&&rect.bottom+2>=event.clientY});cursorRectIndex=rects.indexOf(cursorRect)}},onUntrigger:function(){cursorRectIndex=-1}}}};var sticky={name:"sticky",defaultValue:!1,fn:function(instance){var reference=instance.reference,popper=instance.popper;function shouldCheck(value){return!0===instance.props.sticky||instance.props.sticky===value}var prevRefRect=null,prevPopRect=null;function updatePosition(){var currentRefRect=shouldCheck("reference")?(instance.popperInstance?instance.popperInstance.state.elements.reference:reference).getBoundingClientRect():null,currentPopRect=shouldCheck("popper")?popper.getBoundingClientRect():null;(currentRefRect&&areRectsDifferent(prevRefRect,currentRefRect)||currentPopRect&&areRectsDifferent(prevPopRect,currentPopRect))&&instance.popperInstance&&instance.popperInstance.update(),prevRefRect=currentRefRect,prevPopRect=currentPopRect,instance.state.isMounted&&requestAnimationFrame(updatePosition)}return{onMount:function(){instance.props.sticky&&updatePosition()}}}};function areRectsDifferent(rectA,rectB){return!rectA||!rectB||(rectA.top!==rectB.top||rectA.right!==rectB.right||rectA.bottom!==rectB.bottom||rectA.left!==rectB.left)}tippy2.setDefaultProps({render:render}),exports$1.animateFill=animateFill,exports$1.createSingleton=function(tippyInstances,optionalProps){var _optionalProps$popper;void 0===optionalProps&&(optionalProps={}),errorWhen(!Array.isArray(tippyInstances),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(tippyInstances)].join(" "));var currentTarget,individualInstances=tippyInstances,references=[],overrides=optionalProps.overrides,interceptSetPropsCleanups=[],shownOnCreate=!1;function setReferences(){references=individualInstances.map(function(instance){return instance.reference})}function enableInstances(isEnabled){individualInstances.forEach(function(instance){isEnabled?instance.enable():instance.disable()})}function interceptSetProps(singleton2){return individualInstances.map(function(instance){var originalSetProps2=instance.setProps;return instance.setProps=function(props){originalSetProps2(props),instance.reference===currentTarget&&singleton2.setProps(props)},function(){instance.setProps=originalSetProps2}})}function prepareInstance(singleton2,target){var index=references.indexOf(target);if(target!==currentTarget){currentTarget=target;var overrideProps=(overrides||[]).concat("content").reduce(function(acc,prop){return acc[prop]=individualInstances[index].props[prop],acc},{});singleton2.setProps(Object.assign({},overrideProps,{getReferenceClientRect:"function"==typeof overrideProps.getReferenceClientRect?overrideProps.getReferenceClientRect:function(){return target.getBoundingClientRect()}}))}}enableInstances(!1),setReferences();var plugin={fn:function(){return{onDestroy:function(){enableInstances(!0)},onHidden:function(){currentTarget=null},onClickOutside:function(instance){instance.props.showOnCreate&&!shownOnCreate&&(shownOnCreate=!0,currentTarget=null)},onShow:function(instance){instance.props.showOnCreate&&!shownOnCreate&&(shownOnCreate=!0,prepareInstance(instance,references[0]))},onTrigger:function(instance,event){prepareInstance(instance,event.currentTarget)}}}},singleton=tippy2(div(),Object.assign({},removeProperties(optionalProps,["overrides"]),{plugins:[plugin].concat(optionalProps.plugins||[]),triggerTarget:references,popperOptions:Object.assign({},optionalProps.popperOptions,{modifiers:[].concat((null==(_optionalProps$popper=optionalProps.popperOptions)?void 0:_optionalProps$popper.modifiers)||[],[applyStylesModifier])})})),originalShow=singleton.show;singleton.show=function(target){if(originalShow(),!currentTarget&&null==target)return prepareInstance(singleton,references[0]);if(!currentTarget||null!=target){if("number"==typeof target)return references[target]&&prepareInstance(singleton,references[target]);if(individualInstances.includes(target)){var ref=target.reference;return prepareInstance(singleton,ref)}return references.includes(target)?prepareInstance(singleton,target):void 0}},singleton.showNext=function(){var first=references[0];if(!currentTarget)return singleton.show(0);var index=references.indexOf(currentTarget);singleton.show(references[index+1]||first)},singleton.showPrevious=function(){var last=references[references.length-1];if(!currentTarget)return singleton.show(last);var index=references.indexOf(currentTarget),target=references[index-1]||last;singleton.show(target)};var originalSetProps=singleton.setProps;return singleton.setProps=function(props){overrides=props.overrides||overrides,originalSetProps(props)},singleton.setInstances=function(nextInstances){enableInstances(!0),interceptSetPropsCleanups.forEach(function(fn){return fn()}),individualInstances=nextInstances,enableInstances(!1),setReferences(),interceptSetProps(singleton),singleton.setProps({triggerTarget:references})},interceptSetPropsCleanups=interceptSetProps(singleton),singleton},exports$1.default=tippy2,exports$1.delegate=function(targets,props){errorWhen(!(props&&props.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a t
20ippy."].join(" "));var listeners=[],childTippyInstances=[],disabled=!1,target=props.target,nativeProps=removeProperties(props,["target"]),parentProps=Object.assign({},nativeProps,{trigger:"manual",touch:!1}),childProps=Object.assign({},nativeProps,{showOnCreate:!0}),returnValue=tippy2(targets,parentProps);function onTrigger(event){if(event.target&&!disabled){var targetNode=event.target.closest(target);if(targetNode){var trigger=targetNode.getAttribute("data-tippy-trigger")||props.trigger||defaultProps.trigger;if(!targetNode._tippy&&!("touchstart"===event.type&&"boolean"==typeof childProps.touch||"touchstart"!==event.type&&trigger.indexOf(BUBBLING_EVENTS_MAP[event.type])<0)){var instance=tippy2(targetNode,childProps);instance&&(childTippyInstances=childTippyInstances.concat(instance))}}}}function on(node,eventType,handler,options){void 0===options&&(options=!1),node.addEventListener(eventType,handler,options),listeners.push({node:node,eventType:eventType,handler:handler,options:options})}return normalizeToArray(returnValue).forEach(function(instance){var originalDestroy=instance.destroy,originalEnable=instance.enable,originalDisable=instance.disable;instance.destroy=function(shouldDestroyChildInstances){void 0===shouldDestroyChildInstances&&(shouldDestroyChildInstances=!0),shouldDestroyChildInstances&&childTippyInstances.forEach(function(instance2){instance2.destroy()}),childTippyInstances=[],listeners.forEach(function(_ref){var node=_ref.node,eventType=_ref.eventType,handler=_ref.handler,options=_ref.options;node.removeEventListener(eventType,handler,options)}),listeners=[],originalDestroy()},instance.enable=function(){originalEnable(),childTippyInstances.forEach(function(instance2){return instance2.enable()}),disabled=!1},instance.disable=function(){originalDisable(),childTippyInstances.forEach(function(instance2){return instance2.disable()}),disabled=!0},function(instance){var reference=instance.reference;on(reference,"touchstart",onTrigger,TOUCH_OPTIONS),on(reference,"mouseover",onTrigger),on(reference,"focusin",onTrigger),on(reference,"click",onTrigger)}(instance)}),returnValue},exports$1.followCursor=followCursor2,exports$1.hideAll=function(_temp){var _ref=void 0===_temp?{}:_temp,excludedReferenceOrInstance=_ref.exclude,duration=_ref.duration;mountedInstances.forEach(function(instance){var isExcluded=!1;if(excludedReferenceOrInstance&&(isExcluded=isReferenceElement(excludedReferenceOrInstance)?instance.reference===excludedReferenceOrInstance:instance.popper===excludedReferenceOrInstance.popper),!isExcluded){var originalDuration=instance.props.duration;instance.setProps({duration:duration}),instance.hide(),instance.state.isDestroyed||instance.setProps({duration:originalDuration})}})},exports$1.inlinePositioning=inlinePositioning,exports$1.roundArrow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',exports$1.sticky=sticky}),import_tippy2=__toModule(require_tippy_cjs()),import_tippy=__toModule(require_tippy_cjs());function Tooltip(Alpine){Alpine.magic("tooltip",el=>(content,config={})=>{const timeout=config.timeout;delete config.timeout;const instance=(0,import_tippy2.default)(el,{content:content,trigger:"manual",...config});instance.show(),setTimeout(()=>{instance.hide(),setTimeout(()=>instance.destroy(),config.duration||300)},timeout||2e3)}),Alpine.directive("tooltip",(el,{modifiers:modifiers,expression:expression},{evaluateLater:evaluateLater,effect:effect,cleanup:cleanup})=>{const config=modifiers.length>0?(modifiers=>{const config={plugins:[]},getModifierArgument=modifier=>modifiers[modifiers.indexOf(modifier)+1];if(modifiers.includes("animation")&&(config.animation=getModifierArgument("animation")),modifiers.includes("duration")&&(config.duration=parseInt(getModifierArgument("duration"))),modifiers.includes("delay")){const delay=getModifierArgument("delay");config.delay=delay.includes("-")?delay.split("-").map(n=>parseInt(n)):parseInt(delay)}if(modifiers.includes("cursor")){config.plugins.push(import_tippy.followCursor);const next=getModifierArgument("cursor");["x","initial"].includes(next)?config.followCursor="x"===next?"horizontal":"initial":config.followCursor=!0}modifiers.includes("on")&&(config.trigger=getModifierArgument("on")),modifiers.includes("arrowless")&&(config.arrow=!1),modifiers.includes("html")&&(config.allowHTML=!0),modifiers.includes("interactive")&&(config.interactive=!0),modifiers.includes("border")&&config.interactive&&(config.interactiveBorder=parseInt(getModifierArgument("border"))),modifiers.includes("debounce")&&config.interactive&&(config.interactiveDebounce=parseInt(getModifierArgument("debounce"))),modifiers.includes("max-width")&&(config.maxWidth=parseInt(getModifierArgument("max-width"))),modifiers.includes("theme")&&(config.theme=getModifierArgument("theme")),modifiers.includes("placement")&&(config.placement=getModifierArgument("placement"));const popperOptions={};return modifiers.includes("no-flip")&&(popperOptions.modifiers||=[],popperOptions.modifiers.push({name:"flip",enabled:!1})),config.popperOptions=popperOptions,config})(modifiers):{};el.__x_tippy||(el.__x_tippy=(0,import_tippy2.default)(el,config)),cleanup(()=>{el.__x_tippy&&(el.__x_tippy.destroy(),delete el.__x_tippy)});const enableTooltip=()=>el.__x_tippy.enable(),setupTooltip=content=>{content?(enableTooltip(),el.__x_tippy.setContent(content)):el.__x_tippy.disable()};if(modifiers.includes("raw"))setupTooltip(expression);else{const getContent=evaluateLater(expression);effect(()=>{getContent(content=>{"object"==typeof content?(el.__x_tippy.setProps(content),enableTooltip()):setupTooltip(content)})})}})}Tooltip.defaultProps=props=>(import_tippy2.default.setDefaultProps(props),Tooltip);var module_default=Tooltip;const analyticsHierarchy=["analyticsClickText","analyticsComponentType"];function _analyticsDirective(el,{modifiers:modifiers,expression:expression},{evaluateLater:evaluateLater,cleanup:cleanup}){const _delayedExpression=evaluateLater(expression||"{}"),_pushAnalyticsObject=(extra={})=>{_delayedExpression(result=>{const data=function(el){let element=el;const data={},findPageSlot=currentElement=>{let parent=currentElement.parentElement;for(;parent;){if(parent.hasAttribute("data-analytics-page-slot"))return parent;parent=parent.parentElement}return null},mapClickSlot=parentPageSlot=>{const slotElements=parentPageSlot.querySelectorAll("[data-analytics-click-slot]"),slotMap=new Map;let maxSlotValue=0;
20return Array.from(slotElements).forEach(element=>{const slotValue=element.getAttribute("data-analytics-click-slot").trim();if(""!==slotValue){const numericValue=parseInt(slotValue)||0;slotMap.set(element,numericValue),maxSlotValue=Math.max(maxSlotValue,numericValue)}}),Array.from(slotElements).forEach(element=>{""!==element.getAttribute("data-analytics-click-slot").trim()||slotMap.has(element)||(maxSlotValue++,slotMap.set(element,maxSlotValue))}),slotMap};for(analyticsHierarchy.forEach(attribute=>{data[attribute]=[]});element;)if(element.dataset){if(Object.entries(element.dataset).forEach(([key,value])=>{if(key.startsWith("analytics")){if("analyticsClickSlot"===key&&""===value.trim()){const container=findPageSlot(element);container&&(value=mapClickSlot(container).get(element).toString())}Array.isArray(data[key])?data[key].push(value):data[key]=value}}),data.hasOwnProperty("analyticsStopTraversal")){delete data.analyticsStopTraversal;break}if(data.analyticsNavigationType)break;element=element.parentElement}else element=element.parentElement;return analyticsHierarchy.forEach(attribute=>{data[attribute].length<1?delete data[attribute]:data[attribute]=data[attribute].reverse().join(" > ")}),Object.entries(data).forEach(([key,value])=>{const newKey=[key[9].toLowerCase(),key.substring(10)].join("");data[newKey]=value.slice(-80),data[newKey]=data[newKey].trim().replace(/[\r\n]+/g," "),delete data[key]}),"e_componentClick"!==data.event&&(delete data.itemTitle,"e_searchClick"!==data.event&&delete data.componentType),el.href&&(data.clickURL=/^https?:\/\//i.test(el.href)?el.href:`${window.location.origin}${el.href.startsWith("/")?el.href:`/${el.href}`}`),data}(el);globalThis.dataLayer=globalThis.dataLayer||[],globalThis.dataLayer.push({...result,...extra,...data})})},_clickListener=ev=>{_pushAnalyticsObject()},_analyticsListener=ev=>{_pushAnalyticsObject(ev.detail)};modifiers.includes("manual")||el.addEventListener("click",_clickListener),el.addEventListener("analytics",_analyticsListener),cleanup(()=>{modifiers.includes("manual")||el.removeEventListener("click",_clickListener),el.removeEventListener("analytics",_analyticsListener)})}function $forceNextTick(callback=()=>{}){requestAnimationFrame(()=>{requestAnimationFrame(callback)})}window.Alpine=module_default$5,window.AlpineMagicHelpersConfig={breakpoints:{sm:600,md:768,lg:1024,xl:1440,"2xl":1600}},module_default$5.plugin(module_default$4),module_default$5.plugin(module_default$3),module_default$5.plugin(module_default$2),module_default$5.plugin(module_default$1),module_default$5.plugin(module_default),module_default$5.plugin(function(Alpine){Alpine.directive("analytics",_analyticsDirective)}),module_default$5.magic("forceNextTick",()=>$forceNextTick),module_default$5.store("globalStore",{userLocation:null,setUserLocation(){this.userLocation||!1 in navigator||navigator.geolocation.getCurrentPosition(pos=>{pos&&(this.userLocation={lat:pos.coords.latitude,lng:pos.coords.longitude})})},getDistanceToUserInMiles(pos){return this.userLocation&&pos?((p1,p2)=>{const rad=x=>x*Math.PI/180,dLat=rad(p2.lat-p1.lat),dLong=rad(p2.lng-p1.lng),c=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(rad(p1.lat))*Math.cos(rad(p2.lat))*Math.sin(dLong/2)*Math.sin(dLong/2),distanceInMiles=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6378137*621371e-9;return Math.round(distanceInMiles)})(this.userLocation,pos):null}}),window.Alpine._datas=[],module_default$5.start()}();
21;
22document.addEventListener("DOMContentLoaded",function(){if(navigator.userAgent.indexOf("iPhone")>-1)document.querySelector("meta[name=viewport]").setAttribute("content","width=device-width, initial-scale=1, maximum-scale=1");});;
23/* @license GPL-2.0-or-later https://raw.githubusercontent.com/jquery-form/form/master/LICENSE */
24(function(factory){if(typeof define==='function'&&define.amd)define(['jquery'],factory);else if(typeof module==='object'&&module.exports)module.exports=function(root,jQuery){if(typeof jQuery==='undefined')if(typeof window!=='undefined')jQuery=require('jquery');else jQuery=require('jquery')(root);factory(jQuery);return jQuery;};else factory(jQuery);}(function($){'use strict';var rCRLF=/\r?\n/g;var feature={};feature.fileapi=$('<input type="file">').get(0).files!==undefined;feature.formdata=(typeof window.FormData!=='undefined');var hasProp=!!$.fn.prop;$.fn.attr2=function(){if(!hasProp)return this.attr.apply(this,arguments);var val=this.prop.apply(this,arguments);if((val&&val.jquery)||typeof val==='string')return val;return this.attr.apply(this,arguments);};$.fn.ajaxSubmit=function(options,data,dataType,onSuccess){if(!this.length){log('ajaxSubmit: ski
24pping submit process - no element selected');return this;}var method,action,url,isMsie,iframeSrc,$form=this;if(typeof options==='function')options={success:options};else if(typeof options==='string'||(options===false&&arguments.length>0)){options={'url':options,'data':data,'dataType':dataType};if(typeof onSuccess==='function')options.success=onSuccess;}else{if(typeof options==='undefined')options={};}method=options.method||options.type||this.attr2('method');action=options.url||this.attr2('action');url=(typeof action==='string')?action.trim():'';url=url||window.location.href||'';if(url)url=(url.match(/^([^#]+)/)||[])[1];isMsie=/(MSIE|Trident)/.test(navigator.userAgent||'');iframeSrc=(isMsie&&/^https/i.test(window.location.href||''))?'javascript:false':'about:blank';options=$.extend(true,{url,success:$.ajaxSettings.success,type:method||$.ajaxSettings.type,iframeSrc},options);var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}var traditional=options.traditional;if(typeof traditional==='undefined')traditional=$.ajaxSettings.traditional;var elements=[];var qx,a=this.formToArray(options.semantic,elements,options.filtering);if(options.data){var optionsData=typeof (options.data)==="function"?options.data(a):options.data;options.extraData=optionsData;qx=$.param(optionsData,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}var q=$.param(a,traditional);if(qx)q=(q?(q+'&'+qx):qx);if(options.type.toUpperCase()==='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}else options.data=q;var callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm(options.includeHidden);});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data,textStatus,jqXHR){var successArguments=arguments,fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(function(){oldSuccess.apply(this,successArguments);});});}else{if(options.success)if(Array.isArray(options.success))callbacks=callbacks.concat(options.success);else callbacks.push(options.success);}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++)callbacks[i].apply(context,[data,status,xhr||$form,$form]);};if(options.error){var oldError=options.error;options.error=function(xhr,status,error){var context=options.context||this;oldError.apply(context,[xhr,status,error,$form]);};}if(options.complete){var oldComplete=options.complete;options.complete=function(xhr,status){var context=options.context||this;oldComplete.apply(context,[xhr,status,$form]);};}var fileInputs=$('input[type=file]:enabled',this).filter(function(){return $(this).val()!=='';});var hasFileInputs=fileInputs.length>0;var mp='multipart/form-data';var multipart=($form.attr('enctype')===mp||$form.attr('encoding')===mp);var fileAPI=feature.fileapi&&feature.formdata;log('fileAPI :'+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame))if(options.closeKeepAlive)$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});else jqxhr=fileUploadIframe(a);else if((hasFileInputs||multipart)&&fileAPI)jqxhr=fileUploadXhr(a);else jqxhr=$.ajax(options);$form.removeData('jqxhr').data('jqxhr',jqxhr);for(var k=0;k<elements.length;k++)elements[k]=null;this.trigger('form-submit-notify',[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData,options.traditional).split('&');var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g,' ');part=serialized[i].split('=');result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}return result;}function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++)formdata.append(a[i].name,a[i].value);if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++)if(serializedData[i])formdata.append(serializedData[i][0],serializedData[i][1]);}options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||'POST'});if(options.uploadProgress)s.xhr=function(){var xhr=$.ajaxSettings.xhr();if(xhr.upload)xhr.upload.addEventListener('progress',function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable)percent=Math.ceil(position/total*100);options.uploadProgress(event,position,total,percent);},false);return xhr;};s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){if(options.formData)o.data=options.formData;else o.data=formdata;
24if(beforeSend)beforeSend.call(this,xhr,o);};return $.ajax(s);}function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var deferred=$.Deferred();deferred.abort=function(status){xhr.abort(status);};if(a)for(i=0;i<elements.length;i++){el=$(elements[i]);if(hasProp)el.prop('disabled',false);else el.removeAttr('disabled');}s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id='jqFormIO'+new Date().getTime();var ownerDocument=form.ownerDocument;var $body=$form.closest('body');if(s.iframeTarget){$io=$(s.iframeTarget,ownerDocument);n=$io.attr2('name');if(!n)$io.attr2('name',id);else id=n;}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />',ownerDocument);$io.css({position:'absolute',top:'-1000px',left:'-1000px'});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;try{if(io.contentWindow.document.execCommand)io.contentWindow.document.execCommand('Stop');}catch(ignore){}$io.attr('src',s.iframeSrc);xhr.error=e;if(s.error)s.error.call(s.context,xhr,e,status);if(g)$.event.trigger('ajaxError',[xhr,s,e]);if(s.complete)s.complete.call(s.context,xhr,e);}};g=s.global;if(g&&$.active++===0)$.event.trigger('ajaxStart');if(g)$.event.trigger('ajaxSend',[xhr,s]);if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global)$.active--;deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type==='image'){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=null;try{if(frame.contentWindow)doc=frame.contentWindow.document;}catch(err){log('cannot get iframe.contentWindow document: '+err);}if(doc)return doc;try{doc=frame.contentDocument?frame.contentDocument:frame.document;}catch(err){log('cannot get iframe.contentDocument: '+err);doc=frame.document;}return doc;}var csrf_token=$('meta[name=csrf-token]').attr('content');var csrf_param=$('meta[name=csrf-param]').attr('content');if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr2('target'),a=$form.attr2('action'),mp='multipart/form-data',et=$form.attr('enctype')||$form.attr('encoding')||mp;form.setAttribute('target',id);if(!method||/post/i.test(method))form.setAttribute('method','POST');if(a!==s.url)form.setAttribute('action',s.url);if(!s.skipEncodingOverride&&(!method||/post/i.test(method)))$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});if(s.timeout)timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state&&state.toLowerCase()==='uninitialized')setTimeout(checkState,50);}catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);if(timeoutHandle)clearTimeout(timeoutHandle);timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData)for(var n in s.extraData)if(s.extraData.hasOwnProperty(n))if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty('name')&&s.extraData[n].hasOwnProperty('value'))extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">',ownerDocument).val(s.extraData[n].value).appendTo(form)[0]);else extraInputs.push($('<input type="hidden" name="'+n+'">',ownerDocument).val(s.extraData[n]).appendTo(form)[0]);if(!s.iframeTarget)$io.appendTo($body);if(io.attachEvent)io.attachEvent('onload',cb);else io.addEventListener('load',cb,false);setTimeout(checkState,15);try{form.submit();}catch(err){var submitFn=document.createElement('form').submit;submitFn.apply(form);}}finally{form.setAttribute('action',a);form.setAttribute('enctype',et);if(t)form.setAttribute('target',t);else $form.removeAttr('target');$(extraInputs).remove();}}if(s.forceSync)doSubmit();else setTimeout(doSubmit,10);var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed)return;doc=getDoc(io);if(!doc){log('cannot access response document');e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');deferred.reject(xhr,'timeout');return;}if(e===SERVER_ABORT&&xhr){xhr.abort('server abort');deferred.reject(xhr,'error','server abort');return;}if(!doc||doc.location.href===s.iframeSrc)if(!timedOut)return;if(io.detachEvent)io.detachEvent('onload',cb);else io.removeEventListener('load',cb,false);var status='success',errMsg;
24try{if(timedOut)throw 'timeout';var isXml=s.dataType==='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML))if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return;}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml)s.dataType='xml';xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header.toLowerCase()];};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText;}var dt=(s.dataType||'').toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName('pre')[0];var b=doc.getElementsByTagName('body')[0];if(pre)xhr.responseText=pre.textContent?pre.textContent:pre.innerText;else{if(b)xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}else{if(dt==='xml'&&!xhr.responseXML&&xhr.responseText)xhr.responseXML=toXml(xhr.responseText);}try{data=httpData(xhr,dt,s);}catch(err){status='parsererror';xhr.error=errMsg=(err||status);}}catch(err){log('error caught: ',err);status='error';xhr.error=errMsg=(err||status);}if(xhr.aborted){log('upload aborted');status=null;}if(xhr.status)status=((xhr.status>=200&&xhr.status<300)||xhr.status===304)?'success':'error';if(status==='success'){if(s.success)s.success.call(s.context,data,'success',xhr);deferred.resolve(xhr.responseText,'success',xhr);if(g)$.event.trigger('ajaxSuccess',[xhr,s]);}else{if(status){if(typeof errMsg==='undefined')errMsg=xhr.statusText;if(s.error)s.error.call(s.context,xhr,status,errMsg);deferred.reject(xhr,'error',errMsg);if(g)$.event.trigger('ajaxError',[xhr,s,errMsg]);}}if(g)$.event.trigger('ajaxComplete',[xhr,s]);if(g&&!--$.active)$.event.trigger('ajaxStop');if(s.complete)s.complete.call(s.context,xhr,status);callbackProcessed=true;if(s.timeout)clearTimeout(timeoutHandle);setTimeout(function(){if(!s.iframeTarget)$io.remove();else $io.attr('src',s.iframeSrc);xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}else doc=(new DOMParser()).parseFromString(s,'text/xml');return (doc&&doc.documentElement&&doc.documentElement.nodeName!=='parsererror')?doc:null;};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=((type==='xml'||!type)&&ct.indexOf('xml')>=0),data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror')if($.error)$.error('parsererror');if(s&&s.dataFilter)data=s.dataFilter(data,type);if(typeof data==='string')if((type==='json'||!type)&&ct.indexOf('json')>=0)data=JSON.parse(data);else{if((type==='script'||!type)&&ct.indexOf('javascript')>=0)$.globalEval(data);}return data;};return deferred;}};$.fn.ajaxForm=function(options,data,dataType,onSuccess){if(typeof options==='string'||(options===false&&arguments.length>0)){options={'url':options,'data':data,'dataType':dataType};if(typeof onSuccess==='function')options.success=onSuccess;}options=options||{};options.delegation=options.delegation&&typeof $.fn.on==='function';if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this;}if(options.delegation){$(document).off('submit.form-plugin',this.selector,doAjaxSubmit).off('click.form-plugin',this.selector,captureSubmittingElement).on('submit.form-plugin',this.selector,options,doAjaxSubmit).on('click.form-plugin',this.selector,options,captureSubmittingElement);return this;}if(options.beforeFormUnbind)options.beforeFormUnbind(this,options);return this.ajaxFormUnbind().on('submit.form-plugin',options,doAjaxSubmit).on('click.form-plugin',options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(e.target).closest('form').ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!$el.is('[type=submit],[type=image]')){var t=$el.closest('[type=submit]');if(t.length===0)return;target=t[0];}var form=target.form;form.clk=target;if(target.type==='image')if(typeof e.offsetX!=='undefined'){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset==='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.off('submit.form-plugin click.form-plugin');};$.fn.formToArray=function(semantic,elements,filtering){var a=[];if(this.length===0)return a;var form=this[0];var formId=this.attr('id');var els=(semantic||typeof form.elements==='undefined')?form.getElementsByTagName('*'):form.elements;var els2;if(els)els=$.makeArray(els);if(formId&&(semantic||/(Edge|Trident)\//.test(navigator.userAgent))){els2=$(':input[form="'+formId+'"]').get();if(els2.length)els=(els||[]).concat(els2);}if(!els||!els.length)return a;
24if(typeof (filtering)==="function")els=$.map(els,filtering);var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n||el.disabled)continue;if(semantic&&form.clk&&el.type==='image'){if(form.clk===el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}continue;}v=$.fieldValue(el,true);if(v&&v.constructor===Array){if(elements)elements.push(el);for(j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]});}else if(feature.fileapi&&el.type==='file'){if(elements)elements.push(el);var files=el.files;if(files.length)for(j=0;j<files.length;j++)a.push({name:n,value:files[j],type:el.type});else a.push({name:n,value:'',type:el.type});}else{if(v!==null&&typeof v!=='undefined'){if(elements)elements.push(el);a.push({name:n,value:v,type:el.type,required:el.required});}}}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type==='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor===Array)for(var i=0,max=v.length;i<max;i++)a.push({name:n,value:v[i]});else{if(v!==null&&typeof v!=='undefined')a.push({name:this.name,value:v});}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v==='undefined'||(v.constructor===Array&&!v.length))continue;if(Array.isArray(v))val=val.concat(v);else val.push(v);}return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful==='undefined')successful=true;if(successful&&(!n||el.disabled||t==='reset'||t==='button'||(t==='checkbox'||t==='radio')&&!el.checked||(t==='submit'||t==='image')&&el.form&&el.form.clk!==el||tag==='select'&&el.selectedIndex===-1))return null;if(tag==='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t==='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected&&!op.disabled){var v=op.value;if(!v)v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;if(one)return v;a.push(v);}}return a;}return $(el).val().replace(rCRLF,'\r\n');};$.fn.clearForm=function(includeHidden){return this.each(function(){$('input,select,textarea',this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag==='textarea')this.value='';else if(t==='checkbox'||t==='radio')this.checked=false;else if(tag==='select')this.selectedIndex=-1;else if(t==='file')if(/MSIE/.test(navigator.userAgent))$(this).replaceWith($(this).clone(true));else $(this).val('');else{if(includeHidden)if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden==='string'&&$(this).is(includeHidden)))this.value='';}});};$.fn.resetForm=function(){return this.each(function(){var el=$(this);var tag=this.tagName.toLowerCase();switch(tag){case 'input':this.checked=this.defaultChecked;case 'textarea':this.value=this.defaultValue;return true;case 'option':case 'optgroup':var select=el.parents('select');if(select.length&&select[0].multiple)if(tag==='option')this.selected=this.defaultSelected;else el.find('option').resetForm();else select.resetForm();return true;case 'select':el.find('option').each(function(i){this.selected=this.defaultSelected;if(this.defaultSelected&&!el[0].multiple){el[0].selectedIndex=i;return false;}});return true;case 'label':var forEl=$(el.attr('for'));var list=el.find('input,select,textarea');if(forEl[0])list.unshift(forEl[0]);list.resetForm();return true;case 'form':if(typeof this.reset==='function'||(typeof this.reset==='object'&&!this.reset.nodeType))this.reset();return true;default:el.find('form,input,label,select,textarea').resetForm();return true;}}
24);};$.fn.enable=function(b){if(typeof b==='undefined')b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(typeof select==='undefined')select=true;return this.each(function(){var t=this.type;if(t==='checkbox'||t==='radio')this.checked=select;else{if(this.tagName.toLowerCase()==='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type==='select-one')$sel.find('option').selected(false);this.selected=select;}}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug)return;var msg='[jquery.form] '+Array.prototype.join.call(arguments,'');if(window.console&&window.console.log)window.console.log(msg);else{if(window.opera&&window.opera.postError)window.opera.postError(msg);}}}));;
25/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
26(function($,Drupal,drupalSettings){Drupal.Views={};Drupal.Views.parseQueryString=function(query){const args={};if(query.includes('?'))query=query.substring(query.indexOf('?')+1);let pair;const pairs=query.split('&');for(let i=0;i<pairs.length;i++){pair=pairs[i].split('=');if(pair[0]!=='q')if(pair[1])args[decodeURIComponent(pair[0].replace(/\+/g,' '))]=decodeURIComponent(pair[1].replace(/\+/g,' '));else args[decodeURIComponent(pair[0].replace(/\+/g,' '))]='';}return args;};Drupal.Views.parseViewArgs=function(href,viewPath){const returnObj={};const path=Drupal.Views.getPath(href);const viewHref=Drupal.url(viewPath).substring(drupalSettings.path.baseUrl.length);if(viewHref&&path.startsWith(`${viewHref}/`)){returnObj.view_args=decodeURIComponent(path.substring(viewHref.length+1,path.length));returnObj.view_path=path;}return returnObj;};Drupal.Views.pathPortion=function(href){const protocol=window.location.protocol;if(href.startsWith(protocol))href=href.substring(href.indexOf('/',protocol.length+2));return href;};Drupal.Views.getPath=function(href){href=Drupal.Views.pathPortion(href);href=href.substring(drupalSettings.path.baseUrl.length,href.length);if(href.startsWith('?q='))href=href.substring(3,href.length);const chars=['#','?','&'];for(let i=0;i<chars.length;i++)if(href.includes(chars[i]))href=href.substring(0,href.indexOf(chars[i]));return href;};})(jQuery,Drupal,drupalSettings);;
27(function($,Drupal,drupalSettings){Drupal.behaviors.ViewsAjaxView={};Drupal.behaviors.ViewsAjaxView.attach=function(context,settings){if(settings?.views?.ajaxViews){const {views:{ajaxViews}}=settings;Object.keys(ajaxViews||{}).forEach((i)=>{Drupal.views.instances[i]=new Drupal.views.ajaxView(ajaxViews[i]);});}};Drupal.behaviors.ViewsAjaxView.detach=(context,settings,trigger)=>{if(trigger==='unload')if(settings?.views?.ajaxViews){const {views:{ajaxViews}}=settings;Object.keys(ajaxViews||{}).forEach((i)=>{const selector=`.js-view-dom-id-${ajaxViews[i].view_dom_id}`;if($(selector,context).length){delete Drupal.views.instances[i];delete settings.views.ajaxViews[i];}});}};Drupal.views={};Drupal.views.instances={};Drupal.views.ajaxView=function(settings){const selector=`.js-view-dom-id-${settings.view_dom_id}`;this.$view=$(selector);this.$exposed_form=$(`form#views-exposed-form-${settings.view_name.replace(/_/g,'-')}-${settings.view_display_id.replace(/_/g,'-')}`);let ajaxPath=drupalSettings.views.ajax_path;if(ajaxPath.constructor.toString().includes('Array'))ajaxPath=ajaxPath[0];let queryString=window.location.search||'';if(queryString!==''){queryString=queryString.slice(1);const params=decodeURI(queryString).split('&').filter((param)=>{const [name,value]=param.split('=');return (this.$exposed_form.find(`input[name="${name}"]`).length===0&&!['page','reset','sort','order','q','render'].includes(name));});queryString=encodeURI(params.join('&'));if(queryString!=='')queryString=(ajaxPath.includes('?')?'&':'?')+queryString;}this.element_settings={url:ajaxPath+queryString,submit:settings,httpMethod:'GET',setClick:true,event:'click',selector,progress:{type:'fullscreen'}};this.settings=settings;once('exposed-form',this.$exposed_form).forEach(this.attachExposedFormAjax.bind(this));once('ajax-pager',this.$view.filter(this.filterNestedViews.bind(this))).forEac
27h(this.attachPagerAjax.bind(this));const selfSettings=$.extend({},this.element_settings,{event:'RefreshView',base:this.selector,httpMethod:'GET',element:this.$view.get(0)});this.refreshViewAjax=Drupal.ajax(selfSettings);};Drupal.views.ajaxView.prototype.attachExposedFormAjax=function(){const that=this;this.exposedFormAjax=[];$('input[type=submit], button[type=submit], input[type=image]',this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function(index){const selfSettings=$.extend({},that.element_settings,{base:$(this).attr('id'),element:this});that.exposedFormAjax[index]=Drupal.ajax(selfSettings);});};Drupal.views.ajaxView.prototype.filterNestedViews=function(){return !this.$view.parents('.view').length;};Drupal.views.ajaxView.prototype.attachPagerAjax=function(){this.$view.find('.js-pager__items a, th.views-field a, .attachment .views-summary a').each(this.attachPagerLinkAjax.bind(this));};Drupal.views.ajaxView.prototype.attachPagerLinkAjax=function(id,link){const $link=$(link);const viewData={};const href=$link.attr('href');$.extend(viewData,this.settings,Drupal.Views.parseQueryString(href),Drupal.Views.parseViewArgs(href,this.settings.view_base_path));const selfSettings=$.extend({},this.element_settings,{submit:viewData,base:false,element:link,httpMethod:'GET'});this.pagerAjax=Drupal.ajax(selfSettings);};Drupal.AjaxCommands.prototype.setBrowserUrl=(ajax,response)=>{if(ajax.element&&!ajax.element.closest('.ui-dialog-content'))window.history.replaceState(null,'',response.url);};})(jQuery,Drupal,drupalSettings);;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.