@vouchfor/embeds-legacy 4.0.3 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,7 +149,7 @@ ${e}`,dg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gg=Objec
149
149
  "playlist": {{ it._derived?.playlist }},
150
150
  "preview": {{ it._derived?.preview }},
151
151
  "captions": {{ it._derived?.captions }}
152
- }`}],root:"{{ it.outro?.questions?.items }}"}],system:!0}],meta:{frameRate:30,resolution:1080,transitionDuration:1/3},options:{videoFormat:"letterbox-video"},default:0,system:!0};async function Mg(){return new Image}const gl=Ut(async function(e,t=Mg){return e?new Promise((i,r)=>{t().then(n=>{n.onload=()=>{i(n)},n.onerror=o=>{r(o)},n.src=e})}):null});async function Io({element:s,meta:e,imageFactory:t},i,r){var n,o,a;let A={...s};const{node:l}=s;if((l==null?void 0:l.type)==="video"&&((n=l==null?void 0:l.value)!=null&&n.src||(o=l==null?void 0:l.value)!=null&&o.playlist)){const c=await i(l.value,e);let h;try{h=await gl(l.value.poster,t)}catch{h=null}A={...A,node:{...l,video:c,poster:h,meta:await r(l.value,c.node,e)}}}if((l==null?void 0:l.type)==="image"&&l.value){let c;try{c=await gl(l.value,t)}catch{c=null}A={...A,node:{...l,image:c}}}return A.node&&((a=s.node)!=null&&a.elements)&&(A.node.elements=await Promise.all(s.node.elements.map(c=>Io({element:c,meta:e,imageFactory:t},i,r)))),s.elements&&(A.elements=await Promise.all(s.elements.map(c=>Io({element:c,meta:e,imageFactory:t},i,r)))),A}async function Pg(){return document.createElement("canvas")}function Ws(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=Ws(t==null?void 0:t.elements);if(i)return i}}function Og(s,e){return s.reduce((t,i,r)=>[...t,i.map((n,o)=>n.map(({duration:a},A)=>r===s.length-1&&o===i.length-1&&A===n.length-1?a:a-e))],[])}function Ug(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function Gg(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function Yr(s){return s.flatMap(e=>Array.isArray(e)?e.flatMap(t=>t):e).reduce((e,t)=>e+t,0)}const Hg=Ut(()=>jA.loadYoga());ao.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${Gg(s)}"`:Ug(s)||Array.isArray(s)?JSON.stringify(s):s);const ns=(s,e,t)=>ao.render(s,e,ao.getConfig({autoEscape:!1,defaultFilter:"parse",...t}));async function os({data:s,template:e,burnCaptions:t=!1,debug:i=!1,imageFactory:r,canvasFactory:n=Pg},o,a,A){var l,c,h,u;const d=await Hg(),g=e??Ng;if(!((l=g.templates)!=null&&l.length))throw new Error(`No templates found for template instance: ${g.id}`);let f=g.templates.find(({version:W})=>W===mo);if(!f){const W=g.templates.map(({version:Y})=>`"${Y}"`).join(", ");console.warn(`Template renderer expects template version "${mo}" but got ${W}`),f=g.templates[g.templates.length-1]}const p=await Promise.all(f.content.map(async({scenes:W,root:Y})=>{const X={...g.options,...s,intro:g.intro,outro:g.outro};async function b(x,U){return Promise.all(W.map(async({layout:S,duration:R,data:T,derived:V,options:O})=>{var q,se,ce;const Ae={...X,_index:U,_root:x,_derived:await o({data:s,rootData:x,index:U})},ye=T?JSON.parse(await ns(T,Ae)):{},pe=V?JSON.parse(await ns(V,Ae)):{},Re=O?JSON.parse(await ns(O,Ae)):{},ne=R?parseFloat(await ns(R,Ae)):NaN,ue=(q=f.layouts.find(Be=>Be.name===S))==null?void 0:q.tree;if(!ue)throw new Error(`Layout tree "${S}" not found in template "${f.id}" layouts.`);const be=JSON.parse(await ns(ue,{...ye,...pe,...Re})),me=await Promise.all(be.flatMap(Be=>Io({element:Be,meta:g.meta,imageFactory:r},a,A))),he=Ws(me);return{duration:(isNaN(ne)?null:ne)??((se=he==null?void 0:he.meta)==null?void 0:se.duration)??0,captions:(ce=he==null?void 0:he.meta)==null?void 0:ce.captions,elements:me}}))}if(Y){const x=JSON.parse(await ns(Y,X));return Array.isArray(x)?Promise.all(x.map(async(U,S)=>b(U,S))):Promise.all([b(x,null)])}return Promise.all([b(s,null)])}));if(p.every(W=>W.every(Y=>Y.every(X=>{const b=Ws(X.elements);return!(b!=null&&b.value.src)&&!(b!=null&&b.value.playlist)})))){const W=p.flatMap(Y=>Y.flatMap(X=>X.map(b=>{const x=Ws(b.elements);return!(x!=null&&x.value.src)&&!(x!=null&&x.value.playlist)&&(x==null?void 0:x.value.id)}).filter(Boolean))).join(", ");throw new Error(`Video(s) with ID ${W} failed to load, video can not be processed`)}if(p.every(W=>W.every(Y=>Y.every(X=>X.duration<=0))))throw new Error("No scenes have any duration, video can not be processed");const Q=p.reduce((W,Y)=>{const X=Y.reduce((b,x)=>{const U=x.filter(S=>S.duration>0);return U.length>0?[...b,U]:b},[]);return X.length>0?[...W,X]:W},[]),C=((c=g.meta)==null?void 0:c.frameRate)??30,w=((h=g.meta)==null?void 0:h.resolution)??1080,B=((u=g.meta)==null?void 0:u.transitionDuration)??1/3,L=Og(Q,B),_=Yr(L),$=await Promise.all(Q.map((W,Y)=>{const X=Yr(L[Y]),b=Yr(L.slice(0,Y));return Promise.all(W.map((x,U)=>Promise.all(x.map(async({duration:S,captions:R,elements:T},V)=>{var O,q;const se=await n(),ce=await n(),Ae=await n(),ye=await n(),pe=Ws(T),Re=Yr([...L.slice(0,Y),...L[Y].slice(0,U),...L[Y][U].slice(0,V)]);return{draw:async({canvas:ue,currentTime:be})=>{const me=Math.max(0,be-b),he=Math.max(0,be-Re);await Eo({yoga:d,debug:i,canvas:ue,cropCanvas:se,posterCanvas:ye,letterboxCanvas:ce,elements:T,currentTime:be,contentTime:me,sceneTime:he,totalDuration:_,contentDuration:X,sceneDuration:S}),R&&t&&Dg({canvas:ue,dx:0,dy:0,dw:ue.width,dh:ue.height,vttCaptions:R,sceneTime:he+((pe==null?void 0:pe.meta.start)??0)})},duration:S,transitionCanvas:Ae,id:Fg(),start:Re,video:pe==null?void 0:pe.video,videoMeta:pe==null?void 0:pe.meta,audio:{duration:S,src:(O=pe==null?void 0:pe.value)==null?void 0:O.src,start:(q=pe==null?void 0:pe.meta)==null?void 0:q.start}}}))))})),F=$.flatMap(W=>W);return{scenes:F.flatMap(W=>W),sections:F,contents:$,frameRate:C,resolution:w,transitionDuration:B,fonts:f.fonts??[],duration:_}}const mo="3",$g={name:"@vouchfor/embeds-legacy",version:"4.0.3",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds-legacy.js",module:"dist/es/embeds-legacy.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds-legacy.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player-legacy build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js","test:watch":"yarn test --watch"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video-legacy":"^9.0.0","@vouchfor/media-player-legacy":"^5.0.3",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.0.4","@storybook/addon-links":"^8.0.4","@storybook/blocks":"^8.0.4","@storybook/web-components":"^8.0.4","@storybook/web-components-vite":"^8.0.4","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils-legacy":"^2.0.3","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.0.4",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function Yg(s){const{publicApiUrl:e}=Qr(s),t=Pi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Kg(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Pi()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Pi();return e||(e=Yg(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Pi(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Pi(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function Vg(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function Jg(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:$g.version,templateVersion:mo,...i}}const fl=1;class Wg{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=Vg(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Qr(this.host.env),{client:i,tab:r,request:n,visitor:o}=Kg(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":Jg(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+fl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+fl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Co={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof no<"u"&&no,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(b){return b&&DataView.prototype.isPrototypeOf(b)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(b){return b&&c.indexOf(Object.prototype.toString.call(b))>-1};function u(b){if(typeof b!="string"&&(b=String(b)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(b)||b==="")throw new TypeError('Invalid character in header field name: "'+b+'"');return b.toLowerCase()}function d(b){return typeof b!="string"&&(b=String(b)),b}function g(b){var x={next:function(){var U=b.shift();return{done:U===void 0,value:U}}};return A.iterable&&(x[Symbol.iterator]=function(){return x}),x}function f(b){this.map={},b instanceof f?b.forEach(function(x,U){this.append(U,x)},this):Array.isArray(b)?b.forEach(function(x){this.append(x[0],x[1])},this):b&&Object.getOwnPropertyNames(b).forEach(function(x){this.append(x,b[x])},this)}f.prototype.append=function(b,x){b=u(b),x=d(x);var U=this.map[b];this.map[b]=U?U+", "+x:x},f.prototype.delete=function(b){delete this.map[u(b)]},f.prototype.get=function(b){return b=u(b),this.has(b)?this.map[b]:null},f.prototype.has=function(b){return this.map.hasOwnProperty(u(b))},f.prototype.set=function(b,x){this.map[u(b)]=d(x)},f.prototype.forEach=function(b,x){for(var U in this.map)this.map.hasOwnProperty(U)&&b.call(x,this.map[U],U,this)},f.prototype.keys=function(){var b=[];return this.forEach(function(x,U){b.push(U)}),g(b)},f.prototype.values=function(){var b=[];return this.forEach(function(x){b.push(x)}),g(b)},f.prototype.entries=function(){var b=[];return this.forEach(function(x,U){b.push([U,x])}),g(b)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(b){if(b.bodyUsed)return Promise.reject(new TypeError("Already read"));b.bodyUsed=!0}function y(b){return new Promise(function(x,U){b.onload=function(){x(b.result)},b.onerror=function(){U(b.error)}})}function v(b){var x=new FileReader,U=y(x);return x.readAsArrayBuffer(b),U}function Q(b){var x=new FileReader,U=y(x);return x.readAsText(b),U}function C(b){for(var x=new Uint8Array(b),U=new Array(x.length),S=0;S<x.length;S++)U[S]=String.fromCharCode(x[S]);return U.join("")}function w(b){if(b.slice)return b.slice(0);var x=new Uint8Array(b.byteLength);return x.set(new Uint8Array(b)),x.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(b){this.bodyUsed=this.bodyUsed,this._bodyInit=b,b?typeof b=="string"?this._bodyText=b:A.blob&&Blob.prototype.isPrototypeOf(b)?this._bodyBlob=b:A.formData&&FormData.prototype.isPrototypeOf(b)?this._bodyFormData=b:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(b)?this._bodyText=b.toString():A.arrayBuffer&&A.blob&&l(b)?(this._bodyArrayBuffer=w(b.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(b)||h(b))?this._bodyArrayBuffer=w(b):this._bodyText=b=Object.prototype.toString.call(b):this._bodyText="",this.headers.get("content-type")||(typeof b=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(b)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var b=p(this);if(b)return b;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var b=p(this);return b||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(v)}),this.text=function(){var b=p(this);if(b)return b;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(b){var x=b.toUpperCase();return L.indexOf(x)>-1?x:b}function $(b,x){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');x=x||{};var U=x.body;if(b instanceof $){if(b.bodyUsed)throw new TypeError("Already read");this.url=b.url,this.credentials=b.credentials,x.headers||(this.headers=new f(b.headers)),this.method=b.method,this.mode=b.mode,this.signal=b.signal,!U&&b._bodyInit!=null&&(U=b._bodyInit,b.bodyUsed=!0)}else this.url=String(b);if(this.credentials=x.credentials||this.credentials||"same-origin",(x.headers||!this.headers)&&(this.headers=new f(x.headers)),this.method=_(x.method||this.method||"GET"),this.mode=x.mode||this.mode||null,this.signal=x.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(x.cache==="no-store"||x.cache==="no-cache")){var S=/([?&])_=[^&]*/;if(S.test(this.url))this.url=this.url.replace(S,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function F(b){var x=new FormData;return b.trim().split("&").forEach(function(U){if(U){var S=U.split("="),R=S.shift().replace(/\+/g," "),T=S.join("=").replace(/\+/g," ");x.append(decodeURIComponent(R),decodeURIComponent(T))}}),x}function H(b){var x=new f,U=b.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(S){return S.indexOf(`
152
+ }`}],root:"{{ it.outro?.questions?.items }}"}],system:!0}],meta:{frameRate:30,resolution:1080,transitionDuration:1/3},options:{videoFormat:"letterbox-video"},default:0,system:!0};async function Mg(){const s=new Image;return s.crossOrigin="anonymous",s}const gl=Ut(async function(e,t=Mg){return e?new Promise((i,r)=>{t().then(n=>{n.onload=()=>{i(n)},n.onerror=o=>{r(o)},n.src=e})}):null});async function Io({element:s,meta:e,imageFactory:t},i,r){var n,o,a;let A={...s};const{node:l}=s;if((l==null?void 0:l.type)==="video"&&((n=l==null?void 0:l.value)!=null&&n.src||(o=l==null?void 0:l.value)!=null&&o.playlist)){const c=await i(l.value,e);let h;try{h=await gl(l.value.poster,t)}catch{h=null}A={...A,node:{...l,video:c,poster:h,meta:await r(l.value,c.node,e)}}}if((l==null?void 0:l.type)==="image"&&l.value){let c;try{c=await gl(l.value,t)}catch{c=null}A={...A,node:{...l,image:c}}}return A.node&&((a=s.node)!=null&&a.elements)&&(A.node.elements=await Promise.all(s.node.elements.map(c=>Io({element:c,meta:e,imageFactory:t},i,r)))),s.elements&&(A.elements=await Promise.all(s.elements.map(c=>Io({element:c,meta:e,imageFactory:t},i,r)))),A}async function Pg(){return document.createElement("canvas")}function Ws(s=[]){var e;for(const t of s){if(((e=t==null?void 0:t.node)==null?void 0:e.type)==="video")return t.node;const i=Ws(t==null?void 0:t.elements);if(i)return i}}function Og(s,e){return s.reduce((t,i,r)=>[...t,i.map((n,o)=>n.map(({duration:a},A)=>r===s.length-1&&o===i.length-1&&A===n.length-1?a:a-e))],[])}function Ug(s){if(s===null||typeof s!="object")return!1;if(Object.getPrototypeOf(s)===null)return!0;let e=s;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(s)===e}function Gg(s){return s.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}function Yr(s){return s.flatMap(e=>Array.isArray(e)?e.flatMap(t=>t):e).reduce((e,t)=>e+t,0)}const Hg=Ut(()=>jA.loadYoga());ao.filters.define("parse",s=>typeof s>"u"?null:typeof s=="string"?`"${Gg(s)}"`:Ug(s)||Array.isArray(s)?JSON.stringify(s):s);const ns=(s,e,t)=>ao.render(s,e,ao.getConfig({autoEscape:!1,defaultFilter:"parse",...t}));async function os({data:s,template:e,burnCaptions:t=!1,debug:i=!1,imageFactory:r,canvasFactory:n=Pg},o,a,A){var l,c,h,u;const d=await Hg(),g=e??Ng;if(!((l=g.templates)!=null&&l.length))throw new Error(`No templates found for template instance: ${g.id}`);let f=g.templates.find(({version:W})=>W===mo);if(!f){const W=g.templates.map(({version:Y})=>`"${Y}"`).join(", ");console.warn(`Template renderer expects template version "${mo}" but got ${W}`),f=g.templates[g.templates.length-1]}const p=await Promise.all(f.content.map(async({scenes:W,root:Y})=>{const X={...g.options,...s,intro:g.intro,outro:g.outro};async function b(x,U){return Promise.all(W.map(async({layout:S,duration:R,data:T,derived:V,options:O})=>{var q,se,ce;const Ae={...X,_index:U,_root:x,_derived:await o({data:s,rootData:x,index:U})},ye=T?JSON.parse(await ns(T,Ae)):{},pe=V?JSON.parse(await ns(V,Ae)):{},Re=O?JSON.parse(await ns(O,Ae)):{},ne=R?parseFloat(await ns(R,Ae)):NaN,ue=(q=f.layouts.find(Be=>Be.name===S))==null?void 0:q.tree;if(!ue)throw new Error(`Layout tree "${S}" not found in template "${f.id}" layouts.`);const be=JSON.parse(await ns(ue,{...ye,...pe,...Re})),me=await Promise.all(be.flatMap(Be=>Io({element:Be,meta:g.meta,imageFactory:r},a,A))),he=Ws(me);return{duration:(isNaN(ne)?null:ne)??((se=he==null?void 0:he.meta)==null?void 0:se.duration)??0,captions:(ce=he==null?void 0:he.meta)==null?void 0:ce.captions,elements:me}}))}if(Y){const x=JSON.parse(await ns(Y,X));return Array.isArray(x)?Promise.all(x.map(async(U,S)=>b(U,S))):Promise.all([b(x,null)])}return Promise.all([b(s,null)])}));if(p.every(W=>W.every(Y=>Y.every(X=>{const b=Ws(X.elements);return!(b!=null&&b.value.src)&&!(b!=null&&b.value.playlist)})))){const W=p.flatMap(Y=>Y.flatMap(X=>X.map(b=>{const x=Ws(b.elements);return!(x!=null&&x.value.src)&&!(x!=null&&x.value.playlist)&&(x==null?void 0:x.value.id)}).filter(Boolean))).join(", ");throw new Error(`Video(s) with ID ${W} failed to load, video can not be processed`)}if(p.every(W=>W.every(Y=>Y.every(X=>X.duration<=0))))throw new Error("No scenes have any duration, video can not be processed");const Q=p.reduce((W,Y)=>{const X=Y.reduce((b,x)=>{const U=x.filter(S=>S.duration>0);return U.length>0?[...b,U]:b},[]);return X.length>0?[...W,X]:W},[]),C=((c=g.meta)==null?void 0:c.frameRate)??30,w=((h=g.meta)==null?void 0:h.resolution)??1080,B=((u=g.meta)==null?void 0:u.transitionDuration)??1/3,L=Og(Q,B),_=Yr(L),$=await Promise.all(Q.map((W,Y)=>{const X=Yr(L[Y]),b=Yr(L.slice(0,Y));return Promise.all(W.map((x,U)=>Promise.all(x.map(async({duration:S,captions:R,elements:T},V)=>{var O,q;const se=await n(),ce=await n(),Ae=await n(),ye=await n(),pe=Ws(T),Re=Yr([...L.slice(0,Y),...L[Y].slice(0,U),...L[Y][U].slice(0,V)]);return{draw:async({canvas:ue,currentTime:be})=>{const me=Math.max(0,be-b),he=Math.max(0,be-Re);await Eo({yoga:d,debug:i,canvas:ue,cropCanvas:se,posterCanvas:ye,letterboxCanvas:ce,elements:T,currentTime:be,contentTime:me,sceneTime:he,totalDuration:_,contentDuration:X,sceneDuration:S}),R&&t&&Dg({canvas:ue,dx:0,dy:0,dw:ue.width,dh:ue.height,vttCaptions:R,sceneTime:he+((pe==null?void 0:pe.meta.start)??0)})},duration:S,transitionCanvas:Ae,id:Fg(),start:Re,video:pe==null?void 0:pe.video,videoMeta:pe==null?void 0:pe.meta,audio:{duration:S,src:(O=pe==null?void 0:pe.value)==null?void 0:O.src,start:(q=pe==null?void 0:pe.meta)==null?void 0:q.start}}}))))})),F=$.flatMap(W=>W);return{scenes:F.flatMap(W=>W),sections:F,contents:$,frameRate:C,resolution:w,transitionDuration:B,fonts:f.fonts??[],duration:_}}const mo="3",$g={name:"@vouchfor/embeds-legacy",version:"4.1.0",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds-legacy.js",module:"dist/es/embeds-legacy.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds-legacy.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:deps":"yarn --cwd ../media-player-legacy build","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","build:package":"yarn build","build:storybook":"yarn prebuild && storybook build","generate:manifest":"wca src --outFile custom-elements.json",lint:"eslint . --quiet","lint:fix":"eslint . --fix","lint:staged":"lint-staged",prepublishOnly:"yarn build",size:"size-limit",storybook:"yarn prebuild && storybook dev -p 6007",prebuild:"yarn build:deps && yarn generate:manifest",test:"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:ci":"yarn test --config web-test-runner.ci.config.js","test:watch":"yarn test --watch"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.0","@vouchfor/canvas-video-legacy":"^9.0.0","@vouchfor/media-player-legacy":"^5.1.0",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4-fix.0","@open-wc/testing":"^4.0.0","@storybook/addon-essentials":"^8.5.8","@storybook/addon-links":"^8.5.8","@storybook/blocks":"^8.5.8","@storybook/web-components":"^8.5.8","@storybook/web-components-vite":"^8.5.8","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.6","@vouchfor/eslint-config":"^1.0.1","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils-legacy":"^2.0.3","@web/dev-server-esbuild":"^1.0.2","@web/test-runner":"^0.18.1","@web/test-runner-browserstack":"^0.7.1","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",glob:"^10.3.10","lint-staged":"^15.2.2",lit:"^3.1.2",lodash:"^4.17.21",react:"^18.2.0","react-dom":"^18.2.0","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^8.5.8",svgson:"^5.3.1",typescript:"^5.4.3",vite:"^5.2.2","vite-plugin-commonjs":"^0.10.1","vite-plugin-dts":"^3.7.3","web-component-analyzer":"^2.0.0"}};function Yg(s){const{publicApiUrl:e}=Qr(s),t=Pi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Kg(s){var n,o,a,A,l,c,h,u,d,g,f,p;if(typeof window>"u")return{client:null,tab:null,request:Pi()};let e=(o=(n=window.localStorage)==null?void 0:n.getItem)==null?void 0:o.call(n,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),i=(c=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:c.call(l,"vouch-uid-tab");const r=Pi();return e||(e=Yg(s),(u=(h=window.localStorage)==null?void 0:h.setItem)==null||u.call(h,"vouch-uid-visitor",e)),t||(t=Pi(),(g=(d=window.localStorage)==null?void 0:d.setItem)==null||g.call(d,"vouch-uid-client",t)),i||(i=Pi(),(p=(f=window.sessionStorage)==null?void 0:f.setItem)==null||p.call(f,"vouch-uid-tab",i)),{client:t,tab:i,request:r,visitor:e}}function Vg(s,e){return s&&"vouchId"in s?s.vouchId:(e==null?void 0:e.id)??null}function Jg(s="embedded_player"){var r,n;const[e,t]=((n=(r=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:r.split)==null?void 0:n.call(r,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[A]=a}}),{source:s,time:new Date,region:t,country:e,screenHeight:window.screen.height,screenWidth:window.screen.width,referrer:document.referrer,currentUrl:location.href,embedType:"media-player-embed",embedVersion:$g.version,templateVersion:mo,...i}}const fl=1;class Wg{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const r=Vg(i,this.host.vouch);!r||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,vouchId:r,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Qr(this.host.env),{client:i,tab:r,request:n,visitor:o}=Kg(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":r,"x-uid-request":n,"x-uid-visitor":o,"x-reporting-metadata":Jg(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+fl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]}},this._handleVouchLoaded=({detail:t})=>{t&&(this._hasLoaded[t]||(this._createTrackingEvent("VOUCH_LOADED",{vouchId:t}),this._hasLoaded[t]=!0))},this._handlePlay=()=>{this._hasPlayed||(this._createTrackingEvent("VIDEO_PLAYED",{streamStart:this.host.currentTime}),this._hasPlayed=!0)},this._handleVideoPlay=({detail:{id:t,key:i}})=>{this._answersViewed[i]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[i]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:i,node:r}})=>{var n,o;!this.host.paused&&t===((o=(n=this.host.scene)==null?void 0:n.video)==null?void 0:o.id)&&(this._currentlyPlayingVideo={id:t,key:i,node:r},this._streamLatestTime[i]=r.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=r.currentTime,this._streamLatestTime[i]=r.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+fl&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[i],streamEnd:this._streamLatestTime[i]}),delete this._streamStartTime[i],delete this._streamLatestTime[i]},this._pageUnloading=()=>{this._streamEnded(),this._sendTrackingEvent()},this._handleVisibilityChange=()=>{document.visibilityState==="hidden"&&this._pageUnloading()},this._handlePageHide=()=>{this._pageUnloading()},this.host=e,e.addController(this)}hostConnected(){requestAnimationFrame(()=>{var e,t,i,r;"onvisibilitychange"in document?document.addEventListener("visibilitychange",this._handleVisibilityChange):window.addEventListener("pagehide",this._handlePageHide),this.host.addEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.addEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.addEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.addEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,r;this._pageUnloading(),"onvisibilitychange"in document?document.removeEventListener("visibilitychange",this._handleVisibilityChange):window.removeEventListener("pagehide",this._handlePageHide),this.host.removeEventListener("vouch:loaded",this._handleVouchLoaded),(e=this.host.mediaPlayer)==null||e.removeEventListener("play",this._handlePlay),(t=this.host.mediaPlayer)==null||t.removeEventListener("video:play",this._handleVideoPlay),(i=this.host.mediaPlayer)==null||i.removeEventListener("video:pause",this._handleVideoPause),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Co={exports:{}};(function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof no<"u"&&no,i=function(){function n(){this.fetch=!1,this.DOMException=t.DOMException}return n.prototype=t,new n}();(function(n){(function(o){var a=typeof n<"u"&&n||typeof self<"u"&&self||typeof a<"u"&&a,A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(b){return b&&DataView.prototype.isPrototypeOf(b)}if(A.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(b){return b&&c.indexOf(Object.prototype.toString.call(b))>-1};function u(b){if(typeof b!="string"&&(b=String(b)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(b)||b==="")throw new TypeError('Invalid character in header field name: "'+b+'"');return b.toLowerCase()}function d(b){return typeof b!="string"&&(b=String(b)),b}function g(b){var x={next:function(){var U=b.shift();return{done:U===void 0,value:U}}};return A.iterable&&(x[Symbol.iterator]=function(){return x}),x}function f(b){this.map={},b instanceof f?b.forEach(function(x,U){this.append(U,x)},this):Array.isArray(b)?b.forEach(function(x){this.append(x[0],x[1])},this):b&&Object.getOwnPropertyNames(b).forEach(function(x){this.append(x,b[x])},this)}f.prototype.append=function(b,x){b=u(b),x=d(x);var U=this.map[b];this.map[b]=U?U+", "+x:x},f.prototype.delete=function(b){delete this.map[u(b)]},f.prototype.get=function(b){return b=u(b),this.has(b)?this.map[b]:null},f.prototype.has=function(b){return this.map.hasOwnProperty(u(b))},f.prototype.set=function(b,x){this.map[u(b)]=d(x)},f.prototype.forEach=function(b,x){for(var U in this.map)this.map.hasOwnProperty(U)&&b.call(x,this.map[U],U,this)},f.prototype.keys=function(){var b=[];return this.forEach(function(x,U){b.push(U)}),g(b)},f.prototype.values=function(){var b=[];return this.forEach(function(x){b.push(x)}),g(b)},f.prototype.entries=function(){var b=[];return this.forEach(function(x,U){b.push([U,x])}),g(b)},A.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);function p(b){if(b.bodyUsed)return Promise.reject(new TypeError("Already read"));b.bodyUsed=!0}function y(b){return new Promise(function(x,U){b.onload=function(){x(b.result)},b.onerror=function(){U(b.error)}})}function v(b){var x=new FileReader,U=y(x);return x.readAsArrayBuffer(b),U}function Q(b){var x=new FileReader,U=y(x);return x.readAsText(b),U}function C(b){for(var x=new Uint8Array(b),U=new Array(x.length),S=0;S<x.length;S++)U[S]=String.fromCharCode(x[S]);return U.join("")}function w(b){if(b.slice)return b.slice(0);var x=new Uint8Array(b.byteLength);return x.set(new Uint8Array(b)),x.buffer}function B(){return this.bodyUsed=!1,this._initBody=function(b){this.bodyUsed=this.bodyUsed,this._bodyInit=b,b?typeof b=="string"?this._bodyText=b:A.blob&&Blob.prototype.isPrototypeOf(b)?this._bodyBlob=b:A.formData&&FormData.prototype.isPrototypeOf(b)?this._bodyFormData=b:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(b)?this._bodyText=b.toString():A.arrayBuffer&&A.blob&&l(b)?(this._bodyArrayBuffer=w(b.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(b)||h(b))?this._bodyArrayBuffer=w(b):this._bodyText=b=Object.prototype.toString.call(b):this._bodyText="",this.headers.get("content-type")||(typeof b=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(b)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var b=p(this);if(b)return b;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var b=p(this);return b||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(v)}),this.text=function(){var b=p(this);if(b)return b;if(this._bodyBlob)return Q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(F)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(b){var x=b.toUpperCase();return L.indexOf(x)>-1?x:b}function $(b,x){if(!(this instanceof $))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');x=x||{};var U=x.body;if(b instanceof $){if(b.bodyUsed)throw new TypeError("Already read");this.url=b.url,this.credentials=b.credentials,x.headers||(this.headers=new f(b.headers)),this.method=b.method,this.mode=b.mode,this.signal=b.signal,!U&&b._bodyInit!=null&&(U=b._bodyInit,b.bodyUsed=!0)}else this.url=String(b);if(this.credentials=x.credentials||this.credentials||"same-origin",(x.headers||!this.headers)&&(this.headers=new f(x.headers)),this.method=_(x.method||this.method||"GET"),this.mode=x.mode||this.mode||null,this.signal=x.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(U),(this.method==="GET"||this.method==="HEAD")&&(x.cache==="no-store"||x.cache==="no-cache")){var S=/([?&])_=[^&]*/;if(S.test(this.url))this.url=this.url.replace(S,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}$.prototype.clone=function(){return new $(this,{body:this._bodyInit})};function F(b){var x=new FormData;return b.trim().split("&").forEach(function(U){if(U){var S=U.split("="),R=S.shift().replace(/\+/g," "),T=S.join("=").replace(/\+/g," ");x.append(decodeURIComponent(R),decodeURIComponent(T))}}),x}function H(b){var x=new f,U=b.replace(/\r?\n[\t ]+/g," ");return U.split("\r").map(function(S){return S.indexOf(`
153
153
  `)===0?S.substr(1,S.length):S}).forEach(function(S){var R=S.split(":"),T=R.shift().trim();if(T){var V=R.join(":").trim();x.append(T,V)}}),x}B.call($.prototype);function W(b,x){if(!(this instanceof W))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');x||(x={}),this.type="default",this.status=x.status===void 0?200:x.status,this.ok=this.status>=200&&this.status<300,this.statusText=x.statusText===void 0?"":""+x.statusText,this.headers=new f(x.headers),this.url=x.url||"",this._initBody(b)}B.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},W.error=function(){var b=new W(null,{status:0,statusText:""});return b.type="error",b};var Y=[301,302,303,307,308];W.redirect=function(b,x){if(Y.indexOf(x)===-1)throw new RangeError("Invalid status code");return new W(null,{status:x,headers:{location:b}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(x,U){this.message=x,this.name=U;var S=Error(x);this.stack=S.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function X(b,x){return new Promise(function(U,S){var R=new $(b,x);if(R.signal&&R.signal.aborted)return S(new o.DOMException("Aborted","AbortError"));var T=new XMLHttpRequest;function V(){T.abort()}T.onload=function(){var q={status:T.status,statusText:T.statusText,headers:H(T.getAllResponseHeaders()||"")};q.url="responseURL"in T?T.responseURL:q.headers.get("X-Request-URL");var se="response"in T?T.response:T.responseText;setTimeout(function(){U(new W(se,q))},0)},T.onerror=function(){setTimeout(function(){S(new TypeError("Network request failed"))},0)},T.ontimeout=function(){setTimeout(function(){S(new TypeError("Network request failed"))},0)},T.onabort=function(){setTimeout(function(){S(new o.DOMException("Aborted","AbortError"))},0)};function O(q){try{return q===""&&a.location.href?a.location.href:q}catch{return q}}T.open(R.method,O(R.url),!0),R.credentials==="include"?T.withCredentials=!0:R.credentials==="omit"&&(T.withCredentials=!1),"responseType"in T&&(A.blob?T.responseType="blob":A.arrayBuffer&&R.headers.get("Content-Type")&&R.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(T.responseType="arraybuffer")),x&&typeof x.headers=="object"&&!(x.headers instanceof f)?Object.getOwnPropertyNames(x.headers).forEach(function(q){T.setRequestHeader(q,d(x.headers[q]))}):R.headers.forEach(function(q,se){T.setRequestHeader(se,q)}),R.signal&&(R.signal.addEventListener("abort",V),T.onreadystatechange=function(){T.readyState===4&&R.signal.removeEventListener("abort",V)}),T.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return X.polyfill=!0,a.fetch||(a.fetch=X,a.Headers=f,a.Request=$,a.Response=W),o.Headers=f,o.Request=$,o.Response=W,o.fetch=X,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=t.fetch?t:i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,s.exports=e})(Co,Co.exports);var qg=Co.exports;const pl=Ag(qg);async function jg(s){var e;try{if((e=await pl(s,{method:"HEAD"}))!=null&&e.ok)return s}catch{return}}async function yo({sources:s}){let e=null;const t=s==null?void 0:s.filter(Boolean),i=t==null?void 0:t.find(n=>n.startsWith("blob:")),r=t==null?void 0:t.find(n=>!n.startsWith("http")&&!n.startsWith("blob:"));if(i||r)return i??r;if(t.length>0){const n=t.map(o=>jg(o));e=(await Promise.all(n)).find(Boolean)}return e}async function Xg(s){try{return(await pl(s)).text()}catch{return null}}async function zg(s){return s=s.trim(),s.startsWith("http")||s.startsWith("blob:")?Xg(s):s}const Zg=Ut(async({original:s,translation:e,originalLanguage:t="",translationLanguage:i=""},{language:r})=>{var n,o;const a={[(n=i==null?void 0:i.split("-"))==null?void 0:n[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:s},A=(r&&a[r])??s;return A?zg(A):null},{cacheKey:([s,{language:e}])=>JSON.stringify({...s,language:e})}),ef=Ut(async s=>{var e,t,i,r,n,o,a,A,l,c,h;const[u,d,g]=await Promise.all([yo({sources:[(t=(e=s==null?void 0:s.answer)==null?void 0:e.media)==null?void 0:t.video,(r=(i=s==null?void 0:s.answer)==null?void 0:i.media)==null?void 0:r.input]}),yo({sources:[(o=(n=s==null?void 0:s.answer)==null?void 0:n.media)==null?void 0:o.playlist]}),yo({sources:[((A=(a=s==null?void 0:s.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((h=(c=(l=s==null?void 0:s.answer)==null?void 0:l.media)==null?void 0:c.videos)==null?void 0:h.xs)]})]);return{src:u,playlist:d,preview:g}},{cacheKey:([s])=>{var e,t,i,r,n,o,a,A,l,c,h;return JSON.stringify({video:(t=(e=s==null?void 0:s.answer)==null?void 0:e.media)==null?void 0:t.video,input:(r=(i=s==null?void 0:s.answer)==null?void 0:i.media)==null?void 0:r.input,playlist:(o=(n=s==null?void 0:s.answer)==null?void 0:n.media)==null?void 0:o.playlist,preview:((A=(a=s==null?void 0:s.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((h=(c=(l=s==null?void 0:s.answer)==null?void 0:l.media)==null?void 0:c.videos)==null?void 0:h.xs)})}});function El(s){var e,t,i,r,n,o,a,A,l,c,h,u;const d=((t=(e=s==null?void 0:s.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((n=(r=(i=s==null?void 0:s.answer)==null?void 0:i.contact)==null?void 0:r.name)==null?void 0:n.trim())??"",g=((A=(a=(o=s==null?void 0:s.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:A.name)==="Not Supplied"?"":((u=(h=(c=(l=s==null?void 0:s.answer)==null?void 0:l.contact)==null?void 0:c.client)==null?void 0:h.name)==null?void 0:u.trim())??"",[f,p]=d.split(" ");return{name:d,firstName:f,lastName:p,companyName:g}}const tf=Ut(async(s,e,t)=>{var i,r,n;const o=(i=e==null?void 0:e.answer)==null?void 0:i.id;return((n=(r=s==null?void 0:s.questions)==null?void 0:r.items)==null?void 0:n.reduce((A,l)=>{var c;return((c=l==null?void 0:l.answer)==null?void 0:c.id)===o?(A??0)+1:A},0))<=1?o:`${o}-${t}`},{cacheKey:([s,e,t])=>{var i;return JSON.stringify({index:t,rootData:e,allQuestions:(i=s==null?void 0:s.questions)==null?void 0:i.items})}});async function vo({data:s,rootData:e,index:t},i){var r,n,o,a,A,l,c,h,u,d,g,f,p,y,v,Q,C,w,B,L,_,$,F;const[H,W,Y]=await Promise.all([tf(s,e,t),ef(e),Zg({original:((n=(r=e==null?void 0:e.answer)==null?void 0:r.media)==null?void 0:n.captions)??((a=(o=e==null?void 0:e.answer)==null?void 0:o.captions)==null?void 0:a.current),translation:((l=(A=e==null?void 0:e.answer)==null?void 0:A.media)==null?void 0:l.translation)??((h=(c=e==null?void 0:e.answer)==null?void 0:c.captions)==null?void 0:h.translation),originalLanguage:(d=(u=e==null?void 0:e.answer)==null?void 0:u.transcription)==null?void 0:d.language,translationLanguage:(p=(f=(g=e==null?void 0:e.answer)==null?void 0:g.transcription)==null?void 0:f.translation)==null?void 0:p.language},i)]),X=El(e);return{...W,...X,key:H,captions:Y,answerLabel:((y=e==null?void 0:e.answer)==null?void 0:y.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((w=(C=(Q=(v=s==null?void 0:s.questions)==null?void 0:v.items)==null?void 0:Q[t-1])==null?void 0:C.answer)==null?void 0:w.label)??((_=(L=(B=s==null?void 0:s.questions)==null?void 0:B.items)==null?void 0:L[t-1])==null?void 0:_.title)??null:null,isFirstInstanceOfName:t?((F=($=s==null?void 0:s.questions)==null?void 0:$.items)==null?void 0:F.findIndex(b=>El(b).name===X.name))===t:!0}}const Kr={af:"Afrikaans",sq:"Albanian",am:"Amharic",ar:"Arabic",hy:"Armenian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese (Simplified)",zh_TW:"Chinese (Traditional)",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fi:"Finnish",fr:"French",fa:"Farsi",tl:"Filipino",ka:"Georgian",de:"German",el:"Greek",gu:"Gujarati",ht:"Haitian Creole",ha:"Hausa",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",kn:"Kannada",kk:"Kazakh",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",ml:"Malayalam",mt:"Maltese",mr:"Marathi",mn:"Mongolian",no:"Norwegian",ps:"Pashto",pl:"Polish",pt:"Portuguese",pa:"Punjabi",ro:"Romanian",ru:"Russian",sr:"Serbian",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",sw:"Swahili",sv:"Swedish",ta:"Tamil",te:"Telugu",th:"Thai",tr:"Turkish",uk:"Ukrainian",ur:"Urdu",uz:"Uzbek",vi:"Vietnamese",cy:"Welsh"};function sf({data:s}){var e,t;return((t=(e=s==null?void 0:s.questions)==null?void 0:e.items)==null?void 0:t.reduce((i,r)=>{var n,o,a,A,l,c,h;const u=(a=(o=(n=r==null?void 0:r.answer)==null?void 0:n.transcription)==null?void 0:o.language)==null?void 0:a.split("-")[0],d=(h=(c=(l=(A=r==null?void 0:r.answer)==null?void 0:A.transcription)==null?void 0:l.translation)==null?void 0:c.language)==null?void 0:h.split("-")[0];return u&&Kr[u]&&!i.find(g=>g.value===u)&&i.push({value:u,label:Kr[u]}),d&&Kr[d]&&!i.find(g=>g.value===d)&&i.push({value:d,label:Kr[d]}),i},[]))??[]}/**
154
154
  * @license
155
155
  * Copyright 2018 Google LLC
@@ -187,7 +187,7 @@ ${e}`,dg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gg=Objec
187
187
  * @license
188
188
  * Copyright 2017 Google LLC
189
189
  * SPDX-License-Identifier: BSD-3-Clause
190
- */const Dh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Lh=rs(class extends Os{constructor(s){if(super(s),s.type!==ss.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const r=Xu(s),{values:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??(this.ut=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=Mi(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=Mi(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=Mi(r[h],n[g]),Ps(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=Mi(r[u],n[d]),Ps(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Dh(o,d,g),c=Dh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const y=Ps(s,r[h]);Mi(y,n[d]),A[d]=y}else A[d]=Mi(p,n[d]),Ps(s,r[h],p),r[f]=null;d++}else Jn(r[u]),u--;else Jn(r[h]),h++;for(;d<=g;){const f=Ps(s,A[g+1]);Mi(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&Jn(f)}return this.ut=o,ju(s,A),Ot}});var Rt="top",Ft="bottom",Nt="right",xt="left",Qa="auto",tr=[Rt,Ft,Nt,xt],ms="start",ir="end",LI="clippingParents",_h="viewport",sr="popper",_I="reference",kh=tr.reduce(function(s,e){return s.concat([e+"-"+ms,e+"-"+ir])},[]),Fh=[].concat(tr,[Qa]).reduce(function(s,e){return s.concat([e,e+"-"+ms,e+"-"+ir])},[]),kI="beforeRead",FI="read",NI="afterRead",MI="beforeMain",PI="main",OI="afterMain",UI="beforeWrite",GI="write",HI="afterWrite",$I=[kI,FI,NI,MI,PI,OI,UI,GI,HI];function ii(s){return s?(s.nodeName||"").toLowerCase():null}function Tt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Ji(s){var e=Tt(s).Element;return s instanceof e||s instanceof Element}function Mt(s){var e=Tt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Sa(s){if(typeof ShadowRoot>"u")return!1;var e=Tt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function YI(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Mt(n)||!ii(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function KI(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Mt(r)||!ii(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const Nh={name:"applyStyles",enabled:!0,phase:"write",fn:YI,effect:KI,requires:["computeStyles"]};function si(s){return s.split("-")[0]}var Wi=Math.max,Sn=Math.min,Cs=Math.round;function ba(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Mh(){return!/^((?!chrome|android).)*safari/i.test(ba())}function ys(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Mt(s)&&(r=s.offsetWidth>0&&Cs(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&Cs(i.height)/s.offsetHeight||1);var o=Ji(s)?Tt(s):window,a=o.visualViewport,A=!Mh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function wa(s){var e=ys(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Ph(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Sa(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ii(s){return Tt(s).getComputedStyle(s)}function VI(s){return["table","td","th"].indexOf(ii(s))>=0}function xi(s){return((Ji(s)?s.ownerDocument:s.document)||window.document).documentElement}function bn(s){return ii(s)==="html"?s:s.assignedSlot||s.parentNode||(Sa(s)?s.host:null)||xi(s)}function Oh(s){return!Mt(s)||Ii(s).position==="fixed"?null:s.offsetParent}function JI(s){var e=/firefox/i.test(ba()),t=/Trident/i.test(ba());if(t&&Mt(s)){var i=Ii(s);if(i.position==="fixed")return null}var r=bn(s);for(Sa(r)&&(r=r.host);Mt(r)&&["html","body"].indexOf(ii(r))<0;){var n=Ii(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function rr(s){for(var e=Tt(s),t=Oh(s);t&&VI(t)&&Ii(t).position==="static";)t=Oh(t);return t&&(ii(t)==="html"||ii(t)==="body"&&Ii(t).position==="static")?e:t||JI(s)||e}function Ra(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function nr(s,e,t){return Wi(s,Sn(e,t))}function WI(s,e,t){var i=nr(s,e,t);return i>t?t:i}function Uh(){return{top:0,right:0,bottom:0,left:0}}function Gh(s){return Object.assign({},Uh(),s)}function Hh(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var qI=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Gh(typeof e!="number"?e:Hh(e,tr))};function jI(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=si(t.placement),A=Ra(a),l=[xt,Nt].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=qI(r.padding,t),u=wa(n),d=A==="y"?Rt:xt,g=A==="y"?Ft:Nt,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],y=rr(n),v=y?A==="y"?y.clientHeight||0:y.clientWidth||0:0,Q=f/2-p/2,C=h[d],w=v-u[c]-h[g],B=v/2-u[c]/2+Q,L=nr(C,B,w),_=A;t.modifiersData[i]=(e={},e[_]=L,e.centerOffset=L-B,e)}}function XI(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Ph(e.elements.popper,r)&&(e.elements.arrow=r))}const zI={name:"arrow",enabled:!0,phase:"main",fn:jI,effect:XI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vs(s){return s.split("-")[1]}var ZI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function em(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:Cs(t*r)/r||0,y:Cs(i*r)/r||0}}function $h(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),Q=xt,C=Rt,w=window;if(l){var B=rr(t),L="clientHeight",_="clientWidth";if(B===Tt(t)&&(B=xi(t),Ii(B).position!=="static"&&a==="absolute"&&(L="scrollHeight",_="scrollWidth")),B=B,r===Rt||(r===xt||r===Nt)&&n===ir){C=Ft;var $=h&&B===w&&w.visualViewport?w.visualViewport.height:B[L];f-=$-i.height,f*=A?1:-1}if(r===xt||(r===Rt||r===Ft)&&n===ir){Q=Nt;var F=h&&B===w&&w.visualViewport?w.visualViewport.width:B[_];d-=F-i.width,d*=A?1:-1}}var H=Object.assign({position:a},l&&ZI),W=c===!0?em({x:d,y:f},Tt(t)):{x:d,y:f};if(d=W.x,f=W.y,A){var Y;return Object.assign({},H,(Y={},Y[C]=v?"0":"",Y[Q]=y?"0":"",Y.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",Y))}return Object.assign({},H,(e={},e[C]=v?f+"px":"",e[Q]=y?d+"px":"",e.transform="",e))}function tm(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:si(e.placement),variation:vs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$h(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$h(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const im={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tm,data:{}};var wn={passive:!0};function sm(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Tt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,wn)}),a&&A.addEventListener("resize",t.update,wn),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,wn)}),a&&A.removeEventListener("resize",t.update,wn)}}const rm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sm,data:{}};var nm={left:"right",right:"left",bottom:"top",top:"bottom"};function Rn(s){return s.replace(/left|right|bottom|top/g,function(e){return nm[e]})}var om={start:"end",end:"start"};function Yh(s){return s.replace(/start|end/g,function(e){return om[e]})}function xa(s){var e=Tt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Ta(s){return ys(xi(s)).left+xa(s).scrollLeft}function am(s,e){var t=Tt(s),i=xi(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=Mh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Ta(s),y:A}}function Am(s){var e,t=xi(s),i=xa(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=Wi(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Wi(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Ta(s),A=-i.scrollTop;return Ii(r||t).direction==="rtl"&&(a+=Wi(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Da(s){var e=Ii(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Kh(s){return["html","body","#document"].indexOf(ii(s))>=0?s.ownerDocument.body:Mt(s)&&Da(s)?s:Kh(bn(s))}function or(s,e){var t;e===void 0&&(e=[]);var i=Kh(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Tt(i),o=r?[n].concat(n.visualViewport||[],Da(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(or(bn(o)))}function La(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function lm(s,e){var t=ys(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function Vh(s,e,t){return e===_h?La(am(s,t)):Ji(e)?lm(e,t):La(Am(xi(s)))}function cm(s){var e=or(bn(s)),t=["absolute","fixed"].indexOf(Ii(s).position)>=0,i=t&&Mt(s)?rr(s):s;return Ji(i)?e.filter(function(r){return Ji(r)&&Ph(r,i)&&ii(r)!=="body"}):[]}function hm(s,e,t,i){var r=e==="clippingParents"?cm(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=Vh(s,l,i);return A.top=Wi(c.top,A.top),A.right=Sn(c.right,A.right),A.bottom=Sn(c.bottom,A.bottom),A.left=Wi(c.left,A.left),A},Vh(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Jh(s){var e=s.reference,t=s.element,i=s.placement,r=i?si(i):null,n=i?vs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case Rt:A={x:o,y:e.y-t.height};break;case Ft:A={x:o,y:e.y+e.height};break;case Nt:A={x:e.x+e.width,y:a};break;case xt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?Ra(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case ms:A[l]=A[l]-(e[c]/2-t[c]/2);break;case ir:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function ar(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?LI:a,l=t.rootBoundary,c=l===void 0?_h:l,h=t.elementContext,u=h===void 0?sr:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,y=Gh(typeof p!="number"?p:Hh(p,tr)),v=u===sr?_I:sr,Q=s.rects.popper,C=s.elements[g?v:u],w=hm(Ji(C)?C:C.contextElement||xi(s.elements.popper),A,c,o),B=ys(s.elements.reference),L=Jh({reference:B,element:Q,strategy:"absolute",placement:r}),_=La(Object.assign({},Q,L)),$=u===sr?_:B,F={top:w.top-$.top+y.top,bottom:$.bottom-w.bottom+y.bottom,left:w.left-$.left+y.left,right:$.right-w.right+y.right},H=s.modifiersData.offset;if(u===sr&&H){var W=H[r];Object.keys(F).forEach(function(Y){var X=[Nt,Ft].indexOf(Y)>=0?1:-1,b=[Rt,Ft].indexOf(Y)>=0?"y":"x";F[Y]+=W[b]*X})}return F}function um(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?Fh:A,c=vs(i),h=c?a?kh:kh.filter(function(g){return vs(g)===c}):tr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=ar(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[si(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function dm(s){if(si(s)===Qa)return[];var e=Rn(s);return[Yh(s),e,Yh(e)]}function gm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,y=si(p),v=y===p,Q=A||(v||!g?[Rn(p)]:dm(p)),C=[p].concat(Q).reduce(function(se,ce){return se.concat(si(ce)===Qa?um(e,{placement:ce,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ce)},[]),w=e.rects.reference,B=e.rects.popper,L=new Map,_=!0,$=C[0],F=0;F<C.length;F++){var H=C[F],W=si(H),Y=vs(H)===ms,X=[Rt,Ft].indexOf(W)>=0,b=X?"width":"height",x=ar(e,{placement:H,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=X?Y?Nt:xt:Y?Ft:Rt;w[b]>B[b]&&(U=Rn(U));var S=Rn(U),R=[];if(n&&R.push(x[W]<=0),a&&R.push(x[U]<=0,x[S]<=0),R.every(function(se){return se})){$=H,_=!1;break}L.set(H,R)}if(_)for(var T=g?3:1,V=function(ce){var Ae=C.find(function(ye){var pe=L.get(ye);if(pe)return pe.slice(0,ce).every(function(Re){return Re})});if(Ae)return $=Ae,"break"},O=T;O>0;O--){var q=V(O);if(q==="break")break}e.placement!==$&&(e.modifiersData[i]._skip=!0,e.placement=$,e.reset=!0)}}const fm={name:"flip",enabled:!0,phase:"main",fn:gm,requiresIfExists:["offset"],data:{_skip:!1}};function Wh(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function qh(s){return[Rt,Nt,Ft,xt].some(function(e){return s[e]>=0})}function pm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=ar(e,{elementContext:"reference"}),a=ar(e,{altBoundary:!0}),A=Wh(o,i),l=Wh(a,r,n),c=qh(A),h=qh(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const Em={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pm};function Im(s,e,t){var i=si(s),r=[xt,Rt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[xt,Nt].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function mm(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=Fh.reduce(function(c,h){return c[h]=Im(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const Cm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:mm};function ym(s){var e=s.state,t=s.name;e.modifiersData[t]=Jh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const vm={name:"popperOffsets",enabled:!0,phase:"read",fn:ym,data:{}};function Bm(s){return s==="x"?"y":"x"}function Qm(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=ar(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),y=si(e.placement),v=vs(e.placement),Q=!v,C=Ra(y),w=Bm(C),B=e.modifiersData.popperOffsets,L=e.rects.reference,_=e.rects.popper,$=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,F=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,W={x:0,y:0};if(B){if(n){var Y,X=C==="y"?Rt:xt,b=C==="y"?Ft:Nt,x=C==="y"?"height":"width",U=B[C],S=U+p[X],R=U-p[b],T=d?-_[x]/2:0,V=v===ms?L[x]:_[x],O=v===ms?-_[x]:-L[x],q=e.elements.arrow,se=d&&q?wa(q):{width:0,height:0},ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Uh(),Ae=ce[X],ye=ce[b],pe=nr(0,L[x],se[x]),Re=Q?L[x]/2-T-pe-Ae-F.mainAxis:V-pe-Ae-F.mainAxis,ne=Q?-L[x]/2+T+pe+ye+F.mainAxis:O+pe+ye+F.mainAxis,ue=e.elements.arrow&&rr(e.elements.arrow),be=ue?C==="y"?ue.clientTop||0:ue.clientLeft||0:0,me=(Y=H==null?void 0:H[C])!=null?Y:0,he=U+Re-me-be,te=U+ne-me,Be=nr(d?Sn(S,he):S,U,d?Wi(R,te):R);B[C]=Be,W[C]=Be-U}if(a){var Te,ke=C==="x"?Rt:xt,xe=C==="x"?Ft:Nt,Ne=B[w],Fe=w==="y"?"height":"width",ve=Ne+p[ke],Ke=Ne-p[xe],je=[Rt,xt].indexOf(y)!==-1,rt=(Te=H==null?void 0:H[w])!=null?Te:0,Ve=je?ve:Ne-L[Fe]-_[Fe]-rt+F.altAxis,Ct=je?Ne+L[Fe]+_[Fe]-rt-F.altAxis:Ke,mi=d&&je?WI(Ve,Ne,Ct):nr(d?Ve:ve,Ne,d?Ct:Ke);B[w]=mi,W[w]=mi-Ne}e.modifiersData[i]=W}}const Sm={name:"preventOverflow",enabled:!0,phase:"main",fn:Qm,requiresIfExists:["offset"]};function bm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function wm(s){return s===Tt(s)||!Mt(s)?xa(s):bm(s)}function Rm(s){var e=s.getBoundingClientRect(),t=Cs(e.width)/s.offsetWidth||1,i=Cs(e.height)/s.offsetHeight||1;return t!==1||i!==1}function xm(s,e,t){t===void 0&&(t=!1);var i=Mt(e),r=Mt(e)&&Rm(e),n=xi(e),o=ys(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((ii(e)!=="body"||Da(n))&&(a=wm(e)),Mt(e)?(A=ys(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Ta(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function Tm(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Dm(s){var e=Tm(s);return $I.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Lm(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function _m(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var jh={placement:"bottom",modifiers:[],strategy:"absolute"};function Xh(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function km(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?jh:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},jh,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(y){var v=typeof y=="function"?y(c.options):y;f(),c.options=Object.assign({},n,c.options,v),c.scrollParents={reference:Ji(a)?or(a):a.contextElement?or(a.contextElement):[],popper:or(A)};var Q=Dm(_m([].concat(i,c.options.modifiers)));return c.orderedModifiers=Q.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var y=c.elements,v=y.reference,Q=y.popper;if(Xh(v,Q)){c.rects={reference:xm(v,rr(Q),c.options.strategy==="fixed"),popper:wa(Q)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],B=w.fn,L=w.options,_=L===void 0?{}:L,$=w.name;typeof B=="function"&&(c=B({state:c,options:_,name:$,instance:d})||c)}}}},update:Lm(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!Xh(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var y=p.name,v=p.options,Q=v===void 0?{}:v,C=p.effect;if(typeof C=="function"){var w=C({state:c,name:y,instance:d,options:Q}),B=function(){};h.push(w||B)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Fm=[rm,vm,im,Nh,Cm,fm,Sm,zI,Em],Nm=km({defaultModifiers:Fm}),Mm="tippy-box",zh="tippy-content",Pm="tippy-backdrop",Zh="tippy-arrow",eu="tippy-svg-arrow",qi={passive:!0,capture:!0},tu=function(){return document.body};function _a(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function ka(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function iu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function su(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function Om(s){return s.split(/\s+/).filter(Boolean)}function Bs(s){return[].concat(s)}function ru(s,e){s.indexOf(e)===-1&&s.push(e)}function Um(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function Gm(s){return s.split("-")[0]}function xn(s){return[].slice.call(s)}function nu(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function Ar(){return document.createElement("div")}function Tn(s){return["Element","Fragment"].some(function(e){return ka(s,e)})}function Hm(s){return ka(s,"NodeList")}function $m(s){return ka(s,"MouseEvent")}function Ym(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function Km(s){return Tn(s)?[s]:Hm(s)?xn(s):Array.isArray(s)?s:xn(document.querySelectorAll(s))}function Fa(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function ou(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Vm(s){var e,t=Bs(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function Jm(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=Gm(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,y=n.left-t+d>A,v=t-n.right-g>A;return f||p||y||v})}function Na(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function au(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var ri={isTouch:!1},Au=0;function Wm(){ri.isTouch||(ri.isTouch=!0,window.performance&&document.addEventListener("mousemove",lu))}function lu(){var s=performance.now();s-Au<20&&(ri.isTouch=!1,document.removeEventListener("mousemove",lu)),Au=s}function qm(){var s=document.activeElement;if(Ym(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function jm(){document.addEventListener("touchstart",Wm,qi),window.addEventListener("blur",qm)}var Xm=typeof window<"u"&&typeof document<"u",zm=Xm?!!window.msCrypto:!1,Zm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},eC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Yt=Object.assign({appendTo:tu,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},Zm,eC),tC=Object.keys(Yt),iC=function(e){var t=Object.keys(e);t.forEach(function(i){Yt[i]=e[i]})};function cu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Yt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function sC(s,e){var t=e?Object.keys(cu(Object.assign({},Yt,{plugins:e}))):tC,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function hu(s,e){var t=Object.assign({},e,{content:iu(e.content,[s])},e.ignoreAttributes?{}:sC(s,e.plugins));return t.aria=Object.assign({},Yt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var rC=function(){return"innerHTML"};function Ma(s,e){s[rC()]=e}function uu(s){var e=Ar();return s===!0?e.className=Zh:(e.className=eu,Tn(s)?e.appendChild(s):Ma(e,s)),e}function du(s,e){Tn(e.content)?(Ma(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ma(s,e.content):s.textContent=e.content)}function Pa(s){var e=s.firstElementChild,t=xn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(zh)}),arrow:t.find(function(i){return i.classList.contains(Zh)||i.classList.contains(eu)}),backdrop:t.find(function(i){return i.classList.contains(Pm)})}}function gu(s){var e=Ar(),t=Ar();t.className=Mm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=Ar();i.className=zh,i.setAttribute("data-state","hidden"),du(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=Pa(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&du(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(uu(o.arrow))):A.appendChild(uu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}gu.$$tippy=!0;var nC=1,Dn=[],Oa=[];function oC(s,e){var t=hu(s,Object.assign({},Yt,cu(nu(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=su(he,t.interactiveDebounce),f,p=nC++,y=null,v=Um(t.plugins),Q={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:Ar(),popperInstance:y,props:t,state:Q,plugins:v,clearDelayTimeouts:Ve,setProps:Ct,setContent:mi,show:yt,hide:ai,hideWithInteractivity:Ai,enable:je,disable:rt,unmount:li,destroy:ft};if(!t.render)return C;var w=t.render(C),B=w.popper,L=w.onUpdate;B.setAttribute("data-tippy-root",""),B.id="tippy-"+C.id,C.popper=B,s._tippy=C,B._tippy=C;var _=v.map(function(K){return K.fn(C)}),$=s.hasAttribute("aria-expanded");return ue(),T(),U(),S("onCreate",[C]),t.showOnCreate&&ve(),B.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),B.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&X().addEventListener("mousemove",g)}),C;function F(){var K=C.props.touch;return Array.isArray(K)?K:[K,0]}function H(){return F()[0]==="hold"}function W(){var K;return!!((K=C.props.render)!=null&&K.$$tippy)}function Y(){return f||s}function X(){var K=Y().parentNode;return K?Vm(K):document}function b(){return Pa(B)}function x(K){return C.state.isMounted&&!C.state.isVisible||ri.isTouch||c&&c.type==="focus"?0:_a(C.props.delay,K?0:1,Yt.delay)}function U(K){K===void 0&&(K=!1),B.style.pointerEvents=C.props.interactive&&!K?"":"none",B.style.zIndex=""+C.props.zIndex}function S(K,le,fe){if(fe===void 0&&(fe=!0),_.forEach(function(we){we[K]&&we[K].apply(we,le)}),fe){var De;(De=C.props)[K].apply(De,le)}}function R(){var K=C.props.aria;if(K.content){var le="aria-"+K.content,fe=B.id,De=Bs(C.props.triggerTarget||s);De.forEach(function(we){var Je=we.getAttribute(le);if(C.state.isVisible)we.setAttribute(le,Je?Je+" "+fe:fe);else{var vt=Je&&Je.replace(fe,"").trim();vt?we.setAttribute(le,vt):we.removeAttribute(le)}})}}function T(){if(!($||!C.props.aria.expanded)){var K=Bs(C.props.triggerTarget||s);K.forEach(function(le){C.props.interactive?le.setAttribute("aria-expanded",C.state.isVisible&&le===Y()?"true":"false"):le.removeAttribute("aria-expanded")})}}function V(){X().removeEventListener("mousemove",g),Dn=Dn.filter(function(K){return K!==g})}function O(K){if(!(ri.isTouch&&(A||K.type==="mousedown"))){var le=K.composedPath&&K.composedPath()[0]||K.target;if(!(C.props.interactive&&au(B,le))){if(Bs(C.props.triggerTarget||s).some(function(fe){return au(fe,le)})){if(ri.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else S("onClickOutside",[C,K]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function q(){A=!0}function se(){A=!1}function ce(){var K=X();K.addEventListener("mousedown",O,!0),K.addEventListener("touchend",O,qi),K.addEventListener("touchstart",se,qi),K.addEventListener("touchmove",q,qi)}function Ae(){var K=X();K.removeEventListener("mousedown",O,!0),K.removeEventListener("touchend",O,qi),K.removeEventListener("touchstart",se,qi),K.removeEventListener("touchmove",q,qi)}function ye(K,le){Re(K,function(){!C.state.isVisible&&B.parentNode&&B.parentNode.contains(B)&&le()})}function pe(K,le){Re(K,le)}function Re(K,le){var fe=b().box;function De(we){we.target===fe&&(Na(fe,"remove",De),le())}if(K===0)return le();Na(fe,"remove",h),Na(fe,"add",De),h=De}function ne(K,le,fe){fe===void 0&&(fe=!1);var De=Bs(C.props.triggerTarget||s);De.forEach(function(we){we.addEventListener(K,le,fe),d.push({node:we,eventType:K,handler:le,options:fe})})}function ue(){H()&&(ne("touchstart",me,{passive:!0}),ne("touchend",te,{passive:!0})),Om(C.props.trigger).forEach(function(K){if(K!=="manual")switch(ne(K,me),K){case"mouseenter":ne("mouseleave",te);break;case"focus":ne(zm?"focusout":"blur",Be);break;case"focusin":ne("focusout",Be);break}})}function be(){d.forEach(function(K){var le=K.node,fe=K.eventType,De=K.handler,we=K.options;le.removeEventListener(fe,De,we)}),d=[]}function me(K){var le,fe=!1;if(!(!C.state.isEnabled||Te(K)||a)){var De=((le=c)==null?void 0:le.type)==="focus";c=K,f=K.currentTarget,T(),!C.state.isVisible&&$m(K)&&Dn.forEach(function(we){return we(K)}),K.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?fe=!0:ve(K),K.type==="click"&&(o=!fe),fe&&!De&&Ke(K)}}function he(K){var le=K.target,fe=Y().contains(le)||B.contains(le);if(!(K.type==="mousemove"&&fe)){var De=Fe().concat(B).map(function(we){var Je,vt=we._tippy,Bt=(Je=vt.popperInstance)==null?void 0:Je.state;return Bt?{popperRect:we.getBoundingClientRect(),popperState:Bt,props:t}:null}).filter(Boolean);Jm(De,K)&&(V(),Ke(K))}}function te(K){var le=Te(K)||C.props.trigger.indexOf("click")>=0&&o;if(!le){if(C.props.interactive){C.hideWithInteractivity(K);return}Ke(K)}}function Be(K){C.props.trigger.indexOf("focusin")<0&&K.target!==Y()||C.props.interactive&&K.relatedTarget&&B.contains(K.relatedTarget)||Ke(K)}function Te(K){return ri.isTouch?H()!==K.type.indexOf("touch")>=0:!1}function ke(){xe();var K=C.props,le=K.popperOptions,fe=K.placement,De=K.offset,we=K.getReferenceClientRect,Je=K.moveTransition,vt=W()?Pa(B).arrow:null,Bt=we?{getBoundingClientRect:we,contextElement:we.contextElement||Y()}:s,ws={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Rs){var Li=Rs.state;if(W()){var gr=b(),fr=gr.box;["placement","reference-hidden","escaped"].forEach(function(xs){xs==="placement"?fr.setAttribute("data-placement",Li.placement):Li.attributes.popper["data-popper-"+xs]?fr.setAttribute("data-"+xs,""):fr.removeAttribute("data-"+xs)}),Li.attributes.popper={}}}},Qt=[{name:"offset",options:{offset:De}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Je}},ws];W()&&vt&&Qt.push({name:"arrow",options:{element:vt,padding:3}}),Qt.push.apply(Qt,(le==null?void 0:le.modifiers)||[]),C.popperInstance=Nm(Bt,B,Object.assign({},le,{placement:fe,onFirstUpdate:u,modifiers:Qt}))}function xe(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ne(){var K=C.props.appendTo,le,fe=Y();C.props.interactive&&K===tu||K==="parent"?le=fe.parentNode:le=iu(K,[fe]),le.contains(B)||le.appendChild(B),C.state.isMounted=!0,ke()}function Fe(){return xn(B.querySelectorAll("[data-tippy-root]"))}function ve(K){C.clearDelayTimeouts(),K&&S("onTrigger",[C,K]),ce();var le=x(!0),fe=F(),De=fe[0],we=fe[1];ri.isTouch&&De==="hold"&&we&&(le=we),le?i=setTimeout(function(){C.show()},le):C.show()}function Ke(K){if(C.clearDelayTimeouts(),S("onUntrigger",[C,K]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(K.type)>=0&&o)){var le=x(!1);le?r=setTimeout(function(){C.state.isVisible&&C.hide()},le):n=requestAnimationFrame(function(){C.hide()})}}function je(){C.state.isEnabled=!0}function rt(){C.hide(),C.state.isEnabled=!1}function Ve(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function Ct(K){if(!C.state.isDestroyed){S("onBeforeUpdate",[C,K]),be();var le=C.props,fe=hu(s,Object.assign({},le,nu(K),{ignoreAttributes:!0}));C.props=fe,ue(),le.interactiveDebounce!==fe.interactiveDebounce&&(V(),g=su(he,fe.interactiveDebounce)),le.triggerTarget&&!fe.triggerTarget?Bs(le.triggerTarget).forEach(function(De){De.removeAttribute("aria-expanded")}):fe.triggerTarget&&s.removeAttribute("aria-expanded"),T(),U(),L&&L(le,fe),C.popperInstance&&(ke(),Fe().forEach(function(De){requestAnimationFrame(De._tippy.popperInstance.forceUpdate)})),S("onAfterUpdate",[C,K])}}function mi(K){C.setProps({content:K})}function yt(){var K=C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,De=ri.isTouch&&!C.props.touch,we=_a(C.props.duration,0,Yt.duration);if(!(K||le||fe||De)&&!Y().hasAttribute("disabled")&&(S("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,W()&&(B.style.visibility="visible"),U(),ce(),C.state.isMounted||(B.style.transition="none"),W()){var Je=b(),vt=Je.box,Bt=Je.content;Fa([vt,Bt],0)}u=function(){var Qt;if(!(!C.state.isVisible||l)){if(l=!0,B.offsetHeight,B.style.transition=C.props.moveTransition,W()&&C.props.animation){var Zi=b(),Rs=Zi.box,Li=Zi.content;Fa([Rs,Li],we),ou([Rs,Li],"visible")}R(),T(),ru(Oa,C),(Qt=C.popperInstance)==null||Qt.forceUpdate(),S("onMount",[C]),C.props.animation&&W()&&pe(we,function(){C.state.isShown=!0,S("onShown",[C])})}},Ne()}}function ai(){var K=!C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,De=_a(C.props.duration,1,Yt.duration);if(!(K||le||fe)&&(S("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,W()&&(B.style.visibility="hidden"),V(),Ae(),U(!0),W()){var we=b(),Je=we.box,vt=we.content;C.props.animation&&(Fa([Je,vt],De),ou([Je,vt],"hidden"))}R(),T(),C.props.animation?W()&&ye(De,C.unmount):C.unmount()}}function Ai(K){X().addEventListener("mousemove",g),ru(Dn,g),g(K)}function li(){C.state.isVisible&&C.hide(),C.state.isMounted&&(xe(),Fe().forEach(function(K){K._tippy.unmount()}),B.parentNode&&B.parentNode.removeChild(B),Oa=Oa.filter(function(K){return K!==C}),C.state.isMounted=!1,S("onHidden",[C]))}function ft(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),be(),delete s._tippy,C.state.isDestroyed=!0,S("onDestroy",[C]))}}function ji(s,e){e===void 0&&(e={});var t=Yt.plugins.concat(e.plugins||[]);jm();var i=Object.assign({},e,{plugins:t}),r=Km(s),n=r.reduce(function(o,a){var A=a&&oC(a,i);return A&&o.push(A),o},[]);return Tn(s)?n[0]:n}ji.defaultProps=Yt,ji.setDefaultProps=iC,ji.currentInput=ri,Object.assign({},Nh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),ji.setDefaultProps({render:gu});class aC{constructor(){this.currentTask=null,this.nextTask=null}async enqueue(e){this.nextTask=async()=>{await e()},this.currentTask||this.runNext()}async runNext(){if(!this.nextTask){this.currentTask=null;return}const e=this.nextTask;this.nextTask=null,this.currentTask=e().finally(()=>this.runNext())}}class ni extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const AC=5;function lC(s,e){const t=s.map(({id:r})=>r).join("|"),i=e.map(({id:r})=>r).join("|");return t===i}class cC{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._limitedQueue=new aC,this._canvas=pt(),this._controls=pt(),this.host=e}set activeScenes(e){lC(e,this._activeScenes)||(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:h,duration:u})=>a>=h&&a<h+u))??[];const A=a!==this.currentTime;this._currentTime=a,this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:h})=>a>=h-AC&&a<h))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const l=this.activeScenes[0],c=ul((n=l==null?void 0:l.videoMeta)==null?void 0:n.captions);this.caption=((o=c.find(({start:h,end:u})=>{var d;const g=a-l.start+(((d=l.videoMeta)==null?void 0:d.start)??0);return h&&u&&g>=Hr(h)&&g<=Hr(u)}))==null?void 0:o.text)??"",A&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a})),this.draw(a)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return Et(this._canvas)}controls(){return Et(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,d):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new ni("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){this._limitedQueue.enqueue(async()=>{var t,i;this.host.sceneConfig&&this._canvas.value&&await((i=(t=this.host).compilation)==null?void 0:i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))})}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function hC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function uC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function dC(s,e){return new Promise(t=>{const{id:i,key:r,duration:n}=e,o=document.createElement("video");o.playsInline=!0,o.muted=!0,o.loop=!1,o.src=s;let a=!1;if(o.startLoadOnce=()=>{a||(o.preload="auto",o.load(),a=!0)},n)o.preload="none",t({id:i,key:r,hls:null,config:e,node:o});else{o.preload="metadata";const A=async()=>{t({id:i,key:r,hls:null,config:e,node:o}),o.removeEventListener("loadedmetadata",A)};o.addEventListener("loadedmetadata",A)}})}function gC(s,e){return new Promise(t=>{const{id:i,key:r}=e,n=document.createElement("video");n.playsInline=!0,n.muted=!0,n.loop=!1;let o=!1;const a=new Ei({autoStartLoad:!0,xhrSetup:A=>{const{open:l}=A,c=s.split("?")[1];A.open=function(h,u,d){u.toString().includes("?")||(u+="?"+c),!(!o&&u.toString().includes(".ts"))&&l.apply(this,[h,u,d])}}});a.on(Ei.Events.LEVEL_LOADED,async()=>{o||a==null||a.stopLoad(),t({id:i,key:r,hls:a,config:e,node:n})}),a.loadSource(s),a.attachMedia(n),a.startLoadOnce=(A=-1,l)=>{if(a&&!o){const c=a==null?void 0:a.levels.findIndex(h=>Math.min(h.height,h.width)===l);o=!0,a.startLevel=a.firstLevel,a.startLoad(A),a.currentLevel=c!==-1?c:a.firstLevel}}})}function Ua(s){const{src:e,playlist:t}=s;return t&&!hC()&&Ei.isSupported()?gC(t,s):dC(e,s)}async function fu(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const fC=Ut(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let pC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._delayProcessing=(t=100)=>{const i=new AbortController,r=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(r)}),i},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Ut(async t=>{const{id:i,key:r}=t,n=await Ua(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Ut(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await fu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([t])=>JSON.stringify(t)}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.activeScenes.map(o=>{var a;return(a=o.videoMeta)==null?void 0:a.id}).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new ni(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new vr(this.host,async([e,t,i,r,n,o,a])=>{var A;const l=this._delayProcessing();try{let c=null;if(this.host._errors=[],this.host._languages=this.host.languageResolver({data:e}),(!n||!this.host._languages.find(({value:h})=>n===h))&&(this.host._language=(A=this.host._languages[0])==null?void 0:A.value),i||e){if(i){let f=null;if(r)try{f=await(await fetch(r,{method:"GET"})).text()}catch(v){const Q=new ni("Track failed to fetch",v);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:Q,message:Q.message}))}const y={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:f}}}]}};try{this.scenes=await os({data:y,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(v){try{this.scenes=await os({data:y,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(Q){throw new ni("Fatal source template error",Q,!0)}c=new ni("Source template error",v)}}else try{this.scenes=await os({data:e,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(f){try{this.scenes=await os({data:e,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(p){throw new ni("Fatal data template error",p,!0)}c=new ni("Data template error",f)}Object.keys(this.videos).forEach(f=>{this.scenes.scenes.find(({video:p})=>f===(p==null?void 0:p.key))||this._videos[f].node.pause()});const[h,u,d]=this.scenes.scenes.reduce((f,{video:p,videoMeta:y,start:v,duration:Q})=>{var C;p&&(f[0][p.key]=p,y&&(f[1][p.key]=y));const w=(p==null?void 0:p.key)??`${v}-${Q}`,B=this._getBufferSegments({key:w,node:p==null?void 0:p.node,duration:this.scenes.duration});return f[2][w]={initialised:!p,waiting:!!p,...this.videoState[w],buffered:p?B:(C=this.videoState[w])==null?void 0:C.buffered},f},[{},{},{}]);this.videos=h,this.videoMeta=u,this.videoState={...this.videoState,...d},(await Promise.all(this.scenes.fonts.map(f=>fC(f)))).forEach(f=>{document.fonts.add(f)}),this.duration=this.scenes.duration,this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}c&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message})),this.host.dispatchEvent(new CustomEvent("scenesupdate",{detail:this.scenes,bubbles:!0,composed:!0}))}catch(c){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,language:this.host.language,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.language,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function EC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function IC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Ga=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],mC={id:"captions",event:"captions:click",label:"Closed Captions"},CC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},pu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},yC={id:"playbackRate",label:"Playback playbackRate",subItems:pu};class vC extends vA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==ss.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),Ot}}const Ha=rs(vC),BC=DI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=ll.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),oi={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},QC={colors:oi,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${oi["dark-100"]}`,medium:`0 .125rem .625rem ${oi["dark-100"]}`,large:`0 .25rem 1rem ${oi["dark-50"]}`,xl:`.25rem .25rem 1rem ${oi["dark-250"]}`,xxl:`0 .25rem 2rem ${oi["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${oi["dark-250"]}`,toolbar:`0 -.625rem .625rem ${oi["dark-50"]}`,text:`0 0 .25rem ${oi["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:oi["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},Eu=RI(QC,{delimiter:"-"}),SC=Object.keys(Eu).map(s=>Ts(`:host { --${s}: ${Eu[s]}; }`)),Pe=(s=>{const e=class extends s{firstUpdated(){BC().forEach(({load:n,font:o})=>{document.fonts.add(o),n&&o.load()})}};return e.styles=[(s==null?void 0:s.styles)??[],SC,ht`
190
+ */const Dh=(s,e,t)=>{const i=new Map;for(let r=e;r<=t;r++)i.set(s[r],r);return i},Lh=rs(class extends Os{constructor(s){if(super(s),s.type!==ss.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const a of s)r[o]=i?i(a,o):o,n[o]=t(a,o),o++;return{values:n,keys:r}}render(s,e,t){return this.dt(s,e,t).values}update(s,[e,t,i]){const r=Xu(s),{values:n,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,n;const a=this.ut??(this.ut=[]),A=[];let l,c,h=0,u=r.length-1,d=0,g=n.length-1;for(;h<=u&&d<=g;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(a[h]===o[d])A[d]=Mi(r[h],n[d]),h++,d++;else if(a[u]===o[g])A[g]=Mi(r[u],n[g]),u--,g--;else if(a[h]===o[g])A[g]=Mi(r[h],n[g]),Ps(s,A[g+1],r[h]),h++,g--;else if(a[u]===o[d])A[d]=Mi(r[u],n[d]),Ps(s,r[h],r[u]),u--,d++;else if(l===void 0&&(l=Dh(o,d,g),c=Dh(a,h,u)),l.has(a[h]))if(l.has(a[u])){const f=c.get(o[d]),p=f!==void 0?r[f]:null;if(p===null){const y=Ps(s,r[h]);Mi(y,n[d]),A[d]=y}else A[d]=Mi(p,n[d]),Ps(s,r[h],p),r[f]=null;d++}else Jn(r[u]),u--;else Jn(r[h]),h++;for(;d<=g;){const f=Ps(s,A[g+1]);Mi(f,n[d]),A[d++]=f}for(;h<=u;){const f=r[h++];f!==null&&Jn(f)}return this.ut=o,ju(s,A),Ot}});var Rt="top",Ft="bottom",Nt="right",xt="left",Qa="auto",tr=[Rt,Ft,Nt,xt],ms="start",ir="end",LI="clippingParents",_h="viewport",sr="popper",_I="reference",kh=tr.reduce(function(s,e){return s.concat([e+"-"+ms,e+"-"+ir])},[]),Fh=[].concat(tr,[Qa]).reduce(function(s,e){return s.concat([e,e+"-"+ms,e+"-"+ir])},[]),kI="beforeRead",FI="read",NI="afterRead",MI="beforeMain",PI="main",OI="afterMain",UI="beforeWrite",GI="write",HI="afterWrite",$I=[kI,FI,NI,MI,PI,OI,UI,GI,HI];function ii(s){return s?(s.nodeName||"").toLowerCase():null}function Tt(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function Ji(s){var e=Tt(s).Element;return s instanceof e||s instanceof Element}function Mt(s){var e=Tt(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function Sa(s){if(typeof ShadowRoot>"u")return!1;var e=Tt(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function YI(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},n=e.elements[t];!Mt(n)||!ii(n)||(Object.assign(n.style,i),Object.keys(r).forEach(function(o){var a=r[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function KI(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],n=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(A,l){return A[l]="",A},{});!Mt(r)||!ii(r)||(Object.assign(r.style,a),Object.keys(n).forEach(function(A){r.removeAttribute(A)}))})}}const Nh={name:"applyStyles",enabled:!0,phase:"write",fn:YI,effect:KI,requires:["computeStyles"]};function si(s){return s.split("-")[0]}var Wi=Math.max,Sn=Math.min,Cs=Math.round;function ba(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Mh(){return!/^((?!chrome|android).)*safari/i.test(ba())}function ys(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),r=1,n=1;e&&Mt(s)&&(r=s.offsetWidth>0&&Cs(i.width)/s.offsetWidth||1,n=s.offsetHeight>0&&Cs(i.height)/s.offsetHeight||1);var o=Ji(s)?Tt(s):window,a=o.visualViewport,A=!Mh()&&t,l=(i.left+(A&&a?a.offsetLeft:0))/r,c=(i.top+(A&&a?a.offsetTop:0))/n,h=i.width/r,u=i.height/n;return{width:h,height:u,top:c,right:l+h,bottom:c+u,left:l,x:l,y:c}}function wa(s){var e=ys(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function Ph(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&Sa(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Ii(s){return Tt(s).getComputedStyle(s)}function VI(s){return["table","td","th"].indexOf(ii(s))>=0}function xi(s){return((Ji(s)?s.ownerDocument:s.document)||window.document).documentElement}function bn(s){return ii(s)==="html"?s:s.assignedSlot||s.parentNode||(Sa(s)?s.host:null)||xi(s)}function Oh(s){return!Mt(s)||Ii(s).position==="fixed"?null:s.offsetParent}function JI(s){var e=/firefox/i.test(ba()),t=/Trident/i.test(ba());if(t&&Mt(s)){var i=Ii(s);if(i.position==="fixed")return null}var r=bn(s);for(Sa(r)&&(r=r.host);Mt(r)&&["html","body"].indexOf(ii(r))<0;){var n=Ii(r);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return r;r=r.parentNode}return null}function rr(s){for(var e=Tt(s),t=Oh(s);t&&VI(t)&&Ii(t).position==="static";)t=Oh(t);return t&&(ii(t)==="html"||ii(t)==="body"&&Ii(t).position==="static")?e:t||JI(s)||e}function Ra(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function nr(s,e,t){return Wi(s,Sn(e,t))}function WI(s,e,t){var i=nr(s,e,t);return i>t?t:i}function Uh(){return{top:0,right:0,bottom:0,left:0}}function Gh(s){return Object.assign({},Uh(),s)}function Hh(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var qI=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Gh(typeof e!="number"?e:Hh(e,tr))};function jI(s){var e,t=s.state,i=s.name,r=s.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=si(t.placement),A=Ra(a),l=[xt,Nt].indexOf(a)>=0,c=l?"height":"width";if(!(!n||!o)){var h=qI(r.padding,t),u=wa(n),d=A==="y"?Rt:xt,g=A==="y"?Ft:Nt,f=t.rects.reference[c]+t.rects.reference[A]-o[A]-t.rects.popper[c],p=o[A]-t.rects.reference[A],y=rr(n),v=y?A==="y"?y.clientHeight||0:y.clientWidth||0:0,Q=f/2-p/2,C=h[d],w=v-u[c]-h[g],B=v/2-u[c]/2+Q,L=nr(C,B,w),_=A;t.modifiersData[i]=(e={},e[_]=L,e.centerOffset=L-B,e)}}function XI(s){var e=s.state,t=s.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||Ph(e.elements.popper,r)&&(e.elements.arrow=r))}const zI={name:"arrow",enabled:!0,phase:"main",fn:jI,effect:XI,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vs(s){return s.split("-")[1]}var ZI={top:"auto",right:"auto",bottom:"auto",left:"auto"};function em(s,e){var t=s.x,i=s.y,r=e.devicePixelRatio||1;return{x:Cs(t*r)/r||0,y:Cs(i*r)/r||0}}function $h(s){var e,t=s.popper,i=s.popperRect,r=s.placement,n=s.variation,o=s.offsets,a=s.position,A=s.gpuAcceleration,l=s.adaptive,c=s.roundOffsets,h=s.isFixed,u=o.x,d=u===void 0?0:u,g=o.y,f=g===void 0?0:g,p=typeof c=="function"?c({x:d,y:f}):{x:d,y:f};d=p.x,f=p.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),Q=xt,C=Rt,w=window;if(l){var B=rr(t),L="clientHeight",_="clientWidth";if(B===Tt(t)&&(B=xi(t),Ii(B).position!=="static"&&a==="absolute"&&(L="scrollHeight",_="scrollWidth")),B=B,r===Rt||(r===xt||r===Nt)&&n===ir){C=Ft;var $=h&&B===w&&w.visualViewport?w.visualViewport.height:B[L];f-=$-i.height,f*=A?1:-1}if(r===xt||(r===Rt||r===Ft)&&n===ir){Q=Nt;var F=h&&B===w&&w.visualViewport?w.visualViewport.width:B[_];d-=F-i.width,d*=A?1:-1}}var H=Object.assign({position:a},l&&ZI),W=c===!0?em({x:d,y:f},Tt(t)):{x:d,y:f};if(d=W.x,f=W.y,A){var Y;return Object.assign({},H,(Y={},Y[C]=v?"0":"",Y[Q]=y?"0":"",Y.transform=(w.devicePixelRatio||1)<=1?"translate("+d+"px, "+f+"px)":"translate3d("+d+"px, "+f+"px, 0)",Y))}return Object.assign({},H,(e={},e[C]=v?f+"px":"",e[Q]=y?d+"px":"",e.transform="",e))}function tm(s){var e=s.state,t=s.options,i=t.gpuAcceleration,r=i===void 0?!0:i,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,A=a===void 0?!0:a,l={placement:si(e.placement),variation:vs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$h(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:A})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$h(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const im={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tm,data:{}};var wn={passive:!0};function sm(s){var e=s.state,t=s.instance,i=s.options,r=i.scroll,n=r===void 0?!0:r,o=i.resize,a=o===void 0?!0:o,A=Tt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&l.forEach(function(c){c.addEventListener("scroll",t.update,wn)}),a&&A.addEventListener("resize",t.update,wn),function(){n&&l.forEach(function(c){c.removeEventListener("scroll",t.update,wn)}),a&&A.removeEventListener("resize",t.update,wn)}}const rm={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sm,data:{}};var nm={left:"right",right:"left",bottom:"top",top:"bottom"};function Rn(s){return s.replace(/left|right|bottom|top/g,function(e){return nm[e]})}var om={start:"end",end:"start"};function Yh(s){return s.replace(/start|end/g,function(e){return om[e]})}function xa(s){var e=Tt(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Ta(s){return ys(xi(s)).left+xa(s).scrollLeft}function am(s,e){var t=Tt(s),i=xi(s),r=t.visualViewport,n=i.clientWidth,o=i.clientHeight,a=0,A=0;if(r){n=r.width,o=r.height;var l=Mh();(l||!l&&e==="fixed")&&(a=r.offsetLeft,A=r.offsetTop)}return{width:n,height:o,x:a+Ta(s),y:A}}function Am(s){var e,t=xi(s),i=xa(s),r=(e=s.ownerDocument)==null?void 0:e.body,n=Wi(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Wi(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Ta(s),A=-i.scrollTop;return Ii(r||t).direction==="rtl"&&(a+=Wi(t.clientWidth,r?r.clientWidth:0)-n),{width:n,height:o,x:a,y:A}}function Da(s){var e=Ii(s),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Kh(s){return["html","body","#document"].indexOf(ii(s))>=0?s.ownerDocument.body:Mt(s)&&Da(s)?s:Kh(bn(s))}function or(s,e){var t;e===void 0&&(e=[]);var i=Kh(s),r=i===((t=s.ownerDocument)==null?void 0:t.body),n=Tt(i),o=r?[n].concat(n.visualViewport||[],Da(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(or(bn(o)))}function La(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function lm(s,e){var t=ys(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function Vh(s,e,t){return e===_h?La(am(s,t)):Ji(e)?lm(e,t):La(Am(xi(s)))}function cm(s){var e=or(bn(s)),t=["absolute","fixed"].indexOf(Ii(s).position)>=0,i=t&&Mt(s)?rr(s):s;return Ji(i)?e.filter(function(r){return Ji(r)&&Ph(r,i)&&ii(r)!=="body"}):[]}function hm(s,e,t,i){var r=e==="clippingParents"?cm(s):[].concat(e),n=[].concat(r,[t]),o=n[0],a=n.reduce(function(A,l){var c=Vh(s,l,i);return A.top=Wi(c.top,A.top),A.right=Sn(c.right,A.right),A.bottom=Sn(c.bottom,A.bottom),A.left=Wi(c.left,A.left),A},Vh(s,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Jh(s){var e=s.reference,t=s.element,i=s.placement,r=i?si(i):null,n=i?vs(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,A;switch(r){case Rt:A={x:o,y:e.y-t.height};break;case Ft:A={x:o,y:e.y+e.height};break;case Nt:A={x:e.x+e.width,y:a};break;case xt:A={x:e.x-t.width,y:a};break;default:A={x:e.x,y:e.y}}var l=r?Ra(r):null;if(l!=null){var c=l==="y"?"height":"width";switch(n){case ms:A[l]=A[l]-(e[c]/2-t[c]/2);break;case ir:A[l]=A[l]+(e[c]/2-t[c]/2);break}}return A}function ar(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?s.placement:i,n=t.strategy,o=n===void 0?s.strategy:n,a=t.boundary,A=a===void 0?LI:a,l=t.rootBoundary,c=l===void 0?_h:l,h=t.elementContext,u=h===void 0?sr:h,d=t.altBoundary,g=d===void 0?!1:d,f=t.padding,p=f===void 0?0:f,y=Gh(typeof p!="number"?p:Hh(p,tr)),v=u===sr?_I:sr,Q=s.rects.popper,C=s.elements[g?v:u],w=hm(Ji(C)?C:C.contextElement||xi(s.elements.popper),A,c,o),B=ys(s.elements.reference),L=Jh({reference:B,element:Q,strategy:"absolute",placement:r}),_=La(Object.assign({},Q,L)),$=u===sr?_:B,F={top:w.top-$.top+y.top,bottom:$.bottom-w.bottom+y.bottom,left:w.left-$.left+y.left,right:$.right-w.right+y.right},H=s.modifiersData.offset;if(u===sr&&H){var W=H[r];Object.keys(F).forEach(function(Y){var X=[Nt,Ft].indexOf(Y)>=0?1:-1,b=[Rt,Ft].indexOf(Y)>=0?"y":"x";F[Y]+=W[b]*X})}return F}function um(s,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,A=t.allowedAutoPlacements,l=A===void 0?Fh:A,c=vs(i),h=c?a?kh:kh.filter(function(g){return vs(g)===c}):tr,u=h.filter(function(g){return l.indexOf(g)>=0});u.length===0&&(u=h);var d=u.reduce(function(g,f){return g[f]=ar(s,{placement:f,boundary:r,rootBoundary:n,padding:o})[si(f)],g},{});return Object.keys(d).sort(function(g,f){return d[g]-d[f]})}function dm(s){if(si(s)===Qa)return[];var e=Rn(s);return[Yh(s),e,Yh(e)]}function gm(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!0:o,A=t.fallbackPlacements,l=t.padding,c=t.boundary,h=t.rootBoundary,u=t.altBoundary,d=t.flipVariations,g=d===void 0?!0:d,f=t.allowedAutoPlacements,p=e.options.placement,y=si(p),v=y===p,Q=A||(v||!g?[Rn(p)]:dm(p)),C=[p].concat(Q).reduce(function(se,ce){return se.concat(si(ce)===Qa?um(e,{placement:ce,boundary:c,rootBoundary:h,padding:l,flipVariations:g,allowedAutoPlacements:f}):ce)},[]),w=e.rects.reference,B=e.rects.popper,L=new Map,_=!0,$=C[0],F=0;F<C.length;F++){var H=C[F],W=si(H),Y=vs(H)===ms,X=[Rt,Ft].indexOf(W)>=0,b=X?"width":"height",x=ar(e,{placement:H,boundary:c,rootBoundary:h,altBoundary:u,padding:l}),U=X?Y?Nt:xt:Y?Ft:Rt;w[b]>B[b]&&(U=Rn(U));var S=Rn(U),R=[];if(n&&R.push(x[W]<=0),a&&R.push(x[U]<=0,x[S]<=0),R.every(function(se){return se})){$=H,_=!1;break}L.set(H,R)}if(_)for(var T=g?3:1,V=function(ce){var Ae=C.find(function(ye){var pe=L.get(ye);if(pe)return pe.slice(0,ce).every(function(Re){return Re})});if(Ae)return $=Ae,"break"},O=T;O>0;O--){var q=V(O);if(q==="break")break}e.placement!==$&&(e.modifiersData[i]._skip=!0,e.placement=$,e.reset=!0)}}const fm={name:"flip",enabled:!0,phase:"main",fn:gm,requiresIfExists:["offset"],data:{_skip:!1}};function Wh(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function qh(s){return[Rt,Nt,Ft,xt].some(function(e){return s[e]>=0})}function pm(s){var e=s.state,t=s.name,i=e.rects.reference,r=e.rects.popper,n=e.modifiersData.preventOverflow,o=ar(e,{elementContext:"reference"}),a=ar(e,{altBoundary:!0}),A=Wh(o,i),l=Wh(a,r,n),c=qh(A),h=qh(l);e.modifiersData[t]={referenceClippingOffsets:A,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const Em={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:pm};function Im(s,e,t){var i=si(s),r=[xt,Rt].indexOf(i)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*r,[xt,Nt].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function mm(s){var e=s.state,t=s.options,i=s.name,r=t.offset,n=r===void 0?[0,0]:r,o=Fh.reduce(function(c,h){return c[h]=Im(h,e.rects,n),c},{}),a=o[e.placement],A=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=A,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const Cm={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:mm};function ym(s){var e=s.state,t=s.name;e.modifiersData[t]=Jh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const vm={name:"popperOffsets",enabled:!0,phase:"read",fn:ym,data:{}};function Bm(s){return s==="x"?"y":"x"}function Qm(s){var e=s.state,t=s.options,i=s.name,r=t.mainAxis,n=r===void 0?!0:r,o=t.altAxis,a=o===void 0?!1:o,A=t.boundary,l=t.rootBoundary,c=t.altBoundary,h=t.padding,u=t.tether,d=u===void 0?!0:u,g=t.tetherOffset,f=g===void 0?0:g,p=ar(e,{boundary:A,rootBoundary:l,padding:h,altBoundary:c}),y=si(e.placement),v=vs(e.placement),Q=!v,C=Ra(y),w=Bm(C),B=e.modifiersData.popperOffsets,L=e.rects.reference,_=e.rects.popper,$=typeof f=="function"?f(Object.assign({},e.rects,{placement:e.placement})):f,F=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),H=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,W={x:0,y:0};if(B){if(n){var Y,X=C==="y"?Rt:xt,b=C==="y"?Ft:Nt,x=C==="y"?"height":"width",U=B[C],S=U+p[X],R=U-p[b],T=d?-_[x]/2:0,V=v===ms?L[x]:_[x],O=v===ms?-_[x]:-L[x],q=e.elements.arrow,se=d&&q?wa(q):{width:0,height:0},ce=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Uh(),Ae=ce[X],ye=ce[b],pe=nr(0,L[x],se[x]),Re=Q?L[x]/2-T-pe-Ae-F.mainAxis:V-pe-Ae-F.mainAxis,ne=Q?-L[x]/2+T+pe+ye+F.mainAxis:O+pe+ye+F.mainAxis,ue=e.elements.arrow&&rr(e.elements.arrow),be=ue?C==="y"?ue.clientTop||0:ue.clientLeft||0:0,me=(Y=H==null?void 0:H[C])!=null?Y:0,he=U+Re-me-be,te=U+ne-me,Be=nr(d?Sn(S,he):S,U,d?Wi(R,te):R);B[C]=Be,W[C]=Be-U}if(a){var Te,ke=C==="x"?Rt:xt,xe=C==="x"?Ft:Nt,Ne=B[w],Fe=w==="y"?"height":"width",ve=Ne+p[ke],Ke=Ne-p[xe],je=[Rt,xt].indexOf(y)!==-1,rt=(Te=H==null?void 0:H[w])!=null?Te:0,Ve=je?ve:Ne-L[Fe]-_[Fe]-rt+F.altAxis,Ct=je?Ne+L[Fe]+_[Fe]-rt-F.altAxis:Ke,mi=d&&je?WI(Ve,Ne,Ct):nr(d?Ve:ve,Ne,d?Ct:Ke);B[w]=mi,W[w]=mi-Ne}e.modifiersData[i]=W}}const Sm={name:"preventOverflow",enabled:!0,phase:"main",fn:Qm,requiresIfExists:["offset"]};function bm(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function wm(s){return s===Tt(s)||!Mt(s)?xa(s):bm(s)}function Rm(s){var e=s.getBoundingClientRect(),t=Cs(e.width)/s.offsetWidth||1,i=Cs(e.height)/s.offsetHeight||1;return t!==1||i!==1}function xm(s,e,t){t===void 0&&(t=!1);var i=Mt(e),r=Mt(e)&&Rm(e),n=xi(e),o=ys(s,r,t),a={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(i||!i&&!t)&&((ii(e)!=="body"||Da(n))&&(a=wm(e)),Mt(e)?(A=ys(e,!0),A.x+=e.clientLeft,A.y+=e.clientTop):n&&(A.x=Ta(n))),{x:o.left+a.scrollLeft-A.x,y:o.top+a.scrollTop-A.y,width:o.width,height:o.height}}function Tm(s){var e=new Map,t=new Set,i=[];s.forEach(function(n){e.set(n.name,n)});function r(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var A=e.get(a);A&&r(A)}}),i.push(n)}return s.forEach(function(n){t.has(n.name)||r(n)}),i}function Dm(s){var e=Tm(s);return $I.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Lm(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function _m(s){var e=s.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var jh={placement:"bottom",modifiers:[],strategy:"absolute"};function Xh(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function km(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,n=r===void 0?jh:r;return function(a,A,l){l===void 0&&(l=n);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},jh,n),modifiersData:{},elements:{reference:a,popper:A},attributes:{},styles:{}},h=[],u=!1,d={state:c,setOptions:function(y){var v=typeof y=="function"?y(c.options):y;f(),c.options=Object.assign({},n,c.options,v),c.scrollParents={reference:Ji(a)?or(a):a.contextElement?or(a.contextElement):[],popper:or(A)};var Q=Dm(_m([].concat(i,c.options.modifiers)));return c.orderedModifiers=Q.filter(function(C){return C.enabled}),g(),d.update()},forceUpdate:function(){if(!u){var y=c.elements,v=y.reference,Q=y.popper;if(Xh(v,Q)){c.rects={reference:xm(v,rr(Q),c.options.strategy==="fixed"),popper:wa(Q)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],B=w.fn,L=w.options,_=L===void 0?{}:L,$=w.name;typeof B=="function"&&(c=B({state:c,options:_,name:$,instance:d})||c)}}}},update:Lm(function(){return new Promise(function(p){d.forceUpdate(),p(c)})}),destroy:function(){f(),u=!0}};if(!Xh(a,A))return d;d.setOptions(l).then(function(p){!u&&l.onFirstUpdate&&l.onFirstUpdate(p)});function g(){c.orderedModifiers.forEach(function(p){var y=p.name,v=p.options,Q=v===void 0?{}:v,C=p.effect;if(typeof C=="function"){var w=C({state:c,name:y,instance:d,options:Q}),B=function(){};h.push(w||B)}})}function f(){h.forEach(function(p){return p()}),h=[]}return d}}var Fm=[rm,vm,im,Nh,Cm,fm,Sm,zI,Em],Nm=km({defaultModifiers:Fm}),Mm="tippy-box",zh="tippy-content",Pm="tippy-backdrop",Zh="tippy-arrow",eu="tippy-svg-arrow",qi={passive:!0,capture:!0},tu=function(){return document.body};function _a(s,e,t){if(Array.isArray(s)){var i=s[e];return i??(Array.isArray(t)?t[e]:t)}return s}function ka(s,e){var t={}.toString.call(s);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function iu(s,e){return typeof s=="function"?s.apply(void 0,e):s}function su(s,e){if(e===0)return s;var t;return function(i){clearTimeout(t),t=setTimeout(function(){s(i)},e)}}function Om(s){return s.split(/\s+/).filter(Boolean)}function Bs(s){return[].concat(s)}function ru(s,e){s.indexOf(e)===-1&&s.push(e)}function Um(s){return s.filter(function(e,t){return s.indexOf(e)===t})}function Gm(s){return s.split("-")[0]}function xn(s){return[].slice.call(s)}function nu(s){return Object.keys(s).reduce(function(e,t){return s[t]!==void 0&&(e[t]=s[t]),e},{})}function Ar(){return document.createElement("div")}function Tn(s){return["Element","Fragment"].some(function(e){return ka(s,e)})}function Hm(s){return ka(s,"NodeList")}function $m(s){return ka(s,"MouseEvent")}function Ym(s){return!!(s&&s._tippy&&s._tippy.reference===s)}function Km(s){return Tn(s)?[s]:Hm(s)?xn(s):Array.isArray(s)?s:xn(document.querySelectorAll(s))}function Fa(s,e){s.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function ou(s,e){s.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Vm(s){var e,t=Bs(s),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function Jm(s,e){var t=e.clientX,i=e.clientY;return s.every(function(r){var n=r.popperRect,o=r.popperState,a=r.props,A=a.interactiveBorder,l=Gm(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=l==="bottom"?c.top.y:0,u=l==="top"?c.bottom.y:0,d=l==="right"?c.left.x:0,g=l==="left"?c.right.x:0,f=n.top-i+h>A,p=i-n.bottom-u>A,y=n.left-t+d>A,v=t-n.right-g>A;return f||p||y||v})}function Na(s,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){s[i](r,t)})}function au(s,e){for(var t=e;t;){var i;if(s.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var ri={isTouch:!1},Au=0;function Wm(){ri.isTouch||(ri.isTouch=!0,window.performance&&document.addEventListener("mousemove",lu))}function lu(){var s=performance.now();s-Au<20&&(ri.isTouch=!1,document.removeEventListener("mousemove",lu)),Au=s}function qm(){var s=document.activeElement;if(Ym(s)){var e=s._tippy;s.blur&&!e.state.isVisible&&s.blur()}}function jm(){document.addEventListener("touchstart",Wm,qi),window.addEventListener("blur",qm)}var Xm=typeof window<"u"&&typeof document<"u",zm=Xm?!!window.msCrypto:!1,Zm={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},eC={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Yt=Object.assign({appendTo:tu,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},Zm,eC),tC=Object.keys(Yt),iC=function(e){var t=Object.keys(e);t.forEach(function(i){Yt[i]=e[i]})};function cu(s){var e=s.plugins||[],t=e.reduce(function(i,r){var n=r.name,o=r.defaultValue;if(n){var a;i[n]=s[n]!==void 0?s[n]:(a=Yt[n])!=null?a:o}return i},{});return Object.assign({},s,t)}function sC(s,e){var t=e?Object.keys(cu(Object.assign({},Yt,{plugins:e}))):tC,i=t.reduce(function(r,n){var o=(s.getAttribute("data-tippy-"+n)||"").trim();if(!o)return r;if(n==="content")r[n]=o;else try{r[n]=JSON.parse(o)}catch{r[n]=o}return r},{});return i}function hu(s,e){var t=Object.assign({},e,{content:iu(e.content,[s])},e.ignoreAttributes?{}:sC(s,e.plugins));return t.aria=Object.assign({},Yt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var rC=function(){return"innerHTML"};function Ma(s,e){s[rC()]=e}function uu(s){var e=Ar();return s===!0?e.className=Zh:(e.className=eu,Tn(s)?e.appendChild(s):Ma(e,s)),e}function du(s,e){Tn(e.content)?(Ma(s,""),s.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ma(s,e.content):s.textContent=e.content)}function Pa(s){var e=s.firstElementChild,t=xn(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(zh)}),arrow:t.find(function(i){return i.classList.contains(Zh)||i.classList.contains(eu)}),backdrop:t.find(function(i){return i.classList.contains(Pm)})}}function gu(s){var e=Ar(),t=Ar();t.className=Mm,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=Ar();i.className=zh,i.setAttribute("data-state","hidden"),du(i,s.props),e.appendChild(t),t.appendChild(i),r(s.props,s.props);function r(n,o){var a=Pa(e),A=a.box,l=a.content,c=a.arrow;o.theme?A.setAttribute("data-theme",o.theme):A.removeAttribute("data-theme"),typeof o.animation=="string"?A.setAttribute("data-animation",o.animation):A.removeAttribute("data-animation"),o.inertia?A.setAttribute("data-inertia",""):A.removeAttribute("data-inertia"),A.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?A.setAttribute("role",o.role):A.removeAttribute("role"),(n.content!==o.content||n.allowHTML!==o.allowHTML)&&du(l,s.props),o.arrow?c?n.arrow!==o.arrow&&(A.removeChild(c),A.appendChild(uu(o.arrow))):A.appendChild(uu(o.arrow)):c&&A.removeChild(c)}return{popper:e,onUpdate:r}}gu.$$tippy=!0;var nC=1,Dn=[],Oa=[];function oC(s,e){var t=hu(s,Object.assign({},Yt,cu(nu(e)))),i,r,n,o=!1,a=!1,A=!1,l=!1,c,h,u,d=[],g=su(he,t.interactiveDebounce),f,p=nC++,y=null,v=Um(t.plugins),Q={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:s,popper:Ar(),popperInstance:y,props:t,state:Q,plugins:v,clearDelayTimeouts:Ve,setProps:Ct,setContent:mi,show:yt,hide:ai,hideWithInteractivity:Ai,enable:je,disable:rt,unmount:li,destroy:ft};if(!t.render)return C;var w=t.render(C),B=w.popper,L=w.onUpdate;B.setAttribute("data-tippy-root",""),B.id="tippy-"+C.id,C.popper=B,s._tippy=C,B._tippy=C;var _=v.map(function(K){return K.fn(C)}),$=s.hasAttribute("aria-expanded");return ue(),T(),U(),S("onCreate",[C]),t.showOnCreate&&ve(),B.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),B.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&X().addEventListener("mousemove",g)}),C;function F(){var K=C.props.touch;return Array.isArray(K)?K:[K,0]}function H(){return F()[0]==="hold"}function W(){var K;return!!((K=C.props.render)!=null&&K.$$tippy)}function Y(){return f||s}function X(){var K=Y().parentNode;return K?Vm(K):document}function b(){return Pa(B)}function x(K){return C.state.isMounted&&!C.state.isVisible||ri.isTouch||c&&c.type==="focus"?0:_a(C.props.delay,K?0:1,Yt.delay)}function U(K){K===void 0&&(K=!1),B.style.pointerEvents=C.props.interactive&&!K?"":"none",B.style.zIndex=""+C.props.zIndex}function S(K,le,fe){if(fe===void 0&&(fe=!0),_.forEach(function(we){we[K]&&we[K].apply(we,le)}),fe){var De;(De=C.props)[K].apply(De,le)}}function R(){var K=C.props.aria;if(K.content){var le="aria-"+K.content,fe=B.id,De=Bs(C.props.triggerTarget||s);De.forEach(function(we){var Je=we.getAttribute(le);if(C.state.isVisible)we.setAttribute(le,Je?Je+" "+fe:fe);else{var vt=Je&&Je.replace(fe,"").trim();vt?we.setAttribute(le,vt):we.removeAttribute(le)}})}}function T(){if(!($||!C.props.aria.expanded)){var K=Bs(C.props.triggerTarget||s);K.forEach(function(le){C.props.interactive?le.setAttribute("aria-expanded",C.state.isVisible&&le===Y()?"true":"false"):le.removeAttribute("aria-expanded")})}}function V(){X().removeEventListener("mousemove",g),Dn=Dn.filter(function(K){return K!==g})}function O(K){if(!(ri.isTouch&&(A||K.type==="mousedown"))){var le=K.composedPath&&K.composedPath()[0]||K.target;if(!(C.props.interactive&&au(B,le))){if(Bs(C.props.triggerTarget||s).some(function(fe){return au(fe,le)})){if(ri.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else S("onClickOutside",[C,K]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ae())}}}function q(){A=!0}function se(){A=!1}function ce(){var K=X();K.addEventListener("mousedown",O,!0),K.addEventListener("touchend",O,qi),K.addEventListener("touchstart",se,qi),K.addEventListener("touchmove",q,qi)}function Ae(){var K=X();K.removeEventListener("mousedown",O,!0),K.removeEventListener("touchend",O,qi),K.removeEventListener("touchstart",se,qi),K.removeEventListener("touchmove",q,qi)}function ye(K,le){Re(K,function(){!C.state.isVisible&&B.parentNode&&B.parentNode.contains(B)&&le()})}function pe(K,le){Re(K,le)}function Re(K,le){var fe=b().box;function De(we){we.target===fe&&(Na(fe,"remove",De),le())}if(K===0)return le();Na(fe,"remove",h),Na(fe,"add",De),h=De}function ne(K,le,fe){fe===void 0&&(fe=!1);var De=Bs(C.props.triggerTarget||s);De.forEach(function(we){we.addEventListener(K,le,fe),d.push({node:we,eventType:K,handler:le,options:fe})})}function ue(){H()&&(ne("touchstart",me,{passive:!0}),ne("touchend",te,{passive:!0})),Om(C.props.trigger).forEach(function(K){if(K!=="manual")switch(ne(K,me),K){case"mouseenter":ne("mouseleave",te);break;case"focus":ne(zm?"focusout":"blur",Be);break;case"focusin":ne("focusout",Be);break}})}function be(){d.forEach(function(K){var le=K.node,fe=K.eventType,De=K.handler,we=K.options;le.removeEventListener(fe,De,we)}),d=[]}function me(K){var le,fe=!1;if(!(!C.state.isEnabled||Te(K)||a)){var De=((le=c)==null?void 0:le.type)==="focus";c=K,f=K.currentTarget,T(),!C.state.isVisible&&$m(K)&&Dn.forEach(function(we){return we(K)}),K.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?fe=!0:ve(K),K.type==="click"&&(o=!fe),fe&&!De&&Ke(K)}}function he(K){var le=K.target,fe=Y().contains(le)||B.contains(le);if(!(K.type==="mousemove"&&fe)){var De=Fe().concat(B).map(function(we){var Je,vt=we._tippy,Bt=(Je=vt.popperInstance)==null?void 0:Je.state;return Bt?{popperRect:we.getBoundingClientRect(),popperState:Bt,props:t}:null}).filter(Boolean);Jm(De,K)&&(V(),Ke(K))}}function te(K){var le=Te(K)||C.props.trigger.indexOf("click")>=0&&o;if(!le){if(C.props.interactive){C.hideWithInteractivity(K);return}Ke(K)}}function Be(K){C.props.trigger.indexOf("focusin")<0&&K.target!==Y()||C.props.interactive&&K.relatedTarget&&B.contains(K.relatedTarget)||Ke(K)}function Te(K){return ri.isTouch?H()!==K.type.indexOf("touch")>=0:!1}function ke(){xe();var K=C.props,le=K.popperOptions,fe=K.placement,De=K.offset,we=K.getReferenceClientRect,Je=K.moveTransition,vt=W()?Pa(B).arrow:null,Bt=we?{getBoundingClientRect:we,contextElement:we.contextElement||Y()}:s,ws={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Rs){var Li=Rs.state;if(W()){var gr=b(),fr=gr.box;["placement","reference-hidden","escaped"].forEach(function(xs){xs==="placement"?fr.setAttribute("data-placement",Li.placement):Li.attributes.popper["data-popper-"+xs]?fr.setAttribute("data-"+xs,""):fr.removeAttribute("data-"+xs)}),Li.attributes.popper={}}}},Qt=[{name:"offset",options:{offset:De}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Je}},ws];W()&&vt&&Qt.push({name:"arrow",options:{element:vt,padding:3}}),Qt.push.apply(Qt,(le==null?void 0:le.modifiers)||[]),C.popperInstance=Nm(Bt,B,Object.assign({},le,{placement:fe,onFirstUpdate:u,modifiers:Qt}))}function xe(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function Ne(){var K=C.props.appendTo,le,fe=Y();C.props.interactive&&K===tu||K==="parent"?le=fe.parentNode:le=iu(K,[fe]),le.contains(B)||le.appendChild(B),C.state.isMounted=!0,ke()}function Fe(){return xn(B.querySelectorAll("[data-tippy-root]"))}function ve(K){C.clearDelayTimeouts(),K&&S("onTrigger",[C,K]),ce();var le=x(!0),fe=F(),De=fe[0],we=fe[1];ri.isTouch&&De==="hold"&&we&&(le=we),le?i=setTimeout(function(){C.show()},le):C.show()}function Ke(K){if(C.clearDelayTimeouts(),S("onUntrigger",[C,K]),!C.state.isVisible){Ae();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(K.type)>=0&&o)){var le=x(!1);le?r=setTimeout(function(){C.state.isVisible&&C.hide()},le):n=requestAnimationFrame(function(){C.hide()})}}function je(){C.state.isEnabled=!0}function rt(){C.hide(),C.state.isEnabled=!1}function Ve(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(n)}function Ct(K){if(!C.state.isDestroyed){S("onBeforeUpdate",[C,K]),be();var le=C.props,fe=hu(s,Object.assign({},le,nu(K),{ignoreAttributes:!0}));C.props=fe,ue(),le.interactiveDebounce!==fe.interactiveDebounce&&(V(),g=su(he,fe.interactiveDebounce)),le.triggerTarget&&!fe.triggerTarget?Bs(le.triggerTarget).forEach(function(De){De.removeAttribute("aria-expanded")}):fe.triggerTarget&&s.removeAttribute("aria-expanded"),T(),U(),L&&L(le,fe),C.popperInstance&&(ke(),Fe().forEach(function(De){requestAnimationFrame(De._tippy.popperInstance.forceUpdate)})),S("onAfterUpdate",[C,K])}}function mi(K){C.setProps({content:K})}function yt(){var K=C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,De=ri.isTouch&&!C.props.touch,we=_a(C.props.duration,0,Yt.duration);if(!(K||le||fe||De)&&!Y().hasAttribute("disabled")&&(S("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,W()&&(B.style.visibility="visible"),U(),ce(),C.state.isMounted||(B.style.transition="none"),W()){var Je=b(),vt=Je.box,Bt=Je.content;Fa([vt,Bt],0)}u=function(){var Qt;if(!(!C.state.isVisible||l)){if(l=!0,B.offsetHeight,B.style.transition=C.props.moveTransition,W()&&C.props.animation){var Zi=b(),Rs=Zi.box,Li=Zi.content;Fa([Rs,Li],we),ou([Rs,Li],"visible")}R(),T(),ru(Oa,C),(Qt=C.popperInstance)==null||Qt.forceUpdate(),S("onMount",[C]),C.props.animation&&W()&&pe(we,function(){C.state.isShown=!0,S("onShown",[C])})}},Ne()}}function ai(){var K=!C.state.isVisible,le=C.state.isDestroyed,fe=!C.state.isEnabled,De=_a(C.props.duration,1,Yt.duration);if(!(K||le||fe)&&(S("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,W()&&(B.style.visibility="hidden"),V(),Ae(),U(!0),W()){var we=b(),Je=we.box,vt=we.content;C.props.animation&&(Fa([Je,vt],De),ou([Je,vt],"hidden"))}R(),T(),C.props.animation?W()&&ye(De,C.unmount):C.unmount()}}function Ai(K){X().addEventListener("mousemove",g),ru(Dn,g),g(K)}function li(){C.state.isVisible&&C.hide(),C.state.isMounted&&(xe(),Fe().forEach(function(K){K._tippy.unmount()}),B.parentNode&&B.parentNode.removeChild(B),Oa=Oa.filter(function(K){return K!==C}),C.state.isMounted=!1,S("onHidden",[C]))}function ft(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),be(),delete s._tippy,C.state.isDestroyed=!0,S("onDestroy",[C]))}}function ji(s,e){e===void 0&&(e={});var t=Yt.plugins.concat(e.plugins||[]);jm();var i=Object.assign({},e,{plugins:t}),r=Km(s),n=r.reduce(function(o,a){var A=a&&oC(a,i);return A&&o.push(A),o},[]);return Tn(s)?n[0]:n}ji.defaultProps=Yt,ji.setDefaultProps=iC,ji.currentInput=ri,Object.assign({},Nh,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),ji.setDefaultProps({render:gu});class aC{constructor(){this.currentTask=null,this.nextTask=null}async enqueue(e){this.nextTask=async()=>{await e()},this.currentTask||this.runNext()}async runNext(){if(!this.nextTask){this.currentTask=null;return}const e=this.nextTask;this.nextTask=null,this.currentTask=e().finally(()=>this.runNext())}}class ni extends Error{constructor(e,t=new Error,i=!1){super(),this.fatal=!1,this.fatal=i,this.stack=t.stack,this.message=[e,t.message].filter(Boolean).join(" - ")}}const AC=5;function lC(s,e){const t=s.map(({id:r})=>r).join("|"),i=e.map(({id:r})=>r).join("|");return t===i}class cC{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._limitedQueue=new aC,this._canvas=pt(),this._controls=pt(),this.host=e}set activeScenes(e){lC(e,this._activeScenes)||(this._activeScenes=e,this.host.dispatchEvent(new CustomEvent("scenechange",{detail:e})),this.host.requestUpdate())}get activeScenes(){return this._activeScenes}set currentTime(e){var t,i,r,n,o;const a=Math.min(this.host.duration,Math.max(0,e));this.activeScenes=((t=this.host.scenes)==null?void 0:t.filter(({start:h,duration:u})=>a>=h&&a<h+u))??[];const A=a!==this.currentTime;this._currentTime=a,this._upcomingScenes=((i=this.host.scenes)==null?void 0:i.filter(({start:h})=>a>=h-AC&&a<h))??[],this.loadScenes(),this.syncVideoState(),(r=this._controls.value)==null||r.setAttribute("currentTime",a.toString());const l=this.activeScenes[0],c=ul((n=l==null?void 0:l.videoMeta)==null?void 0:n.captions);this.caption=((o=c.find(({start:h,end:u})=>{var d;const g=a-l.start+(((d=l.videoMeta)==null?void 0:d.start)??0);return h&&u&&g>=Hr(h)&&g<=Hr(u)}))==null?void 0:o.text)??"",A&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:a})),this.draw(a)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return Et(this._canvas)}controls(){return Et(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{var t,i,r;const{start:n,duration:o,video:a,videoMeta:A}=e,l=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused;if(a&&A){const{key:c,hls:h,node:u}=a,{start:d,duration:g}=A,f=this.host.videoState[c];u&&f&&(u.currentTime>=d+g||u.ended||l&&(h?(t=h.startLoadOnce)==null||t.call(h,d):f.initialised||(i=u.startLoadOnce)==null||i.call(u)))}else if(l){const c=`${n}-${o}`,h=this.host._sceneController.videoState[c];this.host.duration&&!((r=h==null?void 0:h.buffered)!=null&&r.length)&&(this.host._sceneController.videoState={...this.host._sceneController.videoState,[c]:{...h,buffered:[{start:Math.max(0,n/this.host.duration*100),end:Math.min((n+o)/this.host.duration*100,100)}]}})}})}syncVideoState(){var e;(e=this.host.scenes)==null||e.forEach(t=>{if(t.video){const{key:i,node:r}=t.video,n=this.host.videoState[i],o=this.activeScenes.includes(t);if(r&&n)if(o&&!this.host.waiting&&!this.host.loading&&!this.host.paused){if(r.paused&&n.initialised)try{return r.play()}catch(a){throw new ni("Video play error",a,!0)}}else r.paused||r.pause()}})}draw(e=this.currentTime){this._limitedQueue.enqueue(async()=>{var t,i;this.host.sceneConfig&&this._canvas.value&&await((i=(t=this.host).compilation)==null?void 0:i.call(t,{currentTime:e,scenes:this.host.sceneConfig,canvas:this._canvas.value}))})}clear(){var e;const t=this._canvas.value;(e=t==null?void 0:t.getContext("2d"))==null||e.clearRect(0,0,t.width,t.height)}}function hC(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function uC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function dC(s,e){return new Promise(t=>{const{id:i,key:r,duration:n}=e,o=document.createElement("video");o.playsInline=!0,o.muted=!0,o.loop=!1,o.crossOrigin="anonymous",o.src=s;let a=!1;if(o.startLoadOnce=()=>{a||(o.preload="auto",o.load(),a=!0)},n)o.preload="none",t({id:i,key:r,hls:null,config:e,node:o});else{o.preload="metadata";const A=async()=>{t({id:i,key:r,hls:null,config:e,node:o}),o.removeEventListener("loadedmetadata",A)};o.addEventListener("loadedmetadata",A)}})}function gC(s,e){return new Promise(t=>{const{id:i,key:r}=e,n=document.createElement("video");n.playsInline=!0,n.muted=!0,n.loop=!1,n.crossOrigin="anonymous";let o=!1;const a=new Ei({autoStartLoad:!0,xhrSetup:A=>{const{open:l}=A,c=s.split("?")[1];A.open=function(h,u,d){u.toString().includes("?")||(u+="?"+c),!(!o&&u.toString().includes(".ts"))&&l.apply(this,[h,u,d])}}});a.on(Ei.Events.LEVEL_LOADED,async()=>{o||a==null||a.stopLoad(),t({id:i,key:r,hls:a,config:e,node:n})}),a.loadSource(s),a.attachMedia(n),a.startLoadOnce=(A=-1,l)=>{if(a&&!o){const c=a==null?void 0:a.levels.findIndex(h=>Math.min(h.height,h.width)===l);o=!0,a.startLevel=a.firstLevel,a.startLoad(A),a.currentLevel=c!==-1?c:a.firstLevel}}})}function Ua(s){const{src:e,playlist:t}=s;return t&&!hC()&&Ei.isSupported()?gC(t,s):dC(e,s)}async function fu(s){return s.duration===1/0?new Promise(e=>{s.currentTime=Number.MAX_SAFE_INTEGER,s.ontimeupdate=()=>{s.ontimeupdate=null,e(s.duration),s.currentTime=0}}):s.duration}const fC=Ut(async function(e){return new FontFace(e.name,`url(${e.woff2??e.url})`,{style:e.style,weight:e.weight}).load()},{cacheKey:([s])=>JSON.stringify(s)});let pC=class{constructor(e){this._hasPlayed=!1,this._memoKey=null,this._lastDeps=null,this._duration=0,this._scenes=null,this._videos={},this._videoMeta={},this._videoState={},this._delayProcessing=(t=100)=>{const i=new AbortController,r=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(r)}),i},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Ut(async t=>{const{id:i,key:r}=t,n=await Ua(t);n.node.volume=this.host.volume,n.node.playbackRate=this.host.playbackRate;const o={loadeddata:this._handleLoadedData,waiting:this._handleWaiting,canplay:this._handleCanPlay,progress:this._handleProgress,seeking:this._handleSeeking,seeked:this._handleSeeked,play:this._handlePlay,playing:this._handlePlaying,pause:this._handlePause,stalled:this._handleStalled,timeupdate:this._handleTimeUpdate,ended:this._handleEnded,error:this._handleError},a=Object.keys(o).reduce((A,l)=>{const c=l,h=o[c]({id:i,key:r,node:n.node});return A[c]=h,n.node.addEventListener(l,h),A},{});return{...n,listeners:a}},{cacheKey:([{id:t,key:i,src:r,playlist:n}])=>JSON.stringify({id:t,key:i,src:r==null?void 0:r.split("?")[0],playlist:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Ut(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await fu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([t])=>JSON.stringify(t)}),this._handleLoadedData=({id:t,key:i,node:r})=>()=>{var n,o;const a=this.videoState[i];if(!(a!=null&&a.initialised)){this.videoState={...this.videoState,[i]:{...a,initialised:!0,waiting:!1,buffered:(a==null?void 0:a.buffered)??[]}};const A=(o=(n=this.scenes)==null?void 0:n.scenes)==null?void 0:o.find(({video:l})=>{l==null||l.key});A&&this._setVideoCurrentTime({scene:A,time:this.host.currentTime}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:r}}))}},this._handleWaiting=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&!(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!0}})},this._handleCanPlay=({key:t})=>()=>{const i=this.videoState[t];i!=null&&i.initialised&&(i!=null&&i.waiting)&&(this.videoState={...this.videoState,[t]:{...i,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=({key:t,node:i})=>()=>{const r=this.videoState[t],n=this._getBufferSegments({key:t,node:i,duration:this.host.duration});this.videoState={...this.videoState,[t]:{...r,buffered:n}}},this._handleSeeking=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:r}}))},this._handleSeeked=({id:t,key:i,node:r})=>()=>{const n=this.videoState[i];n!=null&&n.initialised&&(this.host.draw(),this.host.activeScenes.map(o=>{var a;return(a=o.videoMeta)==null?void 0:a.id}).includes(t)&&this.host.dispatchEvent(new CustomEvent("seeked",{detail:this.host.currentTime})),this.host.dispatchEvent(new CustomEvent("video:seeked",{detail:{id:t,key:i,node:r}})))},this._handlePlay=({id:t,key:i,node:r})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:r}}))},this._handlePlaying=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:r}}))},this._handlePause=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:r}}))},this._handleStalled=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:r}}))},this._handleTimeUpdate=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:r}}))},this._handleEnded=({id:t,key:i,node:r})=>()=>{this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:r}}))},this._handleError=({id:t,key:i,node:r})=>()=>{const n=new ni(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:n,message:n.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:r}}))},this._cleanupVideo=t=>{var i;const r=this.videos[t];r&&(r.node.pause(),r.node.src="",(i=r.hls)==null||i.destroy(),Object.keys(r.listeners??{}).forEach(n=>{var o,a;if((o=this.videos)!=null&&o[t]){const A=(a=r.listeners)==null?void 0:a[n];A&&r.node.removeEventListener(n,A)}}),delete this.videos[t])},this.host=e,this.host.addController(this)}set hasPlayed(e){e!==this._hasPlayed&&(this._hasPlayed=e,this.host.requestUpdate())}get hasPlayed(){return this._hasPlayed}set duration(e){!isNaN(e)&&e!==this._duration&&(this._duration=e,this.host.requestUpdate(),this.host.dispatchEvent(new CustomEvent("durationchange",{detail:this._duration})))}get duration(){return this._duration}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}set videoMeta(e){e!==this._videoMeta&&(this._videoMeta=e,this.host.requestUpdate())}get videoMeta(){return this._videoMeta}set videoState(e){e!==this._videoState&&(this._videoState=e,this.host.requestUpdate())}get videoState(){return this._videoState}_getBufferSegments({key:e,node:t,duration:i}){var r;const n=t==null?void 0:t.buffered,o=[],{start:a,video:A,videoMeta:l}=((r=this.scenes)==null?void 0:r.scenes.find(({video:c})=>e===(c==null?void 0:c.key)))??{};if(t&&n&&A&&l&&typeof a<"u")for(let c=0;c<n.length;c++){const h=n.start(c),u=n.end(c);Math.max(h,l.start)<=Math.min(u,l.start+l.duration)&&o.push({start:Math.max(0,(Math.max(h-l.start,0)+a)/i*100),end:Math.min((Math.min(u-l.start,l.duration)+a)/i*100,100)})}return o}_setupTask(){new vr(this.host,async([e,t,i,r,n,o,a])=>{var A;const l=this._delayProcessing();try{let c=null;if(this.host._errors=[],this.host._languages=this.host.languageResolver({data:e}),(!n||!this.host._languages.find(({value:h})=>n===h))&&(this.host._language=(A=this.host._languages[0])==null?void 0:A.value),i||e){if(i){let f=null;if(r)try{f=await(await fetch(r,{method:"GET"})).text()}catch(v){const Q=new ni("Track failed to fetch",v);this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:Q,message:Q.message}))}const y={questions:{items:[{answer:{id:"source",media:{[i.includes(".m3u8")?"playlist":"video"]:i},captions:{current:f}}}]}};try{this.scenes=await os({data:y,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(v){try{this.scenes=await os({data:y,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(Q){throw new ni("Fatal source template error",Q,!0)}c=new ni("Source template error",v)}}else try{this.scenes=await os({data:e,template:t,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(f){try{this.scenes=await os({data:e,burnCaptions:o,debug:a},this._createDataResolver(this.host.language),this._resolveVideo,this._resolveVideoMeta)}catch(p){throw new ni("Fatal data template error",p,!0)}c=new ni("Data template error",f)}Object.keys(this.videos).forEach(f=>{this.scenes.scenes.find(({video:p})=>f===(p==null?void 0:p.key))||this._videos[f].node.pause()});const[h,u,d]=this.scenes.scenes.reduce((f,{video:p,videoMeta:y,start:v,duration:Q})=>{var C;p&&(f[0][p.key]=p,y&&(f[1][p.key]=y));const w=(p==null?void 0:p.key)??`${v}-${Q}`,B=this._getBufferSegments({key:w,node:p==null?void 0:p.node,duration:this.scenes.duration});return f[2][w]={initialised:!p,waiting:!!p,...this.videoState[w],buffered:p?B:(C=this.videoState[w])==null?void 0:C.buffered},f},[{},{},{}]);this.videos=h,this.videoMeta=u,this.videoState={...this.videoState,...d},(await Promise.all(this.scenes.fonts.map(f=>fC(f)))).forEach(f=>{document.fonts.add(f)}),this.duration=this.scenes.duration,this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused&&this.host.reset(this.host.currentTime,!this.host.paused)}c&&this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message})),this.host.dispatchEvent(new CustomEvent("scenesupdate",{detail:this.scenes,bubbles:!0,composed:!0}))}catch(c){this.scenes=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>{const e=JSON.stringify({data:this.host.data,template:this.host.template,src:this.host.src,track:this.host.track,language:this.host.language,burnCaptions:this.host.burnCaptions,debug:this.host.debug});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.data,this.host.template,this.host.src,this.host.track,this.host.language,this.host.burnCaptions,this.host.debug];return this._memoKey=e,this._lastDeps=t,t})}_setVideoCurrentTime({time:e,scene:t}){const{start:i,video:r,videoMeta:n}=t;if(r&&r.node&&n&&typeof i<"u"){const o=e-i;r.node.currentTime=Math.max(n.start,Math.min(n.start+n.duration,o+n.start))}}setVideosCurrentTime(e){var t;(t=this.scenes)==null||t.scenes.forEach(i=>{this._setVideoCurrentTime({time:e,scene:i})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}};function EC(s){s.requestFullscreen?s.requestFullscreen():s.mozRequestFullScreen?s.mozRequestFullScreen():s.webkitRequestFullscreen?s.webkitRequestFullscreen():s.msRequestFullscreen&&s.msRequestFullscreen()}function IC(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const Ga=["progress","play-large","navigation","play","volume","current-time","duration","speed","captions","fullscreen","preview"],mC={id:"captions",event:"captions:click",label:"Closed Captions"},CC={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},pu={title:"Playback Speed",items:[{id:"playback-rate-0.5",event:"playbackRate:click",label:"0.5x",value:.5},{id:"playback-rate-1",event:"playbackRate:click",label:"1.0x",value:1},{id:"playback-rate-1.5",event:"playbackRate:click",label:"1.5x",value:1.5},{id:"playback-rate-2",event:"playbackRate:click",label:"2.0x",value:2}]},yC={id:"playbackRate",label:"Playback playbackRate",subItems:pu};class vC extends vA{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==ss.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}disconnected(){var e;(e=this.observer)==null||e.disconnect(),this.observer=void 0}reconnected(){var e;this.element&&((e=this.observer)==null||e.observe(this.element))}update(e,[t]){return this.isConnected&&!this.observer&&(this.observer=new ResizeObserver(t),this.element=e.element,this.observer.observe(this.element)),Ot}}const Ha=rs(vC),BC=DI(()=>{const s=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),e=new FontFace("Roobert","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-SemiBold.woff2)",{style:"normal",weight:"600"}),t=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),i=ll.map(r=>({load:!1,font:new FontFace(r.family,`url(${r.url})`,{style:r.style})}));return[{load:!0,font:s},{load:!0,font:e},{load:!0,font:t},...i]}),oi={"red-120":"#feeded","red-130":"#fcd5d0","red-400":"#e84a4a","red-500":"#c51c3a","red-700":"#a21c39","red-800":"#850231","red-900":"#580A2D","teal-80":"#f3fafa","teal-100":"#d6f1f1","teal-200":"#ace3e3","teal-300":"#7acace","teal-400":"#4faab2","teal-500":"#358f97","teal-600":"#287179","teal-700":"#22555c","teal-800":"#21484e","teal-900":"#1f3d42","teal-950":"#0d2126","purple-100":"#d7cfff","purple-700":"#5f2fe9","green-200":"#a4d7aa","green-500":"#38b319","green-800":"#2b3c2f","grey-100":"#f0f0f0","light-50":"rgba(255, 255, 255, .05)","light-100":"rgba(255, 255, 255, .1)","light-200":"rgba(255, 255, 255, .2)","light-400":"rgba(255, 255, 255, .4)","light-500":"rgba(255, 255, 255, .5)","light-640":"rgba(255, 255, 255, .64)","light-800":"rgba(255, 255, 255, .8)","light-1000":"#fff","dark-50":"rgba(0, 0, 0, .05)","dark-80":"rgba(0, 0, 0, .08)","dark-100":"rgba(0, 0, 0, .1)","dark-200":"rgba(0, 0, 0, .2)","dark-250":"rgba(0, 0, 0, .25)","dark-400":"rgba(0, 0, 0, .4)","dark-500":"rgba(0, 0, 0, .5)","dark-640":"rgba(0, 0, 0, .64)","dark-800":"rgba(0, 0, 0, .8)","dark-900":"rgba(0, 0, 0, .9)","dark-1000":"#000"},QC={colors:oi,space:{xxs:".25rem",xs:".5rem",small:".75rem",medium:"1rem",large:"1.5rem",xl:"2.5rem"},sizes:{xxs:"1rem",xs:"1.5rem",small:"2rem",medium:"2.5rem",large:"3rem"},fontWeights:{regular:400,semibold:600},lineHeights:{small:1.1,medium:1.25,large:1.4},letterSpacings:{xxs:"-.04rem",xs:"-.03rem",small:"-.02rem",medium:"-.01rem",large:0},fontSizes:{micro:".625rem",small:".75rem",medium:".875rem",large:"1rem",xl:"1.25rem",xxl:"1.5rem",xxxl:"2rem",huge:"2.75rem"},fontFamilies:{sans:'Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,"Noto Sans", "Noto Color Emoji", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji"',mono:'"Maison Neue Mono", Menlo, Monaco, Consolas, Liberation Mono, "Courier New", monospace'},borderWidths:{thin:".0625rem"},radii:{small:".25rem",medium:".5rem",large:".75rem",xl:"1rem"},shadows:{small:`.25rem .25rem .25rem ${oi["dark-100"]}`,medium:`0 .125rem .625rem ${oi["dark-100"]}`,large:`0 .25rem 1rem ${oi["dark-50"]}`,xl:`.25rem .25rem 1rem ${oi["dark-250"]}`,xxl:`0 .25rem 2rem ${oi["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${oi["dark-250"]}`,toolbar:`0 -.625rem .625rem ${oi["dark-50"]}`,text:`0 0 .25rem ${oi["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:oi["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},Eu=RI(QC,{delimiter:"-"}),SC=Object.keys(Eu).map(s=>Ts(`:host { --${s}: ${Eu[s]}; }`)),Pe=(s=>{const e=class extends s{firstUpdated(){BC().forEach(({load:n,font:o})=>{document.fonts.add(o),n&&o.load()})}};return e.styles=[(s==null?void 0:s.styles)??[],SC,ht`
191
191
  :host {
192
192
  font-family: var(--fontFamilies-sans);
193
193
  font-size: var(--fontSizes-medium);
@@ -268,7 +268,7 @@ ${e}`,dg=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gg=Objec
268
268
  scroll-behavior: auto !important;
269
269
  }
270
270
  }
271
- `],e})(is),bC=(s,e)=>(typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,e)),e),wC=(s,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(r){typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,r))}}},St=s=>e=>typeof e=="function"?bC(s,e):wC(s,e);class RC{constructor(e){this._memoKey=null,this._lastDeps=null,this._scenes=null,this._video=null,this._handleSeeked=()=>{this.host._draw()},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Ut(async t=>{const i=await Ua(t);return i.node.play=async()=>{},i.node.addEventListener("seeked",this._handleSeeked),i},{cacheKey:([{id:t,src:i,playlist:r}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0]})}),this._resolveAnswer=Ut(async t=>{const{id:i,key:r,poster:n}=t,{node:o}=await Ua(t),a=new Image;return{id:i,key:r,config:t,node:o,getSource:()=>(n&&a.src!==n&&(a.onload=()=>{this.host._draw()},a.src=n),a)}},{cacheKey:([{id:t,src:i,playlist:r,poster:n}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0],poster:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Ut(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await fu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,duration:i,startOffset:r,endOffset:n}])=>JSON.stringify({id:t,duration:i,startOffset:r,endOffset:n})}),this.host=e,this.host.addController(this)}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}_setupTask(){new vr(this.host,async([e,t,i,r,n,o])=>{var a,A;try{if(e)return;if(t){const l=t.includes(".m3u8")?"playlist":"video";try{this.scenes=await os({data:{questions:{items:[{answer:{id:"source",media:{[l]:t,reducedQuality:t}}}]}},template:r,burnCaptions:o},this._createDataResolver(n),this._resolveVideo,this._resolveVideoMeta)}catch(c){throw new ni("Video preview source template error",c)}this._video=((A=(a=this.scenes.scenes[0])==null?void 0:a.video)==null?void 0:A.node)??null}else if(i)try{this.scenes=await os({data:i,template:r,burnCaptions:o},this._createDataResolver(n),this._resolveAnswer,this._resolveVideoMeta)}catch(l){throw new ni("Video preview data template error",l)}}catch(l){this.scenes=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,src:this.host.src,data:this.host.data,template:this.host.template,language:this.host.language,burnCaptions:this.host.burnCaptions});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.src,this.host.data,this.host.template,this.host.language,this.host.burnCaptions];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){this._video&&(this._video.pause(),this._video.removeEventListener("seeked",this._handleSeeked),this._video.src="",this._video=null)}}function Iu(s,e,t){return Math.min(Math.max(e,s),t)}function lr(s,e){return e?e instanceof ShadowRoot?lr(s,e.host):e instanceof HTMLElement&&e.matches(s)?e:lr(s,e.parentNode):null}function $a(s,e={}){const t=Math.max(0,s||0),i=Math.floor(t/3600),r=Math.floor(t%3600/60),n=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${r}`.padStart(2,"0")}:${`${n}`.padStart(2,"0")}`:`${r}:${`${n}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var xC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,Qs=(s,e,t,i)=>{for(var r=i>1?void 0:i?TC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&xC(e,t,r),r};let Ti=class extends Pe{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return Ce`<button
271
+ `],e})(is),bC=(s,e)=>(typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,e)),e),wC=(s,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(r){typeof window<"u"&&(window.customElements.get(s)??window.customElements.define(s,r))}}},St=s=>e=>typeof e=="function"?bC(s,e):wC(s,e);class RC{constructor(e){this._memoKey=null,this._lastDeps=null,this._scenes=null,this._video=null,this._handleSeeked=()=>{this.host._draw()},this._createDataResolver=t=>i=>this.host.dataResolver(i,{language:t}),this._resolveVideo=Ut(async t=>{const i=await Ua(t);return i.node.play=async()=>{},i.node.addEventListener("seeked",this._handleSeeked),i},{cacheKey:([{id:t,src:i,playlist:r}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0]})}),this._resolveAnswer=Ut(async t=>{const{id:i,key:r,poster:n}=t,{node:o}=await Ua(t),a=new Image;return a.crossOrigin="anonymous",{id:i,key:r,config:t,node:o,getSource:()=>(n&&a.src!==n&&(a.onload=()=>{this.host._draw()},a.src=n),a)}},{cacheKey:([{id:t,src:i,playlist:r,poster:n}])=>JSON.stringify({id:t,src:i==null?void 0:i.split("?")[0],playlist:r==null?void 0:r.split("?")[0],poster:n==null?void 0:n.split("?")[0]})}),this._resolveVideoMeta=Ut(async(t,i)=>{const{id:r,captions:n,duration:o,startOffset:a,endOffset:A}=t,l=o??await fu(i),c=(a??0)*l,h=(1-(A??0))*l;return{id:r,config:t,captions:n,start:c,duration:h-c}},{cacheKey:([{id:t,duration:i,startOffset:r,endOffset:n}])=>JSON.stringify({id:t,duration:i,startOffset:r,endOffset:n})}),this.host=e,this.host.addController(this)}set scenes(e){e!==this._scenes&&(this._scenes=e,this.host.requestUpdate())}get scenes(){return this._scenes}_setupTask(){new vr(this.host,async([e,t,i,r,n,o])=>{var a,A;try{if(e)return;if(t){const l=t.includes(".m3u8")?"playlist":"video";try{this.scenes=await os({data:{questions:{items:[{answer:{id:"source",media:{[l]:t,reducedQuality:t}}}]}},template:r,burnCaptions:o},this._createDataResolver(n),this._resolveVideo,this._resolveVideoMeta)}catch(c){throw new ni("Video preview source template error",c)}this._video=((A=(a=this.scenes.scenes[0])==null?void 0:a.video)==null?void 0:A.node)??null}else if(i)try{this.scenes=await os({data:i,template:r,burnCaptions:o},this._createDataResolver(n),this._resolveAnswer,this._resolveVideoMeta)}catch(l){throw new ni("Video preview data template error",l)}}catch(l){this.scenes=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,src:this.host.src,data:this.host.data,template:this.host.template,language:this.host.language,burnCaptions:this.host.burnCaptions});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.src,this.host.data,this.host.template,this.host.language,this.host.burnCaptions];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){this._video&&(this._video.pause(),this._video.removeEventListener("seeked",this._handleSeeked),this._video.src="",this._video=null)}}function Iu(s,e,t){return Math.min(Math.max(e,s),t)}function lr(s,e){return e?e instanceof ShadowRoot?lr(s,e.host):e instanceof HTMLElement&&e.matches(s)?e:lr(s,e.parentNode):null}function $a(s,e={}){const t=Math.max(0,s||0),i=Math.floor(t/3600),r=Math.floor(t%3600/60),n=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${r}`.padStart(2,"0")}:${`${n}`.padStart(2,"0")}`:`${r}:${`${n}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var xC=Object.defineProperty,TC=Object.getOwnPropertyDescriptor,Qs=(s,e,t,i)=>{for(var r=i>1?void 0:i?TC(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(e,t,r):o(r))||r);return i&&r&&xC(e,t,r),r};let Ti=class extends Pe{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return Ce`<button
272
272
  class=${Ye({active:this.active,"size-tiny":this.size==="tiny","size-small":this.size==="small","size-large":this.size==="large","radius-medium":this.rounded==="medium","radius-full":this.rounded==="full","weight-light":this.weight==="light","weight-heavy":this.weight==="heavy"})}
273
273
  >
274
274
  <slot></slot>