@vouchfor/embeds 8.7.1 → 8.7.2

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.
@@ -2458,8 +2458,8 @@ vec4 transition(vec2 uv) {
2458
2458
  vec4 b=getToColor(p);
2459
2459
  return mix(a, b, step(0.0+p.y,progress));
2460
2460
  }
2461
- `,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const Gh=il(Lv);var Hh;function kv(r){if(typeof r=="string"){const[e,t]=r.split(":");return Math.min(parseFloat(e),parseFloat(t))}return r}function Mv(r){if(typeof r=="string"){const[e,t]=r.split(":"),i=parseFloat(e),n=parseFloat(t);return i/n}return r}function kl({resolution:r,aspectRatio:e}){const t=kv(r),i=Mv(e),n=i>=1,s=Math.min(n?t*i:t/i,t),o=Math.max(n?t*i:t/i,t);return{resolution:t,aspectRatio:i,height:Math.round(n?s:o),width:Math.round(n?o:s)}}function $h({canvas:r,width:e,height:t,scaleFactor:i=1}){r.width=e*i,r.height=t*i}function Fv({context:r,scaleFactor:e=1}){r.scale(e,e)}function Pv({source:r,sx:e,sy:t,sw:i,sh:n,dx:s,dy:o,dw:a,dh:c}){const l=(r==null?void 0:r.naturalWidth)??(r==null?void 0:r.videoWidth)??(r==null?void 0:r.width),u=(r==null?void 0:r.naturalHeight)??(r==null?void 0:r.videoHeight)??(r==null?void 0:r.height);e=e??0,t=t??0,i=i??l,n=n??u,i<0&&(e+=i,i=Math.abs(i)),n<0&&(t+=n,n=Math.abs(n)),a<0&&(s+=a,a=Math.abs(a)),c<0&&(o+=c,c=Math.abs(c));const A=Math.max(e,0),h=Math.min(e+i,l),d=Math.max(t,0),f=Math.min(t+n,u),g=a/i,p=c/n;return[r,A,d,h-A,f-d,e<0?s-e*g:s,t<0?o-t*p:o,(h-A)*g,(f-d)*p]}function Nv({context:r,source:e,crop:t,flip:i,format:n="letterbox",posX:s,posY:o,scaleFactor:a=1,drawAreaWidth:c,drawAreaHeight:l,sourceWidth:u,sourceHeight:A,cropCanvas:h}){const{x:d,y:f,width:g,height:p}=t??{},E=u*(d??0),y=A*(f??0),B=u*Math.min(1-(d??0),g??1),C=A*Math.min(1-(f??0),p??1);let x=E,Q=y,_=B,M=C,P=B,D=C;if($h({scaleFactor:a,canvas:h,width:B,height:C}),n==="crop"){const K=c/l,ee=B/C,Z=ee>K?B-C*K:0,L=ee<K?C-B/K:0;$h({scaleFactor:a,canvas:h,width:B+Z,height:C+L}),x+=Z/2,Q+=L/2,_-=Z,M-=L,P+=Z,D+=L}const $=h.getContext("2d");if($){Fv({scaleFactor:a,context:$});const K=Pv({source:e,sx:x,sy:Q,sw:_,sh:M,dx:0,dy:0,dw:P,dh:D});$.drawImage(...K)}i?(r.save(),r.translate(s+c,o),r.scale(-1,1),r.drawImage(h,0,0,c,l),r.restore()):r.drawImage(h,s,o,c,l)}const Yh={linear:Wm,easeIn:tl,easeInOut:jm,easeOut:Jm,circIn:Pu,circInOut:qm,circOut:Nu,backIn:rl,backInOut:zm,backOut:Xm,anticipate:Zm,bounceIn:iE,bounceInOut:nE,bounceOut:no},So=gu((r,e,{clamp:t=!0,ease:i="easeIn",...n}={})=>Gm(r,e,{...n,clamp:t,ease:Yh[i]}),{cacheKey:([r,e,t])=>JSON.stringify({from:r,to:e,options:t})}),Ov={type:"clip",processor:{getTargetState:r=>({clip:{x:r.coordinates.x,y:r.coordinates.y,width:r.dimensions.width,height:r.dimensions.height}}),interpolateState:({value:r,easing:e,progress:t,from:i})=>{const n=i.clip??{x:0,y:0,width:1,height:1},s={x:r.coordinates.x,y:r.coordinates.y,width:r.dimensions.width,height:r.dimensions.height};return{clip:So([0,1],[n,s],{ease:e})(t)}}}},xo={type:"fade",processor:{getTargetState:r=>({opacity:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({opacity:So([0,1],[i.opacity,r],{ease:e})(t)})}},Uv={type:"scale",processor:{getTargetState:r=>({scale:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({scale:So([0,1],[i.scale,r],{ease:e})(t)})}},Vh={type:"translate",processor:{getTargetState:r=>({translation:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({translation:So([0,1],[i.translation,r],{ease:e})(t)})}},Gv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Hv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],$v=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Yv=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],is={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:Gv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},Ml={type:"switch",name:"reverseExit",label:"Reverse exit animation"},Vv=.2,Kv=3;function Wv(r,e){const t=r==="both"?e/2:e;return Math.min(Kv,t)}function ns({speed:r,timing:e,elementDuration:t}){const i=Wv(e,t),n=Math.min(Vv,i),s=Math.max(0,Math.min(100,r))/100;return i-s*(i-n)}const Jv="easeOut";function ss(r){return{values:e=>{var t;return{timing:e.timing??"both",speed:[e.speed??50],...((t=r==null?void 0:r.values)==null?void 0:t.call(r,e))??{}}},options:e=>{var t;return{timing:e.timing,speed:e.speed[0],easing:Jv,...((t=r==null?void 0:r.options)==null?void 0:t.call(r,e))??{}}}}}function si({timing:r,duration:e,elementDuration:t,easing:i,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const c=[],l=r==="both"||r==="enter",u=r==="both"||r==="exit",A=Math.max(0,t-e);if(l?(c.push({time:0,value:s,easing:i}),c.push({time:e,value:a,easing:"linear"})):c.push({time:0,value:a,easing:"linear"}),u){A>e&&c.push({time:A,value:a,easing:i});const h=n?s:o;c.push({time:t,value:h,easing:i})}return c}const Kh="fade",jv={type:Kh,name:"Fade",options:{...is},transform:ss(),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:xo}}}},Wh="pan",Jh=.25,jh="left";function qh(r,e,t){switch(r){case"left":return{x:e.width*t,y:0};case"right":return{x:-e.width*t,y:0};default:return qh(jh,e,t)}}function qv(r){return{x:-r.x,y:-r.y}}const Xv={type:Wh,name:"Pan",options:{...is,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:$v},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:r=>`${(r*100).toFixed(0)}%`}},reverseExit:Ml},transform:ss({values:r=>({direction:r.direction??jh,distance:[r.distance??Jh],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??Jh,n=qh(r.direction,e.elementDimensions,i),s=qv(n);return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:xo},translate:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Vh}}}},Xh="pop",zh=.5,zv={type:Xh,name:"Pop",options:{...is},transform:ss(),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:xo},scale:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:zh,exitTo:zh,restValue:1}),renderer:Uv}}}},Zh="rise",ed=50,Zv="up";function eC(r,e){switch(r){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const tC={type:Zh,name:"Rise",options:{...is,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Yv},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:r=>`${r}px`}},reverseExit:Ml},transform:ss({values:r=>({direction:r.direction??Zv,distance:[r.distance??ed],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??ed,{enterY:n,exitY:s}=eC(r.direction,i);return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:xo},translate:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:{x:0,y:n},exitTo:{x:0,y:s},restValue:{x:0,y:0}}),renderer:Vh}}}},td="wipe",Fl="left";function rn(r){switch(r){case"left":return{coordinates:{x:1,y:0},dimensions:{width:0,height:1}};case"right":return{coordinates:{x:0,y:0},dimensions:{width:0,height:1}};case"up":return{coordinates:{x:0,y:1},dimensions:{width:1,height:0}};case"down":return{coordinates:{x:0,y:0},dimensions:{width:1,height:0}};default:return rn(Fl)}}function rd(r){switch(r){case"left":return rn("right");case"right":return rn("left");case"up":return rn("down");case"down":return rn("up");default:return rd(Fl)}}const rC={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},iC={type:td,name:"Wipe",options:{...is,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Hv},reverseExit:Ml},transform:ss({values:r=>({direction:r.direction??Fl,reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=rn(r.direction),n=rd(r.direction);return{clip:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:i,exitTo:n,restValue:rC}),renderer:Ov}}}},nC={[Kh]:jv,[Zh]:tC,[Xh]:zv,[Wh]:Xv,[td]:iC};function sC(r,e){const{type:t,...i}=r,n=nC[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(i,e)}function oC({animation:r,sceneTime:e}){const t=r.keyframes;if(!t||t.length===0)return null;const i=[...t].sort((s,o)=>s.time-o.time);if(e<i[0].time)return null;const n=i[i.length-1];if(e>=n.time)return r.renderer.processor.getTargetState(n.value);for(let s=0;s<i.length-1;s++){const o=i[s],a=i[s+1];if(e>=o.time&&e<=a.time){const c=a.time-o.time,l=c===0?0:(e-o.time)/c,u=o.easing||"linear",A=r.renderer.processor.getTargetState(o.value);return r.renderer.processor.interpolateState({easing:u,progress:l,from:A,value:a.value})}}return null}function aC(r,e,t){const{preset:i,...n}=r;if(!i)return n;const s=sC(i,{elementDuration:e,elementDimensions:t});return{...n,...s}}function id({layout:r,sceneTime:e,animations:t,elementDuration:i=5,elementDimensions:n={width:100,height:100}}){var s,o,a,c,l,u,A,h,d,f,g;let p={clip:null,opacity:((s=r==null?void 0:r.transform)==null?void 0:s.opacity)??1,translation:{x:((a=(o=r==null?void 0:r.transform)==null?void 0:o.translate)==null?void 0:a.x)??0,y:((l=(c=r==null?void 0:r.transform)==null?void 0:c.translate)==null?void 0:l.y)??0},scale:((u=r==null?void 0:r.transform)==null?void 0:u.scale)??1,rotation:((A=r==null?void 0:r.transform)==null?void 0:A.rotation)??0,dimensions:{widthRatio:((d=(h=r==null?void 0:r.transform)==null?void 0:h.dimension)==null?void 0:d.widthRatio)??1,heightRatio:((g=(f=r==null?void 0:r.transform)==null?void 0:f.dimension)==null?void 0:g.heightRatio)??1}};if(!t)return p;const E=aC(t,i,n);for(const y of Object.values(E)){if(!y)continue;const B=oC({animation:y,sceneTime:e});B&&(p={...p,...B})}return p}const lC=[];for(let r=0;r<256;++r)lC.push((r+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const cC="audio",nd=r=>`${r.toFixed(1)}s`,AC={type:cC,options:{speed:{type:"slider",name:"speed",label:"Speed",min:.5,max:2,step:.01,transform:{input:r=>r/100,output:r=>r*100,format:r=>`${(r*100).toFixed(0)}%`}},volume:{type:"slider",name:"volume",label:"Volume",min:0,max:1,step:.01,transform:{input:r=>r/2/100,output:r=>r*2*100,format:r=>`${(r*2*100).toFixed(0)}%`}},duck:{type:"checkbox",name:"duck",label:"Duck under video"},duckLevel:{type:"slider",name:"duckLevel",label:"Duck to",min:0,max:1,step:.01,visible:r=>r.duck,transform:{input:r=>r/100,output:r=>r*100,format:r=>`${(r*100).toFixed(0)}%`}},fadeIn:{type:"slider",name:"fadeIn",label:"Fade in",min:0,max:5,step:.1,transform:{format:nd}},fadeOut:{type:"slider",name:"fadeOut",label:"Fade out",min:0,max:5,step:.1,transform:{format:nd}},loop:{type:"checkbox",name:"loop",label:"Loop"}},transform:{values:r=>({speed:[r.speed??1],volume:[r.volume??.5],loop:r.loop??!1,duck:r.duck??!1,duckLevel:[r.duckLevel??.25],fadeIn:[r.fadeIn??0],fadeOut:[r.fadeOut??0]}),options:r=>({speed:r.speed[0],volume:r.volume[0],loop:r.loop,duck:r.duck,duckLevel:r.duckLevel[0],fadeIn:r.fadeIn[0],fadeOut:r.fadeOut[0]})}},Ur=1.8;function uC({context:r,x:e,y:t,width:i,height:n,radii:s}){let o,a,c,l;typeof s=="number"?o=a=c=l=s:[o,a,c,l]=s,r.beginPath(),r.moveTo(e+Math.min(n/Ur,o),t),r.lineTo(e+i-Math.min(n/Ur,a),t),r.quadraticCurveTo(e+i,t,e+i,t+Math.min(n/Ur,a)),r.lineTo(e+i,t+n-Math.min(n/Ur,c)),r.quadraticCurveTo(e+i,t+n,e+i-Math.min(n/Ur,c),t+n),r.lineTo(e+Math.min(n/Ur,l),t+n),r.quadraticCurveTo(e,t+n,e,t+n-Math.min(n/Ur,l)),r.lineTo(e,t+Math.min(n/Ur,o)),r.quadraticCurveTo(e,t,e+Math.min(n/Ur,o),t),r.closePath()}function hC({context:r,x:e,y:t,width:i,height:n,radii:s,clip:o=!1,debug:a=!1}){uC({context:r,x:e,y:t,width:i,height:n,radii:s}),a&&(r.strokeStyle="blue",r.stroke()),o&&r.clip()}function sd(){var r=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},n={};i.L=1,n[1]="L",Object.keys(t).forEach(function(m,w){i[m]=1<<w+1,n[i[m]]=m}),Object.freeze(i);var s=i.LRI|i.RLI|i.FSI,o=i.L|i.R|i.AL,a=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,c=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,l=i.S|i.WS|i.B|s|i.PDI|c,u=null;function A(){if(!u){u=new Map;var m=function(N){if(t.hasOwnProperty(N)){var G=0;t[N].split(",").forEach(function(z){var oe=z.split("+"),ce=oe[0],he=oe[1];ce=parseInt(ce,36),he=he?parseInt(he,36):0,u.set(G+=ce,i[N]);for(var ve=0;ve<he;ve++)u.set(++G,i[N])})}};for(var w in t)m(w)}}function h(m){return A(),u.get(m.codePointAt(0))||i.L}function d(m){return n[h(m)]}var f={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function g(m,w){var N=36,G=0,z=new Map,oe=w&&new Map,ce;return m.split(",").forEach(function he(ve){if(ve.indexOf("+")!==-1)for(var Be=+ve;Be--;)he(ce);else{ce=ve;var Le=ve.split(">"),Pe=Le[0],tt=Le[1];Pe=String.fromCodePoint(G+=parseInt(Pe,N)),tt=String.fromCodePoint(G+=parseInt(tt,N)),z.set(Pe,tt),w&&oe.set(tt,Pe)}}),{map:z,reverseMap:oe}}var p,E,y;function B(){if(!p){var m=g(f.pairs,!0),w=m.map,N=m.reverseMap;p=w,E=N,y=g(f.canonical,!1).map}}function C(m){return B(),p.get(m)||null}function x(m){return B(),E.get(m)||null}function Q(m){return B(),y.get(m)||null}var _=i.L,M=i.R,P=i.EN,D=i.ES,$=i.ET,K=i.AN,ee=i.CS,Z=i.B,L=i.S,U=i.ON,V=i.BN,k=i.NSM,R=i.AL,F=i.LRO,J=i.RLO,Y=i.LRE,re=i.RLE,se=i.PDF,fe=i.LRI,me=i.RLI,De=i.FSI,be=i.PDI;function ke(m,w){for(var N=125,G=new Uint32Array(m.length),z=0;z<m.length;z++)G[z]=h(m[z]);var oe=new Map;function ce(Yt,Ir){var Vt=G[Yt];G[Yt]=Ir,oe.set(Vt,oe.get(Vt)-1),Vt&a&&oe.set(a,oe.get(a)-1),oe.set(Ir,(oe.get(Ir)||0)+1),Ir&a&&oe.set(a,(oe.get(a)||0)+1)}for(var he=new Uint8Array(m.length),ve=new Map,Be=[],Le=null,Pe=0;Pe<m.length;Pe++)Le||Be.push(Le={start:Pe,end:m.length-1,level:w==="rtl"?1:w==="ltr"?0:mp(Pe,!1)}),G[Pe]&Z&&(Le.end=Pe,Le=null);for(var tt=re|Y|J|F|s|be|se|Z,ot=function(Yt){return Yt+(Yt&1?1:2)},vt=function(Yt){return Yt+(Yt&1?2:1)},rt=0;rt<Be.length;rt++){Le=Be[rt];var j=[{_level:Le.level,_override:0,_isolate:0}],ue=void 0,Ce=0,Me=0,Ne=0;oe.clear();for(var Oe=Le.start;Oe<=Le.end;Oe++){var We=G[Oe];if(ue=j[j.length-1],oe.set(We,(oe.get(We)||0)+1),We&a&&oe.set(a,(oe.get(a)||0)+1),We&tt)if(We&(re|Y)){he[Oe]=ue._level;var Ct=(We===re?vt:ot)(ue._level);Ct<=N&&!Ce&&!Me?j.push({_level:Ct,_override:0,_isolate:0}):Ce||Me++}else if(We&(J|F)){he[Oe]=ue._level;var Jr=(We===J?vt:ot)(ue._level);Jr<=N&&!Ce&&!Me?j.push({_level:Jr,_override:We&J?M:_,_isolate:0}):Ce||Me++}else if(We&s){We&De&&(We=mp(Oe+1,!0)===1?me:fe),he[Oe]=ue._level,ue._override&&ce(Oe,ue._override);var yt=(We===me?vt:ot)(ue._level);yt<=N&&Ce===0&&Me===0?(Ne++,j.push({_level:yt,_override:0,_isolate:1,_isolInitIndex:Oe})):Ce++}else if(We&be){if(Ce>0)Ce--;else if(Ne>0){for(Me=0;!j[j.length-1]._isolate;)j.pop();var gr=j[j.length-1]._isolInitIndex;gr!=null&&(ve.set(gr,Oe),ve.set(Oe,gr)),j.pop(),Ne--}ue=j[j.length-1],he[Oe]=ue._level,ue._override&&ce(Oe,ue._override)}else We&se?(Ce===0&&(Me>0?Me--:!ue._isolate&&j.length>1&&(j.pop(),ue=j[j.length-1])),he[Oe]=ue._level):We&Z&&(he[Oe]=Le.level);else he[Oe]=ue._level,ue._override&&We!==V&&ce(Oe,ue._override)}for(var jt=[],Bt=null,qt=Le.start;qt<=Le.end;qt++){var jr=G[qt];if(!(jr&c)){var qr=he[qt],Sa=jr&s,pr=jr===be;Bt&&qr===Bt._level?(Bt._end=qt,Bt._endsWithIsolInit=Sa):jt.push(Bt={_start:qt,_end:qt,_level:qr,_startsWithPDI:pr,_endsWithIsolInit:Sa})}}for(var Ls=[],Tn=0;Tn<jt.length;Tn++){var kt=jt[Tn];if(!kt._startsWithPDI||kt._startsWithPDI&&!ve.has(kt._start)){for(var bn=[Bt=kt],Vi=void 0;Bt&&Bt._endsWithIsolInit&&(Vi=ve.get(Bt._end))!=null;)for(var pi=Tn+1;pi<jt.length;pi++)if(jt[pi]._start===Vi){bn.push(Bt=jt[pi]);break}for(var Fr=[],Ki=0;Ki<bn.length;Ki++)for(var Sn=bn[Ki],ks=Sn._start;ks<=Sn._end;ks++)Fr.push(ks);for(var SA=he[Fr[0]],xa=Le.level,xn=Fr[0]-1;xn>=0;xn--)if(!(G[xn]&c)){xa=he[xn];break}var Ms=Fr[Fr.length-1],xA=he[Ms],wa=Le.level;if(!(G[Ms]&s)){for(var wn=Ms+1;wn<=Le.end;wn++)if(!(G[wn]&c)){wa=he[wn];break}}Ls.push({_seqIndices:Fr,_sosType:Math.max(xa,SA)%2?M:_,_eosType:Math.max(wa,xA)%2?M:_})}}for(var Fs=0;Fs<Ls.length;Fs++){var Qn=Ls[Fs],Te=Qn._seqIndices,Wi=Qn._sosType,wA=Qn._eosType,Xr=he[Te[0]]&1?M:_;if(oe.get(k))for(var Rn=0;Rn<Te.length;Rn++){var Ps=Te[Rn];if(G[Ps]&k){for(var mi=Wi,_n=Rn-1;_n>=0;_n--)if(!(G[Te[_n]]&c)){mi=G[Te[_n]];break}ce(Ps,mi&(s|be)?U:mi)}}if(oe.get(P))for(var Dn=0;Dn<Te.length;Dn++){var Ns=Te[Dn];if(G[Ns]&P)for(var Ei=Dn-1;Ei>=-1;Ei--){var ar=Ei===-1?Wi:G[Te[Ei]];if(ar&o){ar===R&&ce(Ns,K);break}}}if(oe.get(R))for(var Ii=0;Ii<Te.length;Ii++){var Os=Te[Ii];G[Os]&R&&ce(Os,M)}if(oe.get(D)||oe.get(ee))for(var T=1;T<Te.length-1;T++){var b=Te[T];if(G[b]&(D|ee)){for(var O=0,H=0,X=T-1;X>=0&&(O=G[Te[X]],!!(O&c));X--);for(var te=T+1;te<Te.length&&(H=G[Te[te]],!!(H&c));te++);O===H&&(G[b]===D?O===P:O&(P|K))&&ce(b,O)}}if(oe.get(P))for(var ne=0;ne<Te.length;ne++){var ae=Te[ne];if(G[ae]&P){for(var de=ne-1;de>=0&&G[Te[de]]&($|c);de--)ce(Te[de],P);for(ne++;ne<Te.length&&G[Te[ne]]&($|c|P);ne++)G[Te[ne]]!==P&&ce(Te[ne],P)}}if(oe.get($)||oe.get(D)||oe.get(ee))for(var le=0;le<Te.length;le++){var Ee=Te[le];if(G[Ee]&($|D|ee)){ce(Ee,U);for(var Se=le-1;Se>=0&&G[Te[Se]]&c;Se--)ce(Te[Se],U);for(var Ye=le+1;Ye<Te.length&&G[Te[Ye]]&c;Ye++)ce(Te[Ye],U)}}if(oe.get(P))for(var at=0,Je=Wi;at<Te.length;at++){var Mt=Te[at],Pt=G[Mt];Pt&P?Je===_&&ce(Mt,_):Pt&o&&(Je=Pt)}if(oe.get(a)){var mr=M|P|K,lr=mr|_,Ji=[];{for(var zr=[],Ln=0;Ln<Te.length;Ln++)if(G[Te[Ln]]&a){var Us=m[Te[Ln]],lp=void 0;if(C(Us)!==null)if(zr.length<63)zr.push({char:Us,seqIndex:Ln});else break;else if((lp=x(Us))!==null)for(var Gs=zr.length-1;Gs>=0;Gs--){var QA=zr[Gs].char;if(QA===lp||QA===x(Q(Us))||C(Q(QA))===Us){Ji.push([zr[Gs].seqIndex,Ln]),zr.length=Gs;break}}}Ji.sort(function(Yt,Ir){return Yt[0]-Ir[0]})}for(var RA=0;RA<Ji.length;RA++){for(var cp=Ji[RA],Qa=cp[0],_A=cp[1],Ap=!1,Er=0,DA=Qa+1;DA<_A;DA++){var up=Te[DA];if(G[up]&lr){Ap=!0;var hp=G[up]&mr?M:_;if(hp===Xr){Er=hp;break}}}if(Ap&&!Er){Er=Wi;for(var LA=Qa-1;LA>=0;LA--){var dp=Te[LA];if(G[dp]&lr){var fp=G[dp]&mr?M:_;fp!==Xr?Er=fp:Er=Xr;break}}}if(Er){if(G[Te[Qa]]=G[Te[_A]]=Er,Er!==Xr){for(var Hs=Qa+1;Hs<Te.length;Hs++)if(!(G[Te[Hs]]&c)){h(m[Te[Hs]])&k&&(G[Te[Hs]]=Er);break}}if(Er!==Xr){for(var $s=_A+1;$s<Te.length;$s++)if(!(G[Te[$s]]&c)){h(m[Te[$s]])&k&&(G[Te[$s]]=Er);break}}}}for(var vi=0;vi<Te.length;vi++)if(G[Te[vi]]&a){for(var gp=vi,kA=vi,MA=Wi,Ys=vi-1;Ys>=0;Ys--)if(G[Te[Ys]]&c)gp=Ys;else{MA=G[Te[Ys]]&mr?M:_;break}for(var pp=wA,Vs=vi+1;Vs<Te.length;Vs++)if(G[Te[Vs]]&(a|c))kA=Vs;else{pp=G[Te[Vs]]&mr?M:_;break}for(var FA=gp;FA<=kA;FA++)G[Te[FA]]=MA===pp?MA:Xr;vi=kA}}}for(var Xt=Le.start;Xt<=Le.end;Xt++){var CQ=he[Xt],Ra=G[Xt];if(CQ&1?Ra&(_|P|K)&&he[Xt]++:Ra&M?he[Xt]++:Ra&(K|P)&&(he[Xt]+=2),Ra&c&&(he[Xt]=Xt===0?Le.level:he[Xt-1]),Xt===Le.end||h(m[Xt])&(L|Z))for(var _a=Xt;_a>=0&&h(m[_a])&l;_a--)he[_a]=Le.level}}return{levels:he,paragraphs:Be};function mp(Yt,Ir){for(var Vt=Yt;Vt<m.length;Vt++){var Ci=G[Vt];if(Ci&(M|R))return 1;if(Ci&(Z|_)||Ir&&Ci===be)return 0;if(Ci&s){var Ep=yQ(Vt);Vt=Ep===-1?m.length:Ep}}return 0}function yQ(Yt){for(var Ir=1,Vt=Yt+1;Vt<m.length;Vt++){var Ci=G[Vt];if(Ci&Z)break;if(Ci&be){if(--Ir===0)return Vt}else Ci&s&&Ir++}return-1}}var pe="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",xe;function He(){if(!xe){var m=g(pe,!0),w=m.map,N=m.reverseMap;N.forEach(function(G,z){w.set(z,G)}),xe=w}}function Re(m){return He(),xe.get(m)||null}function Xe(m,w,N,G){var z=m.length;N=Math.max(0,N==null?0:+N),G=Math.min(z-1,G==null?z-1:+G);for(var oe=new Map,ce=N;ce<=G;ce++)if(w[ce]&1){var he=Re(m[ce]);he!==null&&oe.set(ce,he)}return oe}function we(m,w,N,G){var z=m.length;N=Math.max(0,N==null?0:+N),G=Math.min(z-1,G==null?z-1:+G);var oe=[];return w.paragraphs.forEach(function(ce){var he=Math.max(N,ce.start),ve=Math.min(G,ce.end);if(he<ve){for(var Be=w.levels.slice(he,ve+1),Le=ve;Le>=he&&h(m[Le])&l;Le--)Be[Le]=ce.level;for(var Pe=ce.level,tt=1/0,ot=0;ot<Be.length;ot++){var vt=Be[ot];vt>Pe&&(Pe=vt),vt<tt&&(tt=vt|1)}for(var rt=Pe;rt>=tt;rt--)for(var j=0;j<Be.length;j++)if(Be[j]>=rt){for(var ue=j;j+1<Be.length&&Be[j+1]>=rt;)j++;j>ue&&oe.push([ue+he,j+he])}}}),oe}function S(m,w,N,G){var z=I(m,w,N,G),oe=[].concat(m);return z.forEach(function(ce,he){oe[he]=(w.levels[ce]&1?Re(m[ce]):null)||m[ce]}),oe.join("")}function I(m,w,N,G){for(var z=we(m,w,N,G),oe=[],ce=0;ce<m.length;ce++)oe[ce]=ce;return z.forEach(function(he){for(var ve=he[0],Be=he[1],Le=oe.slice(ve,Be+1),Pe=Le.length;Pe--;)oe[Be-Pe]=Le[Pe]}),oe}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=Q,e.getEmbeddingLevels=ke,e.getMirroredCharacter=Re,e.getMirroredCharactersMap=Xe,e.getReorderSegments=we,e.getReorderedIndices=I,e.getReorderedString=S,e.openingToClosingBracket=C,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return r}const od=Object.freeze(Object.defineProperty({__proto__:null,default:sd},Symbol.toStringTag,{value:"Module"})),dC=typeof od=="function"?od:sd;function fC(r,e){return r==="start"?e==="rtl"?"right":"left":r==="end"?e==="rtl"?"left":"right":r??"left"}const ad=dC();function gC(r){var e;if(!r)return"ltr";try{const{paragraphs:t}=ad.getEmbeddingLevels(r);return(((e=t[0])==null?void 0:e.level)??0)%2===1?"rtl":"ltr"}catch{return"ltr"}}function pC(r){return{order:r.map((e,t)=>t),directions:r.map(()=>"ltr"),baseDirection:"ltr"}}function mC(r,e){var t;if(!r.length)return{order:[],directions:[],baseDirection:e??"ltr"};try{const i=r.map(({text:d})=>d).join(" "),{levels:n,paragraphs:s}=ad.getEmbeddingLevels(i,e),o=((t=s[0])==null?void 0:t.level)??0,a=o%2===1?"rtl":"ltr",c=[];let l=0;for(const d of r)c.push(n[l]??o),l+=d.text.length+1;const u=r.map((d,f)=>f),A=Math.max(...c);for(let d=A;d>=1;d--){let f=-1;for(let g=0;g<=u.length;g++){const p=g<u.length&&c[u[g]]>=d;if(p&&f<0)f=g;else if(!p&&f>=0){const E=u.slice(f,g).reverse();u.splice(f,E.length,...E),f=-1}}}const h=c.map(d=>d%2===1?"rtl":"ltr");return{order:u,directions:h,baseDirection:a}}catch{return pC(r)}}const EC=500;function IC(){const r=new Map,e={has:t=>r.has(t),get:t=>r.get(t),set:(t,i)=>{if(r.size>=EC&&!r.has(t)){const n=r.keys().next();n.done||r.delete(n.value)}r.set(t,i)},delete:t=>r.delete(t),clear:()=>r.clear()};return typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",()=>e.clear()),e}let Pl;function vC(){return Pl===void 0&&(Pl=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"word"}):null),Pl}const ld=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function CC(r){return r.split(`
2462
- `).map(e=>{if(!e)return[];const t=[];for(const i of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(i))t.push({text:i,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(ld.test(i))for(const n of cd(i))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:i,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function cd(r){const e=[];let t=!1,i="";const n=vC();if(!n)return[{text:r,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(r)){if(!o&&s.trim().length===0){t=e.length>0?!0:t;continue}if(o){e.push({text:s,spaceBefore:t}),t=!1;continue}e.length>0?e[e.length-1].text+=s:i+=s}return i&&e.length>0?e[0].text=i+e[0].text:i&&e.push({text:i,spaceBefore:t}),e}function yC(r){const e=[];for(const t of r){const n=ld.test(t.text)||/\s/.test(t.text)?cd(t.text):[{text:t.text,spaceBefore:!1}];if(n.length<=1){e.push({text:t.text,logicalIndex:e.length,whitespace:!1,spaceBefore:e.length>0,timing:{id:t.id,start:t.start,end:t.end}});continue}const s=n.reduce((c,l)=>c+[...l.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((c,l)=>{const u=[...c.text].length/s*o,A=a,h=l===n.length-1?t.end:a+u;a=h,e.push({text:c.text,logicalIndex:e.length,whitespace:!1,spaceBefore:l===0?e.length>0:c.spaceBefore,timing:{id:t.id,subIndex:l,start:A,end:h}})})}return e}const BC=/(?<value>\d+\.?\d*)(?=px)/,Nl=1;function TC(r,e){const t=typeof r=="string"?CC(r):[yC(r)];return e?t.map(i=>i.map(n=>({...n,text:n.text.toUpperCase()}))):t}function bC({context:r,groups:e,appendedFont:t,fontSizes:i,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:c}){const l=[],u=h=>{const d=i[h%i.length];return{fontSize:d,font:t.replace(BC,d.toString())}},A=(h,d)=>(r.font=h,r.letterSpacing=`${a}px`,r.measureText(d));for(const h of e){const d=l.length,{fontSize:f,font:g}=u(l.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},E="",y="";const B=()=>{const C=A(p.font,"");p.fontAscent=C.fontBoundingBoxAscent,p.fontDescent=C.fontBoundingBoxDescent,l.push(p);const x=u(l.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},E="",y=""};for(const C of h){if(C.whitespace){y+=C.text;continue}const x=()=>{const M=p.items.length>0&&C.spaceBefore&&!y?" ":y,P=M?A(p.font,M).width:0,D=A(p.font,C.text);return{token:C,metrics:D,width:D.width+o,gapBefore:P,gapText:M}};let Q=x();const _=c?A(p.font,E+Q.gapText+C.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&_>n+Nl&&p.items.length>0&&(B(),Q=x()),s&&c&&p.items.length===0&&Q.width>n+Nl){let M=C.text;for(;M.length>0;){let P="";for(const $ of M){const K=A(p.font,P+$).width+o;if(P&&K>n+Nl)break;P+=$}M=M.slice(P.length);const D=A(p.font,P);p.items.push({token:{...C,text:P},metrics:D,width:D.width+o,gapBefore:0,gapText:""}),E=P,p.lineWidth=D.width+o*p.items.length,M.length>0&&B()}y="";continue}p.items.push(Q),E+=Q.gapText+C.text,p.lineWidth=c?A(p.font,E).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,y=""}c&&y&&(p.items.length>0||l.length===d)&&(E+=y,p.lineWidth=A(p.font,E).width+o*p.items.length),(p.items.length>0||l.length===d)&&B()}return l}const Ad=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"},{family:"Noto Telugu",regex:new RegExp("\\p{Script=Telugu}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTelugu-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Tamil",regex:new RegExp("\\p{Script=Tamil}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTamil-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Kannada",regex:new RegExp("\\p{Script=Kannada}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKannada-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Malayalam",regex:new RegExp("\\p{Script=Malayalam}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMalayalam-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Bengali",regex:new RegExp("\\p{Script=Bengali}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansBengali-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gujarati",regex:new RegExp("\\p{Script=Gujarati}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGujarati-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gurmukhi",regex:new RegExp("\\p{Script=Gurmukhi}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGurmukhi-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Sinhala",regex:new RegExp("\\p{Script=Sinhala}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSinhala-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Thai",regex:new RegExp("\\p{Script=Thai}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansThai-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Lao",regex:new RegExp("\\p{Script=Lao}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansLao-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Khmer",regex:new RegExp("\\p{Script=Khmer}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKhmer-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Myanmar",regex:new RegExp("\\p{Script=Myanmar}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMyanmar-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Ethiopic",regex:new RegExp("\\p{Script=Ethiopic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansEthiopic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Armenian",regex:new RegExp("\\p{Script=Armenian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArmenian-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Georgian",regex:new RegExp("\\p{Script=Georgian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGeorgian-VariableFont_wdth%2Cwght.woff2",style:"normal"}];function ud({text:r,font:e}){let t=e;return Ad.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}function hd(r){return Math.max(r??1,.5)}function SC({measured:r,index:e,lineTop:t,dx:i,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:c}){const{items:l,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=r;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=hd(a),E=A*p+c,y=(p-1)*A/2,B=(A+d-f)/2,C=t+y+B+c/2,{order:x,directions:Q,baseDirection:_}=mC(l.map(({token:Z})=>({text:Z.text})),o),M=l.map(({gapBefore:Z})=>Z);let P=i+g+c/2;const D=[];x.forEach((Z,L)=>{const U=l[Z];P+=M[L],D.push({...U.token,x:P,baselineY:C,width:U.width,lineIndex:e,direction:Q[Z],font:u,metrics:U.metrics}),P+=U.width});const $=[],K=[];D.forEach((Z,L)=>{const U=$[$.length-1];if(U&&U.direction===Z.direction){const V=Math.max(U.x+U.width,Z.x+Z.width);U.tokens.push(Z),U.x=Math.min(U.x,Z.x),U.width=V-U.x,K[K.length-1].push(x[L])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),K.push([x[L]])}),$.forEach((Z,L)=>{const U=[...K[L]].sort((V,k)=>V-k);Z.text=U.map((V,k)=>k===0?l[V].token.text:`${l[V].gapText}${l[V].token.text}`).join("")});const ee=o??_;return{index:e,box:{x:i+g,y:t,width:h,height:E},baselineY:C,direction:ee,runs:$,tokens:D}}function xC(r){const{context:e,text:t,font:i,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:c=a,align:l="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=r,E=TC(t,p),y=E.flat().map(({text:Q})=>Q).join(" "),B=ud({font:i,text:y}),C=u??gC(y),x=fC(l,C);try{e.save();const Q=bC({context:e,groups:E,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),_=[];let M=o;for(let ee=0;ee<Q.length;ee++){const Z=SC({measured:Q[ee],index:ee,lineTop:M,dx:s,dw:c,align:x,direction:u,lineHeight:A,strokeWidth:f});_.push(Z),M+=Z.box.height+h}const P=Q[Q.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*hd(A))/2):0,$=_.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,_.length-1)+D,K=_.length?{x:Math.min(..._.map(({box:ee})=>ee.x)),y:Math.min(..._.map(({box:ee})=>ee.y)),width:Math.max(..._.map(({box:ee})=>ee.x+ee.width))-Math.min(..._.map(({box:ee})=>ee.x)),height:Math.max(..._.map(({box:ee})=>ee.y+ee.height))-Math.min(..._.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:_,totalHeight:$,blockBox:K,direction:C,font:B}}finally{e.restore()}}gu(xC,{cache:IC(),cacheKey:([r])=>JSON.stringify([r.text,r.font,r.fontSizes,r.dx,r.dy,r.dw,r.maxW,r.align,r.direction,r.lineHeight,r.lineGap,r.letterSpacing,r.strokeWidth,r.wrap,r.uppercase])});function wC(r){return r.slice(0,1).toUpperCase()+r.slice(1)}Object.keys(Yh).map(r=>({label:wC(r),value:r,data:r}));const QC=Ar(()=>Ou.loadYoga());function RC(r=.4,e=.4){const t=Math.max(.1,Math.min(.8,r)),i=Math.max(.2,Math.min(.6,e)),s=(1-t)/2,a=1-i;return[{x:0,y:s},{x:a,y:s},{x:a,y:0},{x:1,y:.5},{x:a,y:1},{x:a,y:1-s},{x:0,y:1-s}]}const wo=64;function _C(){const r=[],e={x:.5,y:.5},t=.5;for(let i=0;i<wo;i++){const n=i/wo*2*Math.PI,s=e.x+t*Math.cos(n),o=e.y+t*Math.sin(n);r.push({x:s,y:o})}return r}function DC(r=1){const e=[],t={x:.5,y:.5};let i,n;r>=1?(i=.5,n=.5/r):(i=.5*r,n=.5);for(let s=0;s<wo;s++){const o=s/wo*2*Math.PI,a=t.x+i*Math.cos(o),c=t.y+n*Math.sin(o);e.push({x:a,y:c})}return e}function LC(){const r=[];for(let t=0;t<=100;t++){const i=t/100*2*Math.PI,n=16*Math.sin(i)**3,s=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i)),o=(n+16)/32,a=(s+13)/26;r.push({x:o,y:a})}return r}function dd(r=0,e=1){if(r===0)return[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];const t=r*Math.PI/180,i=Math.tan(t)/e;return[{x:Math.max(0,Math.min(1,0+i)),y:0},{x:Math.max(0,Math.min(1,1+i)),y:0},{x:Math.max(0,Math.min(1,1-i)),y:1},{x:Math.max(0,Math.min(1,0-i)),y:1}]}function Qo(r){if(r<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let l=0;l<r;l++){const u=l*2*Math.PI/r-Math.PI/2,A=Math.cos(u),h=Math.sin(u);t.push({x:A,y:h})}const i=Math.min(...t.map(l=>l.x)),n=Math.max(...t.map(l=>l.x)),s=Math.min(...t.map(l=>l.y)),o=Math.max(...t.map(l=>l.y)),a=n-i,c=o-s;for(const l of t){const u=(l.x-i)/a,A=(l.y-s)/c;e.push({x:u,y:A})}return e}function fd(r=90){const e=r*Math.PI/180,i=.5/Math.tan(e),s=1/(1+Math.abs(i)*2),o=i*s;return[{x:.5+o,y:0},{x:1,y:.5},{x:.5-o,y:1},{x:0,y:.5}]}function kC(r=5,e=.4){const t=[];for(let n=0;n<r*2;n++){const s=n*Math.PI/r-Math.PI/2,o=n%2===0?.5:e,a=.5+o*Math.cos(s),c=.5+o*Math.sin(s);t.push({x:a,y:c})}return t}function MC(r="isosceles",e={}){switch(r){case"equilateral":return FC();case"isosceles":return gd(e.baseAngle??60);case"right":return PC(e.rightAnglePosition??"bottom-left");case"scalene":return NC(e.angles??[60,60,60])}}function FC(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function gd(r){const e=r*Math.PI/180,t=.5/Math.tan(e),i=Math.max(.1,Math.min(2,t));return[{x:.5,y:1-Math.min(1,i)},{x:0,y:1},{x:1,y:1}]}function PC(r){switch(r){case"top":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}];case"bottom-left":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}];case"bottom-right":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}}function NC(r){return gd(r[0])}function OC(r={},e=1){const{type:t="rectangle",customPolygon:i,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:c,regularPolygon:l}=r;switch(t){case"rectangle":return dd(0,e);case"parallelogram":return dd((n==null?void 0:n.angle)??30,e);case"triangle":return MC((s==null?void 0:s.type)??"isosceles",{baseAngle:s==null?void 0:s.baseAngle,angles:s==null?void 0:s.angles,rightAnglePosition:s==null?void 0:s.rightAnglePosition});case"rhombus":return fd((o==null?void 0:o.angle)??90);case"diamond":return fd(90);case"pentagon":return Qo(5);case"hexagon":return Qo(6);case"octagon":return Qo(8);case"star":return kC((c==null?void 0:c.points)??5,(c==null?void 0:c.innerRadius)??.4);case"arrow":return RC((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return LC();case"circle":return _C();case"ellipse":return DC(e);case"custom-polygon":if(!(i!=null&&i.points)||i.points.length<3)throw new Error("Custom polygon must have at least 3 points");return i.points;default:return Qo((l==null?void 0:l.sides)??6)}}function UC(r,e){let t=!1;const i=r.x,n=r.y;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,l=e[o].x,u=e[o].y;c>n!=u>n&&i<(l-a)*(n-c)/(u-c)+a&&(t=!t)}return t}function GC(r,e){let t=1,i=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;UC({x:o,y:r},e)&&(t=Math.min(t,o),i=Math.max(i,o))}return i>=t?{left:t,right:i}:null}function HC(r){const e=Math.min(...r.map(c=>c.y)),t=Math.max(...r.map(c=>c.y));let i={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let c=0;c<=s;c++){const l=e+c*o;a.push({y:l,span:GC(l,r)})}for(let c=0;c<a.length-1;c++){const l=a[c].y;for(let u=c+1;u<a.length;u++){const h=a[u].y-l;let d=0,f=1,g=!0;const p=Math.min(5,u-c+1);for(let E=0;E<p;E++){const y=c+Math.floor(E/(p-1)*(u-c)),B=a[y].span;if(B){if(d=Math.max(d,B.left),f=Math.min(f,B.right),d>=f){g=!1;break}}else{g=!1;break}}if(g&&f>d){const E=f-d,y=E*h;y>n&&(n=y,i={x:d,y:l,width:E,height:h})}}}return i}function $C(r,e=1){const t=OC(r,e);if(t.length<3)return{top:0,right:0,bottom:0,left:0};if(r.type==="rectangle")return{top:0,right:0,bottom:0,left:0};const i=HC(t),n=i.y,s=i.x,o=1-(i.x+i.width),a=1-(i.y+i.height);return{top:Math.max(0,n),right:Math.max(0,o),bottom:Math.max(0,a),left:Math.max(0,s)}}const YC="video",VC=.01,pd=(r,e)=>Math.abs(r-e)<=e*VC,KC={type:YC,options:{flip:{type:"checkbox",name:"flip",label:"Flip"},loop:{type:"checkbox",name:"loop",label:"Loop"},speed:{type:"slider",name:"speed",label:"Speed",min:.5,max:2,step:.01,transform:{input:r=>r/100,output:r=>r*100,format:r=>`${(r*100).toFixed(0)}%`}},volume:{type:"slider",name:"volume",label:"Volume",min:0,max:1,step:.01,transform:{input:r=>r/2/100,output:r=>r*2*100,format:r=>`${(r*2*100).toFixed(0)}%`}}},transform:{values:r=>({flip:r.flip??!1,loop:r.loop??!1,crop:r.crop??{x:0,y:0,width:1,height:1},format:r.format??"letterbox",speed:[r.speed??1],volume:[r.volume??.5]}),options:r=>({flip:r.flip,loop:r.loop,crop:r.crop,format:r.format,speed:r.speed[0],volume:r.volume[0]})},width:({node:r,options:e,dependencies:t})=>{const{crop:i,format:n}=e;if(!t||n==="crop")return r.getComputedWidth();const s=t.aspectRatio*(((i==null?void 0:i.width)??1)/((i==null?void 0:i.height)??1)),o=r.getComputedWidth(),a=r.getComputedHeight(),c=o/a;return s>c||pd(s,c)?o:a*s},height:({node:r,options:e,dependencies:t})=>{const{crop:i,format:n}=e;if(!t||n==="crop")return r.getComputedHeight();const s=t.aspectRatio*(((i==null?void 0:i.width)??1)/((i==null?void 0:i.height)??1)),o=r.getComputedWidth(),a=r.getComputedHeight();return pd(s,o/a)?a:o/s},render:async({dx:r,dy:e,dw:t,dh:i,radius:n,sceneTime:s,options:o,dependencies:a,canvases:c})=>{const{crop:l,flip:u=!1,format:A="letterbox",speed:h=1}=o,d=c.sceneCanvas.getContext("2d");if(!d||!(a!=null&&a.video))return;const f=await a.video(s*h),g=(f==null?void 0:f.videoWidth)??(f==null?void 0:f.naturalWidth)??(f==null?void 0:f.width),p=(f==null?void 0:f.videoHeight)??(f==null?void 0:f.naturalHeight)??(f==null?void 0:f.height);if(g&&p){d.save();const{topLeft:E,topRight:y,bottomLeft:B,bottomRight:C}=n;hC({context:d,x:r,y:e,width:t,height:i,radii:[E,y,C,B]}),d.clip(),Nv({context:d,crop:l,flip:u,format:A,sourceWidth:g,sourceHeight:p,source:f,posX:r,posY:e,drawAreaWidth:t,drawAreaHeight:i,cropCanvas:c.cropCanvas,letterboxCanvas:c.letterboxCanvas}),d.restore()}}};function Zt(r){let e=0;for(const t of r)Array.isArray(t)?e+=Zt(t):e+=t;return e}function Ro(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const c=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,l=((s=r[i-1])==null?void 0:s.duration)??1/0,u=((o=r[i+1])==null?void 0:o.duration)??1/0,A=((a=r[i+2])==null?void 0:a.type)==="transition"?r[i+2]:null;return Math.min(c?l/2:l,t,A?u/2:u)*-1}return t})}function Ol(r,e){var t;const i=[];if(((t=r.renderer)==null?void 0:t.type)===e&&i.push(r),r.children)for(const n of r.children)i.push(...Ol(n,e));return i}function md(r){return r===null||typeof r=="number"&&!Number.isFinite(r)}function WC(r){const e={};for(const[t,i]of Object.entries(r))md(i)||(typeof i=="object"&&!Array.isArray(i)?e[t]=Object.fromEntries(Object.entries(i).filter(([,n])=>!md(n))):e[t]=i);return e}function JC(r){return typeof r=="number"?{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r}:{topLeft:(r==null?void 0:r.topLeft)??0,topRight:(r==null?void 0:r.topRight)??0,bottomRight:(r==null?void 0:r.bottomRight)??0,bottomLeft:(r==null?void 0:r.bottomLeft)??0}}function jC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:typeof r.top=="number"?r.top*e:r.top,right:typeof r.right=="number"?r.right*e:r.right,bottom:typeof r.bottom=="number"?r.bottom*e:r.bottom,left:typeof r.left=="number"?r.left*e:r.left}}function qC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function XC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function Ed(r,e,{layout:t,scale:i=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:c,minHeight:l,maxWidth:u,maxHeight:A,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:E,direction:y="column",align:B="start",alignSelf:C,justify:x="start"}=WC(t??{}),Q={static:r.POSITION_TYPE_STATIC,relative:r.POSITION_TYPE_RELATIVE,absolute:r.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(Q[n]),typeof s<"u"){const{top:D,right:$,bottom:K,left:ee}=jC(s,i);typeof D<"u"&&e.setPosition(r.EDGE_TOP,D),typeof $<"u"&&e.setPosition(r.EDGE_RIGHT,$),typeof K<"u"&&e.setPosition(r.EDGE_BOTTOM,K),typeof ee<"u"&&e.setPosition(r.EDGE_LEFT,ee)}const _={row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(_[y]);const M={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(M[B]),C&&e.setAlignSelf(M[C]);const P={start:r.JUSTIFY_FLEX_START,end:r.JUSTIFY_FLEX_END,center:r.JUSTIFY_CENTER,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND,"space-evenly":r.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(P[x]),typeof p<"u"){const{top:D,right:$,bottom:K,left:ee}=qC(p,i);e.setMargin(r.EDGE_TOP,D),e.setMargin(r.EDGE_RIGHT,$),e.setMargin(r.EDGE_BOTTOM,K),e.setMargin(r.EDGE_LEFT,ee)}if(typeof E<"u"){const{top:D,right:$,bottom:K,left:ee}=XC(E,i);e.setPadding(r.EDGE_TOP,D),e.setPadding(r.EDGE_RIGHT,$),e.setPadding(r.EDGE_BOTTOM,K),e.setPadding(r.EDGE_LEFT,ee)}typeof d<"u"||typeof f<"u"?(typeof d<"u"&&e.setFlexGrow(d),typeof f<"u"&&e.setFlexShrink(f)):typeof h<"u"&&e.setFlex(h),e.setGap(r.GUTTER_ALL,(g??0)*i),typeof o<"u"&&e.setWidth(typeof o=="number"?o*i:o),typeof a<"u"&&e.setHeight(typeof a=="number"?a*i:a),typeof c<"u"&&e.setMinWidth(typeof c=="number"?c*i:c),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*i:l),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*i:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*i:A)}async function Id({id:r,yoga:e,index:t,parent:i,element:n,resolvers:s}){var o,a,c;const{layout:l={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();Ed(e,d,{layout:l}),i.insertChild(d,t);let f=null;s&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="caption"||(h==null?void 0:h.type)==="image"||(h==null?void 0:h.type)==="video")&&((h==null?void 0:h.type)==="caption"?f=await((o=s.text)==null?void 0:o.call(s,{id:r,config:u,options:A}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:r,config:u,options:A}))??null);const g=[];for await(const[p,E]of((c=n.children)==null?void 0:c.entries())??[])g.push(await Id({id:r,yoga:e,index:p,parent:d,element:E,resolvers:s}));return{node:d,radius:JC(l.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function vd(r,e,t=0,i=0){const{top:n,left:s}=r.getComputedLayout(),{top:o,left:a,width:c,height:l}=e.node.getComputedLayout(),u=t+a,A=i+o,h=e.childNodes.map(d=>vd(r,d,u,A));return{...e,x:s+u,y:n+A,width:c,height:l,childNodes:h}}async function Ul({yoga:r,root:e,tree:t,measureCanvas:i}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:c}of t){if(a){const{width:l,height:u}=a;if(l&&i){e.calculateLayout();const A=await l({node:n,options:s,dependencies:o,measureCanvas:i});A&&n.setWidth(A)}if(u&&i){e.calculateLayout();const A=await u({node:n,options:s,dependencies:o,measureCanvas:i});A&&n.setHeight(A)}if((s==null?void 0:s.format)==="crop"&&(o!=null&&o.aspectRatio)&&(a.type==="video"||a.type==="image")){const A=s.crop;if(!A||A.x===0&&A.y===0&&A.width===1&&A.height===1){e.calculateLayout();const d=n.getComputedWidth(),f=n.getComputedHeight();if(d>0&&f>0){const g=d/f,p=o.aspectRatio;if(Math.abs(g-p)>.001){let E,y;g<p?(E=g/p,y=1):(E=1,y=p/g),s.crop={x:(1-E)/2,y:(1-y)/2,width:E,height:y}}}}}if(await Ul({yoga:r,root:e,tree:c,measureCanvas:i}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=$C(s.shape,A/h);n.setPadding(r.EDGE_TOP,d.top*h),n.setPadding(r.EDGE_RIGHT,d.right*A),n.setPadding(r.EDGE_BOTTOM,d.bottom*h),n.setPadding(r.EDGE_LEFT,d.left*A)}}e.calculateLayout(),await Ul({yoga:r,root:e,tree:c,measureCanvas:i})}}async function Cd({id:r,root:e,resolvers:t,measureCanvas:i}){const n=await QC(),s=n.Node.create();Ed(n,s,{layout:e.layout});const o=await Id({id:r,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Ul({yoga:n,root:s,tree:[o],measureCanvas:i});const{top:a,left:c,width:l,height:u}=s.getComputedLayout(),A={root:{x:c,y:a,width:l,height:u},node:vd(s,o)};return s.freeRecursive(),A}function yd(){return document.createElement("canvas")}function zC(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function ZC(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}EE.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${ZC(r)}"`:zC(r)||Array.isArray(r)?JSON.stringify(r):r);function ey(r){return r.some(({type:e})=>e==="text")}function ty(r){return r.some(({type:e})=>e==="caption")}function ry(r){return r.some(({type:e})=>e==="audio")}function iy(r){return r.some(({type:e})=>e==="video"||e==="image")}function _o(r){return r.type==="audio"}function ny(r){return r.type==="video"}const sy="3";async function oy({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Cd({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function ay({track:r}){const e=Ro(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const c=Zt(e.slice(0,a));return s.push(oy({scene:o,start:c})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const c=Zt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:c,config:o,duration:o.duration}),s},[]),n=r.map(({id:s})=>t.find(({id:o})=>o===s)??i.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:i,mergedScenes:n,config:r,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function Bd({node:r,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var c,l,u,A,h;const d=e.sceneCanvas.getContext("2d");if(d){d.save(),d.setTransform(s);const f=(a==null?void 0:a.rotation)!=null&&((c=r.element.layout)!=null&&c.transform)?{...r.element.layout,transform:{...r.element.layout.transform,rotation:a.rotation}}:r.element.layout,g=id({layout:f,sceneTime:t,animations:r.element.animations,elementDuration:i,elementDimensions:{width:r.width,height:r.height}}),{opacity:p,translation:E,scale:y,clip:B,dimensions:C,rotation:x}=g,Q=r.width*C.widthRatio,_=r.height*C.heightRatio;if(d.globalAlpha=p*n,(E.x||E.y)&&d.translate(E.x,E.y),(y!==1||x!==0)&&(d.translate(r.x+Q/2,r.y+_/2),d.scale(y,y),d.rotate(x*Math.PI/180),d.translate(-(r.x+Q/2),-(r.y+_/2))),B){d.beginPath();const D={x:r.x+B.x*Q,y:r.y+B.y*_,width:B.width*Q,height:B.height*_};d.rect(D.x,D.y,D.width,D.height),d.clip()}if(o){const D=d.globalAlpha;d.globalAlpha=1,d.strokeStyle="red",d.strokeRect(r.x,r.y,Q,_),d.globalAlpha=D}const M=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...r.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((l=r.options)!=null&&l.font)?{font:{...r.options.font,size:a.fontSize}}:{}}:r.options,P=(a==null?void 0:a.fontSize)!=null&&((u=r.dependencies)!=null&&u.font)?{...r.dependencies,font:{...r.dependencies.font,size:a.fontSize}}:r.dependencies;await((h=(A=r.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:Q,dh:_,radius:r.radius,options:M,dependencies:P}));for await(const D of r.childNodes)await Bd({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function ly({layout:r,canvases:e,sceneTime:t,sceneDuration:i,debug:n=!1,override:s}){const{node:o}=r;await Bd({debug:n,node:o,canvases:e,sceneDuration:i,sceneTime:t,override:s})}async function Do({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=yd}){var a,c;const{id:l,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),E=o(),y=o(),B=o(),C=o(),x=await Cd({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof A=="number"?{position:"absolute",inset:{top:A,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((c=f.element.layout)==null?void 0:c.height)}}},resolvers:i,measureCanvas:C}),Q=async(_,M)=>{const P=Math.max(0,_-t);p.width=p.height=0,p.width=n,p.height=s,await ly({debug:r,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:E,letterboxCanvas:y,posterCanvas:B},override:M})};return{id:l,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function cy({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Ro(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="caption"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var E;return p===((E=e[d+1])==null?void 0:E.id)}),from:a.find(({id:p})=>{var E;return p===((E=e[d-1])==null?void 0:E.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function Ay({groups:r,tracks:e}){const t=r.map(s=>new Set(s.sceneIds)),i=r.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];_o(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let c,l=1/0;for(let u=0;u<r.length;u++){if(o===u)continue;const A=t[u];s.sceneIds.every(d=>A.has(d))&&A.size>t[o].size&&A.size<l&&(c=r[u].id,l=A.size)}return{id:s.id,sceneIds:s.sceneIds,animations:s.animations,bounds:s.bounds,kind:s.kind,topmostTrackIndex:a.length>0?Math.max(...a):-1,parentGroupId:c,depth:0}}),n=new Map(i.map(s=>[s.id,s]));for(const s of i){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return i}function uy({group:r,currentTime:e,activeMembers:t,fallbackDimensions:i}){if(!r.animations||t.length===0)return null;const n=Math.min(...t.map(A=>A.start)),o=Math.max(...t.map(A=>A.end))-n,a=Math.max(0,e-n),c=r.bounds,l=(c==null?void 0:c.width)??i.width,u=(c==null?void 0:c.height)??i.height;return id({sceneTime:a,animations:r.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function Td({group:r,animationState:e,targetCtx:t,fallbackDimensions:i}){const n=r.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??i.width,c=(n==null?void 0:n.height)??i.height,{opacity:l,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=l,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+c/2;t.translate(f,g),t.scale(A,A),t.rotate(d*Math.PI/180),t.translate(-f,-g)}h&&(t.beginPath(),t.rect(s+h.x*a,o+h.y*c,h.width*a,h.height*c),t.clip())}async function hy({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Ro(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="video"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var E;return p===((E=e[d+1])==null?void 0:E.id)}),from:a.find(({id:p})=>{var E;return p===((E=e[d-1])==null?void 0:E.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function dy({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Ro(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="text"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var E;return p===((E=e[d+1])==null?void 0:E.id)}),from:a.find(({id:p})=>{var E;return p===((E=e[d-1])==null?void 0:E.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const fy=(((Hh=Gh)==null?void 0:Hh.default)??Gh).reduce((r,e)=>(r[e.name]=e,r),{});function gy(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function py({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:c=!0}){var l,u,A;const h=gy(a,o);if(o.disable(o.DEPTH_TEST),h.buffer?o.bindBuffer(o.ARRAY_BUFFER,h.buffer):(h.buffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h.buffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),o.STATIC_DRAW)),o.viewport(0,0,n,s),h.fromTexture?h.fromTexture.setPixels(t):(h.fromTexture=(((l=yo)==null?void 0:l.default)??yo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=yo)==null?void 0:u.default)??yo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((A=Uh)==null?void 0:A.default)??Uh)(o,fy[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!c)return o.flush(),new Uint8Array(0);const f=new Uint8Array(n*s*4);return o.readPixels(0,0,n,s,o.RGBA,o.UNSIGNED_BYTE,f),o.flush(),f}function my(r){for(const[e,t]of r.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(i=>{i.dispose()}),r.delete(e)}function Ey({name:r,to:e,from:t,progress:i,canvas:n,contextResources:s}){const o=n.getContext("webgl",{alpha:!0,depth:!1,antialias:!1,preserveDrawingBuffer:!1});o&&(o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),py({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function bd({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=yd,drawTransition:o=Ey}){var a;const c=new Map,l=await Promise.all(e.tracks.map(async E=>{if(iy(E))return{...await hy({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(ey(E))return{...await dy({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(ty(E))return{...await cy({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(ry(E))return{...await ay({track:E}),config:E};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?Ay({groups:e.groups,tracks:l}):[],A=new Map,h=[...u].sort((E,y)=>E.depth-y.depth);for(const E of h)for(const y of E.sceneIds)A.set(y,E);const d=new Map(u.map(E=>[E.id,E]));function f(E){const y=[];let B=A.get(E.id);for(;B;)B.animations&&y.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return y}return{draw:async({canvas:E,currentTime:y,overrides:B,signal:C})=>{const x=E.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,E.width,E.height),x.save(),x.fillStyle="black",x.fillRect(0,0,E.width,E.height),x.restore();const Q=new Map;for(const D of l)if(!_o(D))for(const $ of D.scenes){if(y<$.start||y>=$.start+$.duration)continue;const K=$.layout,ee=K==null?void 0:K.node,Z={start:$.start,end:$.start+$.duration,x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0,width:(ee==null?void 0:ee.width)??E.width,height:(ee==null?void 0:ee.height)??E.height};let L=A.get($.id);for(;L;)L.animations&&(Q.has(L.id)||Q.set(L.id,[]),Q.get(L.id).push(Z)),L=L.parentGroupId?d.get(L.parentGroupId):void 0}const _=new Map;function M(D){if(_.has(D.id))return _.get(D.id);const $=uy({group:D,currentTime:y,activeMembers:Q.get(D.id)??[],fallbackDimensions:{width:E.width,height:E.height}});return _.set(D.id,$),$}function P(D,$,K){const ee=f({id:K});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const L=ee[Z],U=M(L);U&&Td({group:L,animationState:U,targetCtx:D,fallbackDimensions:{width:E.width,height:E.height}})}D.drawImage($,0,0,$.width,$.height),D.restore()}for(let D=0;D<l.length;D++){if(C!=null&&C.aborted)return;const $=l[D];if(_o($))continue;const{scenes:K,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=E.width,Z.height=E.height;const L=Z.getContext("2d");if(!L)continue;const U=K.filter(({start:R,duration:F})=>y>=R&&y<R+F);if(U.length===0)continue;const V=ee.find(({start:R,duration:F})=>y>=R&&y<R+F),k=!!(V&&V.to&&V.from&&V.duration>0);for await(const R of U){if(C!=null&&C.aborted)return;const{sceneCanvas:F,draw:J,id:Y}=R;if(await(J==null?void 0:J(y,B==null?void 0:B.get(Y))),C!=null&&C.aborted)return;k&&(V.to.id===Y||V.from.id===Y)||P(L,F,Y)}if(k){const{name:R,to:F,from:J,duration:Y,transitionCanvas:re}=V;re.width=re.height=0,re.width=Z.width,re.height=Z.height;const se=Math.min(1,Math.max(0,(y-F.start)/Y));if(await o({name:R,progress:se,contextResources:c,to:F.sceneCanvas,from:J.sceneCanvas,canvas:re}),C!=null&&C.aborted)return;const fe=new Set(f({id:J.id})),me=new Set(f({id:F.id})),be=[...fe].filter(ke=>me.has(ke)).sort((ke,pe)=>ke.depth-pe.depth);if(be.length===0)L.drawImage(re,0,0,re.width,re.height);else{L.save();for(const ke of be){const pe=M(ke);pe&&Td({group:ke,animationState:pe,targetCtx:L,fallbackDimensions:{width:E.width,height:E.height}})}L.drawImage(re,0,0,re.width,re.height),L.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{my(c)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:E})=>E))}}const os=.3,Lo=.5,Iy=1;function vy(r){return r.tracks.flatMap(t=>t.scenes).filter(ny).filter(t=>{var i;const n=Ol(t.config.root.element,"video")[0];if(!n||(i=n.config)!=null&&i.alpha)return!1;const{volume:s}=KC.transform.values(n.options??{});return s[0]>0}).map(({start:t,duration:i})=>({start:t,end:t+i})).sort((t,i)=>t.start-i.start).reduce((t,i)=>{const n=t[t.length-1];return n&&i.start-n.end<Iy?t[t.length-1]={start:n.start,end:Math.max(n.end,i.end)}:t.push(i),t},[])}const Cy=r=>Math.round(r*1e6)/1e6;function yy(r,e,t){return e.reduce((i,{start:n,end:s})=>r<=n-os||r>=s+Lo?i:r<n?Math.min(i,1-(1-t)*(r-(n-os))/os):r<=s?Math.min(i,t):Math.min(i,t+(1-t)*(r-s)/Lo),1)}function By(r,e){const t=Ol(r.config.root.element,"audio")[0],{duration:i}=r;if(!t||i<=0)return null;const n=AC.transform.values(t.options??{}),[s]=n.duckLevel,[o]=n.fadeIn,[a]=n.fadeOut,c=n.duck&&s<1?e.map(({start:A,end:h})=>({start:A-r.start,end:h-r.start})).filter(({start:A,end:h})=>A-os<i&&h+Lo>0):[];if(o<=0&&a<=0&&c.length===0)return null;const l=A=>Math.max(0,Math.min(1,o>0?A/o:1,a>0?(i-A)/a:1)),u=[0,i,o,i-a,...o>0&&a>0?[i*o/(o+a)]:[],...c.flatMap(({start:A,end:h})=>[A-os,A,h,h+Lo])];return[...new Set(u.filter(A=>A>=0&&A<=i).map(Cy))].sort((A,h)=>A-h).map(A=>({time:A,gain:l(A)*yy(A,c,s)}))}function Ty(r){const e=vy(r),t=new Map;for(const i of r.tracks)if(_o(i))for(const n of i.scenes){const s=By(n,e);s&&t.set(n.id,s)}return t}function by(r,e){if(r.length===0)return 1;if(e<=r[0].time)return r[0].gain;for(let t=1;t<r.length;t++){const i=r[t];if(e<=i.time){const n=r[t-1];return n.gain+(i.gain-n.gain)*(e-n.time)/(i.time-n.time)}}return r[r.length-1].gain}const Sy={name:"@vouchfor/embeds",version:"8.7.1",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","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 generate:manifest","test:browser":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner --config web-test-runner.ci.config.js","test:browser:local":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:watch":"yarn test:browser --watch",typecheck:"tsc --noEmit"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.2","@vouchfor/canvas-video":"^13.7.0","@vouchfor/media-player":"^9.7.1",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4","@open-wc/testing":"^4.0.0","@storybook/addon-docs":"^10.6.0","@storybook/addon-links":"^10.6.0","@storybook/web-components":"^10.6.0","@storybook/web-components-vite":"^10.6.0","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.10","@vouchfor/eslint-config":"^1.0.8","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"^6.7.0","@web/dev-server-esbuild":"^1.0.4","@web/test-runner":"^0.20.1","@web/test-runner-browserstack":"^0.8.0","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",dotenv:"^17.4.2",eslint:"^8.57.0",glob:"^10.4.5","lint-staged":"^15.5.1",lit:"^3.3.0",lodash:"^4.17.21",react:"^18.3.1","react-dom":"^18.3.1","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^10.6.0",svgson:"^5.3.1",typescript:"^5.8.3",vite:"^5.4.18","vite-plugin-commonjs":"^0.10.4","vite-plugin-dts":"^3.9.1","web-component-analyzer":"^2.0.0"}};function xy(r){const{publicApiUrl:e}=Zs(r),t=Qi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function wy(r){var s,o,a,c,l,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Qi()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(c=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:c.call(a,"vouch-uid-client"),i=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=Qi();return e||(e=xy(r),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=Qi(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=Qi(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",i)),{client:t,tab:i,request:n,visitor:e}}function Qy(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function Ry(r="embedded_player"){var n,s;const[e,t]=((s=(n=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:n.split)==null?void 0:s.call(n,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const c=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[c]=a}}),{source:r,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:Sy.version,templateVersion:sy,...i}}const Sd=1;class _y{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=Qy(i,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Zs(this.host.env),{client:i,tab:n,request:s,visitor:o}=wy(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":Ry(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Sd&&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:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:i,node:n},this._streamLatestTime[i]=n.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=n.currentTime,this._streamLatestTime[i]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Sd&&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,n;"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),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,n;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),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Gl={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ri<"u"&&ri,i=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof ri<"u"&&ri||{},c={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(L){return L&&DataView.prototype.isPrototypeOf(L)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var U={next:function(){var V=L.shift();return{done:V===void 0,value:V}}};return c.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(L){this.map={},L instanceof g?L.forEach(function(U,V){this.append(V,U)},this):Array.isArray(L)?L.forEach(function(U){if(U.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+U.length);this.append(U[0],U[1])},this):L&&Object.getOwnPropertyNames(L).forEach(function(U){this.append(U,L[U])},this)}g.prototype.append=function(L,U){L=h(L),U=d(U);var V=this.map[L];this.map[L]=V?V+", "+U:U},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,U){this.map[h(L)]=d(U)},g.prototype.forEach=function(L,U){for(var V in this.map)this.map.hasOwnProperty(V)&&L.call(U,this.map[V],V,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(U,V){L.push(V)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(U){L.push(U)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(U,V){L.push([V,U])}),f(L)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function E(L){return new Promise(function(U,V){L.onload=function(){U(L.result)},L.onerror=function(){V(L.error)}})}function y(L){var U=new FileReader,V=E(U);return U.readAsArrayBuffer(L),V}function B(L){var U=new FileReader,V=E(U),k=/charset=([A-Za-z0-9_-]+)/.exec(L.type),R=k?k[1]:"utf-8";return U.readAsText(L,R),V}function C(L){for(var U=new Uint8Array(L),V=new Array(U.length),k=0;k<U.length;k++)V[k]=String.fromCharCode(U[k]);return V.join("")}function x(L){if(L.slice)return L.slice(0);var U=new Uint8Array(L.byteLength);return U.set(new Uint8Array(L)),U.buffer}function Q(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:c.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:c.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():c.arrayBuffer&&c.blob&&l(L)?(this._bodyArrayBuffer=x(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||A(L))?this._bodyArrayBuffer=x(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var L=p(this);if(L)return L;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 L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return B(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)},c.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function M(L){var U=L.toUpperCase();return _.indexOf(U)>-1?U:L}function P(L,U){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var V=U.body;if(L instanceof P){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,U.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!V&&L._bodyInit!=null&&(V=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=M(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal||function(){if("AbortController"in a){var F=new AbortController;return F.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(V),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var k=/([?&])_=[^&]*/;if(k.test(this.url))this.url=this.url.replace(k,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(L){var U=new FormData;return L.trim().split("&").forEach(function(V){if(V){var k=V.split("="),R=k.shift().replace(/\+/g," "),F=k.join("=").replace(/\+/g," ");U.append(decodeURIComponent(R),decodeURIComponent(F))}}),U}function $(L){var U=new g,V=L.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(k){return k.indexOf(`
2461
+ `,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const Gh=il(Lv);var Hh;function kv(r){if(typeof r=="string"){const[e,t]=r.split(":");return Math.min(parseFloat(e),parseFloat(t))}return r}function Mv(r){if(typeof r=="string"){const[e,t]=r.split(":"),i=parseFloat(e),n=parseFloat(t);return i/n}return r}function kl({resolution:r,aspectRatio:e}){const t=kv(r),i=Mv(e),n=i>=1,s=Math.min(n?t*i:t/i,t),o=Math.max(n?t*i:t/i,t);return{resolution:t,aspectRatio:i,height:Math.round(n?s:o),width:Math.round(n?o:s)}}function $h({canvas:r,width:e,height:t,scaleFactor:i=1}){r.width=e*i,r.height=t*i}function Fv({context:r,scaleFactor:e=1}){r.scale(e,e)}function Pv({source:r,sx:e,sy:t,sw:i,sh:n,dx:s,dy:o,dw:a,dh:c}){const l=(r==null?void 0:r.naturalWidth)??(r==null?void 0:r.videoWidth)??(r==null?void 0:r.width),u=(r==null?void 0:r.naturalHeight)??(r==null?void 0:r.videoHeight)??(r==null?void 0:r.height);e=e??0,t=t??0,i=i??l,n=n??u,i<0&&(e+=i,i=Math.abs(i)),n<0&&(t+=n,n=Math.abs(n)),a<0&&(s+=a,a=Math.abs(a)),c<0&&(o+=c,c=Math.abs(c));const A=Math.max(e,0),h=Math.min(e+i,l),d=Math.max(t,0),f=Math.min(t+n,u),g=a/i,p=c/n;return[r,A,d,h-A,f-d,e<0?s-e*g:s,t<0?o-t*p:o,(h-A)*g,(f-d)*p]}function Nv({context:r,source:e,crop:t,flip:i,format:n="letterbox",posX:s,posY:o,scaleFactor:a=1,drawAreaWidth:c,drawAreaHeight:l,sourceWidth:u,sourceHeight:A,cropCanvas:h}){const{x:d,y:f,width:g,height:p}=t??{},E=u*(d??0),y=A*(f??0),B=u*Math.min(1-(d??0),g??1),C=A*Math.min(1-(f??0),p??1);let x=E,Q=y,_=B,M=C,P=B,D=C;if($h({scaleFactor:a,canvas:h,width:B,height:C}),n==="crop"){const K=c/l,ee=B/C,Z=ee>K?B-C*K:0,L=ee<K?C-B/K:0;$h({scaleFactor:a,canvas:h,width:B+Z,height:C+L}),x+=Z/2,Q+=L/2,_-=Z,M-=L,P+=Z,D+=L}const $=h.getContext("2d");if($){Fv({scaleFactor:a,context:$});const K=Pv({source:e,sx:x,sy:Q,sw:_,sh:M,dx:0,dy:0,dw:P,dh:D});$.drawImage(...K)}i?(r.save(),r.translate(s+c,o),r.scale(-1,1),r.drawImage(h,0,0,c,l),r.restore()):r.drawImage(h,s,o,c,l)}const Yh={linear:Wm,easeIn:tl,easeInOut:jm,easeOut:Jm,circIn:Pu,circInOut:qm,circOut:Nu,backIn:rl,backInOut:zm,backOut:Xm,anticipate:Zm,bounceIn:iE,bounceInOut:nE,bounceOut:no},So=gu((r,e,{clamp:t=!0,ease:i="easeIn",...n}={})=>Gm(r,e,{...n,clamp:t,ease:Yh[i]}),{cacheKey:([r,e,t])=>JSON.stringify({from:r,to:e,options:t})}),Ov={type:"clip",processor:{getTargetState:r=>({clip:{x:r.coordinates.x,y:r.coordinates.y,width:r.dimensions.width,height:r.dimensions.height}}),interpolateState:({value:r,easing:e,progress:t,from:i})=>{const n=i.clip??{x:0,y:0,width:1,height:1},s={x:r.coordinates.x,y:r.coordinates.y,width:r.dimensions.width,height:r.dimensions.height};return{clip:So([0,1],[n,s],{ease:e})(t)}}}},xo={type:"fade",processor:{getTargetState:r=>({opacity:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({opacity:So([0,1],[i.opacity,r],{ease:e})(t)})}},Uv={type:"scale",processor:{getTargetState:r=>({scale:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({scale:So([0,1],[i.scale,r],{ease:e})(t)})}},Vh={type:"translate",processor:{getTargetState:r=>({translation:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({translation:So([0,1],[i.translation,r],{ease:e})(t)})}},Gv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Hv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],$v=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Yv=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],is={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:Gv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},Ml={type:"switch",name:"reverseExit",label:"Reverse exit animation"},Vv=.2,Kv=3;function Wv(r,e){const t=r==="both"?e/2:e;return Math.min(Kv,t)}function ns({speed:r,timing:e,elementDuration:t}){const i=Wv(e,t),n=Math.min(Vv,i),s=Math.max(0,Math.min(100,r))/100;return i-s*(i-n)}const Jv="easeOut";function ss(r){return{values:e=>{var t;return{timing:e.timing??"both",speed:[e.speed??50],...((t=r==null?void 0:r.values)==null?void 0:t.call(r,e))??{}}},options:e=>{var t;return{timing:e.timing,speed:e.speed[0],easing:Jv,...((t=r==null?void 0:r.options)==null?void 0:t.call(r,e))??{}}}}}function si({timing:r,duration:e,elementDuration:t,easing:i,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const c=[],l=r==="both"||r==="enter",u=r==="both"||r==="exit",A=Math.max(0,t-e);if(l?(c.push({time:0,value:s,easing:i}),c.push({time:e,value:a,easing:"linear"})):c.push({time:0,value:a,easing:"linear"}),u){A>e&&c.push({time:A,value:a,easing:i});const h=n?s:o;c.push({time:t,value:h,easing:i})}return c}const Kh="fade",jv={type:Kh,name:"Fade",options:{...is},transform:ss(),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:xo}}}},Wh="pan",Jh=.25,jh="left";function qh(r,e,t){switch(r){case"left":return{x:e.width*t,y:0};case"right":return{x:-e.width*t,y:0};default:return qh(jh,e,t)}}function qv(r){return{x:-r.x,y:-r.y}}const Xv={type:Wh,name:"Pan",options:{...is,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:$v},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:r=>`${(r*100).toFixed(0)}%`}},reverseExit:Ml},transform:ss({values:r=>({direction:r.direction??jh,distance:[r.distance??Jh],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??Jh,n=qh(r.direction,e.elementDimensions,i),s=qv(n);return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:xo},translate:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Vh}}}},Xh="pop",zh=.5,zv={type:Xh,name:"Pop",options:{...is},transform:ss(),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:xo},scale:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:zh,exitTo:zh,restValue:1}),renderer:Uv}}}},Zh="rise",ed=50,Zv="up";function eC(r,e){switch(r){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const tC={type:Zh,name:"Rise",options:{...is,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Yv},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:r=>`${r}px`}},reverseExit:Ml},transform:ss({values:r=>({direction:r.direction??Zv,distance:[r.distance??ed],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??ed,{enterY:n,exitY:s}=eC(r.direction,i);return{fade:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:xo},translate:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:{x:0,y:n},exitTo:{x:0,y:s},restValue:{x:0,y:0}}),renderer:Vh}}}},td="wipe",Fl="left";function rn(r){switch(r){case"left":return{coordinates:{x:1,y:0},dimensions:{width:0,height:1}};case"right":return{coordinates:{x:0,y:0},dimensions:{width:0,height:1}};case"up":return{coordinates:{x:0,y:1},dimensions:{width:1,height:0}};case"down":return{coordinates:{x:0,y:0},dimensions:{width:1,height:0}};default:return rn(Fl)}}function rd(r){switch(r){case"left":return rn("right");case"right":return rn("left");case"up":return rn("down");case"down":return rn("up");default:return rd(Fl)}}const rC={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},iC={type:td,name:"Wipe",options:{...is,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Hv},reverseExit:Ml},transform:ss({values:r=>({direction:r.direction??Fl,reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=ns({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=rn(r.direction),n=rd(r.direction);return{clip:{keyframes:si({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:i,exitTo:n,restValue:rC}),renderer:Ov}}}},nC={[Kh]:jv,[Zh]:tC,[Xh]:zv,[Wh]:Xv,[td]:iC};function sC(r,e){const{type:t,...i}=r,n=nC[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(i,e)}function oC({animation:r,sceneTime:e}){const t=r.keyframes;if(!t||t.length===0)return null;const i=[...t].sort((s,o)=>s.time-o.time);if(e<i[0].time)return null;const n=i[i.length-1];if(e>=n.time)return r.renderer.processor.getTargetState(n.value);for(let s=0;s<i.length-1;s++){const o=i[s],a=i[s+1];if(e>=o.time&&e<=a.time){const c=a.time-o.time,l=c===0?0:(e-o.time)/c,u=o.easing||"linear",A=r.renderer.processor.getTargetState(o.value);return r.renderer.processor.interpolateState({easing:u,progress:l,from:A,value:a.value})}}return null}function aC(r,e,t){const{preset:i,...n}=r;if(!i)return n;const s=sC(i,{elementDuration:e,elementDimensions:t});return{...n,...s}}function id({layout:r,sceneTime:e,animations:t,elementDuration:i=5,elementDimensions:n={width:100,height:100}}){var s,o,a,c,l,u,A,h,d,f,g;let p={clip:null,opacity:((s=r==null?void 0:r.transform)==null?void 0:s.opacity)??1,translation:{x:((a=(o=r==null?void 0:r.transform)==null?void 0:o.translate)==null?void 0:a.x)??0,y:((l=(c=r==null?void 0:r.transform)==null?void 0:c.translate)==null?void 0:l.y)??0},scale:((u=r==null?void 0:r.transform)==null?void 0:u.scale)??1,rotation:((A=r==null?void 0:r.transform)==null?void 0:A.rotation)??0,dimensions:{widthRatio:((d=(h=r==null?void 0:r.transform)==null?void 0:h.dimension)==null?void 0:d.widthRatio)??1,heightRatio:((g=(f=r==null?void 0:r.transform)==null?void 0:f.dimension)==null?void 0:g.heightRatio)??1}};if(!t)return p;const E=aC(t,i,n);for(const y of Object.values(E)){if(!y)continue;const B=oC({animation:y,sceneTime:e});B&&(p={...p,...B})}return p}const lC=[];for(let r=0;r<256;++r)lC.push((r+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const cC="audio",nd=r=>`${r.toFixed(1)}s`,AC={type:cC,options:{speed:{type:"slider",name:"speed",label:"Speed",min:.5,max:2,step:.01,transform:{input:r=>r/100,output:r=>r*100,format:r=>`${(r*100).toFixed(0)}%`}},volume:{type:"slider",name:"volume",label:"Volume",min:0,max:1,step:.01,transform:{input:r=>r/2/100,output:r=>r*2*100,format:r=>`${(r*2*100).toFixed(0)}%`}},duck:{type:"checkbox",name:"duck",label:"Duck under video"},duckLevel:{type:"slider",name:"duckLevel",label:"Duck to",min:0,max:1,step:.01,visible:r=>r.duck,transform:{input:r=>r/100,output:r=>r*100,format:r=>`${(r*100).toFixed(0)}%`}},fadeIn:{type:"slider",name:"fadeIn",label:"Fade in",min:0,max:5,step:.1,transform:{format:nd}},fadeOut:{type:"slider",name:"fadeOut",label:"Fade out",min:0,max:5,step:.1,transform:{format:nd}},loop:{type:"checkbox",name:"loop",label:"Loop"}},transform:{values:r=>({speed:[r.speed??1],volume:[r.volume??.5],loop:r.loop??!1,duck:r.duck??!1,duckLevel:[r.duckLevel??.25],fadeIn:[r.fadeIn??0],fadeOut:[r.fadeOut??0]}),options:r=>({speed:r.speed[0],volume:r.volume[0],loop:r.loop,duck:r.duck,duckLevel:r.duckLevel[0],fadeIn:r.fadeIn[0],fadeOut:r.fadeOut[0]})}},Ur=1.8;function uC({context:r,x:e,y:t,width:i,height:n,radii:s}){let o,a,c,l;typeof s=="number"?o=a=c=l=s:[o,a,c,l]=s,r.beginPath(),r.moveTo(e+Math.min(n/Ur,o),t),r.lineTo(e+i-Math.min(n/Ur,a),t),r.quadraticCurveTo(e+i,t,e+i,t+Math.min(n/Ur,a)),r.lineTo(e+i,t+n-Math.min(n/Ur,c)),r.quadraticCurveTo(e+i,t+n,e+i-Math.min(n/Ur,c),t+n),r.lineTo(e+Math.min(n/Ur,l),t+n),r.quadraticCurveTo(e,t+n,e,t+n-Math.min(n/Ur,l)),r.lineTo(e,t+Math.min(n/Ur,o)),r.quadraticCurveTo(e,t,e+Math.min(n/Ur,o),t),r.closePath()}function hC({context:r,x:e,y:t,width:i,height:n,radii:s,clip:o=!1,debug:a=!1}){uC({context:r,x:e,y:t,width:i,height:n,radii:s}),a&&(r.strokeStyle="blue",r.stroke()),o&&r.clip()}function sd(){var r=function(e){var t={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},i={},n={};i.L=1,n[1]="L",Object.keys(t).forEach(function(m,w){i[m]=1<<w+1,n[i[m]]=m}),Object.freeze(i);var s=i.LRI|i.RLI|i.FSI,o=i.L|i.R|i.AL,a=i.B|i.S|i.WS|i.ON|i.FSI|i.LRI|i.RLI|i.PDI,c=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,l=i.S|i.WS|i.B|s|i.PDI|c,u=null;function A(){if(!u){u=new Map;var m=function(N){if(t.hasOwnProperty(N)){var G=0;t[N].split(",").forEach(function(z){var oe=z.split("+"),ce=oe[0],he=oe[1];ce=parseInt(ce,36),he=he?parseInt(he,36):0,u.set(G+=ce,i[N]);for(var ve=0;ve<he;ve++)u.set(++G,i[N])})}};for(var w in t)m(w)}}function h(m){return A(),u.get(m.codePointAt(0))||i.L}function d(m){return n[h(m)]}var f={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function g(m,w){var N=36,G=0,z=new Map,oe=w&&new Map,ce;return m.split(",").forEach(function he(ve){if(ve.indexOf("+")!==-1)for(var Be=+ve;Be--;)he(ce);else{ce=ve;var Le=ve.split(">"),Pe=Le[0],tt=Le[1];Pe=String.fromCodePoint(G+=parseInt(Pe,N)),tt=String.fromCodePoint(G+=parseInt(tt,N)),z.set(Pe,tt),w&&oe.set(tt,Pe)}}),{map:z,reverseMap:oe}}var p,E,y;function B(){if(!p){var m=g(f.pairs,!0),w=m.map,N=m.reverseMap;p=w,E=N,y=g(f.canonical,!1).map}}function C(m){return B(),p.get(m)||null}function x(m){return B(),E.get(m)||null}function Q(m){return B(),y.get(m)||null}var _=i.L,M=i.R,P=i.EN,D=i.ES,$=i.ET,K=i.AN,ee=i.CS,Z=i.B,L=i.S,U=i.ON,V=i.BN,k=i.NSM,R=i.AL,F=i.LRO,J=i.RLO,Y=i.LRE,re=i.RLE,se=i.PDF,fe=i.LRI,me=i.RLI,De=i.FSI,be=i.PDI;function ke(m,w){for(var N=125,G=new Uint32Array(m.length),z=0;z<m.length;z++)G[z]=h(m[z]);var oe=new Map;function ce(Yt,Ir){var Vt=G[Yt];G[Yt]=Ir,oe.set(Vt,oe.get(Vt)-1),Vt&a&&oe.set(a,oe.get(a)-1),oe.set(Ir,(oe.get(Ir)||0)+1),Ir&a&&oe.set(a,(oe.get(a)||0)+1)}for(var he=new Uint8Array(m.length),ve=new Map,Be=[],Le=null,Pe=0;Pe<m.length;Pe++)Le||Be.push(Le={start:Pe,end:m.length-1,level:w==="rtl"?1:w==="ltr"?0:mp(Pe,!1)}),G[Pe]&Z&&(Le.end=Pe,Le=null);for(var tt=re|Y|J|F|s|be|se|Z,ot=function(Yt){return Yt+(Yt&1?1:2)},vt=function(Yt){return Yt+(Yt&1?2:1)},rt=0;rt<Be.length;rt++){Le=Be[rt];var j=[{_level:Le.level,_override:0,_isolate:0}],ue=void 0,Ce=0,Me=0,Ne=0;oe.clear();for(var Oe=Le.start;Oe<=Le.end;Oe++){var We=G[Oe];if(ue=j[j.length-1],oe.set(We,(oe.get(We)||0)+1),We&a&&oe.set(a,(oe.get(a)||0)+1),We&tt)if(We&(re|Y)){he[Oe]=ue._level;var Ct=(We===re?vt:ot)(ue._level);Ct<=N&&!Ce&&!Me?j.push({_level:Ct,_override:0,_isolate:0}):Ce||Me++}else if(We&(J|F)){he[Oe]=ue._level;var Jr=(We===J?vt:ot)(ue._level);Jr<=N&&!Ce&&!Me?j.push({_level:Jr,_override:We&J?M:_,_isolate:0}):Ce||Me++}else if(We&s){We&De&&(We=mp(Oe+1,!0)===1?me:fe),he[Oe]=ue._level,ue._override&&ce(Oe,ue._override);var yt=(We===me?vt:ot)(ue._level);yt<=N&&Ce===0&&Me===0?(Ne++,j.push({_level:yt,_override:0,_isolate:1,_isolInitIndex:Oe})):Ce++}else if(We&be){if(Ce>0)Ce--;else if(Ne>0){for(Me=0;!j[j.length-1]._isolate;)j.pop();var gr=j[j.length-1]._isolInitIndex;gr!=null&&(ve.set(gr,Oe),ve.set(Oe,gr)),j.pop(),Ne--}ue=j[j.length-1],he[Oe]=ue._level,ue._override&&ce(Oe,ue._override)}else We&se?(Ce===0&&(Me>0?Me--:!ue._isolate&&j.length>1&&(j.pop(),ue=j[j.length-1])),he[Oe]=ue._level):We&Z&&(he[Oe]=Le.level);else he[Oe]=ue._level,ue._override&&We!==V&&ce(Oe,ue._override)}for(var jt=[],Bt=null,qt=Le.start;qt<=Le.end;qt++){var jr=G[qt];if(!(jr&c)){var qr=he[qt],Sa=jr&s,pr=jr===be;Bt&&qr===Bt._level?(Bt._end=qt,Bt._endsWithIsolInit=Sa):jt.push(Bt={_start:qt,_end:qt,_level:qr,_startsWithPDI:pr,_endsWithIsolInit:Sa})}}for(var Ls=[],Tn=0;Tn<jt.length;Tn++){var kt=jt[Tn];if(!kt._startsWithPDI||kt._startsWithPDI&&!ve.has(kt._start)){for(var bn=[Bt=kt],Vi=void 0;Bt&&Bt._endsWithIsolInit&&(Vi=ve.get(Bt._end))!=null;)for(var pi=Tn+1;pi<jt.length;pi++)if(jt[pi]._start===Vi){bn.push(Bt=jt[pi]);break}for(var Fr=[],Ki=0;Ki<bn.length;Ki++)for(var Sn=bn[Ki],ks=Sn._start;ks<=Sn._end;ks++)Fr.push(ks);for(var SA=he[Fr[0]],xa=Le.level,xn=Fr[0]-1;xn>=0;xn--)if(!(G[xn]&c)){xa=he[xn];break}var Ms=Fr[Fr.length-1],xA=he[Ms],wa=Le.level;if(!(G[Ms]&s)){for(var wn=Ms+1;wn<=Le.end;wn++)if(!(G[wn]&c)){wa=he[wn];break}}Ls.push({_seqIndices:Fr,_sosType:Math.max(xa,SA)%2?M:_,_eosType:Math.max(wa,xA)%2?M:_})}}for(var Fs=0;Fs<Ls.length;Fs++){var Qn=Ls[Fs],Te=Qn._seqIndices,Wi=Qn._sosType,wA=Qn._eosType,Xr=he[Te[0]]&1?M:_;if(oe.get(k))for(var Rn=0;Rn<Te.length;Rn++){var Ps=Te[Rn];if(G[Ps]&k){for(var mi=Wi,_n=Rn-1;_n>=0;_n--)if(!(G[Te[_n]]&c)){mi=G[Te[_n]];break}ce(Ps,mi&(s|be)?U:mi)}}if(oe.get(P))for(var Dn=0;Dn<Te.length;Dn++){var Ns=Te[Dn];if(G[Ns]&P)for(var Ei=Dn-1;Ei>=-1;Ei--){var ar=Ei===-1?Wi:G[Te[Ei]];if(ar&o){ar===R&&ce(Ns,K);break}}}if(oe.get(R))for(var Ii=0;Ii<Te.length;Ii++){var Os=Te[Ii];G[Os]&R&&ce(Os,M)}if(oe.get(D)||oe.get(ee))for(var T=1;T<Te.length-1;T++){var b=Te[T];if(G[b]&(D|ee)){for(var O=0,H=0,X=T-1;X>=0&&(O=G[Te[X]],!!(O&c));X--);for(var te=T+1;te<Te.length&&(H=G[Te[te]],!!(H&c));te++);O===H&&(G[b]===D?O===P:O&(P|K))&&ce(b,O)}}if(oe.get(P))for(var ne=0;ne<Te.length;ne++){var ae=Te[ne];if(G[ae]&P){for(var de=ne-1;de>=0&&G[Te[de]]&($|c);de--)ce(Te[de],P);for(ne++;ne<Te.length&&G[Te[ne]]&($|c|P);ne++)G[Te[ne]]!==P&&ce(Te[ne],P)}}if(oe.get($)||oe.get(D)||oe.get(ee))for(var le=0;le<Te.length;le++){var Ee=Te[le];if(G[Ee]&($|D|ee)){ce(Ee,U);for(var Se=le-1;Se>=0&&G[Te[Se]]&c;Se--)ce(Te[Se],U);for(var Ye=le+1;Ye<Te.length&&G[Te[Ye]]&c;Ye++)ce(Te[Ye],U)}}if(oe.get(P))for(var at=0,Je=Wi;at<Te.length;at++){var Mt=Te[at],Pt=G[Mt];Pt&P?Je===_&&ce(Mt,_):Pt&o&&(Je=Pt)}if(oe.get(a)){var mr=M|P|K,lr=mr|_,Ji=[];{for(var zr=[],Ln=0;Ln<Te.length;Ln++)if(G[Te[Ln]]&a){var Us=m[Te[Ln]],lp=void 0;if(C(Us)!==null)if(zr.length<63)zr.push({char:Us,seqIndex:Ln});else break;else if((lp=x(Us))!==null)for(var Gs=zr.length-1;Gs>=0;Gs--){var QA=zr[Gs].char;if(QA===lp||QA===x(Q(Us))||C(Q(QA))===Us){Ji.push([zr[Gs].seqIndex,Ln]),zr.length=Gs;break}}}Ji.sort(function(Yt,Ir){return Yt[0]-Ir[0]})}for(var RA=0;RA<Ji.length;RA++){for(var cp=Ji[RA],Qa=cp[0],_A=cp[1],Ap=!1,Er=0,DA=Qa+1;DA<_A;DA++){var up=Te[DA];if(G[up]&lr){Ap=!0;var hp=G[up]&mr?M:_;if(hp===Xr){Er=hp;break}}}if(Ap&&!Er){Er=Wi;for(var LA=Qa-1;LA>=0;LA--){var dp=Te[LA];if(G[dp]&lr){var fp=G[dp]&mr?M:_;fp!==Xr?Er=fp:Er=Xr;break}}}if(Er){if(G[Te[Qa]]=G[Te[_A]]=Er,Er!==Xr){for(var Hs=Qa+1;Hs<Te.length;Hs++)if(!(G[Te[Hs]]&c)){h(m[Te[Hs]])&k&&(G[Te[Hs]]=Er);break}}if(Er!==Xr){for(var $s=_A+1;$s<Te.length;$s++)if(!(G[Te[$s]]&c)){h(m[Te[$s]])&k&&(G[Te[$s]]=Er);break}}}}for(var vi=0;vi<Te.length;vi++)if(G[Te[vi]]&a){for(var gp=vi,kA=vi,MA=Wi,Ys=vi-1;Ys>=0;Ys--)if(G[Te[Ys]]&c)gp=Ys;else{MA=G[Te[Ys]]&mr?M:_;break}for(var pp=wA,Vs=vi+1;Vs<Te.length;Vs++)if(G[Te[Vs]]&(a|c))kA=Vs;else{pp=G[Te[Vs]]&mr?M:_;break}for(var FA=gp;FA<=kA;FA++)G[Te[FA]]=MA===pp?MA:Xr;vi=kA}}}for(var Xt=Le.start;Xt<=Le.end;Xt++){var yQ=he[Xt],Ra=G[Xt];if(yQ&1?Ra&(_|P|K)&&he[Xt]++:Ra&M?he[Xt]++:Ra&(K|P)&&(he[Xt]+=2),Ra&c&&(he[Xt]=Xt===0?Le.level:he[Xt-1]),Xt===Le.end||h(m[Xt])&(L|Z))for(var _a=Xt;_a>=0&&h(m[_a])&l;_a--)he[_a]=Le.level}}return{levels:he,paragraphs:Be};function mp(Yt,Ir){for(var Vt=Yt;Vt<m.length;Vt++){var Ci=G[Vt];if(Ci&(M|R))return 1;if(Ci&(Z|_)||Ir&&Ci===be)return 0;if(Ci&s){var Ep=BQ(Vt);Vt=Ep===-1?m.length:Ep}}return 0}function BQ(Yt){for(var Ir=1,Vt=Yt+1;Vt<m.length;Vt++){var Ci=G[Vt];if(Ci&Z)break;if(Ci&be){if(--Ir===0)return Vt}else Ci&s&&Ir++}return-1}}var pe="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",xe;function He(){if(!xe){var m=g(pe,!0),w=m.map,N=m.reverseMap;N.forEach(function(G,z){w.set(z,G)}),xe=w}}function Re(m){return He(),xe.get(m)||null}function Xe(m,w,N,G){var z=m.length;N=Math.max(0,N==null?0:+N),G=Math.min(z-1,G==null?z-1:+G);for(var oe=new Map,ce=N;ce<=G;ce++)if(w[ce]&1){var he=Re(m[ce]);he!==null&&oe.set(ce,he)}return oe}function we(m,w,N,G){var z=m.length;N=Math.max(0,N==null?0:+N),G=Math.min(z-1,G==null?z-1:+G);var oe=[];return w.paragraphs.forEach(function(ce){var he=Math.max(N,ce.start),ve=Math.min(G,ce.end);if(he<ve){for(var Be=w.levels.slice(he,ve+1),Le=ve;Le>=he&&h(m[Le])&l;Le--)Be[Le]=ce.level;for(var Pe=ce.level,tt=1/0,ot=0;ot<Be.length;ot++){var vt=Be[ot];vt>Pe&&(Pe=vt),vt<tt&&(tt=vt|1)}for(var rt=Pe;rt>=tt;rt--)for(var j=0;j<Be.length;j++)if(Be[j]>=rt){for(var ue=j;j+1<Be.length&&Be[j+1]>=rt;)j++;j>ue&&oe.push([ue+he,j+he])}}}),oe}function S(m,w,N,G){var z=I(m,w,N,G),oe=[].concat(m);return z.forEach(function(ce,he){oe[he]=(w.levels[ce]&1?Re(m[ce]):null)||m[ce]}),oe.join("")}function I(m,w,N,G){for(var z=we(m,w,N,G),oe=[],ce=0;ce<m.length;ce++)oe[ce]=ce;return z.forEach(function(he){for(var ve=he[0],Be=he[1],Le=oe.slice(ve,Be+1),Pe=Le.length;Pe--;)oe[Be-Pe]=Le[Pe]}),oe}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=Q,e.getEmbeddingLevels=ke,e.getMirroredCharacter=Re,e.getMirroredCharactersMap=Xe,e.getReorderSegments=we,e.getReorderedIndices=I,e.getReorderedString=S,e.openingToClosingBracket=C,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return r}const od=Object.freeze(Object.defineProperty({__proto__:null,default:sd},Symbol.toStringTag,{value:"Module"})),dC=typeof od=="function"?od:sd;function fC(r,e){return r==="start"?e==="rtl"?"right":"left":r==="end"?e==="rtl"?"left":"right":r??"left"}const ad=dC();function gC(r){var e;if(!r)return"ltr";try{const{paragraphs:t}=ad.getEmbeddingLevels(r);return(((e=t[0])==null?void 0:e.level)??0)%2===1?"rtl":"ltr"}catch{return"ltr"}}function pC(r){return{order:r.map((e,t)=>t),directions:r.map(()=>"ltr"),baseDirection:"ltr"}}function mC(r,e){var t;if(!r.length)return{order:[],directions:[],baseDirection:e??"ltr"};try{const i=r.map(({text:d})=>d).join(" "),{levels:n,paragraphs:s}=ad.getEmbeddingLevels(i,e),o=((t=s[0])==null?void 0:t.level)??0,a=o%2===1?"rtl":"ltr",c=[];let l=0;for(const d of r)c.push(n[l]??o),l+=d.text.length+1;const u=r.map((d,f)=>f),A=Math.max(...c);for(let d=A;d>=1;d--){let f=-1;for(let g=0;g<=u.length;g++){const p=g<u.length&&c[u[g]]>=d;if(p&&f<0)f=g;else if(!p&&f>=0){const E=u.slice(f,g).reverse();u.splice(f,E.length,...E),f=-1}}}const h=c.map(d=>d%2===1?"rtl":"ltr");return{order:u,directions:h,baseDirection:a}}catch{return pC(r)}}const EC=500;function IC(){const r=new Map,e={has:t=>r.has(t),get:t=>r.get(t),set:(t,i)=>{if(r.size>=EC&&!r.has(t)){const n=r.keys().next();n.done||r.delete(n.value)}r.set(t,i)},delete:t=>r.delete(t),clear:()=>r.clear()};return typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",()=>e.clear()),e}let Pl;function vC(){return Pl===void 0&&(Pl=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"word"}):null),Pl}const ld=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function CC(r){return r.split(`
2462
+ `).map(e=>{if(!e)return[];const t=[];for(const i of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(i))t.push({text:i,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(ld.test(i))for(const n of cd(i))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:i,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function cd(r){const e=[];let t=!1,i="";const n=vC();if(!n)return[{text:r,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(r)){if(!o&&s.trim().length===0){t=e.length>0?!0:t;continue}if(o){e.push({text:s,spaceBefore:t}),t=!1;continue}e.length>0?e[e.length-1].text+=s:i+=s}return i&&e.length>0?e[0].text=i+e[0].text:i&&e.push({text:i,spaceBefore:t}),e}function yC(r){const e=[];for(const t of r){const n=ld.test(t.text)||/\s/.test(t.text)?cd(t.text):[{text:t.text,spaceBefore:!1}];if(n.length<=1){e.push({text:t.text,logicalIndex:e.length,whitespace:!1,spaceBefore:e.length>0,timing:{id:t.id,start:t.start,end:t.end}});continue}const s=n.reduce((c,l)=>c+[...l.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((c,l)=>{const u=[...c.text].length/s*o,A=a,h=l===n.length-1?t.end:a+u;a=h,e.push({text:c.text,logicalIndex:e.length,whitespace:!1,spaceBefore:l===0?e.length>0:c.spaceBefore,timing:{id:t.id,subIndex:l,start:A,end:h}})})}return e}const BC=/(?<value>\d+\.?\d*)(?=px)/,Nl=1;function TC(r,e){const t=typeof r=="string"?CC(r):[yC(r)];return e?t.map(i=>i.map(n=>({...n,text:n.text.toUpperCase()}))):t}function bC({context:r,groups:e,appendedFont:t,fontSizes:i,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:c}){const l=[],u=h=>{const d=i[h%i.length];return{fontSize:d,font:t.replace(BC,d.toString())}},A=(h,d)=>(r.font=h,r.letterSpacing=`${a}px`,r.measureText(d));for(const h of e){const d=l.length,{fontSize:f,font:g}=u(l.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},E="",y="";const B=()=>{const C=A(p.font,"");p.fontAscent=C.fontBoundingBoxAscent,p.fontDescent=C.fontBoundingBoxDescent,l.push(p);const x=u(l.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},E="",y=""};for(const C of h){if(C.whitespace){y+=C.text;continue}const x=()=>{const M=p.items.length>0&&C.spaceBefore&&!y?" ":y,P=M?A(p.font,M).width:0,D=A(p.font,C.text);return{token:C,metrics:D,width:D.width+o,gapBefore:P,gapText:M}};let Q=x();const _=c?A(p.font,E+Q.gapText+C.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&_>n+Nl&&p.items.length>0&&(B(),Q=x()),s&&c&&p.items.length===0&&Q.width>n+Nl){let M=C.text;for(;M.length>0;){let P="";for(const $ of M){const K=A(p.font,P+$).width+o;if(P&&K>n+Nl)break;P+=$}M=M.slice(P.length);const D=A(p.font,P);p.items.push({token:{...C,text:P},metrics:D,width:D.width+o,gapBefore:0,gapText:""}),E=P,p.lineWidth=D.width+o*p.items.length,M.length>0&&B()}y="";continue}p.items.push(Q),E+=Q.gapText+C.text,p.lineWidth=c?A(p.font,E).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,y=""}c&&y&&(p.items.length>0||l.length===d)&&(E+=y,p.lineWidth=A(p.font,E).width+o*p.items.length),(p.items.length>0||l.length===d)&&B()}return l}const Ad=[{family:"Noto Arabic",regex:new RegExp("\\p{Script=Arabic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArabic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Chinese",regex:new RegExp("\\p{Script=Han}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSC-VariableFont_wght.woff2",style:"normal"},{family:"Noto Hebrew",regex:new RegExp("\\p{Script=Hebrew}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansHebrew-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Hindi",regex:new RegExp("\\p{Script=Devanagari}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansDevanagari-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Japanese",regex:new RegExp("\\p{Script=Han}|\\p{Script=Katakana}|\\p{Script=Hiragana}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansJP-VariableFont_wght.woff2",style:"normal"},{family:"Noto Korean",regex:new RegExp("\\p{Script=Hangul}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKR-VariableFont_wght.woff2",style:"normal"},{family:"Noto Color Emoji",regex:new RegExp("\\p{Extended_Pictographic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoColorEmoji-Regular.woff2",style:"normal"},{family:"Noto Telugu",regex:new RegExp("\\p{Script=Telugu}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTelugu-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Tamil",regex:new RegExp("\\p{Script=Tamil}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansTamil-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Kannada",regex:new RegExp("\\p{Script=Kannada}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKannada-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Malayalam",regex:new RegExp("\\p{Script=Malayalam}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMalayalam-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Bengali",regex:new RegExp("\\p{Script=Bengali}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansBengali-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gujarati",regex:new RegExp("\\p{Script=Gujarati}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGujarati-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Gurmukhi",regex:new RegExp("\\p{Script=Gurmukhi}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGurmukhi-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Sinhala",regex:new RegExp("\\p{Script=Sinhala}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansSinhala-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Thai",regex:new RegExp("\\p{Script=Thai}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansThai-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Lao",regex:new RegExp("\\p{Script=Lao}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansLao-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Khmer",regex:new RegExp("\\p{Script=Khmer}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansKhmer-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Myanmar",regex:new RegExp("\\p{Script=Myanmar}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansMyanmar-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Ethiopic",regex:new RegExp("\\p{Script=Ethiopic}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansEthiopic-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Armenian",regex:new RegExp("\\p{Script=Armenian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansArmenian-VariableFont_wdth%2Cwght.woff2",style:"normal"},{family:"Noto Georgian",regex:new RegExp("\\p{Script=Georgian}","u"),url:"https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/NotoSansGeorgian-VariableFont_wdth%2Cwght.woff2",style:"normal"}];function ud({text:r,font:e}){let t=e;return Ad.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}function hd(r){return Math.max(r??1,.5)}function SC({measured:r,index:e,lineTop:t,dx:i,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:c}){const{items:l,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=r;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=hd(a),E=A*p+c,y=(p-1)*A/2,B=(A+d-f)/2,C=t+y+B+c/2,{order:x,directions:Q,baseDirection:_}=mC(l.map(({token:Z})=>({text:Z.text})),o),M=l.map(({gapBefore:Z})=>Z);let P=i+g+c/2;const D=[];x.forEach((Z,L)=>{const U=l[Z];P+=M[L],D.push({...U.token,x:P,baselineY:C,width:U.width,lineIndex:e,direction:Q[Z],font:u,metrics:U.metrics}),P+=U.width});const $=[],K=[];D.forEach((Z,L)=>{const U=$[$.length-1];if(U&&U.direction===Z.direction){const V=Math.max(U.x+U.width,Z.x+Z.width);U.tokens.push(Z),U.x=Math.min(U.x,Z.x),U.width=V-U.x,K[K.length-1].push(x[L])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),K.push([x[L]])}),$.forEach((Z,L)=>{const U=[...K[L]].sort((V,k)=>V-k);Z.text=U.map((V,k)=>k===0?l[V].token.text:`${l[V].gapText}${l[V].token.text}`).join("")});const ee=o??_;return{index:e,box:{x:i+g,y:t,width:h,height:E},baselineY:C,direction:ee,runs:$,tokens:D}}function xC(r){const{context:e,text:t,font:i,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:c=a,align:l="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=r,E=TC(t,p),y=E.flat().map(({text:Q})=>Q).join(" "),B=ud({font:i,text:y}),C=u??gC(y),x=fC(l,C);try{e.save();const Q=bC({context:e,groups:E,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),_=[];let M=o;for(let ee=0;ee<Q.length;ee++){const Z=SC({measured:Q[ee],index:ee,lineTop:M,dx:s,dw:c,align:x,direction:u,lineHeight:A,strokeWidth:f});_.push(Z),M+=Z.box.height+h}const P=Q[Q.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*hd(A))/2):0,$=_.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,_.length-1)+D,K=_.length?{x:Math.min(..._.map(({box:ee})=>ee.x)),y:Math.min(..._.map(({box:ee})=>ee.y)),width:Math.max(..._.map(({box:ee})=>ee.x+ee.width))-Math.min(..._.map(({box:ee})=>ee.x)),height:Math.max(..._.map(({box:ee})=>ee.y+ee.height))-Math.min(..._.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:_,totalHeight:$,blockBox:K,direction:C,font:B}}finally{e.restore()}}gu(xC,{cache:IC(),cacheKey:([r])=>JSON.stringify([r.text,r.font,r.fontSizes,r.dx,r.dy,r.dw,r.maxW,r.align,r.direction,r.lineHeight,r.lineGap,r.letterSpacing,r.strokeWidth,r.wrap,r.uppercase])});function wC(r){return r.slice(0,1).toUpperCase()+r.slice(1)}Object.keys(Yh).map(r=>({label:wC(r),value:r,data:r}));const QC=Ar(()=>Ou.loadYoga());function RC(r=.4,e=.4){const t=Math.max(.1,Math.min(.8,r)),i=Math.max(.2,Math.min(.6,e)),s=(1-t)/2,a=1-i;return[{x:0,y:s},{x:a,y:s},{x:a,y:0},{x:1,y:.5},{x:a,y:1},{x:a,y:1-s},{x:0,y:1-s}]}const wo=64;function _C(){const r=[],e={x:.5,y:.5},t=.5;for(let i=0;i<wo;i++){const n=i/wo*2*Math.PI,s=e.x+t*Math.cos(n),o=e.y+t*Math.sin(n);r.push({x:s,y:o})}return r}function DC(r=1){const e=[],t={x:.5,y:.5};let i,n;r>=1?(i=.5,n=.5/r):(i=.5*r,n=.5);for(let s=0;s<wo;s++){const o=s/wo*2*Math.PI,a=t.x+i*Math.cos(o),c=t.y+n*Math.sin(o);e.push({x:a,y:c})}return e}function LC(){const r=[];for(let t=0;t<=100;t++){const i=t/100*2*Math.PI,n=16*Math.sin(i)**3,s=-(13*Math.cos(i)-5*Math.cos(2*i)-2*Math.cos(3*i)-Math.cos(4*i)),o=(n+16)/32,a=(s+13)/26;r.push({x:o,y:a})}return r}function dd(r=0,e=1){if(r===0)return[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];const t=r*Math.PI/180,i=Math.tan(t)/e;return[{x:Math.max(0,Math.min(1,0+i)),y:0},{x:Math.max(0,Math.min(1,1+i)),y:0},{x:Math.max(0,Math.min(1,1-i)),y:1},{x:Math.max(0,Math.min(1,0-i)),y:1}]}function Qo(r){if(r<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let l=0;l<r;l++){const u=l*2*Math.PI/r-Math.PI/2,A=Math.cos(u),h=Math.sin(u);t.push({x:A,y:h})}const i=Math.min(...t.map(l=>l.x)),n=Math.max(...t.map(l=>l.x)),s=Math.min(...t.map(l=>l.y)),o=Math.max(...t.map(l=>l.y)),a=n-i,c=o-s;for(const l of t){const u=(l.x-i)/a,A=(l.y-s)/c;e.push({x:u,y:A})}return e}function fd(r=90){const e=r*Math.PI/180,i=.5/Math.tan(e),s=1/(1+Math.abs(i)*2),o=i*s;return[{x:.5+o,y:0},{x:1,y:.5},{x:.5-o,y:1},{x:0,y:.5}]}function kC(r=5,e=.4){const t=[];for(let n=0;n<r*2;n++){const s=n*Math.PI/r-Math.PI/2,o=n%2===0?.5:e,a=.5+o*Math.cos(s),c=.5+o*Math.sin(s);t.push({x:a,y:c})}return t}function MC(r="isosceles",e={}){switch(r){case"equilateral":return FC();case"isosceles":return gd(e.baseAngle??60);case"right":return PC(e.rightAnglePosition??"bottom-left");case"scalene":return NC(e.angles??[60,60,60])}}function FC(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function gd(r){const e=r*Math.PI/180,t=.5/Math.tan(e),i=Math.max(.1,Math.min(2,t));return[{x:.5,y:1-Math.min(1,i)},{x:0,y:1},{x:1,y:1}]}function PC(r){switch(r){case"top":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}];case"bottom-left":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}];case"bottom-right":return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}}function NC(r){return gd(r[0])}function OC(r={},e=1){const{type:t="rectangle",customPolygon:i,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:c,regularPolygon:l}=r;switch(t){case"rectangle":return dd(0,e);case"parallelogram":return dd((n==null?void 0:n.angle)??30,e);case"triangle":return MC((s==null?void 0:s.type)??"isosceles",{baseAngle:s==null?void 0:s.baseAngle,angles:s==null?void 0:s.angles,rightAnglePosition:s==null?void 0:s.rightAnglePosition});case"rhombus":return fd((o==null?void 0:o.angle)??90);case"diamond":return fd(90);case"pentagon":return Qo(5);case"hexagon":return Qo(6);case"octagon":return Qo(8);case"star":return kC((c==null?void 0:c.points)??5,(c==null?void 0:c.innerRadius)??.4);case"arrow":return RC((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return LC();case"circle":return _C();case"ellipse":return DC(e);case"custom-polygon":if(!(i!=null&&i.points)||i.points.length<3)throw new Error("Custom polygon must have at least 3 points");return i.points;default:return Qo((l==null?void 0:l.sides)??6)}}function UC(r,e){let t=!1;const i=r.x,n=r.y;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s].x,c=e[s].y,l=e[o].x,u=e[o].y;c>n!=u>n&&i<(l-a)*(n-c)/(u-c)+a&&(t=!t)}return t}function GC(r,e){let t=1,i=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;UC({x:o,y:r},e)&&(t=Math.min(t,o),i=Math.max(i,o))}return i>=t?{left:t,right:i}:null}function HC(r){const e=Math.min(...r.map(c=>c.y)),t=Math.max(...r.map(c=>c.y));let i={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let c=0;c<=s;c++){const l=e+c*o;a.push({y:l,span:GC(l,r)})}for(let c=0;c<a.length-1;c++){const l=a[c].y;for(let u=c+1;u<a.length;u++){const h=a[u].y-l;let d=0,f=1,g=!0;const p=Math.min(5,u-c+1);for(let E=0;E<p;E++){const y=c+Math.floor(E/(p-1)*(u-c)),B=a[y].span;if(B){if(d=Math.max(d,B.left),f=Math.min(f,B.right),d>=f){g=!1;break}}else{g=!1;break}}if(g&&f>d){const E=f-d,y=E*h;y>n&&(n=y,i={x:d,y:l,width:E,height:h})}}}return i}function $C(r,e=1){const t=OC(r,e);if(t.length<3)return{top:0,right:0,bottom:0,left:0};if(r.type==="rectangle")return{top:0,right:0,bottom:0,left:0};const i=HC(t),n=i.y,s=i.x,o=1-(i.x+i.width),a=1-(i.y+i.height);return{top:Math.max(0,n),right:Math.max(0,o),bottom:Math.max(0,a),left:Math.max(0,s)}}const YC="video",VC=.01,pd=(r,e)=>Math.abs(r-e)<=e*VC,KC={type:YC,options:{flip:{type:"checkbox",name:"flip",label:"Flip"},loop:{type:"checkbox",name:"loop",label:"Loop"},speed:{type:"slider",name:"speed",label:"Speed",min:.5,max:2,step:.01,transform:{input:r=>r/100,output:r=>r*100,format:r=>`${(r*100).toFixed(0)}%`}},volume:{type:"slider",name:"volume",label:"Volume",min:0,max:1,step:.01,transform:{input:r=>r/2/100,output:r=>r*2*100,format:r=>`${(r*2*100).toFixed(0)}%`}}},transform:{values:r=>({flip:r.flip??!1,loop:r.loop??!1,crop:r.crop??{x:0,y:0,width:1,height:1},format:r.format??"letterbox",speed:[r.speed??1],volume:[r.volume??.5]}),options:r=>({flip:r.flip,loop:r.loop,crop:r.crop,format:r.format,speed:r.speed[0],volume:r.volume[0]})},width:({node:r,options:e,dependencies:t})=>{const{crop:i,format:n}=e;if(!t||n==="crop")return r.getComputedWidth();const s=t.aspectRatio*(((i==null?void 0:i.width)??1)/((i==null?void 0:i.height)??1)),o=r.getComputedWidth(),a=r.getComputedHeight(),c=o/a;return s>c||pd(s,c)?o:a*s},height:({node:r,options:e,dependencies:t})=>{const{crop:i,format:n}=e;if(!t||n==="crop")return r.getComputedHeight();const s=t.aspectRatio*(((i==null?void 0:i.width)??1)/((i==null?void 0:i.height)??1)),o=r.getComputedWidth(),a=r.getComputedHeight();return pd(s,o/a)?a:o/s},render:async({dx:r,dy:e,dw:t,dh:i,radius:n,sceneTime:s,options:o,dependencies:a,canvases:c})=>{const{crop:l,flip:u=!1,format:A="letterbox",speed:h=1}=o,d=c.sceneCanvas.getContext("2d");if(!d||!(a!=null&&a.video))return;const f=await a.video(s*h),g=(f==null?void 0:f.videoWidth)??(f==null?void 0:f.naturalWidth)??(f==null?void 0:f.width),p=(f==null?void 0:f.videoHeight)??(f==null?void 0:f.naturalHeight)??(f==null?void 0:f.height);if(g&&p){d.save();const{topLeft:E,topRight:y,bottomLeft:B,bottomRight:C}=n;hC({context:d,x:r,y:e,width:t,height:i,radii:[E,y,C,B]}),d.clip(),Nv({context:d,crop:l,flip:u,format:A,sourceWidth:g,sourceHeight:p,source:f,posX:r,posY:e,drawAreaWidth:t,drawAreaHeight:i,cropCanvas:c.cropCanvas,letterboxCanvas:c.letterboxCanvas}),d.restore()}}};function Zt(r){let e=0;for(const t of r)Array.isArray(t)?e+=Zt(t):e+=t;return e}function Ro(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const c=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,l=((s=r[i-1])==null?void 0:s.duration)??1/0,u=((o=r[i+1])==null?void 0:o.duration)??1/0,A=((a=r[i+2])==null?void 0:a.type)==="transition"?r[i+2]:null;return Math.min(c?l/2:l,t,A?u/2:u)*-1}return t})}function Ol(r,e){var t;const i=[];if(((t=r.renderer)==null?void 0:t.type)===e&&i.push(r),r.children)for(const n of r.children)i.push(...Ol(n,e));return i}function md(r){return r===null||typeof r=="number"&&!Number.isFinite(r)}function WC(r){const e={};for(const[t,i]of Object.entries(r))md(i)||(typeof i=="object"&&!Array.isArray(i)?e[t]=Object.fromEntries(Object.entries(i).filter(([,n])=>!md(n))):e[t]=i);return e}function JC(r){return typeof r=="number"?{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r}:{topLeft:(r==null?void 0:r.topLeft)??0,topRight:(r==null?void 0:r.topRight)??0,bottomRight:(r==null?void 0:r.bottomRight)??0,bottomLeft:(r==null?void 0:r.bottomLeft)??0}}function jC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:typeof r.top=="number"?r.top*e:r.top,right:typeof r.right=="number"?r.right*e:r.right,bottom:typeof r.bottom=="number"?r.bottom*e:r.bottom,left:typeof r.left=="number"?r.left*e:r.left}}function qC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function XC(r,e){return typeof r=="number"?{top:r*e,right:r*e,bottom:r*e,left:r*e}:typeof r=="string"?{top:r,right:r,bottom:r,left:r}:{top:(typeof r.top=="number"?r.top*e:r.top)??0,right:(typeof r.right=="number"?r.right*e:r.right)??0,bottom:(typeof r.bottom=="number"?r.bottom*e:r.bottom)??0,left:(typeof r.left=="number"?r.left*e:r.left)??0}}function Ed(r,e,{layout:t,scale:i=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:c,minHeight:l,maxWidth:u,maxHeight:A,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:E,direction:y="column",align:B="start",alignSelf:C,justify:x="start"}=WC(t??{}),Q={static:r.POSITION_TYPE_STATIC,relative:r.POSITION_TYPE_RELATIVE,absolute:r.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(Q[n]),typeof s<"u"){const{top:D,right:$,bottom:K,left:ee}=jC(s,i);typeof D<"u"&&e.setPosition(r.EDGE_TOP,D),typeof $<"u"&&e.setPosition(r.EDGE_RIGHT,$),typeof K<"u"&&e.setPosition(r.EDGE_BOTTOM,K),typeof ee<"u"&&e.setPosition(r.EDGE_LEFT,ee)}const _={row:r.FLEX_DIRECTION_ROW,column:r.FLEX_DIRECTION_COLUMN,"row-reverse":r.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":r.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(_[y]);const M={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(M[B]),C&&e.setAlignSelf(M[C]);const P={start:r.JUSTIFY_FLEX_START,end:r.JUSTIFY_FLEX_END,center:r.JUSTIFY_CENTER,"space-between":r.JUSTIFY_SPACE_BETWEEN,"space-around":r.JUSTIFY_SPACE_AROUND,"space-evenly":r.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(P[x]),typeof p<"u"){const{top:D,right:$,bottom:K,left:ee}=qC(p,i);e.setMargin(r.EDGE_TOP,D),e.setMargin(r.EDGE_RIGHT,$),e.setMargin(r.EDGE_BOTTOM,K),e.setMargin(r.EDGE_LEFT,ee)}if(typeof E<"u"){const{top:D,right:$,bottom:K,left:ee}=XC(E,i);e.setPadding(r.EDGE_TOP,D),e.setPadding(r.EDGE_RIGHT,$),e.setPadding(r.EDGE_BOTTOM,K),e.setPadding(r.EDGE_LEFT,ee)}typeof d<"u"||typeof f<"u"?(typeof d<"u"&&e.setFlexGrow(d),typeof f<"u"&&e.setFlexShrink(f)):typeof h<"u"&&e.setFlex(h),e.setGap(r.GUTTER_ALL,(g??0)*i),typeof o<"u"&&e.setWidth(typeof o=="number"?o*i:o),typeof a<"u"&&e.setHeight(typeof a=="number"?a*i:a),typeof c<"u"&&e.setMinWidth(typeof c=="number"?c*i:c),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*i:l),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*i:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*i:A)}async function Id({id:r,yoga:e,index:t,parent:i,element:n,resolvers:s}){var o,a,c;const{layout:l={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();Ed(e,d,{layout:l}),i.insertChild(d,t);let f=null;s&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="caption"||(h==null?void 0:h.type)==="image"||(h==null?void 0:h.type)==="video")&&((h==null?void 0:h.type)==="caption"?f=await((o=s.text)==null?void 0:o.call(s,{id:r,config:u,options:A}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:r,config:u,options:A}))??null);const g=[];for await(const[p,E]of((c=n.children)==null?void 0:c.entries())??[])g.push(await Id({id:r,yoga:e,index:p,parent:d,element:E,resolvers:s}));return{node:d,radius:JC(l.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function vd(r,e,t=0,i=0){const{top:n,left:s}=r.getComputedLayout(),{top:o,left:a,width:c,height:l}=e.node.getComputedLayout(),u=t+a,A=i+o,h=e.childNodes.map(d=>vd(r,d,u,A));return{...e,x:s+u,y:n+A,width:c,height:l,childNodes:h}}async function Ul({yoga:r,root:e,tree:t,measureCanvas:i}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:c}of t){if(a){const{width:l,height:u}=a;if(l&&i){e.calculateLayout();const A=await l({node:n,options:s,dependencies:o,measureCanvas:i});A&&n.setWidth(A)}if(u&&i){e.calculateLayout();const A=await u({node:n,options:s,dependencies:o,measureCanvas:i});A&&n.setHeight(A)}if((s==null?void 0:s.format)==="crop"&&(o!=null&&o.aspectRatio)&&(a.type==="video"||a.type==="image")){const A=s.crop;if(!A||A.x===0&&A.y===0&&A.width===1&&A.height===1){e.calculateLayout();const d=n.getComputedWidth(),f=n.getComputedHeight();if(d>0&&f>0){const g=d/f,p=o.aspectRatio;if(Math.abs(g-p)>.001){let E,y;g<p?(E=g/p,y=1):(E=1,y=p/g),s.crop={x:(1-E)/2,y:(1-y)/2,width:E,height:y}}}}}if(await Ul({yoga:r,root:e,tree:c,measureCanvas:i}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=$C(s.shape,A/h);n.setPadding(r.EDGE_TOP,d.top*h),n.setPadding(r.EDGE_RIGHT,d.right*A),n.setPadding(r.EDGE_BOTTOM,d.bottom*h),n.setPadding(r.EDGE_LEFT,d.left*A)}}e.calculateLayout(),await Ul({yoga:r,root:e,tree:c,measureCanvas:i})}}async function Cd({id:r,root:e,resolvers:t,measureCanvas:i}){const n=await QC(),s=n.Node.create();Ed(n,s,{layout:e.layout});const o=await Id({id:r,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Ul({yoga:n,root:s,tree:[o],measureCanvas:i});const{top:a,left:c,width:l,height:u}=s.getComputedLayout(),A={root:{x:c,y:a,width:l,height:u},node:vd(s,o)};return s.freeRecursive(),A}function yd(){return document.createElement("canvas")}function zC(r){if(r===null||typeof r!="object")return!1;if(Object.getPrototypeOf(r)===null)return!0;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function ZC(r){return r.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}EE.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${ZC(r)}"`:zC(r)||Array.isArray(r)?JSON.stringify(r):r);function ey(r){return r.some(({type:e})=>e==="text")}function ty(r){return r.some(({type:e})=>e==="caption")}function ry(r){return r.some(({type:e})=>e==="audio")}function iy(r){return r.some(({type:e})=>e==="video"||e==="image")}function _o(r){return r.type==="audio"}function ny(r){return r.type==="video"}const sy="3";async function oy({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Cd({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function ay({track:r}){const e=Ro(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const c=Zt(e.slice(0,a));return s.push(oy({scene:o,start:c})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const c=Zt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:c,config:o,duration:o.duration}),s},[]),n=r.map(({id:s})=>t.find(({id:o})=>o===s)??i.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:i,mergedScenes:n,config:r,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function Bd({node:r,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var c,l,u,A,h;const d=e.sceneCanvas.getContext("2d");if(d){d.save(),d.setTransform(s);const f=(a==null?void 0:a.rotation)!=null&&((c=r.element.layout)!=null&&c.transform)?{...r.element.layout,transform:{...r.element.layout.transform,rotation:a.rotation}}:r.element.layout,g=id({layout:f,sceneTime:t,animations:r.element.animations,elementDuration:i,elementDimensions:{width:r.width,height:r.height}}),{opacity:p,translation:E,scale:y,clip:B,dimensions:C,rotation:x}=g,Q=r.width*C.widthRatio,_=r.height*C.heightRatio;if(d.globalAlpha=p*n,(E.x||E.y)&&d.translate(E.x,E.y),(y!==1||x!==0)&&(d.translate(r.x+Q/2,r.y+_/2),d.scale(y,y),d.rotate(x*Math.PI/180),d.translate(-(r.x+Q/2),-(r.y+_/2))),B){d.beginPath();const D={x:r.x+B.x*Q,y:r.y+B.y*_,width:B.width*Q,height:B.height*_};d.rect(D.x,D.y,D.width,D.height),d.clip()}if(o){const D=d.globalAlpha;d.globalAlpha=1,d.strokeStyle="red",d.strokeRect(r.x,r.y,Q,_),d.globalAlpha=D}const M=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...r.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((l=r.options)!=null&&l.font)?{font:{...r.options.font,size:a.fontSize}}:{}}:r.options,P=(a==null?void 0:a.fontSize)!=null&&((u=r.dependencies)!=null&&u.font)?{...r.dependencies,font:{...r.dependencies.font,size:a.fontSize}}:r.dependencies;await((h=(A=r.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:r.x,dy:r.y,dw:Q,dh:_,radius:r.radius,options:M,dependencies:P}));for await(const D of r.childNodes)await Bd({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function ly({layout:r,canvases:e,sceneTime:t,sceneDuration:i,debug:n=!1,override:s}){const{node:o}=r;await Bd({debug:n,node:o,canvases:e,sceneDuration:i,sceneTime:t,override:s})}async function Do({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=yd}){var a,c;const{id:l,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),E=o(),y=o(),B=o(),C=o(),x=await Cd({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof A=="number"?{position:"absolute",inset:{top:A,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((c=f.element.layout)==null?void 0:c.height)}}},resolvers:i,measureCanvas:C}),Q=async(_,M)=>{const P=Math.max(0,_-t);p.width=p.height=0,p.width=n,p.height=s,await ly({debug:r,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:E,letterboxCanvas:y,posterCanvas:B},override:M})};return{id:l,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function cy({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Ro(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="caption"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var E;return p===((E=e[d+1])==null?void 0:E.id)}),from:a.find(({id:p})=>{var E;return p===((E=e[d-1])==null?void 0:E.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function Ay({groups:r,tracks:e}){const t=r.map(s=>new Set(s.sceneIds)),i=r.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];_o(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let c,l=1/0;for(let u=0;u<r.length;u++){if(o===u)continue;const A=t[u];s.sceneIds.every(d=>A.has(d))&&A.size>t[o].size&&A.size<l&&(c=r[u].id,l=A.size)}return{id:s.id,sceneIds:s.sceneIds,animations:s.animations,bounds:s.bounds,kind:s.kind,topmostTrackIndex:a.length>0?Math.max(...a):-1,parentGroupId:c,depth:0}}),n=new Map(i.map(s=>[s.id,s]));for(const s of i){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return i}function uy({group:r,currentTime:e,activeMembers:t,fallbackDimensions:i}){if(!r.animations||t.length===0)return null;const n=Math.min(...t.map(A=>A.start)),o=Math.max(...t.map(A=>A.end))-n,a=Math.max(0,e-n),c=r.bounds,l=(c==null?void 0:c.width)??i.width,u=(c==null?void 0:c.height)??i.height;return id({sceneTime:a,animations:r.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function Td({group:r,animationState:e,targetCtx:t,fallbackDimensions:i}){const n=r.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??i.width,c=(n==null?void 0:n.height)??i.height,{opacity:l,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=l,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+c/2;t.translate(f,g),t.scale(A,A),t.rotate(d*Math.PI/180),t.translate(-f,-g)}h&&(t.beginPath(),t.rect(s+h.x*a,o+h.y*c,h.width*a,h.height*c),t.clip())}async function hy({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Ro(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="video"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var E;return p===((E=e[d+1])==null?void 0:E.id)}),from:a.find(({id:p})=>{var E;return p===((E=e[d-1])==null?void 0:E.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function dy({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Ro(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=Zt(o.slice(0,d));return h.type==="text"&&A.push(Do({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),c=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=Zt(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),l=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=Zt(o.slice(0,d))-f;return A.push({type:h.type,id:h.id,name:h.name,start:g,duration:f,config:h,transitionCanvas:s(),to:a.find(({id:p})=>{var E;return p===((E=e[d+1])==null?void 0:E.id)}),from:a.find(({id:p})=>{var E;return p===((E=e[d-1])==null?void 0:E.id)})}),A},[]),u=e.map(({id:A})=>a.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)??l.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:c,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const fy=(((Hh=Gh)==null?void 0:Hh.default)??Gh).reduce((r,e)=>(r[e.name]=e,r),{});function gy(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function py({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:c=!0}){var l,u,A;const h=gy(a,o);if(o.disable(o.DEPTH_TEST),h.buffer?o.bindBuffer(o.ARRAY_BUFFER,h.buffer):(h.buffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h.buffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),o.STATIC_DRAW)),o.viewport(0,0,n,s),h.fromTexture?h.fromTexture.setPixels(t):(h.fromTexture=(((l=yo)==null?void 0:l.default)??yo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=yo)==null?void 0:u.default)??yo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((A=Uh)==null?void 0:A.default)??Uh)(o,fy[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!c)return o.flush(),new Uint8Array(0);const f=new Uint8Array(n*s*4);return o.readPixels(0,0,n,s,o.RGBA,o.UNSIGNED_BYTE,f),o.flush(),f}function my(r){for(const[e,t]of r.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(i=>{i.dispose()}),r.delete(e)}function Ey({name:r,to:e,from:t,progress:i,canvas:n,contextResources:s}){const o=n.getContext("webgl",{alpha:!0,depth:!1,antialias:!1,preserveDrawingBuffer:!1});o&&(o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0),py({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function bd({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=yd,drawTransition:o=Ey}){var a;const c=new Map,l=await Promise.all(e.tracks.map(async E=>{if(iy(E))return{...await hy({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(ey(E))return{...await dy({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(ty(E))return{...await cy({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(ry(E))return{...await ay({track:E}),config:E};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?Ay({groups:e.groups,tracks:l}):[],A=new Map,h=[...u].sort((E,y)=>E.depth-y.depth);for(const E of h)for(const y of E.sceneIds)A.set(y,E);const d=new Map(u.map(E=>[E.id,E]));function f(E){const y=[];let B=A.get(E.id);for(;B;)B.animations&&y.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return y}return{draw:async({canvas:E,currentTime:y,overrides:B,signal:C})=>{const x=E.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,E.width,E.height),x.save(),x.fillStyle="black",x.fillRect(0,0,E.width,E.height),x.restore();const Q=new Map;for(const D of l)if(!_o(D))for(const $ of D.scenes){if(y<$.start||y>=$.start+$.duration)continue;const K=$.layout,ee=K==null?void 0:K.node,Z={start:$.start,end:$.start+$.duration,x:(ee==null?void 0:ee.x)??0,y:(ee==null?void 0:ee.y)??0,width:(ee==null?void 0:ee.width)??E.width,height:(ee==null?void 0:ee.height)??E.height};let L=A.get($.id);for(;L;)L.animations&&(Q.has(L.id)||Q.set(L.id,[]),Q.get(L.id).push(Z)),L=L.parentGroupId?d.get(L.parentGroupId):void 0}const _=new Map;function M(D){if(_.has(D.id))return _.get(D.id);const $=uy({group:D,currentTime:y,activeMembers:Q.get(D.id)??[],fallbackDimensions:{width:E.width,height:E.height}});return _.set(D.id,$),$}function P(D,$,K){const ee=f({id:K});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const L=ee[Z],U=M(L);U&&Td({group:L,animationState:U,targetCtx:D,fallbackDimensions:{width:E.width,height:E.height}})}D.drawImage($,0,0,$.width,$.height),D.restore()}for(let D=0;D<l.length;D++){if(C!=null&&C.aborted)return;const $=l[D];if(_o($))continue;const{scenes:K,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=E.width,Z.height=E.height;const L=Z.getContext("2d");if(!L)continue;const U=K.filter(({start:R,duration:F})=>y>=R&&y<R+F);if(U.length===0)continue;const V=ee.find(({start:R,duration:F})=>y>=R&&y<R+F),k=!!(V&&V.to&&V.from&&V.duration>0);for await(const R of U){if(C!=null&&C.aborted)return;const{sceneCanvas:F,draw:J,id:Y}=R;if(await(J==null?void 0:J(y,B==null?void 0:B.get(Y))),C!=null&&C.aborted)return;k&&(V.to.id===Y||V.from.id===Y)||P(L,F,Y)}if(k){const{name:R,to:F,from:J,duration:Y,transitionCanvas:re}=V;re.width=re.height=0,re.width=Z.width,re.height=Z.height;const se=Math.min(1,Math.max(0,(y-F.start)/Y));if(await o({name:R,progress:se,contextResources:c,to:F.sceneCanvas,from:J.sceneCanvas,canvas:re}),C!=null&&C.aborted)return;const fe=new Set(f({id:J.id})),me=new Set(f({id:F.id})),be=[...fe].filter(ke=>me.has(ke)).sort((ke,pe)=>ke.depth-pe.depth);if(be.length===0)L.drawImage(re,0,0,re.width,re.height);else{L.save();for(const ke of be){const pe=M(ke);pe&&Td({group:ke,animationState:pe,targetCtx:L,fallbackDimensions:{width:E.width,height:E.height}})}L.drawImage(re,0,0,re.width,re.height),L.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{my(c)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:E})=>E))}}const os=.3,Lo=.5,Iy=1;function vy(r){return r.tracks.flatMap(t=>t.scenes).filter(ny).filter(t=>{var i;const n=Ol(t.config.root.element,"video")[0];if(!n||(i=n.config)!=null&&i.alpha)return!1;const{volume:s}=KC.transform.values(n.options??{});return s[0]>0}).map(({start:t,duration:i})=>({start:t,end:t+i})).sort((t,i)=>t.start-i.start).reduce((t,i)=>{const n=t[t.length-1];return n&&i.start-n.end<Iy?t[t.length-1]={start:n.start,end:Math.max(n.end,i.end)}:t.push(i),t},[])}const Cy=r=>Math.round(r*1e6)/1e6;function yy(r,e,t){return e.reduce((i,{start:n,end:s})=>r<=n-os||r>=s+Lo?i:r<n?Math.min(i,1-(1-t)*(r-(n-os))/os):r<=s?Math.min(i,t):Math.min(i,t+(1-t)*(r-s)/Lo),1)}function By(r,e){const t=Ol(r.config.root.element,"audio")[0],{duration:i}=r;if(!t||i<=0)return null;const n=AC.transform.values(t.options??{}),[s]=n.duckLevel,[o]=n.fadeIn,[a]=n.fadeOut,c=n.duck&&s<1?e.map(({start:A,end:h})=>({start:A-r.start,end:h-r.start})).filter(({start:A,end:h})=>A-os<i&&h+Lo>0):[];if(o<=0&&a<=0&&c.length===0)return null;const l=A=>Math.max(0,Math.min(1,o>0?A/o:1,a>0?(i-A)/a:1)),u=[0,i,o,i-a,...o>0&&a>0?[i*o/(o+a)]:[],...c.flatMap(({start:A,end:h})=>[A-os,A,h,h+Lo])];return[...new Set(u.filter(A=>A>=0&&A<=i).map(Cy))].sort((A,h)=>A-h).map(A=>({time:A,gain:l(A)*yy(A,c,s)}))}function Ty(r){const e=vy(r),t=new Map;for(const i of r.tracks)if(_o(i))for(const n of i.scenes){const s=By(n,e);s&&t.set(n.id,s)}return t}function by(r,e){if(r.length===0)return 1;if(e<=r[0].time)return r[0].gain;for(let t=1;t<r.length;t++){const i=r[t];if(e<=i.time){const n=r[t-1];return n.gain+(i.gain-n.gain)*(e-n.time)/(i.time-n.time)}}return r[r.length-1].gain}const Sy={name:"@vouchfor/embeds",version:"8.7.2",license:"MIT",author:"Aaron Williams",main:"dist/es/embeds.js",module:"dist/es/embeds.js",type:"module",types:"dist/es/src/index.d.ts",exports:{".":"./dist/es/embeds.js"},files:["dist","src"],publishConfig:{tag:"latest",access:"public"},engines:{node:">=18.18.0"},scripts:{build:"rm -rf dist && tsc && yarn build:self","build:self":"vite build --mode iife && vite build --mode es && node scripts/build.cjs","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 generate:manifest","test:browser":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner --config web-test-runner.ci.config.js","test:browser:local":"rm -rf test/lib && yarn prebuild && vite build --mode test && web-test-runner","test:watch":"yarn test:browser --watch",typecheck:"tsc --noEmit"},"lint-staged":{"**/*.{ts,tsx,js}":"eslint --fix --quiet","**/*.{md,json,yml}":"prettier --write"},dependencies:{"@a11y/focus-trap":"^1.0.5","@lit/task":"^1.0.2","@vouchfor/canvas-video":"^13.7.0","@vouchfor/media-player":"^9.7.2",uuid:"^9.0.1"},peerDependencies:{lit:"^3.1.2"},devDependencies:{"@esm-bundle/chai":"^4.3.4","@open-wc/testing":"^4.0.0","@storybook/addon-docs":"^10.6.0","@storybook/addon-links":"^10.6.0","@storybook/web-components":"^10.6.0","@storybook/web-components-vite":"^10.6.0","@svgr/core":"^8.1.0","@types/flat":"^5.0.5","@types/mocha":"^10.0.10","@vouchfor/eslint-config":"^1.0.8","@vouchfor/prettier-config":"^1.0.1","@vouchfor/video-utils":"^6.7.0","@web/dev-server-esbuild":"^1.0.4","@web/test-runner":"^0.20.1","@web/test-runner-browserstack":"^0.8.0","@web/test-runner-mocha":"^0.9.0","@web/test-runner-playwright":"^0.11.0",dotenv:"^17.4.2",eslint:"^8.57.0",glob:"^10.4.5","lint-staged":"^15.5.1",lit:"^3.3.0",lodash:"^4.17.21",react:"^18.3.1","react-dom":"^18.3.1","rollup-plugin-tla":"^0.0.2",sinon:"^17.0.1",storybook:"^10.6.0",svgson:"^5.3.1",typescript:"^5.8.3",vite:"^5.4.18","vite-plugin-commonjs":"^0.10.4","vite-plugin-dts":"^3.9.1","web-component-analyzer":"^2.0.0"}};function xy(r){const{publicApiUrl:e}=Zs(r),t=Qi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function wy(r){var s,o,a,c,l,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:Qi()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(c=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:c.call(a,"vouch-uid-client"),i=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=Qi();return e||(e=xy(r),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=Qi(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=Qi(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",i)),{client:t,tab:i,request:n,visitor:e}}function Qy(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function Ry(r="embedded_player"){var n,s;const[e,t]=((s=(n=Intl.DateTimeFormat().resolvedOptions().timeZone)==null?void 0:n.split)==null?void 0:s.call(n,"/"))??[],i={};return[...new URLSearchParams(location.search).entries()].forEach(([o,a])=>{if(/utm/.test(o)){const c=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());i[c]=a}}),{source:r,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:Sy.version,templateVersion:sy,...i}}const Sd=1;class _y{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=Qy(i,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...i,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Zs(this.host.env),{client:i,tab:n,request:s,visitor:o}=wy(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":i,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":Ry(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+Sd&&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:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:i,node:n},this._streamLatestTime[i]=n.currentTime,this._streamStartTime[i]||(this._streamStartTime[i]=n.currentTime,this._streamLatestTime[i]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:i}})=>{this._streamLatestTime[i]>this._streamStartTime[i]+Sd&&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,n;"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),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,i,n;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),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var Gl={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ri<"u"&&ri,i=function(){function s(){this.fetch=!1,this.DOMException=t.DOMException}return s.prototype=t,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof ri<"u"&&ri||{},c={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(L){return L&&DataView.prototype.isPrototypeOf(L)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var U={next:function(){var V=L.shift();return{done:V===void 0,value:V}}};return c.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(L){this.map={},L instanceof g?L.forEach(function(U,V){this.append(V,U)},this):Array.isArray(L)?L.forEach(function(U){if(U.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+U.length);this.append(U[0],U[1])},this):L&&Object.getOwnPropertyNames(L).forEach(function(U){this.append(U,L[U])},this)}g.prototype.append=function(L,U){L=h(L),U=d(U);var V=this.map[L];this.map[L]=V?V+", "+U:U},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,U){this.map[h(L)]=d(U)},g.prototype.forEach=function(L,U){for(var V in this.map)this.map.hasOwnProperty(V)&&L.call(U,this.map[V],V,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(U,V){L.push(V)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(U){L.push(U)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(U,V){L.push([V,U])}),f(L)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function E(L){return new Promise(function(U,V){L.onload=function(){U(L.result)},L.onerror=function(){V(L.error)}})}function y(L){var U=new FileReader,V=E(U);return U.readAsArrayBuffer(L),V}function B(L){var U=new FileReader,V=E(U),k=/charset=([A-Za-z0-9_-]+)/.exec(L.type),R=k?k[1]:"utf-8";return U.readAsText(L,R),V}function C(L){for(var U=new Uint8Array(L),V=new Array(U.length),k=0;k<U.length;k++)V[k]=String.fromCharCode(U[k]);return V.join("")}function x(L){if(L.slice)return L.slice(0);var U=new Uint8Array(L.byteLength);return U.set(new Uint8Array(L)),U.buffer}function Q(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:c.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:c.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():c.arrayBuffer&&c.blob&&l(L)?(this._bodyArrayBuffer=x(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||A(L))?this._bodyArrayBuffer=x(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var L=p(this);if(L)return L;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 L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return B(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)},c.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function M(L){var U=L.toUpperCase();return _.indexOf(U)>-1?U:L}function P(L,U){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var V=U.body;if(L instanceof P){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,U.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!V&&L._bodyInit!=null&&(V=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=M(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal||function(){if("AbortController"in a){var F=new AbortController;return F.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(V),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var k=/([?&])_=[^&]*/;if(k.test(this.url))this.url=this.url.replace(k,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(L){var U=new FormData;return L.trim().split("&").forEach(function(V){if(V){var k=V.split("="),R=k.shift().replace(/\+/g," "),F=k.join("=").replace(/\+/g," ");U.append(decodeURIComponent(R),decodeURIComponent(F))}}),U}function $(L){var U=new g,V=L.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(k){return k.indexOf(`
2463
2463
  `)===0?k.substr(1,k.length):k}).forEach(function(k){var R=k.split(":"),F=R.shift().trim();if(F){var J=R.join(":").trim();try{U.append(F,J)}catch(Y){console.warn("Response "+Y.message)}}}),U}Q.call(P.prototype);function K(L,U){if(!(this instanceof K))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=U.statusText===void 0?"":""+U.statusText,this.headers=new g(U.headers),this.url=U.url||"",this._initBody(L)}Q.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},K.error=function(){var L=new K(null,{status:200,statusText:""});return L.ok=!1,L.status=0,L.type="error",L};var ee=[301,302,303,307,308];K.redirect=function(L,U){if(ee.indexOf(U)===-1)throw new RangeError("Invalid status code");return new K(null,{status:U,headers:{location:L}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(U,V){this.message=U,this.name=V;var k=Error(U);this.stack=k.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Z(L,U){return new Promise(function(V,k){var R=new P(L,U);if(R.signal&&R.signal.aborted)return k(new o.DOMException("Aborted","AbortError"));var F=new XMLHttpRequest;function J(){F.abort()}F.onload=function(){var se={statusText:F.statusText,headers:$(F.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(F.status<200||F.status>599)?se.status=200:se.status=F.status,se.url="responseURL"in F?F.responseURL:se.headers.get("X-Request-URL");var fe="response"in F?F.response:F.responseText;setTimeout(function(){V(new K(fe,se))},0)},F.onerror=function(){setTimeout(function(){k(new TypeError("Network request failed"))},0)},F.ontimeout=function(){setTimeout(function(){k(new TypeError("Network request timed out"))},0)},F.onabort=function(){setTimeout(function(){k(new o.DOMException("Aborted","AbortError"))},0)};function Y(se){try{return se===""&&a.location.href?a.location.href:se}catch{return se}}if(F.open(R.method,Y(R.url),!0),R.credentials==="include"?F.withCredentials=!0:R.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&(c.blob?F.responseType="blob":c.arrayBuffer&&(F.responseType="arraybuffer")),U&&typeof U.headers=="object"&&!(U.headers instanceof g||a.Headers&&U.headers instanceof a.Headers)){var re=[];Object.getOwnPropertyNames(U.headers).forEach(function(se){re.push(h(se)),F.setRequestHeader(se,d(U.headers[se]))}),R.headers.forEach(function(se,fe){re.indexOf(fe)===-1&&F.setRequestHeader(fe,se)})}else R.headers.forEach(function(se,fe){F.setRequestHeader(fe,se)});R.signal&&(R.signal.addEventListener("abort",J),F.onreadystatechange=function(){F.readyState===4&&R.signal.removeEventListener("abort",J)}),F.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return Z.polyfill=!0,a.fetch||(a.fetch=Z,a.Headers=g,a.Request=P,a.Response=K),o.Headers=g,o.Request=P,o.Response=K,o.fetch=Z,o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=t.fetch?t:i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(Gl,Gl.exports);var Dy=Gl.exports;const xd=il(Dy);async function Ly(r){var e;try{if((e=await xd(r,{method:"HEAD"}))!=null&&e.ok)return r}catch{return}}async function Hl({sources:r}){const e=r==null?void 0:r.filter(Boolean),t=e==null?void 0:e.find(s=>s.startsWith("blob:")),i=e==null?void 0:e.find(s=>!s.startsWith("http")&&!s.startsWith("blob:"));if(t||i)return t??i;let n=e[0];if(e.length>0){const s=e.map(a=>Ly(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function ky(r){try{return(await xd(r)).text()}catch{return null}}async function My(r){return r=r.trim(),r.startsWith("http")||r.startsWith("blob:")?ky(r):r}function Fy(r){if(typeof r=="string"){const[e,t]=r.split(":");return parseFloat(e)/parseFloat(t)}return r}const Py=Ar(async({original:r,translation:e,originalLanguage:t="",translationLanguage:i=""},{language:n})=>{var s,o;const a={[(s=i==null?void 0:i.split("-"))==null?void 0:s[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:r},c=(n&&a[n])??r;return c?My(c):null},{cacheKey:([r,{language:e}])=>JSON.stringify({...r,language:e})});function Ny(r){var e;return((e=r==null?void 0:r.items)==null?void 0:e.map(t=>{var i;return{text:(i=t.alternatives[0])==null?void 0:i.content,start:t.start_time,end:t.end_time}}))??[]}const Oy=Ar(async r=>{var e,t,i,n,s,o,a,c,l,u,A;const[h,d,f]=await Promise.all([Hl({sources:[(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,(n=(i=r==null?void 0:r.answer)==null?void 0:i.media)==null?void 0:n.input]}),Hl({sources:[(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),Hl({sources:[((c=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:c.reducedQuality)??((A=(u=(l=r==null?void 0:r.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:A.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([r])=>{var e,t,i,n,s,o,a,c,l,u,A;return JSON.stringify({video:(t=(e=r==null?void 0:r.answer)==null?void 0:e.media)==null?void 0:t.video,input:(n=(i=r==null?void 0:r.answer)==null?void 0:i.media)==null?void 0:n.input,playlist:(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist,preview:((c=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:c.reducedQuality)??((A=(u=(l=r==null?void 0:r.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:A.xs)})}});function wd(r){var e,t,i,n,s,o,a,c,l,u,A,h;const d=((t=(e=r==null?void 0:r.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((s=(n=(i=r==null?void 0:r.answer)==null?void 0:i.contact)==null?void 0:n.name)==null?void 0:s.trim())??"",f=((c=(a=(o=r==null?void 0:r.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:c.name)==="Not Supplied"?"":((h=(A=(u=(l=r==null?void 0:r.answer)==null?void 0:l.contact)==null?void 0:u.client)==null?void 0:A.name)==null?void 0:h.trim())??"",[g,p]=d.split(" ");return{name:d,firstName:g,lastName:p,companyName:f}}function Uy(r){var e,t;const i=(t=(e=r==null?void 0:r.answer)==null?void 0:e.contact)==null?void 0:t.roleTitle,n=i==null?void 0:i.split(" ");return{roleTitle:i,roleWords:n,firstRoleWord:n==null?void 0:n[0],remainingRoleWords:n==null?void 0:n.slice(1).join(" ")}}async function Gy(r,e,t){var i,n,s;const o=(i=e==null?void 0:e.answer)==null?void 0:i.id;return((s=(n=r==null?void 0:r.questions)==null?void 0:n.items)==null?void 0:s.reduce((c,l)=>{var u;return((u=l==null?void 0:l.answer)==null?void 0:u.id)===o?(c??0)+1:c},0))<=1?o:`${o}-${t}`}async function $l({data:r,rootData:e,index:t},i){var n,s,o,a,c,l,u,A,h,d,f,g,p,E,y,B,C,x,Q,_,M,P,D,$,K;const ee=(n=e==null?void 0:e.answer)==null?void 0:n.metadata;(ee==null?void 0:ee.aspectRatio)!=null&&(ee.aspectRatio=Fy(ee.aspectRatio));const[Z,L,U]=await Promise.all([Gy(r,e,t),Oy(e),Py({original:((o=(s=e==null?void 0:e.answer)==null?void 0:s.media)==null?void 0:o.captions)??((c=(a=e==null?void 0:e.answer)==null?void 0:a.captions)==null?void 0:c.current),translation:((u=(l=e==null?void 0:e.answer)==null?void 0:l.media)==null?void 0:u.translation)??((h=(A=e==null?void 0:e.answer)==null?void 0:A.captions)==null?void 0:h.translation),originalLanguage:(f=(d=e==null?void 0:e.answer)==null?void 0:d.transcription)==null?void 0:f.language,translationLanguage:(E=(p=(g=e==null?void 0:e.answer)==null?void 0:g.transcription)==null?void 0:p.translation)==null?void 0:E.language},i)]),V=wd(e),k=Uy(e);return{...L,...V,...k,key:Z,captions:U,wordTimings:Ny((y=e==null?void 0:e.answer)==null?void 0:y.transcription),answerLabel:((B=e==null?void 0:e.answer)==null?void 0:B.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((_=(Q=(x=(C=r==null?void 0:r.questions)==null?void 0:C.items)==null?void 0:x[t-1])==null?void 0:Q.answer)==null?void 0:_.label)??((D=(P=(M=r==null?void 0:r.questions)==null?void 0:M.items)==null?void 0:P[t-1])==null?void 0:D.title)??null:null,isFirstInstanceOfName:t?((K=($=r==null?void 0:r.questions)==null?void 0:$.items)==null?void 0:K.findIndex(R=>wd(R).name===V.name))===t:!0}}const ko={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 Hy({data:r}){var e,t;return((t=(e=r==null?void 0:r.questions)==null?void 0:e.items)==null?void 0:t.reduce((i,n)=>{var s,o,a,c,l,u,A;const h=(a=(o=(s=n==null?void 0:n.answer)==null?void 0:s.transcription)==null?void 0:o.language)==null?void 0:a.split("-")[0],d=(A=(u=(l=(c=n==null?void 0:n.answer)==null?void 0:c.transcription)==null?void 0:l.translation)==null?void 0:u.language)==null?void 0:A.split("-")[0];return h&&ko[h]&&!i.find(f=>f.value===h)&&i.push({value:h,label:ko[h]}),d&&ko[d]&&!i.find(f=>f.value===d)&&i.push({value:d,label:ko[d]}),i},[]))??[]}/**
2464
2464
  * @license
2465
2465
  * Copyright 2018 Google LLC
@@ -2511,7 +2511,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2511
2511
  * @license
2512
2512
  * Copyright 2017 Google LLC
2513
2513
  * SPDX-License-Identifier: BSD-3-Clause
2514
- */const d0=(r,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},f0=Zi(class extends $n{constructor(r){if(super(r),r.type!==zi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],s=[];let o=0;for(const a of r)n[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){const n=Np(r),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??(this.ut=[]),c=[];let l,u,A=0,h=n.length-1,d=0,f=s.length-1;for(;A<=h&&d<=f;)if(n[A]===null)A++;else if(n[h]===null)h--;else if(a[A]===o[d])c[d]=wi(n[A],s[d]),A++,d++;else if(a[h]===o[f])c[f]=wi(n[h],s[f]),h--,f--;else if(a[A]===o[f])c[f]=wi(n[A],s[f]),Hn(r,c[f+1],n[A]),A++,f--;else if(a[h]===o[d])c[d]=wi(n[h],s[d]),Hn(r,n[A],n[h]),h--,d++;else if(l===void 0&&(l=d0(o,d,f),u=d0(a,A,h)),l.has(a[A]))if(l.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const E=Hn(r,n[A]);wi(E,s[d]),c[d]=E}else c[d]=wi(p,s[d]),Hn(r,n[A],p),n[g]=null;d++}else Ha(n[h]),h--;else Ha(n[A]),A++;for(;d<=f;){const g=Hn(r,c[f+1]);wi(g,s[d]),c[d++]=g}for(;A<=h;){const g=n[A++];g!==null&&Ha(g)}return this.ut=o,Pp(r,c),cr}});var Gt="top",nr="bottom",sr="right",Ht="left",tA="auto",vs=[Gt,nr,sr,Ht],gn="start",Cs="end",kS="clippingParents",g0="viewport",ys="popper",MS="reference",p0=vs.reduce(function(r,e){return r.concat([e+"-"+gn,e+"-"+Cs])},[]),m0=[].concat(vs,[tA]).reduce(function(r,e){return r.concat([e,e+"-"+gn,e+"-"+Cs])},[]),FS="beforeRead",PS="read",NS="afterRead",OS="beforeMain",US="main",GS="afterMain",HS="beforeWrite",$S="write",YS="afterWrite",VS=[FS,PS,NS,OS,US,GS,HS,$S,YS];function Rr(r){return r?(r.nodeName||"").toLowerCase():null}function Jt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Ni(r){var e=Jt(r).Element;return r instanceof e||r instanceof Element}function or(r){var e=Jt(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function rA(r){if(typeof ShadowRoot>"u")return!1;var e=Jt(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function KS(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!or(s)||!Rr(s)||(Object.assign(s.style,i),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function WS(r){var e=r.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 n=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(c,l){return c[l]="",c},{});!or(n)||!Rr(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(c){n.removeAttribute(c)}))})}}const E0={name:"applyStyles",enabled:!0,phase:"write",fn:KS,effect:WS,requires:["computeStyles"]};function _r(r){return r.split("-")[0]}var Oi=Math.max,ga=Math.min,pn=Math.round;function iA(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function I0(){return!/^((?!chrome|android).)*safari/i.test(iA())}function mn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=r.getBoundingClientRect(),n=1,s=1;e&&or(r)&&(n=r.offsetWidth>0&&pn(i.width)/r.offsetWidth||1,s=r.offsetHeight>0&&pn(i.height)/r.offsetHeight||1);var o=Ni(r)?Jt(r):window,a=o.visualViewport,c=!I0()&&t,l=(i.left+(c&&a?a.offsetLeft:0))/n,u=(i.top+(c&&a?a.offsetTop:0))/s,A=i.width/n,h=i.height/s;return{width:A,height:h,top:u,right:l+A,bottom:u+h,left:l,x:l,y:u}}function nA(r){var e=mn(r),t=r.offsetWidth,i=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:i}}function v0(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&rA(t)){var i=e;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Wr(r){return Jt(r).getComputedStyle(r)}function JS(r){return["table","td","th"].indexOf(Rr(r))>=0}function hi(r){return((Ni(r)?r.ownerDocument:r.document)||window.document).documentElement}function pa(r){return Rr(r)==="html"?r:r.assignedSlot||r.parentNode||(rA(r)?r.host:null)||hi(r)}function C0(r){return!or(r)||Wr(r).position==="fixed"?null:r.offsetParent}function jS(r){var e=/firefox/i.test(iA()),t=/Trident/i.test(iA());if(t&&or(r)){var i=Wr(r);if(i.position==="fixed")return null}var n=pa(r);for(rA(n)&&(n=n.host);or(n)&&["html","body"].indexOf(Rr(n))<0;){var s=Wr(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Bs(r){for(var e=Jt(r),t=C0(r);t&&JS(t)&&Wr(t).position==="static";)t=C0(t);return t&&(Rr(t)==="html"||Rr(t)==="body"&&Wr(t).position==="static")?e:t||jS(r)||e}function sA(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function Ts(r,e,t){return Oi(r,ga(e,t))}function qS(r,e,t){var i=Ts(r,e,t);return i>t?t:i}function y0(){return{top:0,right:0,bottom:0,left:0}}function B0(r){return Object.assign({},y0(),r)}function T0(r,e){return e.reduce(function(t,i){return t[i]=r,t},{})}var XS=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,B0(typeof e!="number"?e:T0(e,vs))};function zS(r){var e,t=r.state,i=r.name,n=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=_r(t.placement),c=sA(a),l=[Ht,sr].indexOf(a)>=0,u=l?"height":"width";if(!(!s||!o)){var A=XS(n.padding,t),h=nA(s),d=c==="y"?Gt:Ht,f=c==="y"?nr:sr,g=t.rects.reference[u]+t.rects.reference[c]-o[c]-t.rects.popper[u],p=o[c]-t.rects.reference[c],E=Bs(s),y=E?c==="y"?E.clientHeight||0:E.clientWidth||0:0,B=g/2-p/2,C=A[d],x=y-h[u]-A[f],Q=y/2-h[u]/2+B,_=Ts(C,Q,x),M=c;t.modifiersData[i]=(e={},e[M]=_,e.centerOffset=_-Q,e)}}function ZS(r){var e=r.state,t=r.options,i=t.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||v0(e.elements.popper,n)&&(e.elements.arrow=n))}const ex={name:"arrow",enabled:!0,phase:"main",fn:zS,effect:ZS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function En(r){return r.split("-")[1]}var tx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rx(r,e){var t=r.x,i=r.y,n=e.devicePixelRatio||1;return{x:pn(t*n)/n||0,y:pn(i*n)/n||0}}function b0(r){var e,t=r.popper,i=r.popperRect,n=r.placement,s=r.variation,o=r.offsets,a=r.position,c=r.gpuAcceleration,l=r.adaptive,u=r.roundOffsets,A=r.isFixed,h=o.x,d=h===void 0?0:h,f=o.y,g=f===void 0?0:f,p=typeof u=="function"?u({x:d,y:g}):{x:d,y:g};d=p.x,g=p.y;var E=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),B=Ht,C=Gt,x=window;if(l){var Q=Bs(t),_="clientHeight",M="clientWidth";if(Q===Jt(t)&&(Q=hi(t),Wr(Q).position!=="static"&&a==="absolute"&&(_="scrollHeight",M="scrollWidth")),Q=Q,n===Gt||(n===Ht||n===sr)&&s===Cs){C=nr;var P=A&&Q===x&&x.visualViewport?x.visualViewport.height:Q[_];g-=P-i.height,g*=c?1:-1}if(n===Ht||(n===Gt||n===nr)&&s===Cs){B=sr;var D=A&&Q===x&&x.visualViewport?x.visualViewport.width:Q[M];d-=D-i.width,d*=c?1:-1}}var $=Object.assign({position:a},l&&tx),K=u===!0?rx({x:d,y:g},Jt(t)):{x:d,y:g};if(d=K.x,g=K.y,c){var ee;return Object.assign({},$,(ee={},ee[C]=y?"0":"",ee[B]=E?"0":"",ee.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",ee))}return Object.assign({},$,(e={},e[C]=y?g+"px":"",e[B]=E?d+"px":"",e.transform="",e))}function ix(r){var e=r.state,t=r.options,i=t.gpuAcceleration,n=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,c=a===void 0?!0:a,l={placement:_r(e.placement),variation:En(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,b0(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,b0(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const nx={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ix,data:{}};var ma={passive:!0};function sx(r){var e=r.state,t=r.instance,i=r.options,n=i.scroll,s=n===void 0?!0:n,o=i.resize,a=o===void 0?!0:o,c=Jt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(u){u.addEventListener("scroll",t.update,ma)}),a&&c.addEventListener("resize",t.update,ma),function(){s&&l.forEach(function(u){u.removeEventListener("scroll",t.update,ma)}),a&&c.removeEventListener("resize",t.update,ma)}}const ox={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sx,data:{}};var ax={left:"right",right:"left",bottom:"top",top:"bottom"};function Ea(r){return r.replace(/left|right|bottom|top/g,function(e){return ax[e]})}var lx={start:"end",end:"start"};function S0(r){return r.replace(/start|end/g,function(e){return lx[e]})}function oA(r){var e=Jt(r),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function aA(r){return mn(hi(r)).left+oA(r).scrollLeft}function cx(r,e){var t=Jt(r),i=hi(r),n=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,c=0;if(n){s=n.width,o=n.height;var l=I0();(l||!l&&e==="fixed")&&(a=n.offsetLeft,c=n.offsetTop)}return{width:s,height:o,x:a+aA(r),y:c}}function Ax(r){var e,t=hi(r),i=oA(r),n=(e=r.ownerDocument)==null?void 0:e.body,s=Oi(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Oi(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+aA(r),c=-i.scrollTop;return Wr(n||t).direction==="rtl"&&(a+=Oi(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:c}}function lA(r){var e=Wr(r),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function x0(r){return["html","body","#document"].indexOf(Rr(r))>=0?r.ownerDocument.body:or(r)&&lA(r)?r:x0(pa(r))}function bs(r,e){var t;e===void 0&&(e=[]);var i=x0(r),n=i===((t=r.ownerDocument)==null?void 0:t.body),s=Jt(i),o=n?[s].concat(s.visualViewport||[],lA(i)?i:[]):i,a=e.concat(o);return n?a:a.concat(bs(pa(o)))}function cA(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function ux(r,e){var t=mn(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function w0(r,e,t){return e===g0?cA(cx(r,t)):Ni(e)?ux(e,t):cA(Ax(hi(r)))}function hx(r){var e=bs(pa(r)),t=["absolute","fixed"].indexOf(Wr(r).position)>=0,i=t&&or(r)?Bs(r):r;return Ni(i)?e.filter(function(n){return Ni(n)&&v0(n,i)&&Rr(n)!=="body"}):[]}function dx(r,e,t,i){var n=e==="clippingParents"?hx(r):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(c,l){var u=w0(r,l,i);return c.top=Oi(u.top,c.top),c.right=ga(u.right,c.right),c.bottom=ga(u.bottom,c.bottom),c.left=Oi(u.left,c.left),c},w0(r,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 Q0(r){var e=r.reference,t=r.element,i=r.placement,n=i?_r(i):null,s=i?En(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(n){case Gt:c={x:o,y:e.y-t.height};break;case nr:c={x:o,y:e.y+e.height};break;case sr:c={x:e.x+e.width,y:a};break;case Ht:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var l=n?sA(n):null;if(l!=null){var u=l==="y"?"height":"width";switch(s){case gn:c[l]=c[l]-(e[u]/2-t[u]/2);break;case Cs:c[l]=c[l]+(e[u]/2-t[u]/2);break}}return c}function Ss(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=i===void 0?r.placement:i,s=t.strategy,o=s===void 0?r.strategy:s,a=t.boundary,c=a===void 0?kS:a,l=t.rootBoundary,u=l===void 0?g0:l,A=t.elementContext,h=A===void 0?ys:A,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,E=B0(typeof p!="number"?p:T0(p,vs)),y=h===ys?MS:ys,B=r.rects.popper,C=r.elements[f?y:h],x=dx(Ni(C)?C:C.contextElement||hi(r.elements.popper),c,u,o),Q=mn(r.elements.reference),_=Q0({reference:Q,element:B,strategy:"absolute",placement:n}),M=cA(Object.assign({},B,_)),P=h===ys?M:Q,D={top:x.top-P.top+E.top,bottom:P.bottom-x.bottom+E.bottom,left:x.left-P.left+E.left,right:P.right-x.right+E.right},$=r.modifiersData.offset;if(h===ys&&$){var K=$[n];Object.keys(D).forEach(function(ee){var Z=[sr,nr].indexOf(ee)>=0?1:-1,L=[Gt,nr].indexOf(ee)>=0?"y":"x";D[ee]+=K[L]*Z})}return D}function fx(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,l=c===void 0?m0:c,u=En(i),A=u?a?p0:p0.filter(function(f){return En(f)===u}):vs,h=A.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=A);var d=h.reduce(function(f,g){return f[g]=Ss(r,{placement:g,boundary:n,rootBoundary:s,padding:o})[_r(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function gx(r){if(_r(r)===tA)return[];var e=Ea(r);return[S0(r),e,S0(e)]}function px(r){var e=r.state,t=r.options,i=r.name;if(!e.modifiersData[i]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,l=t.padding,u=t.boundary,A=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,E=_r(p),y=E===p,B=c||(y||!f?[Ea(p)]:gx(p)),C=[p].concat(B).reduce(function(se,fe){return se.concat(_r(fe)===tA?fx(e,{placement:fe,boundary:u,rootBoundary:A,padding:l,flipVariations:f,allowedAutoPlacements:g}):fe)},[]),x=e.rects.reference,Q=e.rects.popper,_=new Map,M=!0,P=C[0],D=0;D<C.length;D++){var $=C[D],K=_r($),ee=En($)===gn,Z=[Gt,nr].indexOf(K)>=0,L=Z?"width":"height",U=Ss(e,{placement:$,boundary:u,rootBoundary:A,altBoundary:h,padding:l}),V=Z?ee?sr:Ht:ee?nr:Gt;x[L]>Q[L]&&(V=Ea(V));var k=Ea(V),R=[];if(s&&R.push(U[K]<=0),a&&R.push(U[V]<=0,U[k]<=0),R.every(function(se){return se})){P=$,M=!1;break}_.set($,R)}if(M)for(var F=f?3:1,J=function(fe){var me=C.find(function(De){var be=_.get(De);if(be)return be.slice(0,fe).every(function(ke){return ke})});if(me)return P=me,"break"},Y=F;Y>0;Y--){var re=J(Y);if(re==="break")break}e.placement!==P&&(e.modifiersData[i]._skip=!0,e.placement=P,e.reset=!0)}}const mx={name:"flip",enabled:!0,phase:"main",fn:px,requiresIfExists:["offset"],data:{_skip:!1}};function R0(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function _0(r){return[Gt,sr,nr,Ht].some(function(e){return r[e]>=0})}function Ex(r){var e=r.state,t=r.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Ss(e,{elementContext:"reference"}),a=Ss(e,{altBoundary:!0}),c=R0(o,i),l=R0(a,n,s),u=_0(c),A=_0(l);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":A})}const Ix={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ex};function vx(r,e,t){var i=_r(r),n=[Ht,Gt].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Ht,sr].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Cx(r){var e=r.state,t=r.options,i=r.name,n=t.offset,s=n===void 0?[0,0]:n,o=m0.reduce(function(u,A){return u[A]=vx(A,e.rects,s),u},{}),a=o[e.placement],c=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const yx={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Cx};function Bx(r){var e=r.state,t=r.name;e.modifiersData[t]=Q0({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Tx={name:"popperOffsets",enabled:!0,phase:"read",fn:Bx,data:{}};function bx(r){return r==="x"?"y":"x"}function Sx(r){var e=r.state,t=r.options,i=r.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,l=t.rootBoundary,u=t.altBoundary,A=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=Ss(e,{boundary:c,rootBoundary:l,padding:A,altBoundary:u}),E=_r(e.placement),y=En(e.placement),B=!y,C=sA(E),x=bx(C),Q=e.modifiersData.popperOffsets,_=e.rects.reference,M=e.rects.popper,P=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,D=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,K={x:0,y:0};if(Q){if(s){var ee,Z=C==="y"?Gt:Ht,L=C==="y"?nr:sr,U=C==="y"?"height":"width",V=Q[C],k=V+p[Z],R=V-p[L],F=d?-M[U]/2:0,J=y===gn?_[U]:M[U],Y=y===gn?-M[U]:-_[U],re=e.elements.arrow,se=d&&re?nA(re):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:y0(),me=fe[Z],De=fe[L],be=Ts(0,_[U],se[U]),ke=B?_[U]/2-F-be-me-D.mainAxis:J-be-me-D.mainAxis,pe=B?-_[U]/2+F+be+De+D.mainAxis:Y+be+De+D.mainAxis,xe=e.elements.arrow&&Bs(e.elements.arrow),He=xe?C==="y"?xe.clientTop||0:xe.clientLeft||0:0,Re=(ee=$==null?void 0:$[C])!=null?ee:0,Xe=V+ke-Re-He,we=V+pe-Re,S=Ts(d?ga(k,Xe):k,V,d?Oi(R,we):R);Q[C]=S,K[C]=S-V}if(a){var I,m=C==="x"?Gt:Ht,w=C==="x"?nr:sr,N=Q[x],G=x==="y"?"height":"width",z=N+p[m],oe=N-p[w],ce=[Gt,Ht].indexOf(E)!==-1,he=(I=$==null?void 0:$[x])!=null?I:0,ve=ce?z:N-_[G]-M[G]-he+D.altAxis,Be=ce?N+_[G]+M[G]-he-D.altAxis:oe,Le=d&&ce?qS(ve,N,Be):Ts(d?ve:z,N,d?Be:oe);Q[x]=Le,K[x]=Le-N}e.modifiersData[i]=K}}const xx={name:"preventOverflow",enabled:!0,phase:"main",fn:Sx,requiresIfExists:["offset"]};function wx(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Qx(r){return r===Jt(r)||!or(r)?oA(r):wx(r)}function Rx(r){var e=r.getBoundingClientRect(),t=pn(e.width)/r.offsetWidth||1,i=pn(e.height)/r.offsetHeight||1;return t!==1||i!==1}function _x(r,e,t){t===void 0&&(t=!1);var i=or(e),n=or(e)&&Rx(e),s=hi(e),o=mn(r,n,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!t)&&((Rr(e)!=="body"||lA(s))&&(a=Qx(e)),or(e)?(c=mn(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=aA(s))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function Dx(r){var e=new Map,t=new Set,i=[];r.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&n(c)}}),i.push(s)}return r.forEach(function(s){t.has(s.name)||n(s)}),i}function Lx(r){var e=Dx(r);return VS.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function kx(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function Mx(r){var e=r.reduce(function(t,i){var n=t[i.name];return t[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var D0={placement:"bottom",modifiers:[],strategy:"absolute"};function L0(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Fx(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?D0:n;return function(a,c,l){l===void 0&&(l=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},D0,s),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},A=[],h=!1,d={state:u,setOptions:function(E){var y=typeof E=="function"?E(u.options):E;g(),u.options=Object.assign({},s,u.options,y),u.scrollParents={reference:Ni(a)?bs(a):a.contextElement?bs(a.contextElement):[],popper:bs(c)};var B=Lx(Mx([].concat(i,u.options.modifiers)));return u.orderedModifiers=B.filter(function(C){return C.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var E=u.elements,y=E.reference,B=E.popper;if(L0(y,B)){u.rects={reference:_x(y,Bs(B),u.options.strategy==="fixed"),popper:nA(B)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(D){return u.modifiersData[D.name]=Object.assign({},D.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],Q=x.fn,_=x.options,M=_===void 0?{}:_,P=x.name;typeof Q=="function"&&(u=Q({state:u,options:M,name:P,instance:d})||u)}}}},update:kx(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!L0(a,c))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var E=p.name,y=p.options,B=y===void 0?{}:y,C=p.effect;if(typeof C=="function"){var x=C({state:u,name:E,instance:d,options:B}),Q=function(){};A.push(x||Q)}})}function g(){A.forEach(function(p){return p()}),A=[]}return d}}var Px=[ox,Tx,nx,E0,yx,mx,xx,ex,Ix],Nx=Fx({defaultModifiers:Px}),Ox="tippy-box",k0="tippy-content",Ux="tippy-backdrop",M0="tippy-arrow",F0="tippy-svg-arrow",Ui={passive:!0,capture:!0},P0=function(){return document.body};function AA(r,e,t){if(Array.isArray(r)){var i=r[e];return i??(Array.isArray(t)?t[e]:t)}return r}function uA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function N0(r,e){return typeof r=="function"?r.apply(void 0,e):r}function O0(r,e){if(e===0)return r;var t;return function(i){clearTimeout(t),t=setTimeout(function(){r(i)},e)}}function Gx(r){return r.split(/\s+/).filter(Boolean)}function In(r){return[].concat(r)}function U0(r,e){r.indexOf(e)===-1&&r.push(e)}function Hx(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function $x(r){return r.split("-")[0]}function Ia(r){return[].slice.call(r)}function G0(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function xs(){return document.createElement("div")}function va(r){return["Element","Fragment"].some(function(e){return uA(r,e)})}function Yx(r){return uA(r,"NodeList")}function Vx(r){return uA(r,"MouseEvent")}function Kx(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function Wx(r){return va(r)?[r]:Yx(r)?Ia(r):Array.isArray(r)?r:Ia(document.querySelectorAll(r))}function hA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function H0(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Jx(r){var e,t=In(r),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function jx(r,e){var t=e.clientX,i=e.clientY;return r.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,c=a.interactiveBorder,l=$x(o.placement),u=o.modifiersData.offset;if(!u)return!0;var A=l==="bottom"?u.top.y:0,h=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,f=l==="left"?u.right.x:0,g=s.top-i+A>c,p=i-s.bottom-h>c,E=s.left-t+d>c,y=t-s.right-f>c;return g||p||E||y})}function dA(r,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){r[i](n,t)})}function $0(r,e){for(var t=e;t;){var i;if(r.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Dr={isTouch:!1},Y0=0;function qx(){Dr.isTouch||(Dr.isTouch=!0,window.performance&&document.addEventListener("mousemove",V0))}function V0(){var r=performance.now();r-Y0<20&&(Dr.isTouch=!1,document.removeEventListener("mousemove",V0)),Y0=r}function Xx(){var r=document.activeElement;if(Kx(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function zx(){document.addEventListener("touchstart",qx,Ui),window.addEventListener("blur",Xx)}var Zx=typeof window<"u"&&typeof document<"u",ew=Zx?!!window.msCrypto:!1,tw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},rw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fr=Object.assign({appendTo:P0,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},tw,rw),iw=Object.keys(fr),nw=function(e){var t=Object.keys(e);t.forEach(function(i){fr[i]=e[i]})};function K0(r){var e=r.plugins||[],t=e.reduce(function(i,n){var s=n.name,o=n.defaultValue;if(s){var a;i[s]=r[s]!==void 0?r[s]:(a=fr[s])!=null?a:o}return i},{});return Object.assign({},r,t)}function sw(r,e){var t=e?Object.keys(K0(Object.assign({},fr,{plugins:e}))):iw,i=t.reduce(function(n,s){var o=(r.getAttribute("data-tippy-"+s)||"").trim();if(!o)return n;if(s==="content")n[s]=o;else try{n[s]=JSON.parse(o)}catch{n[s]=o}return n},{});return i}function W0(r,e){var t=Object.assign({},e,{content:N0(e.content,[r])},e.ignoreAttributes?{}:sw(r,e.plugins));return t.aria=Object.assign({},fr.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 ow=function(){return"innerHTML"};function fA(r,e){r[ow()]=e}function J0(r){var e=xs();return r===!0?e.className=M0:(e.className=F0,va(r)?e.appendChild(r):fA(e,r)),e}function j0(r,e){va(e.content)?(fA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?fA(r,e.content):r.textContent=e.content)}function gA(r){var e=r.firstElementChild,t=Ia(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(k0)}),arrow:t.find(function(i){return i.classList.contains(M0)||i.classList.contains(F0)}),backdrop:t.find(function(i){return i.classList.contains(Ux)})}}function q0(r){var e=xs(),t=xs();t.className=Ox,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=xs();i.className=k0,i.setAttribute("data-state","hidden"),j0(i,r.props),e.appendChild(t),t.appendChild(i),n(r.props,r.props);function n(s,o){var a=gA(e),c=a.box,l=a.content,u=a.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&j0(l,r.props),o.arrow?u?s.arrow!==o.arrow&&(c.removeChild(u),c.appendChild(J0(o.arrow))):c.appendChild(J0(o.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:n}}q0.$$tippy=!0;var aw=1,Ca=[],pA=[];function lw(r,e){var t=W0(r,Object.assign({},fr,K0(G0(e)))),i,n,s,o=!1,a=!1,c=!1,l=!1,u,A,h,d=[],f=O0(Xe,t.interactiveDebounce),g,p=aw++,E=null,y=Hx(t.plugins),B={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:r,popper:xs(),popperInstance:E,props:t,state:B,plugins:y,clearDelayTimeouts:ve,setProps:Be,setContent:Le,show:Pe,hide:tt,hideWithInteractivity:ot,enable:ce,disable:he,unmount:vt,destroy:rt};if(!t.render)return C;var x=t.render(C),Q=x.popper,_=x.onUpdate;Q.setAttribute("data-tippy-root",""),Q.id="tippy-"+C.id,C.popper=Q,r._tippy=C,Q._tippy=C;var M=y.map(function(j){return j.fn(C)}),P=r.hasAttribute("aria-expanded");return xe(),F(),V(),k("onCreate",[C]),t.showOnCreate&&z(),Q.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),Q.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",f)}),C;function D(){var j=C.props.touch;return Array.isArray(j)?j:[j,0]}function $(){return D()[0]==="hold"}function K(){var j;return!!((j=C.props.render)!=null&&j.$$tippy)}function ee(){return g||r}function Z(){var j=ee().parentNode;return j?Jx(j):document}function L(){return gA(Q)}function U(j){return C.state.isMounted&&!C.state.isVisible||Dr.isTouch||u&&u.type==="focus"?0:AA(C.props.delay,j?0:1,fr.delay)}function V(j){j===void 0&&(j=!1),Q.style.pointerEvents=C.props.interactive&&!j?"":"none",Q.style.zIndex=""+C.props.zIndex}function k(j,ue,Ce){if(Ce===void 0&&(Ce=!0),M.forEach(function(Ne){Ne[j]&&Ne[j].apply(Ne,ue)}),Ce){var Me;(Me=C.props)[j].apply(Me,ue)}}function R(){var j=C.props.aria;if(j.content){var ue="aria-"+j.content,Ce=Q.id,Me=In(C.props.triggerTarget||r);Me.forEach(function(Ne){var Oe=Ne.getAttribute(ue);if(C.state.isVisible)Ne.setAttribute(ue,Oe?Oe+" "+Ce:Ce);else{var We=Oe&&Oe.replace(Ce,"").trim();We?Ne.setAttribute(ue,We):Ne.removeAttribute(ue)}})}}function F(){if(!(P||!C.props.aria.expanded)){var j=In(C.props.triggerTarget||r);j.forEach(function(ue){C.props.interactive?ue.setAttribute("aria-expanded",C.state.isVisible&&ue===ee()?"true":"false"):ue.removeAttribute("aria-expanded")})}}function J(){Z().removeEventListener("mousemove",f),Ca=Ca.filter(function(j){return j!==f})}function Y(j){if(!(Dr.isTouch&&(c||j.type==="mousedown"))){var ue=j.composedPath&&j.composedPath()[0]||j.target;if(!(C.props.interactive&&$0(Q,ue))){if(In(C.props.triggerTarget||r).some(function(Ce){return $0(Ce,ue)})){if(Dr.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else k("onClickOutside",[C,j]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||me())}}}function re(){c=!0}function se(){c=!1}function fe(){var j=Z();j.addEventListener("mousedown",Y,!0),j.addEventListener("touchend",Y,Ui),j.addEventListener("touchstart",se,Ui),j.addEventListener("touchmove",re,Ui)}function me(){var j=Z();j.removeEventListener("mousedown",Y,!0),j.removeEventListener("touchend",Y,Ui),j.removeEventListener("touchstart",se,Ui),j.removeEventListener("touchmove",re,Ui)}function De(j,ue){ke(j,function(){!C.state.isVisible&&Q.parentNode&&Q.parentNode.contains(Q)&&ue()})}function be(j,ue){ke(j,ue)}function ke(j,ue){var Ce=L().box;function Me(Ne){Ne.target===Ce&&(dA(Ce,"remove",Me),ue())}if(j===0)return ue();dA(Ce,"remove",A),dA(Ce,"add",Me),A=Me}function pe(j,ue,Ce){Ce===void 0&&(Ce=!1);var Me=In(C.props.triggerTarget||r);Me.forEach(function(Ne){Ne.addEventListener(j,ue,Ce),d.push({node:Ne,eventType:j,handler:ue,options:Ce})})}function xe(){$()&&(pe("touchstart",Re,{passive:!0}),pe("touchend",we,{passive:!0})),Gx(C.props.trigger).forEach(function(j){if(j!=="manual")switch(pe(j,Re),j){case"mouseenter":pe("mouseleave",we);break;case"focus":pe(ew?"focusout":"blur",S);break;case"focusin":pe("focusout",S);break}})}function He(){d.forEach(function(j){var ue=j.node,Ce=j.eventType,Me=j.handler,Ne=j.options;ue.removeEventListener(Ce,Me,Ne)}),d=[]}function Re(j){var ue,Ce=!1;if(!(!C.state.isEnabled||I(j)||a)){var Me=((ue=u)==null?void 0:ue.type)==="focus";u=j,g=j.currentTarget,F(),!C.state.isVisible&&Vx(j)&&Ca.forEach(function(Ne){return Ne(j)}),j.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?Ce=!0:z(j),j.type==="click"&&(o=!Ce),Ce&&!Me&&oe(j)}}function Xe(j){var ue=j.target,Ce=ee().contains(ue)||Q.contains(ue);if(!(j.type==="mousemove"&&Ce)){var Me=G().concat(Q).map(function(Ne){var Oe,We=Ne._tippy,Ct=(Oe=We.popperInstance)==null?void 0:Oe.state;return Ct?{popperRect:Ne.getBoundingClientRect(),popperState:Ct,props:t}:null}).filter(Boolean);jx(Me,j)&&(J(),oe(j))}}function we(j){var ue=I(j)||C.props.trigger.indexOf("click")>=0&&o;if(!ue){if(C.props.interactive){C.hideWithInteractivity(j);return}oe(j)}}function S(j){C.props.trigger.indexOf("focusin")<0&&j.target!==ee()||C.props.interactive&&j.relatedTarget&&Q.contains(j.relatedTarget)||oe(j)}function I(j){return Dr.isTouch?$()!==j.type.indexOf("touch")>=0:!1}function m(){w();var j=C.props,ue=j.popperOptions,Ce=j.placement,Me=j.offset,Ne=j.getReferenceClientRect,Oe=j.moveTransition,We=K()?gA(Q).arrow:null,Ct=Ne?{getBoundingClientRect:Ne,contextElement:Ne.contextElement||ee()}:r,Jr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(jt){var Bt=jt.state;if(K()){var qt=L(),jr=qt.box;["placement","reference-hidden","escaped"].forEach(function(qr){qr==="placement"?jr.setAttribute("data-placement",Bt.placement):Bt.attributes.popper["data-popper-"+qr]?jr.setAttribute("data-"+qr,""):jr.removeAttribute("data-"+qr)}),Bt.attributes.popper={}}}},yt=[{name:"offset",options:{offset:Me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Oe}},Jr];K()&&We&&yt.push({name:"arrow",options:{element:We,padding:3}}),yt.push.apply(yt,(ue==null?void 0:ue.modifiers)||[]),C.popperInstance=Nx(Ct,Q,Object.assign({},ue,{placement:Ce,onFirstUpdate:h,modifiers:yt}))}function w(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function N(){var j=C.props.appendTo,ue,Ce=ee();C.props.interactive&&j===P0||j==="parent"?ue=Ce.parentNode:ue=N0(j,[Ce]),ue.contains(Q)||ue.appendChild(Q),C.state.isMounted=!0,m()}function G(){return Ia(Q.querySelectorAll("[data-tippy-root]"))}function z(j){C.clearDelayTimeouts(),j&&k("onTrigger",[C,j]),fe();var ue=U(!0),Ce=D(),Me=Ce[0],Ne=Ce[1];Dr.isTouch&&Me==="hold"&&Ne&&(ue=Ne),ue?i=setTimeout(function(){C.show()},ue):C.show()}function oe(j){if(C.clearDelayTimeouts(),k("onUntrigger",[C,j]),!C.state.isVisible){me();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&o)){var ue=U(!1);ue?n=setTimeout(function(){C.state.isVisible&&C.hide()},ue):s=requestAnimationFrame(function(){C.hide()})}}function ce(){C.state.isEnabled=!0}function he(){C.hide(),C.state.isEnabled=!1}function ve(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function Be(j){if(!C.state.isDestroyed){k("onBeforeUpdate",[C,j]),He();var ue=C.props,Ce=W0(r,Object.assign({},ue,G0(j),{ignoreAttributes:!0}));C.props=Ce,xe(),ue.interactiveDebounce!==Ce.interactiveDebounce&&(J(),f=O0(Xe,Ce.interactiveDebounce)),ue.triggerTarget&&!Ce.triggerTarget?In(ue.triggerTarget).forEach(function(Me){Me.removeAttribute("aria-expanded")}):Ce.triggerTarget&&r.removeAttribute("aria-expanded"),F(),V(),_&&_(ue,Ce),C.popperInstance&&(m(),G().forEach(function(Me){requestAnimationFrame(Me._tippy.popperInstance.forceUpdate)})),k("onAfterUpdate",[C,j])}}function Le(j){C.setProps({content:j})}function Pe(){var j=C.state.isVisible,ue=C.state.isDestroyed,Ce=!C.state.isEnabled,Me=Dr.isTouch&&!C.props.touch,Ne=AA(C.props.duration,0,fr.duration);if(!(j||ue||Ce||Me)&&!ee().hasAttribute("disabled")&&(k("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,K()&&(Q.style.visibility="visible"),V(),fe(),C.state.isMounted||(Q.style.transition="none"),K()){var Oe=L(),We=Oe.box,Ct=Oe.content;hA([We,Ct],0)}h=function(){var yt;if(!(!C.state.isVisible||l)){if(l=!0,Q.offsetHeight,Q.style.transition=C.props.moveTransition,K()&&C.props.animation){var gr=L(),jt=gr.box,Bt=gr.content;hA([jt,Bt],Ne),H0([jt,Bt],"visible")}R(),F(),U0(pA,C),(yt=C.popperInstance)==null||yt.forceUpdate(),k("onMount",[C]),C.props.animation&&K()&&be(Ne,function(){C.state.isShown=!0,k("onShown",[C])})}},N()}}function tt(){var j=!C.state.isVisible,ue=C.state.isDestroyed,Ce=!C.state.isEnabled,Me=AA(C.props.duration,1,fr.duration);if(!(j||ue||Ce)&&(k("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,K()&&(Q.style.visibility="hidden"),J(),me(),V(!0),K()){var Ne=L(),Oe=Ne.box,We=Ne.content;C.props.animation&&(hA([Oe,We],Me),H0([Oe,We],"hidden"))}R(),F(),C.props.animation?K()&&De(Me,C.unmount):C.unmount()}}function ot(j){Z().addEventListener("mousemove",f),U0(Ca,f),f(j)}function vt(){C.state.isVisible&&C.hide(),C.state.isMounted&&(w(),G().forEach(function(j){j._tippy.unmount()}),Q.parentNode&&Q.parentNode.removeChild(Q),pA=pA.filter(function(j){return j!==C}),C.state.isMounted=!1,k("onHidden",[C]))}function rt(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),He(),delete r._tippy,C.state.isDestroyed=!0,k("onDestroy",[C]))}}function Gi(r,e){e===void 0&&(e={});var t=fr.plugins.concat(e.plugins||[]);zx();var i=Object.assign({},e,{plugins:t}),n=Wx(r),s=n.reduce(function(o,a){var c=a&&lw(a,i);return c&&o.push(c),o},[]);return va(r)?s[0]:s}Gi.defaultProps=fr,Gi.setDefaultProps=nw,Gi.currentInput=Dr,Object.assign({},E0,{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)}}),Gi.setDefaultProps({render:q0});function $t(r,e){return`${r}-${e}`}function Lr(r){var e,t;const i=[];return(((e=r.renderer)==null?void 0:e.type)==="video"||((t=r.renderer)==null?void 0:t.type)==="audio")&&i.push({...r.config,...r.options}),i.push(...r.childNodes.flatMap(Lr).filter(Boolean)),i}function cw(r){return r instanceof Error||typeof r=="object"&&r!==null&&"message"in r&&typeof r.message=="string"&&r.message?r.message:r instanceof Event?`${r.type} event`:r==null?"":String(r)}class ya extends Error{constructor(e,t,i=!1){super(),this.fatal=!1,this.fatal=i,t instanceof Error&&(this.stack=t.stack),this.message=[e,cw(t)].filter(Boolean).join(" - ")}}function di(r,e,t){return Math.min(Math.max(e,r),t)}const Aw=5;function uw(r,e){return r.length!==e.length||r.some((t,i)=>t!==e[i])}class hw{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=_t(),this._controls=_t(),this._drawAbort=null,this.host=e}set activeScenes(e){uw(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,n;const s=di(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l,duration:u})=>s>=l&&s<l+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((i=this.host.composition)==null?void 0:i.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l})=>s>=l-Aw&&s<l)),[]))??[],this.loadScenes(),this.syncMediaState(),(n=this._controls.value)==null||n.setAttribute("currentTime",s.toString()),o&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:s})),this.draw(s)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return Dt(this._canvas)}controls(){return Dt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Lr(e.layout.node).forEach(({key:i})=>{var n,s,o;const{id:a,start:c,duration:l}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,A=$t(a,i);if(this.host.media[A]){const h=this.host.media[A],{speed:d,volume:f,hls:g,node:p,start:E,duration:y}=h,B=this.host.mediaState[A];p&&B&&(p.currentTime>=E+y||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,E):B.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=di(0,this.host.volume*(f??1)*this.host.envelopeGain(a,c),1),p.playbackRate=di(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${c}-${l}`,d=this.host._sceneController.mediaState[h];this.host.duration&&!((o=d==null?void 0:d.buffered)!=null&&o.length)&&(this.host._sceneController.mediaState={...this.host._sceneController.mediaState,[h]:{...d,buffered:[{start:Math.max(0,c/this.host.duration*100),end:Math.min((c+l)/this.host.duration*100,100)}]}})}})})}syncMediaState(){var e;return Promise.all(((e=this.host.composition)==null?void 0:e.tracks.flatMap(t=>t.scenes.flatMap(i=>Lr(i.layout.node).map(async({key:s})=>{const o=$t(i.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:c}=a,l=this.host.mediaState[o];if(!this.activeScenes.includes(i))c.paused||c.pause();else if(l&&!this.host.waiting&&!this.host.loading&&!this.host.paused&&c.paused&&!c.ended&&l.initialised)try{await c.play()}catch(A){throw new ya("Video play error",A,!0)}}}))))??[])}draw(e=this.currentTime,t){var i;(i=this._drawAbort)==null||i.abort(),this._drawAbort=new AbortController,this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,canvas:this._canvas.value,overrides:t,signal:this._drawAbort.signal})}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)}}const dw=Ar(async r=>{const e=await fetch(r,{cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch font (${e.status}): ${r}`);return e.arrayBuffer()}),X0=Ar(async(r,e,t)=>new FontFace(r,await dw(t),{weight:e,style:"normal"}).load(),{cacheKey:([r,e,t])=>`${r}|${e}|${t}`}),fw=Ar(async function(e){const{weight:t,family:i}=e,{client:n,server:s}=i.weights.find(a=>a.weight===t)??{},o=n??s;return o?X0(i.name,t,o):null},{cacheKey:([r])=>{const{client:e,server:t}=r.family.weights.find(i=>i.weight===r.weight)??{};return`${r.family.name}|${r.weight}|${e??t??""}`}});Ar(async function(e){return(await Promise.all(e.weights.map(async({weight:i,client:n,server:s})=>{const o=n??s;if(!o)return null;const a=Array.from(document.fonts).find(l=>l.family===e.name&&l.weight===i);if(a)return a;const c=await X0(e.name,i,o);return document.fonts.add(c),c}))).filter(i=>i!==null)},{cacheKey:([r])=>JSON.stringify(r)});function gw(r){return r.startsWith("data:")?r.split(",")[0]:r.split(/[?#]/)[0]}function z0(r,e,t){return new Promise((i,n)=>{const s=new Image;s.crossOrigin=e,s.onload=()=>i(s),s.onerror=()=>n(new Error(t)),s.src=r})}async function pw(r,e){const t=await fetch(r,{mode:"cors",cache:"no-store"}).catch(i=>{throw new Error(`Failed to fetch image (${String(i)}): ${e}`)});if(!t.ok)throw new Error(`Failed to fetch image (${t.status}): ${e}`);return t.blob().catch(i=>{throw new Error(`Failed to read image (${String(i)}): ${e}`)})}async function mw(r,e){const t=URL.createObjectURL(await pw(r,e));try{const i=e.endsWith(".svg")?`${t}#${e}`:t;return await z0(i,null,`Failed to decode image: ${e}`)}finally{URL.revokeObjectURL(t)}}const Ew=Ar(async r=>{const e=gw(r);try{return await mw(r,e)}catch(t){return z0(r,"anonymous",`Failed to load image: ${e}`).catch(()=>{throw t})}}),Iw=Ar(async({options:r})=>{const e=await fw(r.font);return e&&document.fonts.add(e),{font:r.font}}),vw=Ar(async({config:r})=>r.src?{image:await Ew(r.src)}:{image:null},{cacheKey:([{config:r}])=>JSON.stringify(r)});async function mA(r){return r.duration===1/0?new Promise(e=>{r.currentTime=Number.MAX_SAFE_INTEGER,r.ontimeupdate=()=>{r.ontimeupdate=null,e(r.duration),r.currentTime=0}}):r.duration}function Z0(r,e){if(r.type==="video"&&r.alpha)return(e?r.alpha.mov:r.alpha.webm)||void 0}function Cw(r,e){return Z0(r,e)??r.src}function EA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function yw(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Bw({config:r,elementSize:e}){return new Promise(async t=>{let i=null;const{type:n,key:s,duration:o}=r,a=Cw(r,EA());n==="video"?(i=document.createElement("video"),i.playsInline=!0,e&&(i.width=e.width,i.height=e.height)):i=document.createElement("audio"),i.muted=!0,i.loop=!1,i.crossOrigin="anonymous",i.src=a;let c=!1;if(i.startLoadOnce=()=>{c||(i.preload="auto",i.load(),c=!0)},n==="video"&&o&&r.aspectRatio)i.preload="none",t({key:s,hls:null,node:i,aspectRatio:r.aspectRatio,totalDuration:o});else{i.preload="metadata";const l=async()=>{const u=await mA(i),A=i instanceof HTMLVideoElement&&i.videoHeight>0?i.videoWidth/i.videoHeight:null;t({key:s,hls:null,node:i,totalDuration:u,aspectRatio:A}),i.removeEventListener("loadedmetadata",l)};i.addEventListener("loadedmetadata",l)}})}function Tw({key:r,playlist:e,duration:t,elementSize:i}){return new Promise(n=>{const s=document.createElement("video");s instanceof HTMLVideoElement&&(i&&(s.width=i.width,s.height=i.height),s.playsInline=!0),s.muted=!0,s.loop=!1,s.crossOrigin="anonymous";let o=!1,a=!1,c=!1;const l=new ir({autoStartLoad:!0,capLevelToPlayerSize:!1,xhrSetup:u=>{const{open:A}=u,h=e.split("?")[1];u.open=function(d,f,g){if(h&&!f.toString().includes("?")&&(f+="?"+h),!o&&f.toString().includes(".ts")){if(a)return;a=!0}A.apply(this,[d,f,g])}}});l.on(ir.Events.BUFFER_CODECS,async(u,A)=>{var h,d;if(c)return;const f=A.video,g=(h=f==null?void 0:f.metadata)==null?void 0:h.width,p=(d=f==null?void 0:f.metadata)==null?void 0:d.height;if(g&&p){c=!0,o||l==null||l.stopLoad();const E=t??await mA(s);n({key:r,hls:l,node:s,aspectRatio:g/p,totalDuration:E})}}),l.on(ir.Events.LEVEL_LOADED,async()=>{setTimeout(async()=>{if(c)return;c=!0,o||l==null||l.stopLoad();const u=t??await mA(s),A=l.levels[l.levels.length-1];n({key:r,hls:l,node:s,aspectRatio:A.width/A.height,totalDuration:u})},2e3)}),i&&l.on(ir.Events.MANIFEST_PARSED,()=>{const u=window.devicePixelRatio||1,A=Math.min(i.width,i.height)*u;let h=0;for(let d=l.levels.length-1;d>=0;d--)if(Math.min(l.levels[d].width,l.levels[d].height)<=A){h=d;break}l.autoLevelCapping=h}),l.loadSource(e),l.attachMedia(s),l.startLoadOnce=(u=-1,A)=>{if(l&&!o){const h=l.levels.findIndex(d=>Math.min(d.height,d.width)===A);o=!0,l.startLoad(u),h!==-1&&(l.currentLevel=h)}}})}function bw({config:r,elementSize:e}){const{playlist:t}=r;return!Z0(r,EA())&&t&&!EA()&&ir.isSupported()?Tw({key:r.key,playlist:t,duration:r.duration??0,elementSize:e}):Bw({config:r,elementSize:e})}let Sw=class{constructor(e){this._hasPlayed=!1,this._duration=0,this._composition=null,this._media={},this._mediaState={},this._compositionController=new AbortController,this._delayProcessing=(t=100)=>{const i=new AbortController,n=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(n)}),i},this._mediaFactory=Ar(async(t,i)=>{var n,s,o,a;const{key:c}=i,l=((s=(n=this.host.shadowRoot)==null?void 0:n.host)==null?void 0:s.clientWidth)??0,u=((a=(o=this.host.shadowRoot)==null?void 0:o.host)==null?void 0:a.clientHeight)??0,A=await bw({config:i,elementSize:{width:l,height:u}}),h={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},d=Object.keys(h).reduce((f,g)=>{const p=g,E=h[p]({id:t,key:c,node:A.node});return f[p]=E,A.node.addEventListener(g,E),f},{});return{media:A,listeners:d,aspectRatio:A.aspectRatio,source:()=>A.node}},{cacheKey:([t,{key:i,src:n,playlist:s,...o}])=>{const a="alpha"in o&&o.alpha?{webm:o.alpha.webm.split("?")[0],mov:o.alpha.mov.split("?")[0]}:void 0;return JSON.stringify({id:t,key:i,src:n==null?void 0:n.split("?")[0],playlist:s==null?void 0:s.split("?")[0],alpha:a})}}),this._handleLoadedData=({id:t,key:i,node:n})=>()=>{const s=$t(t,i),o=this.mediaState[s];o!=null&&o.initialised||(this.mediaState={...this.mediaState,[s]:{...o,initialised:!0,waiting:!1,buffered:(o==null?void 0:o.buffered)??[]}},this.setMediaCurrentTime(this.host.currentTime),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:n}})))},this._handleWaiting=({id:t,key:i,node:n})=>()=>{const s=$t(t,i),o=this.mediaState[s];o!=null&&o.initialised&&!(o!=null&&o.waiting)&&(this.mediaState={...this.mediaState,[s]:{...o,waiting:!0}},this.host.dispatchEvent(new CustomEvent("video:waiting",{detail:{id:t,key:i,node:n}})))},this._handleCanPlay=({id:t,key:i})=>()=>{const n=$t(t,i),s=this.mediaState[n];s!=null&&s.initialised&&(s!=null&&s.waiting)&&(this.mediaState={...this.mediaState,[n]:{...s,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=()=>()=>{},this._handleSeeking=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:n}}))},this._handleSeeked=({id:t,key:i,node:n})=>()=>{const s=$t(t,i),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Lr(a.layout.node).map(({id:l})=>l)).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:n}})))},this._handlePlay=({id:t,key:i,node:n})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:n}}))},this._handlePlaying=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:n}}))},this._handlePause=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:n}}))},this._handleStalled=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:n}}))},this._handleTimeUpdate=({id:t,key:i,node:n})=>()=>{const s=this.media[$t(t,i)];s!=null&&s.loop&&s.duration>0&&n.currentTime>=s.start+s.duration&&(n.currentTime=s.start,n.paused||n.play()),this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:n}}))},this._handleEnded=({id:t,key:i,node:n})=>()=>{const s=this.media[$t(t,i)];if(s!=null&&s.loop){n.currentTime=s.start,this.host.paused||n.play();return}this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:n}}))},this._handleError=({id:t,key:i,node:n})=>()=>{const s=new ya(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:s,message:s.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:n}}))},this._cleanupMedia=t=>{var i;const n=this.media[t];n&&(n.node.pause(),n.node.src="",(i=n.hls)==null||i.destroy(),Object.keys(n.listeners??{}).forEach(s=>{var o,a;if((o=this.media)!=null&&o[t]){const c=(a=n.listeners)==null?void 0:a[s];c&&n.node.removeEventListener(s,c)}}),delete this._media[t],delete this._mediaState[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 composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set media(e){e!==this._media&&(this._media=e,this.host.requestUpdate())}get media(){return this._media}set mediaState(e){e!==this._mediaState&&(this._mediaState=e,this.host.requestUpdate())}get mediaState(){return this._mediaState}_setupTask(){new Xs(this.host,async([e,t,i,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,c=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:l})=>t===l))&&(this.host._language=(s=this.host._languages[0])==null?void 0:s.value),e){const{width:l,height:u}=kl({aspectRatio:i,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await bd({debug:n,config:e,resolvers:{text:Iw,image:vw,video:async({id:g,config:p,options:E})=>{const{media:y,source:B}=await this._mediaFactory(g,{...p,...E});return{video:B,aspectRatio:y.aspectRatio}}},rootWidth:l,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new ya("Fatal composition error",f,!0)}this.duration=Number.isFinite(this.composition.duration)?this.composition.duration:0;const A={...this.media},h={...this.mediaState},d=[];for(const f of this.composition.tracks)for(const g of f.scenes){const p=Lr(g.layout.node);for(const E of p){const{media:y,listeners:B}=await this._mediaFactory(g.id,E),C=$t(g.id,y.key);d.push(C);const x=(E.startOffset??0)*y.totalDuration,Q=(1-(E.endOffset??0))*y.totalDuration;A[C]={...y,listeners:B,start:x,duration:Q-x,speed:E.speed??1,volume:E.volume??1,loop:E.loop??!1},h[C]={initialised:!y,waiting:!!y,...this.mediaState[C]}}}this.media=A,this.mediaState=h,Object.keys(this.media).forEach(f=>{d.includes(f)||this.media[f].node.pause()}),this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused?this.host.reset(this.host.currentTime,!this.host.paused):this.setMediaCurrentTime(this.host.currentTime)}this.host.dispatchEvent(new CustomEvent("compositionupdate",{detail:this.composition,bubbles:!0,composed:!0}))}catch(l){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}finally{c.abort(),this.host._processing=!1}},()=>[this.host.config,this.host.language,this.host.aspectRatio,this.host.debug])}_setMediaCurrentTime({time:e,scene:t}){const{id:i,layout:n,start:s}=t;Lr(n.node).forEach(({key:a})=>{const c=$t(i,a);if(this.media[c]){const l=this.media[c],u=(e-s)*l.speed,A=l.loop&&l.duration>0?u%l.duration:u;l.node.currentTime=di(l.start,A+l.start,l.start+l.duration)}})}setMediaCurrentTime(e){var t;(t=this.composition)==null||t.tracks.forEach(i=>{i.scenes.forEach(n=>{this._setMediaCurrentTime({time:e,scene:n})})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.media).forEach(e=>{this._cleanupMedia(e)}),this.media={}}};function xw(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function ww(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const IA=["progress","play-large","navigation","play","volume","current-time","duration","levels","speed","captions","fullscreen","preview"],Qw={id:"captions",event:"captions:click",label:"Closed Captions"},Rw={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},ep={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}]},_w={id:"playbackRate",label:"Playback playbackRate",subItems:ep};class Dw extends su{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==zi.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)),cr}}const vA=Zi(Dw),Lw=LS(()=>{const r=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","url(https://vouch-clients.s3.ap-southeast-2.amazonaws.com/vouch/fonts/Roobert-Bold.woff2",{style:"normal",weight:"700"}),i=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),n=Ad.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:r},{load:!0,font:e},{load:!0,font:t},{load:!0,font:i},...n]}),kr={"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"},kw={colors:kr,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 ${kr["dark-100"]}`,medium:`0 .125rem .625rem ${kr["dark-100"]}`,large:`0 .25rem 1rem ${kr["dark-50"]}`,xl:`.25rem .25rem 1rem ${kr["dark-250"]}`,xxl:`0 .25rem 2rem ${kr["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${kr["dark-250"]}`,toolbar:`0 -.625rem .625rem ${kr["dark-50"]}`,text:`0 0 .25rem ${kr["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:kr["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},tp=RS(kw,{delimiter:"-"}),Mw=Object.keys(tp).map(r=>kn(`:host { --${r}: ${tp[r]}; }`)),et=(r=>{const e=class extends r{firstUpdated(){Lw().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Mw,xt`
2514
+ */const d0=(r,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},f0=Zi(class extends $n{constructor(r){if(super(r),r.type!==zi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);const n=[],s=[];let o=0;for(const a of r)n[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:n}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,i]){const n=Np(r),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(n))return this.ut=o,s;const a=this.ut??(this.ut=[]),c=[];let l,u,A=0,h=n.length-1,d=0,f=s.length-1;for(;A<=h&&d<=f;)if(n[A]===null)A++;else if(n[h]===null)h--;else if(a[A]===o[d])c[d]=wi(n[A],s[d]),A++,d++;else if(a[h]===o[f])c[f]=wi(n[h],s[f]),h--,f--;else if(a[A]===o[f])c[f]=wi(n[A],s[f]),Hn(r,c[f+1],n[A]),A++,f--;else if(a[h]===o[d])c[d]=wi(n[h],s[d]),Hn(r,n[A],n[h]),h--,d++;else if(l===void 0&&(l=d0(o,d,f),u=d0(a,A,h)),l.has(a[A]))if(l.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const E=Hn(r,n[A]);wi(E,s[d]),c[d]=E}else c[d]=wi(p,s[d]),Hn(r,n[A],p),n[g]=null;d++}else Ha(n[h]),h--;else Ha(n[A]),A++;for(;d<=f;){const g=Hn(r,c[f+1]);wi(g,s[d]),c[d++]=g}for(;A<=h;){const g=n[A++];g!==null&&Ha(g)}return this.ut=o,Pp(r,c),cr}});var Gt="top",nr="bottom",sr="right",Ht="left",tA="auto",vs=[Gt,nr,sr,Ht],gn="start",Cs="end",kS="clippingParents",g0="viewport",ys="popper",MS="reference",p0=vs.reduce(function(r,e){return r.concat([e+"-"+gn,e+"-"+Cs])},[]),m0=[].concat(vs,[tA]).reduce(function(r,e){return r.concat([e,e+"-"+gn,e+"-"+Cs])},[]),FS="beforeRead",PS="read",NS="afterRead",OS="beforeMain",US="main",GS="afterMain",HS="beforeWrite",$S="write",YS="afterWrite",VS=[FS,PS,NS,OS,US,GS,HS,$S,YS];function Rr(r){return r?(r.nodeName||"").toLowerCase():null}function Jt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Ni(r){var e=Jt(r).Element;return r instanceof e||r instanceof Element}function or(r){var e=Jt(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function rA(r){if(typeof ShadowRoot>"u")return!1;var e=Jt(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function KS(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!or(s)||!Rr(s)||(Object.assign(s.style,i),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function WS(r){var e=r.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 n=e.elements[i],s=e.attributes[i]||{},o=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=o.reduce(function(c,l){return c[l]="",c},{});!or(n)||!Rr(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(c){n.removeAttribute(c)}))})}}const E0={name:"applyStyles",enabled:!0,phase:"write",fn:KS,effect:WS,requires:["computeStyles"]};function _r(r){return r.split("-")[0]}var Oi=Math.max,ga=Math.min,pn=Math.round;function iA(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function I0(){return!/^((?!chrome|android).)*safari/i.test(iA())}function mn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=r.getBoundingClientRect(),n=1,s=1;e&&or(r)&&(n=r.offsetWidth>0&&pn(i.width)/r.offsetWidth||1,s=r.offsetHeight>0&&pn(i.height)/r.offsetHeight||1);var o=Ni(r)?Jt(r):window,a=o.visualViewport,c=!I0()&&t,l=(i.left+(c&&a?a.offsetLeft:0))/n,u=(i.top+(c&&a?a.offsetTop:0))/s,A=i.width/n,h=i.height/s;return{width:A,height:h,top:u,right:l+A,bottom:u+h,left:l,x:l,y:u}}function nA(r){var e=mn(r),t=r.offsetWidth,i=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:i}}function v0(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&rA(t)){var i=e;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Wr(r){return Jt(r).getComputedStyle(r)}function JS(r){return["table","td","th"].indexOf(Rr(r))>=0}function hi(r){return((Ni(r)?r.ownerDocument:r.document)||window.document).documentElement}function pa(r){return Rr(r)==="html"?r:r.assignedSlot||r.parentNode||(rA(r)?r.host:null)||hi(r)}function C0(r){return!or(r)||Wr(r).position==="fixed"?null:r.offsetParent}function jS(r){var e=/firefox/i.test(iA()),t=/Trident/i.test(iA());if(t&&or(r)){var i=Wr(r);if(i.position==="fixed")return null}var n=pa(r);for(rA(n)&&(n=n.host);or(n)&&["html","body"].indexOf(Rr(n))<0;){var s=Wr(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Bs(r){for(var e=Jt(r),t=C0(r);t&&JS(t)&&Wr(t).position==="static";)t=C0(t);return t&&(Rr(t)==="html"||Rr(t)==="body"&&Wr(t).position==="static")?e:t||jS(r)||e}function sA(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function Ts(r,e,t){return Oi(r,ga(e,t))}function qS(r,e,t){var i=Ts(r,e,t);return i>t?t:i}function y0(){return{top:0,right:0,bottom:0,left:0}}function B0(r){return Object.assign({},y0(),r)}function T0(r,e){return e.reduce(function(t,i){return t[i]=r,t},{})}var XS=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,B0(typeof e!="number"?e:T0(e,vs))};function zS(r){var e,t=r.state,i=r.name,n=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=_r(t.placement),c=sA(a),l=[Ht,sr].indexOf(a)>=0,u=l?"height":"width";if(!(!s||!o)){var A=XS(n.padding,t),h=nA(s),d=c==="y"?Gt:Ht,f=c==="y"?nr:sr,g=t.rects.reference[u]+t.rects.reference[c]-o[c]-t.rects.popper[u],p=o[c]-t.rects.reference[c],E=Bs(s),y=E?c==="y"?E.clientHeight||0:E.clientWidth||0:0,B=g/2-p/2,C=A[d],x=y-h[u]-A[f],Q=y/2-h[u]/2+B,_=Ts(C,Q,x),M=c;t.modifiersData[i]=(e={},e[M]=_,e.centerOffset=_-Q,e)}}function ZS(r){var e=r.state,t=r.options,i=t.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||v0(e.elements.popper,n)&&(e.elements.arrow=n))}const ex={name:"arrow",enabled:!0,phase:"main",fn:zS,effect:ZS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function En(r){return r.split("-")[1]}var tx={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rx(r,e){var t=r.x,i=r.y,n=e.devicePixelRatio||1;return{x:pn(t*n)/n||0,y:pn(i*n)/n||0}}function b0(r){var e,t=r.popper,i=r.popperRect,n=r.placement,s=r.variation,o=r.offsets,a=r.position,c=r.gpuAcceleration,l=r.adaptive,u=r.roundOffsets,A=r.isFixed,h=o.x,d=h===void 0?0:h,f=o.y,g=f===void 0?0:f,p=typeof u=="function"?u({x:d,y:g}):{x:d,y:g};d=p.x,g=p.y;var E=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),B=Ht,C=Gt,x=window;if(l){var Q=Bs(t),_="clientHeight",M="clientWidth";if(Q===Jt(t)&&(Q=hi(t),Wr(Q).position!=="static"&&a==="absolute"&&(_="scrollHeight",M="scrollWidth")),Q=Q,n===Gt||(n===Ht||n===sr)&&s===Cs){C=nr;var P=A&&Q===x&&x.visualViewport?x.visualViewport.height:Q[_];g-=P-i.height,g*=c?1:-1}if(n===Ht||(n===Gt||n===nr)&&s===Cs){B=sr;var D=A&&Q===x&&x.visualViewport?x.visualViewport.width:Q[M];d-=D-i.width,d*=c?1:-1}}var $=Object.assign({position:a},l&&tx),K=u===!0?rx({x:d,y:g},Jt(t)):{x:d,y:g};if(d=K.x,g=K.y,c){var ee;return Object.assign({},$,(ee={},ee[C]=y?"0":"",ee[B]=E?"0":"",ee.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",ee))}return Object.assign({},$,(e={},e[C]=y?g+"px":"",e[B]=E?d+"px":"",e.transform="",e))}function ix(r){var e=r.state,t=r.options,i=t.gpuAcceleration,n=i===void 0?!0:i,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,c=a===void 0?!0:a,l={placement:_r(e.placement),variation:En(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,b0(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,b0(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const nx={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ix,data:{}};var ma={passive:!0};function sx(r){var e=r.state,t=r.instance,i=r.options,n=i.scroll,s=n===void 0?!0:n,o=i.resize,a=o===void 0?!0:o,c=Jt(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(u){u.addEventListener("scroll",t.update,ma)}),a&&c.addEventListener("resize",t.update,ma),function(){s&&l.forEach(function(u){u.removeEventListener("scroll",t.update,ma)}),a&&c.removeEventListener("resize",t.update,ma)}}const ox={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sx,data:{}};var ax={left:"right",right:"left",bottom:"top",top:"bottom"};function Ea(r){return r.replace(/left|right|bottom|top/g,function(e){return ax[e]})}var lx={start:"end",end:"start"};function S0(r){return r.replace(/start|end/g,function(e){return lx[e]})}function oA(r){var e=Jt(r),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function aA(r){return mn(hi(r)).left+oA(r).scrollLeft}function cx(r,e){var t=Jt(r),i=hi(r),n=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,c=0;if(n){s=n.width,o=n.height;var l=I0();(l||!l&&e==="fixed")&&(a=n.offsetLeft,c=n.offsetTop)}return{width:s,height:o,x:a+aA(r),y:c}}function Ax(r){var e,t=hi(r),i=oA(r),n=(e=r.ownerDocument)==null?void 0:e.body,s=Oi(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Oi(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+aA(r),c=-i.scrollTop;return Wr(n||t).direction==="rtl"&&(a+=Oi(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:c}}function lA(r){var e=Wr(r),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function x0(r){return["html","body","#document"].indexOf(Rr(r))>=0?r.ownerDocument.body:or(r)&&lA(r)?r:x0(pa(r))}function bs(r,e){var t;e===void 0&&(e=[]);var i=x0(r),n=i===((t=r.ownerDocument)==null?void 0:t.body),s=Jt(i),o=n?[s].concat(s.visualViewport||[],lA(i)?i:[]):i,a=e.concat(o);return n?a:a.concat(bs(pa(o)))}function cA(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function ux(r,e){var t=mn(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function w0(r,e,t){return e===g0?cA(cx(r,t)):Ni(e)?ux(e,t):cA(Ax(hi(r)))}function hx(r){var e=bs(pa(r)),t=["absolute","fixed"].indexOf(Wr(r).position)>=0,i=t&&or(r)?Bs(r):r;return Ni(i)?e.filter(function(n){return Ni(n)&&v0(n,i)&&Rr(n)!=="body"}):[]}function dx(r,e,t,i){var n=e==="clippingParents"?hx(r):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(c,l){var u=w0(r,l,i);return c.top=Oi(u.top,c.top),c.right=ga(u.right,c.right),c.bottom=ga(u.bottom,c.bottom),c.left=Oi(u.left,c.left),c},w0(r,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 Q0(r){var e=r.reference,t=r.element,i=r.placement,n=i?_r(i):null,s=i?En(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(n){case Gt:c={x:o,y:e.y-t.height};break;case nr:c={x:o,y:e.y+e.height};break;case sr:c={x:e.x+e.width,y:a};break;case Ht:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var l=n?sA(n):null;if(l!=null){var u=l==="y"?"height":"width";switch(s){case gn:c[l]=c[l]-(e[u]/2-t[u]/2);break;case Cs:c[l]=c[l]+(e[u]/2-t[u]/2);break}}return c}function Ss(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=i===void 0?r.placement:i,s=t.strategy,o=s===void 0?r.strategy:s,a=t.boundary,c=a===void 0?kS:a,l=t.rootBoundary,u=l===void 0?g0:l,A=t.elementContext,h=A===void 0?ys:A,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,E=B0(typeof p!="number"?p:T0(p,vs)),y=h===ys?MS:ys,B=r.rects.popper,C=r.elements[f?y:h],x=dx(Ni(C)?C:C.contextElement||hi(r.elements.popper),c,u,o),Q=mn(r.elements.reference),_=Q0({reference:Q,element:B,strategy:"absolute",placement:n}),M=cA(Object.assign({},B,_)),P=h===ys?M:Q,D={top:x.top-P.top+E.top,bottom:P.bottom-x.bottom+E.bottom,left:x.left-P.left+E.left,right:P.right-x.right+E.right},$=r.modifiersData.offset;if(h===ys&&$){var K=$[n];Object.keys(D).forEach(function(ee){var Z=[sr,nr].indexOf(ee)>=0?1:-1,L=[Gt,nr].indexOf(ee)>=0?"y":"x";D[ee]+=K[L]*Z})}return D}function fx(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,l=c===void 0?m0:c,u=En(i),A=u?a?p0:p0.filter(function(f){return En(f)===u}):vs,h=A.filter(function(f){return l.indexOf(f)>=0});h.length===0&&(h=A);var d=h.reduce(function(f,g){return f[g]=Ss(r,{placement:g,boundary:n,rootBoundary:s,padding:o})[_r(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function gx(r){if(_r(r)===tA)return[];var e=Ea(r);return[S0(r),e,S0(e)]}function px(r){var e=r.state,t=r.options,i=r.name;if(!e.modifiersData[i]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,c=t.fallbackPlacements,l=t.padding,u=t.boundary,A=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,f=d===void 0?!0:d,g=t.allowedAutoPlacements,p=e.options.placement,E=_r(p),y=E===p,B=c||(y||!f?[Ea(p)]:gx(p)),C=[p].concat(B).reduce(function(se,fe){return se.concat(_r(fe)===tA?fx(e,{placement:fe,boundary:u,rootBoundary:A,padding:l,flipVariations:f,allowedAutoPlacements:g}):fe)},[]),x=e.rects.reference,Q=e.rects.popper,_=new Map,M=!0,P=C[0],D=0;D<C.length;D++){var $=C[D],K=_r($),ee=En($)===gn,Z=[Gt,nr].indexOf(K)>=0,L=Z?"width":"height",U=Ss(e,{placement:$,boundary:u,rootBoundary:A,altBoundary:h,padding:l}),V=Z?ee?sr:Ht:ee?nr:Gt;x[L]>Q[L]&&(V=Ea(V));var k=Ea(V),R=[];if(s&&R.push(U[K]<=0),a&&R.push(U[V]<=0,U[k]<=0),R.every(function(se){return se})){P=$,M=!1;break}_.set($,R)}if(M)for(var F=f?3:1,J=function(fe){var me=C.find(function(De){var be=_.get(De);if(be)return be.slice(0,fe).every(function(ke){return ke})});if(me)return P=me,"break"},Y=F;Y>0;Y--){var re=J(Y);if(re==="break")break}e.placement!==P&&(e.modifiersData[i]._skip=!0,e.placement=P,e.reset=!0)}}const mx={name:"flip",enabled:!0,phase:"main",fn:px,requiresIfExists:["offset"],data:{_skip:!1}};function R0(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function _0(r){return[Gt,sr,nr,Ht].some(function(e){return r[e]>=0})}function Ex(r){var e=r.state,t=r.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Ss(e,{elementContext:"reference"}),a=Ss(e,{altBoundary:!0}),c=R0(o,i),l=R0(a,n,s),u=_0(c),A=_0(l);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":A})}const Ix={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ex};function vx(r,e,t){var i=_r(r),n=[Ht,Gt].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Ht,sr].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Cx(r){var e=r.state,t=r.options,i=r.name,n=t.offset,s=n===void 0?[0,0]:n,o=m0.reduce(function(u,A){return u[A]=vx(A,e.rects,s),u},{}),a=o[e.placement],c=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=l),e.modifiersData[i]=o}const yx={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Cx};function Bx(r){var e=r.state,t=r.name;e.modifiersData[t]=Q0({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Tx={name:"popperOffsets",enabled:!0,phase:"read",fn:Bx,data:{}};function bx(r){return r==="x"?"y":"x"}function Sx(r){var e=r.state,t=r.options,i=r.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,c=t.boundary,l=t.rootBoundary,u=t.altBoundary,A=t.padding,h=t.tether,d=h===void 0?!0:h,f=t.tetherOffset,g=f===void 0?0:f,p=Ss(e,{boundary:c,rootBoundary:l,padding:A,altBoundary:u}),E=_r(e.placement),y=En(e.placement),B=!y,C=sA(E),x=bx(C),Q=e.modifiersData.popperOffsets,_=e.rects.reference,M=e.rects.popper,P=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,D=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),$=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,K={x:0,y:0};if(Q){if(s){var ee,Z=C==="y"?Gt:Ht,L=C==="y"?nr:sr,U=C==="y"?"height":"width",V=Q[C],k=V+p[Z],R=V-p[L],F=d?-M[U]/2:0,J=y===gn?_[U]:M[U],Y=y===gn?-M[U]:-_[U],re=e.elements.arrow,se=d&&re?nA(re):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:y0(),me=fe[Z],De=fe[L],be=Ts(0,_[U],se[U]),ke=B?_[U]/2-F-be-me-D.mainAxis:J-be-me-D.mainAxis,pe=B?-_[U]/2+F+be+De+D.mainAxis:Y+be+De+D.mainAxis,xe=e.elements.arrow&&Bs(e.elements.arrow),He=xe?C==="y"?xe.clientTop||0:xe.clientLeft||0:0,Re=(ee=$==null?void 0:$[C])!=null?ee:0,Xe=V+ke-Re-He,we=V+pe-Re,S=Ts(d?ga(k,Xe):k,V,d?Oi(R,we):R);Q[C]=S,K[C]=S-V}if(a){var I,m=C==="x"?Gt:Ht,w=C==="x"?nr:sr,N=Q[x],G=x==="y"?"height":"width",z=N+p[m],oe=N-p[w],ce=[Gt,Ht].indexOf(E)!==-1,he=(I=$==null?void 0:$[x])!=null?I:0,ve=ce?z:N-_[G]-M[G]-he+D.altAxis,Be=ce?N+_[G]+M[G]-he-D.altAxis:oe,Le=d&&ce?qS(ve,N,Be):Ts(d?ve:z,N,d?Be:oe);Q[x]=Le,K[x]=Le-N}e.modifiersData[i]=K}}const xx={name:"preventOverflow",enabled:!0,phase:"main",fn:Sx,requiresIfExists:["offset"]};function wx(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Qx(r){return r===Jt(r)||!or(r)?oA(r):wx(r)}function Rx(r){var e=r.getBoundingClientRect(),t=pn(e.width)/r.offsetWidth||1,i=pn(e.height)/r.offsetHeight||1;return t!==1||i!==1}function _x(r,e,t){t===void 0&&(t=!1);var i=or(e),n=or(e)&&Rx(e),s=hi(e),o=mn(r,n,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!t)&&((Rr(e)!=="body"||lA(s))&&(a=Qx(e)),or(e)?(c=mn(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=aA(s))),{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function Dx(r){var e=new Map,t=new Set,i=[];r.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&n(c)}}),i.push(s)}return r.forEach(function(s){t.has(s.name)||n(s)}),i}function Lx(r){var e=Dx(r);return VS.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function kx(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function Mx(r){var e=r.reduce(function(t,i){var n=t[i.name];return t[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var D0={placement:"bottom",modifiers:[],strategy:"absolute"};function L0(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Fx(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?D0:n;return function(a,c,l){l===void 0&&(l=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},D0,s),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},A=[],h=!1,d={state:u,setOptions:function(E){var y=typeof E=="function"?E(u.options):E;g(),u.options=Object.assign({},s,u.options,y),u.scrollParents={reference:Ni(a)?bs(a):a.contextElement?bs(a.contextElement):[],popper:bs(c)};var B=Lx(Mx([].concat(i,u.options.modifiers)));return u.orderedModifiers=B.filter(function(C){return C.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var E=u.elements,y=E.reference,B=E.popper;if(L0(y,B)){u.rects={reference:_x(y,Bs(B),u.options.strategy==="fixed"),popper:nA(B)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(D){return u.modifiersData[D.name]=Object.assign({},D.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],Q=x.fn,_=x.options,M=_===void 0?{}:_,P=x.name;typeof Q=="function"&&(u=Q({state:u,options:M,name:P,instance:d})||u)}}}},update:kx(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!L0(a,c))return d;d.setOptions(l).then(function(p){!h&&l.onFirstUpdate&&l.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var E=p.name,y=p.options,B=y===void 0?{}:y,C=p.effect;if(typeof C=="function"){var x=C({state:u,name:E,instance:d,options:B}),Q=function(){};A.push(x||Q)}})}function g(){A.forEach(function(p){return p()}),A=[]}return d}}var Px=[ox,Tx,nx,E0,yx,mx,xx,ex,Ix],Nx=Fx({defaultModifiers:Px}),Ox="tippy-box",k0="tippy-content",Ux="tippy-backdrop",M0="tippy-arrow",F0="tippy-svg-arrow",Ui={passive:!0,capture:!0},P0=function(){return document.body};function AA(r,e,t){if(Array.isArray(r)){var i=r[e];return i??(Array.isArray(t)?t[e]:t)}return r}function uA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function N0(r,e){return typeof r=="function"?r.apply(void 0,e):r}function O0(r,e){if(e===0)return r;var t;return function(i){clearTimeout(t),t=setTimeout(function(){r(i)},e)}}function Gx(r){return r.split(/\s+/).filter(Boolean)}function In(r){return[].concat(r)}function U0(r,e){r.indexOf(e)===-1&&r.push(e)}function Hx(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function $x(r){return r.split("-")[0]}function Ia(r){return[].slice.call(r)}function G0(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function xs(){return document.createElement("div")}function va(r){return["Element","Fragment"].some(function(e){return uA(r,e)})}function Yx(r){return uA(r,"NodeList")}function Vx(r){return uA(r,"MouseEvent")}function Kx(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function Wx(r){return va(r)?[r]:Yx(r)?Ia(r):Array.isArray(r)?r:Ia(document.querySelectorAll(r))}function hA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function H0(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function Jx(r){var e,t=In(r),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function jx(r,e){var t=e.clientX,i=e.clientY;return r.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,c=a.interactiveBorder,l=$x(o.placement),u=o.modifiersData.offset;if(!u)return!0;var A=l==="bottom"?u.top.y:0,h=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,f=l==="left"?u.right.x:0,g=s.top-i+A>c,p=i-s.bottom-h>c,E=s.left-t+d>c,y=t-s.right-f>c;return g||p||E||y})}function dA(r,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){r[i](n,t)})}function $0(r,e){for(var t=e;t;){var i;if(r.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var Dr={isTouch:!1},Y0=0;function qx(){Dr.isTouch||(Dr.isTouch=!0,window.performance&&document.addEventListener("mousemove",V0))}function V0(){var r=performance.now();r-Y0<20&&(Dr.isTouch=!1,document.removeEventListener("mousemove",V0)),Y0=r}function Xx(){var r=document.activeElement;if(Kx(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function zx(){document.addEventListener("touchstart",qx,Ui),window.addEventListener("blur",Xx)}var Zx=typeof window<"u"&&typeof document<"u",ew=Zx?!!window.msCrypto:!1,tw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},rw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fr=Object.assign({appendTo:P0,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},tw,rw),iw=Object.keys(fr),nw=function(e){var t=Object.keys(e);t.forEach(function(i){fr[i]=e[i]})};function K0(r){var e=r.plugins||[],t=e.reduce(function(i,n){var s=n.name,o=n.defaultValue;if(s){var a;i[s]=r[s]!==void 0?r[s]:(a=fr[s])!=null?a:o}return i},{});return Object.assign({},r,t)}function sw(r,e){var t=e?Object.keys(K0(Object.assign({},fr,{plugins:e}))):iw,i=t.reduce(function(n,s){var o=(r.getAttribute("data-tippy-"+s)||"").trim();if(!o)return n;if(s==="content")n[s]=o;else try{n[s]=JSON.parse(o)}catch{n[s]=o}return n},{});return i}function W0(r,e){var t=Object.assign({},e,{content:N0(e.content,[r])},e.ignoreAttributes?{}:sw(r,e.plugins));return t.aria=Object.assign({},fr.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 ow=function(){return"innerHTML"};function fA(r,e){r[ow()]=e}function J0(r){var e=xs();return r===!0?e.className=M0:(e.className=F0,va(r)?e.appendChild(r):fA(e,r)),e}function j0(r,e){va(e.content)?(fA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?fA(r,e.content):r.textContent=e.content)}function gA(r){var e=r.firstElementChild,t=Ia(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(k0)}),arrow:t.find(function(i){return i.classList.contains(M0)||i.classList.contains(F0)}),backdrop:t.find(function(i){return i.classList.contains(Ux)})}}function q0(r){var e=xs(),t=xs();t.className=Ox,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=xs();i.className=k0,i.setAttribute("data-state","hidden"),j0(i,r.props),e.appendChild(t),t.appendChild(i),n(r.props,r.props);function n(s,o){var a=gA(e),c=a.box,l=a.content,u=a.arrow;o.theme?c.setAttribute("data-theme",o.theme):c.removeAttribute("data-theme"),typeof o.animation=="string"?c.setAttribute("data-animation",o.animation):c.removeAttribute("data-animation"),o.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?c.setAttribute("role",o.role):c.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&j0(l,r.props),o.arrow?u?s.arrow!==o.arrow&&(c.removeChild(u),c.appendChild(J0(o.arrow))):c.appendChild(J0(o.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:n}}q0.$$tippy=!0;var aw=1,Ca=[],pA=[];function lw(r,e){var t=W0(r,Object.assign({},fr,K0(G0(e)))),i,n,s,o=!1,a=!1,c=!1,l=!1,u,A,h,d=[],f=O0(Xe,t.interactiveDebounce),g,p=aw++,E=null,y=Hx(t.plugins),B={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:p,reference:r,popper:xs(),popperInstance:E,props:t,state:B,plugins:y,clearDelayTimeouts:ve,setProps:Be,setContent:Le,show:Pe,hide:tt,hideWithInteractivity:ot,enable:ce,disable:he,unmount:vt,destroy:rt};if(!t.render)return C;var x=t.render(C),Q=x.popper,_=x.onUpdate;Q.setAttribute("data-tippy-root",""),Q.id="tippy-"+C.id,C.popper=Q,r._tippy=C,Q._tippy=C;var M=y.map(function(j){return j.fn(C)}),P=r.hasAttribute("aria-expanded");return xe(),F(),V(),k("onCreate",[C]),t.showOnCreate&&z(),Q.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),Q.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",f)}),C;function D(){var j=C.props.touch;return Array.isArray(j)?j:[j,0]}function $(){return D()[0]==="hold"}function K(){var j;return!!((j=C.props.render)!=null&&j.$$tippy)}function ee(){return g||r}function Z(){var j=ee().parentNode;return j?Jx(j):document}function L(){return gA(Q)}function U(j){return C.state.isMounted&&!C.state.isVisible||Dr.isTouch||u&&u.type==="focus"?0:AA(C.props.delay,j?0:1,fr.delay)}function V(j){j===void 0&&(j=!1),Q.style.pointerEvents=C.props.interactive&&!j?"":"none",Q.style.zIndex=""+C.props.zIndex}function k(j,ue,Ce){if(Ce===void 0&&(Ce=!0),M.forEach(function(Ne){Ne[j]&&Ne[j].apply(Ne,ue)}),Ce){var Me;(Me=C.props)[j].apply(Me,ue)}}function R(){var j=C.props.aria;if(j.content){var ue="aria-"+j.content,Ce=Q.id,Me=In(C.props.triggerTarget||r);Me.forEach(function(Ne){var Oe=Ne.getAttribute(ue);if(C.state.isVisible)Ne.setAttribute(ue,Oe?Oe+" "+Ce:Ce);else{var We=Oe&&Oe.replace(Ce,"").trim();We?Ne.setAttribute(ue,We):Ne.removeAttribute(ue)}})}}function F(){if(!(P||!C.props.aria.expanded)){var j=In(C.props.triggerTarget||r);j.forEach(function(ue){C.props.interactive?ue.setAttribute("aria-expanded",C.state.isVisible&&ue===ee()?"true":"false"):ue.removeAttribute("aria-expanded")})}}function J(){Z().removeEventListener("mousemove",f),Ca=Ca.filter(function(j){return j!==f})}function Y(j){if(!(Dr.isTouch&&(c||j.type==="mousedown"))){var ue=j.composedPath&&j.composedPath()[0]||j.target;if(!(C.props.interactive&&$0(Q,ue))){if(In(C.props.triggerTarget||r).some(function(Ce){return $0(Ce,ue)})){if(Dr.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else k("onClickOutside",[C,j]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||me())}}}function re(){c=!0}function se(){c=!1}function fe(){var j=Z();j.addEventListener("mousedown",Y,!0),j.addEventListener("touchend",Y,Ui),j.addEventListener("touchstart",se,Ui),j.addEventListener("touchmove",re,Ui)}function me(){var j=Z();j.removeEventListener("mousedown",Y,!0),j.removeEventListener("touchend",Y,Ui),j.removeEventListener("touchstart",se,Ui),j.removeEventListener("touchmove",re,Ui)}function De(j,ue){ke(j,function(){!C.state.isVisible&&Q.parentNode&&Q.parentNode.contains(Q)&&ue()})}function be(j,ue){ke(j,ue)}function ke(j,ue){var Ce=L().box;function Me(Ne){Ne.target===Ce&&(dA(Ce,"remove",Me),ue())}if(j===0)return ue();dA(Ce,"remove",A),dA(Ce,"add",Me),A=Me}function pe(j,ue,Ce){Ce===void 0&&(Ce=!1);var Me=In(C.props.triggerTarget||r);Me.forEach(function(Ne){Ne.addEventListener(j,ue,Ce),d.push({node:Ne,eventType:j,handler:ue,options:Ce})})}function xe(){$()&&(pe("touchstart",Re,{passive:!0}),pe("touchend",we,{passive:!0})),Gx(C.props.trigger).forEach(function(j){if(j!=="manual")switch(pe(j,Re),j){case"mouseenter":pe("mouseleave",we);break;case"focus":pe(ew?"focusout":"blur",S);break;case"focusin":pe("focusout",S);break}})}function He(){d.forEach(function(j){var ue=j.node,Ce=j.eventType,Me=j.handler,Ne=j.options;ue.removeEventListener(Ce,Me,Ne)}),d=[]}function Re(j){var ue,Ce=!1;if(!(!C.state.isEnabled||I(j)||a)){var Me=((ue=u)==null?void 0:ue.type)==="focus";u=j,g=j.currentTarget,F(),!C.state.isVisible&&Vx(j)&&Ca.forEach(function(Ne){return Ne(j)}),j.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||o)&&C.props.hideOnClick!==!1&&C.state.isVisible?Ce=!0:z(j),j.type==="click"&&(o=!Ce),Ce&&!Me&&oe(j)}}function Xe(j){var ue=j.target,Ce=ee().contains(ue)||Q.contains(ue);if(!(j.type==="mousemove"&&Ce)){var Me=G().concat(Q).map(function(Ne){var Oe,We=Ne._tippy,Ct=(Oe=We.popperInstance)==null?void 0:Oe.state;return Ct?{popperRect:Ne.getBoundingClientRect(),popperState:Ct,props:t}:null}).filter(Boolean);jx(Me,j)&&(J(),oe(j))}}function we(j){var ue=I(j)||C.props.trigger.indexOf("click")>=0&&o;if(!ue){if(C.props.interactive){C.hideWithInteractivity(j);return}oe(j)}}function S(j){C.props.trigger.indexOf("focusin")<0&&j.target!==ee()||C.props.interactive&&j.relatedTarget&&Q.contains(j.relatedTarget)||oe(j)}function I(j){return Dr.isTouch?$()!==j.type.indexOf("touch")>=0:!1}function m(){w();var j=C.props,ue=j.popperOptions,Ce=j.placement,Me=j.offset,Ne=j.getReferenceClientRect,Oe=j.moveTransition,We=K()?gA(Q).arrow:null,Ct=Ne?{getBoundingClientRect:Ne,contextElement:Ne.contextElement||ee()}:r,Jr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(jt){var Bt=jt.state;if(K()){var qt=L(),jr=qt.box;["placement","reference-hidden","escaped"].forEach(function(qr){qr==="placement"?jr.setAttribute("data-placement",Bt.placement):Bt.attributes.popper["data-popper-"+qr]?jr.setAttribute("data-"+qr,""):jr.removeAttribute("data-"+qr)}),Bt.attributes.popper={}}}},yt=[{name:"offset",options:{offset:Me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Oe}},Jr];K()&&We&&yt.push({name:"arrow",options:{element:We,padding:3}}),yt.push.apply(yt,(ue==null?void 0:ue.modifiers)||[]),C.popperInstance=Nx(Ct,Q,Object.assign({},ue,{placement:Ce,onFirstUpdate:h,modifiers:yt}))}function w(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function N(){var j=C.props.appendTo,ue,Ce=ee();C.props.interactive&&j===P0||j==="parent"?ue=Ce.parentNode:ue=N0(j,[Ce]),ue.contains(Q)||ue.appendChild(Q),C.state.isMounted=!0,m()}function G(){return Ia(Q.querySelectorAll("[data-tippy-root]"))}function z(j){C.clearDelayTimeouts(),j&&k("onTrigger",[C,j]),fe();var ue=U(!0),Ce=D(),Me=Ce[0],Ne=Ce[1];Dr.isTouch&&Me==="hold"&&Ne&&(ue=Ne),ue?i=setTimeout(function(){C.show()},ue):C.show()}function oe(j){if(C.clearDelayTimeouts(),k("onUntrigger",[C,j]),!C.state.isVisible){me();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&o)){var ue=U(!1);ue?n=setTimeout(function(){C.state.isVisible&&C.hide()},ue):s=requestAnimationFrame(function(){C.hide()})}}function ce(){C.state.isEnabled=!0}function he(){C.hide(),C.state.isEnabled=!1}function ve(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function Be(j){if(!C.state.isDestroyed){k("onBeforeUpdate",[C,j]),He();var ue=C.props,Ce=W0(r,Object.assign({},ue,G0(j),{ignoreAttributes:!0}));C.props=Ce,xe(),ue.interactiveDebounce!==Ce.interactiveDebounce&&(J(),f=O0(Xe,Ce.interactiveDebounce)),ue.triggerTarget&&!Ce.triggerTarget?In(ue.triggerTarget).forEach(function(Me){Me.removeAttribute("aria-expanded")}):Ce.triggerTarget&&r.removeAttribute("aria-expanded"),F(),V(),_&&_(ue,Ce),C.popperInstance&&(m(),G().forEach(function(Me){requestAnimationFrame(Me._tippy.popperInstance.forceUpdate)})),k("onAfterUpdate",[C,j])}}function Le(j){C.setProps({content:j})}function Pe(){var j=C.state.isVisible,ue=C.state.isDestroyed,Ce=!C.state.isEnabled,Me=Dr.isTouch&&!C.props.touch,Ne=AA(C.props.duration,0,fr.duration);if(!(j||ue||Ce||Me)&&!ee().hasAttribute("disabled")&&(k("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,K()&&(Q.style.visibility="visible"),V(),fe(),C.state.isMounted||(Q.style.transition="none"),K()){var Oe=L(),We=Oe.box,Ct=Oe.content;hA([We,Ct],0)}h=function(){var yt;if(!(!C.state.isVisible||l)){if(l=!0,Q.offsetHeight,Q.style.transition=C.props.moveTransition,K()&&C.props.animation){var gr=L(),jt=gr.box,Bt=gr.content;hA([jt,Bt],Ne),H0([jt,Bt],"visible")}R(),F(),U0(pA,C),(yt=C.popperInstance)==null||yt.forceUpdate(),k("onMount",[C]),C.props.animation&&K()&&be(Ne,function(){C.state.isShown=!0,k("onShown",[C])})}},N()}}function tt(){var j=!C.state.isVisible,ue=C.state.isDestroyed,Ce=!C.state.isEnabled,Me=AA(C.props.duration,1,fr.duration);if(!(j||ue||Ce)&&(k("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,l=!1,o=!1,K()&&(Q.style.visibility="hidden"),J(),me(),V(!0),K()){var Ne=L(),Oe=Ne.box,We=Ne.content;C.props.animation&&(hA([Oe,We],Me),H0([Oe,We],"hidden"))}R(),F(),C.props.animation?K()&&De(Me,C.unmount):C.unmount()}}function ot(j){Z().addEventListener("mousemove",f),U0(Ca,f),f(j)}function vt(){C.state.isVisible&&C.hide(),C.state.isMounted&&(w(),G().forEach(function(j){j._tippy.unmount()}),Q.parentNode&&Q.parentNode.removeChild(Q),pA=pA.filter(function(j){return j!==C}),C.state.isMounted=!1,k("onHidden",[C]))}function rt(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),He(),delete r._tippy,C.state.isDestroyed=!0,k("onDestroy",[C]))}}function Gi(r,e){e===void 0&&(e={});var t=fr.plugins.concat(e.plugins||[]);zx();var i=Object.assign({},e,{plugins:t}),n=Wx(r),s=n.reduce(function(o,a){var c=a&&lw(a,i);return c&&o.push(c),o},[]);return va(r)?s[0]:s}Gi.defaultProps=fr,Gi.setDefaultProps=nw,Gi.currentInput=Dr,Object.assign({},E0,{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)}}),Gi.setDefaultProps({render:q0});function $t(r,e){return`${r}-${e}`}function Lr(r){var e,t;const i=[];return(((e=r.renderer)==null?void 0:e.type)==="video"||((t=r.renderer)==null?void 0:t.type)==="audio")&&i.push({...r.config,...r.options}),i.push(...r.childNodes.flatMap(Lr).filter(Boolean)),i}function cw(r){return r instanceof Error||typeof r=="object"&&r!==null&&"message"in r&&typeof r.message=="string"&&r.message?r.message:r instanceof Event?`${r.type} event`:r==null?"":String(r)}class ya extends Error{constructor(e,t,i=!1){super(),this.fatal=!1,this.fatal=i,t instanceof Error&&(this.stack=t.stack),this.message=[e,cw(t)].filter(Boolean).join(" - ")}}function di(r,e,t){return Math.min(Math.max(e,r),t)}const Aw=5;function uw(r,e){return r.length!==e.length||r.some((t,i)=>t!==e[i])}class hw{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=_t(),this._controls=_t(),this._drawAbort=null,this.host=e}set activeScenes(e){uw(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,n;const s=di(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l,duration:u})=>s>=l&&s<l+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((i=this.host.composition)==null?void 0:i.tracks.reduce((a,c)=>a.concat(c.scenes.filter(({start:l})=>s>=l-Aw&&s<l)),[]))??[],this.loadScenes(),this.syncMediaState(),(n=this._controls.value)==null||n.setAttribute("currentTime",s.toString()),o&&this.host.dispatchEvent(new CustomEvent("timeupdate",{detail:s})),this.draw(s)}get currentTime(){return this._currentTime}set caption(e){e!==this._caption&&(this._caption=e,this.host.requestUpdate())}get caption(){return this._caption}canvas(){return Dt(this._canvas)}controls(){return Dt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Lr(e.layout.node).forEach(({key:i})=>{var n,s,o;const{id:a,start:c,duration:l}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,A=$t(a,i);if(this.host.media[A]){const h=this.host.media[A],{speed:d,volume:f,hls:g,node:p,start:E,duration:y}=h,B=this.host.mediaState[A];p&&B&&(p.currentTime>=E+y||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,E):B.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=di(0,this.host.volume*(f??1)*this.host.envelopeGain(a,c),1),p.playbackRate=di(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${c}-${l}`,d=this.host._sceneController.mediaState[h];this.host.duration&&!((o=d==null?void 0:d.buffered)!=null&&o.length)&&(this.host._sceneController.mediaState={...this.host._sceneController.mediaState,[h]:{...d,buffered:[{start:Math.max(0,c/this.host.duration*100),end:Math.min((c+l)/this.host.duration*100,100)}]}})}})})}syncMediaState(){var e;return Promise.all(((e=this.host.composition)==null?void 0:e.tracks.flatMap(t=>t.scenes.flatMap(i=>Lr(i.layout.node).map(async({key:s})=>{const o=$t(i.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:c}=a,l=this.host.mediaState[o];if(!this.activeScenes.includes(i))c.paused||c.pause();else if(l&&!this.host.waiting&&!this.host.loading&&!this.host.paused&&c.paused&&!c.ended&&l.initialised)try{await c.play()}catch(A){throw new ya("Video play error",A,!0)}}}))))??[])}draw(e=this.currentTime,t){var i;(i=this._drawAbort)==null||i.abort(),this._drawAbort=new AbortController,this.host.composition&&this._canvas.value&&this.host.composition.draw({currentTime:e,canvas:this._canvas.value,overrides:t,signal:this._drawAbort.signal})}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)}}const dw=Ar(async r=>{const e=await fetch(r,{cache:"no-store"});if(!e.ok)throw new Error(`Failed to fetch font (${e.status}): ${r}`);return e.arrayBuffer()}),X0=Ar(async(r,e,t)=>new FontFace(r,await dw(t),{weight:e,style:"normal"}).load(),{cacheKey:([r,e,t])=>`${r}|${e}|${t}`}),fw=Ar(async function(e){const{weight:t,family:i}=e,{client:n,server:s}=i.weights.find(a=>a.weight===t)??{},o=n??s;return o?X0(i.name,t,o):null},{cacheKey:([r])=>{const{client:e,server:t}=r.family.weights.find(i=>i.weight===r.weight)??{};return`${r.family.name}|${r.weight}|${e??t??""}`}});Ar(async function(e){return(await Promise.all(e.weights.map(async({weight:i,client:n,server:s})=>{const o=n??s;if(!o)return null;const a=Array.from(document.fonts).find(l=>l.family===e.name&&l.weight===i);if(a)return a;const c=await X0(e.name,i,o);return document.fonts.add(c),c}))).filter(i=>i!==null)},{cacheKey:([r])=>JSON.stringify(r)});function gw(r){return r.startsWith("data:")?r.split(",")[0]:r.split(/[?#]/)[0]}function z0(r,e,t){return new Promise((i,n)=>{const s=new Image;s.crossOrigin=e,s.onload=()=>i(s),s.onerror=()=>n(new Error(t)),s.src=r})}async function pw(r,e){const t=await fetch(r,{mode:"cors",cache:"no-store"}).catch(i=>{throw new Error(`Failed to fetch image (${String(i)}): ${e}`)});if(!t.ok)throw new Error(`Failed to fetch image (${t.status}): ${e}`);return t.blob().catch(i=>{throw new Error(`Failed to read image (${String(i)}): ${e}`)})}async function mw(r,e){const t=URL.createObjectURL(await pw(r,e));try{const i=e.endsWith(".svg")?`${t}#${e}`:t;return await z0(i,null,`Failed to decode image: ${e}`)}finally{URL.revokeObjectURL(t)}}const Ew=Ar(async r=>{const e=gw(r);try{return await mw(r,e)}catch(t){return z0(r,"anonymous",`Failed to load image: ${e}`).catch(()=>{throw t})}}),Iw=Ar(async({options:r})=>{const e=await fw(r.font);return e&&document.fonts.add(e),{font:r.font}}),vw=Ar(async({config:r})=>r.src?{image:await Ew(r.src)}:{image:null},{cacheKey:([{config:r}])=>JSON.stringify(r)});async function mA(r){return r.duration===1/0?new Promise(e=>{r.currentTime=Number.MAX_SAFE_INTEGER,r.ontimeupdate=()=>{r.ontimeupdate=null,e(r.duration),r.currentTime=0}}):r.duration}function Z0(r,e){if(r.type==="video"&&r.alpha)return(e?r.alpha.mov:r.alpha.webm)||void 0}function Cw(r,e){return Z0(r,e)??r.src}function EA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function yw(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Bw({config:r,elementSize:e}){return new Promise(async t=>{let i=null;const{type:n,key:s,duration:o}=r,a=Cw(r,EA());n==="video"?(i=document.createElement("video"),i.playsInline=!0,e&&(i.width=e.width,i.height=e.height)):i=document.createElement("audio"),i.muted=!0,i.loop=!1,i.crossOrigin="anonymous",i.src=a;let c=!1;if(i.startLoadOnce=()=>{c||(i.preload="auto",i.load(),c=!0)},n==="video"&&o&&r.aspectRatio)i.preload="none",t({key:s,hls:null,node:i,aspectRatio:r.aspectRatio,totalDuration:o});else{i.preload="metadata";const l=async()=>{const u=await mA(i),A=i instanceof HTMLVideoElement&&i.videoHeight>0?i.videoWidth/i.videoHeight:null;t({key:s,hls:null,node:i,totalDuration:u,aspectRatio:A}),i.removeEventListener("loadedmetadata",l)};i.addEventListener("loadedmetadata",l)}})}function Tw({key:r,playlist:e,duration:t,elementSize:i}){return new Promise(n=>{const s=document.createElement("video");s instanceof HTMLVideoElement&&(i&&(s.width=i.width,s.height=i.height),s.playsInline=!0),s.muted=!0,s.loop=!1,s.crossOrigin="anonymous";let o=!1,a=!1,c=!1;const l=new ir({autoStartLoad:!0,capLevelToPlayerSize:!1,xhrSetup:u=>{const{open:A}=u,h=e.split("?")[1];u.open=function(d,f,g){if(h&&!f.toString().includes("?")&&(f+="?"+h),!o&&f.toString().includes(".ts")){if(a)return;a=!0}A.apply(this,[d,f,g])}}});l.on(ir.Events.BUFFER_CODECS,async(u,A)=>{var h,d;if(c)return;const f=A.video,g=(h=f==null?void 0:f.metadata)==null?void 0:h.width,p=(d=f==null?void 0:f.metadata)==null?void 0:d.height;if(g&&p){c=!0,o||l==null||l.stopLoad();const E=t??await mA(s);n({key:r,hls:l,node:s,aspectRatio:g/p,totalDuration:E})}}),l.on(ir.Events.LEVEL_LOADED,async()=>{setTimeout(async()=>{if(c)return;c=!0,o||l==null||l.stopLoad();const u=t??await mA(s),A=l.levels[l.levels.length-1];n({key:r,hls:l,node:s,aspectRatio:A.width/A.height,totalDuration:u})},2e3)}),i&&l.on(ir.Events.MANIFEST_PARSED,()=>{const u=window.devicePixelRatio||1,A=Math.min(i.width,i.height)*u;let h=0;for(let d=l.levels.length-1;d>=0;d--)if(Math.min(l.levels[d].width,l.levels[d].height)<=A){h=d;break}l.autoLevelCapping=h}),l.loadSource(e),l.attachMedia(s),l.startLoadOnce=(u=-1,A)=>{if(l&&!o){const h=l.levels.findIndex(d=>Math.min(d.height,d.width)===A);o=!0,l.startLoad(u),h!==-1&&(l.currentLevel=h)}}})}function bw({config:r,elementSize:e}){const{playlist:t}=r;return!Z0(r,EA())&&t&&!EA()&&ir.isSupported()?Tw({key:r.key,playlist:t,duration:r.duration??0,elementSize:e}):Bw({config:r,elementSize:e})}const Sw=.25;let xw=class{constructor(e){this._hasPlayed=!1,this._duration=0,this._composition=null,this._media={},this._mediaState={},this._compositionController=new AbortController,this._delayProcessing=(t=100)=>{const i=new AbortController,n=setTimeout(()=>{i.signal.aborted||(this.host._processing=!0)},t);return i.signal.addEventListener("abort",()=>{clearTimeout(n)}),i},this._mediaFactory=Ar(async(t,i)=>{var n,s,o,a;const{key:c}=i,l=((s=(n=this.host.shadowRoot)==null?void 0:n.host)==null?void 0:s.clientWidth)??0,u=((a=(o=this.host.shadowRoot)==null?void 0:o.host)==null?void 0:a.clientHeight)??0,A=await bw({config:i,elementSize:{width:l,height:u}}),h={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},d=Object.keys(h).reduce((f,g)=>{const p=g,E=h[p]({id:t,key:c,node:A.node});return f[p]=E,A.node.addEventListener(g,E),f},{});return{media:A,listeners:d,aspectRatio:A.aspectRatio,source:()=>A.node}},{cacheKey:([t,{key:i,src:n,playlist:s,...o}])=>{const a="alpha"in o&&o.alpha?{webm:o.alpha.webm.split("?")[0],mov:o.alpha.mov.split("?")[0]}:void 0;return JSON.stringify({id:t,key:i,src:n==null?void 0:n.split("?")[0],playlist:s==null?void 0:s.split("?")[0],alpha:a})}}),this._handleLoadedData=({id:t,key:i,node:n})=>()=>{const s=$t(t,i),o=this.mediaState[s];o!=null&&o.initialised||(this.mediaState={...this.mediaState,[s]:{...o,initialised:!0,waiting:!1,buffered:(o==null?void 0:o.buffered)??[]}},this.setMediaCurrentTime(this.host.currentTime,{only:{id:t,key:i}}),this.host.dispatchEvent(new CustomEvent("video:loadeddata",{detail:{id:t,key:i,node:n}})))},this._handleWaiting=({id:t,key:i,node:n})=>()=>{const s=$t(t,i),o=this.mediaState[s];o!=null&&o.initialised&&!(o!=null&&o.waiting)&&(this.mediaState={...this.mediaState,[s]:{...o,waiting:!0}},this.host.dispatchEvent(new CustomEvent("video:waiting",{detail:{id:t,key:i,node:n}})))},this._handleCanPlay=({id:t,key:i})=>()=>{const n=$t(t,i),s=this.mediaState[n];s!=null&&s.initialised&&(s!=null&&s.waiting)&&(this.mediaState={...this.mediaState,[n]:{...s,waiting:!1}}),this.host.paused&&this.host.draw()},this._handleProgress=()=>()=>{},this._handleSeeking=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:seeking",{detail:{id:t,key:i,node:n}}))},this._handleSeeked=({id:t,key:i,node:n})=>()=>{const s=$t(t,i),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Lr(a.layout.node).map(({id:l})=>l)).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:n}})))},this._handlePlay=({id:t,key:i,node:n})=>()=>{this.hasPlayed=!0,this.host.dispatchEvent(new CustomEvent("video:play",{detail:{id:t,key:i,node:n}}))},this._handlePlaying=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:playing",{detail:{id:t,key:i,node:n}}))},this._handlePause=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:pause",{detail:{id:t,key:i,node:n}}))},this._handleStalled=({id:t,key:i,node:n})=>()=>{this.host.dispatchEvent(new CustomEvent("video:stalled",{detail:{id:t,key:i,node:n}}))},this._handleTimeUpdate=({id:t,key:i,node:n})=>()=>{const s=this.media[$t(t,i)];s!=null&&s.loop&&s.duration>0&&n.currentTime>=s.start+s.duration&&(n.currentTime=s.start,n.paused||n.play()),this.host.dispatchEvent(new CustomEvent("video:timeupdate",{detail:{id:t,key:i,node:n}}))},this._handleEnded=({id:t,key:i,node:n})=>()=>{const s=this.media[$t(t,i)];if(s!=null&&s.loop){n.currentTime=s.start,this.host.paused||n.play();return}this.host.dispatchEvent(new CustomEvent("video:ended",{detail:{id:t,key:i,node:n}}))},this._handleError=({id:t,key:i,node:n})=>()=>{const s=new ya(`Video error - answer ${t} failed to load`);this.host.dispatchEvent(new ErrorEvent("error",{bubbles:!0,composed:!0,error:s,message:s.message})),this.host.dispatchEvent(new CustomEvent("video:error",{detail:{id:t,key:i,node:n}}))},this._cleanupMedia=t=>{var i;const n=this.media[t];n&&(n.node.pause(),n.node.src="",(i=n.hls)==null||i.destroy(),Object.keys(n.listeners??{}).forEach(s=>{var o,a;if((o=this.media)!=null&&o[t]){const c=(a=n.listeners)==null?void 0:a[s];c&&n.node.removeEventListener(s,c)}}),delete this._media[t],delete this._mediaState[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 composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set media(e){e!==this._media&&(this._media=e,this.host.requestUpdate())}get media(){return this._media}set mediaState(e){e!==this._mediaState&&(this._mediaState=e,this.host.requestUpdate())}get mediaState(){return this._mediaState}_setupTask(){new Xs(this.host,async([e,t,i,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,c=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:l})=>t===l))&&(this.host._language=(s=this.host._languages[0])==null?void 0:s.value),e){const{width:l,height:u}=kl({aspectRatio:i,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await bd({debug:n,config:e,resolvers:{text:Iw,image:vw,video:async({id:g,config:p,options:E})=>{const{media:y,source:B}=await this._mediaFactory(g,{...p,...E});return{video:B,aspectRatio:y.aspectRatio}}},rootWidth:l,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new ya("Fatal composition error",f,!0)}this.duration=Number.isFinite(this.composition.duration)?this.composition.duration:0;const A={...this.media},h={...this.mediaState},d=[];for(const f of this.composition.tracks)for(const g of f.scenes){const p=Lr(g.layout.node);for(const E of p){const{media:y,listeners:B}=await this._mediaFactory(g.id,E),C=$t(g.id,y.key);d.push(C);const x=(E.startOffset??0)*y.totalDuration,Q=(1-(E.endOffset??0))*y.totalDuration;A[C]={...y,listeners:B,start:x,duration:Q-x,speed:E.speed??1,volume:E.volume??1,loop:E.loop??!1},h[C]={initialised:!y,waiting:!!y,...this.mediaState[C]}}}this.media=A,this.mediaState=h,Object.keys(this.media).forEach(f=>{d.includes(f)||this.media[f].node.pause()}),this.host.currentTime>this.duration?this.host.reset(this.duration,!1):this.host.paused?this.host.reset(this.host.currentTime,!this.host.paused):this.setMediaCurrentTime(this.host.currentTime,{resync:!0})}this.host.dispatchEvent(new CustomEvent("compositionupdate",{detail:this.composition,bubbles:!0,composed:!0}))}catch(l){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:l,message:l.message}))}finally{c.abort(),this.host._processing=!1}},()=>[this.host.config,this.host.language,this.host.aspectRatio,this.host.debug])}_setMediaCurrentTime({time:e,scene:t,key:i,resync:n}){const{id:s,layout:o,start:a}=t;Lr(o.node).filter(({key:l})=>!i||l===i).forEach(({key:l})=>{const u=$t(s,l);if(this.media[u]){const A=this.media[u],h=(e-a)*A.speed,d=A.loop&&A.duration>0?h%A.duration:h,f=di(A.start,d+A.start,A.start+A.duration);if(n&&!A.node.paused&&Math.abs(A.node.currentTime-f)<Sw)return;A.node.currentTime=f}})}setMediaCurrentTime(e,{only:t,resync:i}={}){var n;(n=this.composition)==null||n.tracks.forEach(s=>{s.scenes.forEach(o=>{(!t||o.id===t.id)&&this._setMediaCurrentTime({time:e,scene:o,key:t==null?void 0:t.key,resync:i})})})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.media).forEach(e=>{this._cleanupMedia(e)}),this.media={}}};function ww(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function Qw(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const IA=["progress","play-large","navigation","play","volume","current-time","duration","levels","speed","captions","fullscreen","preview"],Rw={id:"captions",event:"captions:click",label:"Closed Captions"},_w={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},ep={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}]},Dw={id:"playbackRate",label:"Playback playbackRate",subItems:ep};class Lw extends su{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==zi.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)),cr}}const vA=Zi(Lw),kw=LS(()=>{const r=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","url(https://vouch-clients.s3.ap-southeast-2.amazonaws.com/vouch/fonts/Roobert-Bold.woff2",{style:"normal",weight:"700"}),i=new FontFace("Roobert Captions","url(https://media-player-fonts.s3.ap-southeast-2.amazonaws.com/Roobert-Regular.woff2)",{style:"normal",weight:"400"}),n=Ad.map(s=>({load:!1,font:new FontFace(s.family,`url(${s.url})`,{style:s.style})}));return[{load:!0,font:r},{load:!0,font:e},{load:!0,font:t},{load:!0,font:i},...n]}),kr={"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"},Mw={colors:kr,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 ${kr["dark-100"]}`,medium:`0 .125rem .625rem ${kr["dark-100"]}`,large:`0 .25rem 1rem ${kr["dark-50"]}`,xl:`.25rem .25rem 1rem ${kr["dark-250"]}`,xxl:`0 .25rem 2rem ${kr["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${kr["dark-250"]}`,toolbar:`0 -.625rem .625rem ${kr["dark-50"]}`,text:`0 0 .25rem ${kr["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:kr["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},tp=RS(Mw,{delimiter:"-"}),Fw=Object.keys(tp).map(r=>kn(`:host { --${r}: ${tp[r]}; }`)),et=(r=>{const e=class extends r{firstUpdated(){kw().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Fw,xt`
2515
2515
  :host {
2516
2516
  font-family: var(--fontFamilies-sans);
2517
2517
  font-size: var(--fontSizes-medium);
@@ -2592,7 +2592,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2592
2592
  scroll-behavior: auto !important;
2593
2593
  }
2594
2594
  }
2595
- `],e})(Xi),Fw=(r,e)=>(typeof window<"u"&&(window.customElements.get(r)??window.customElements.define(r,e)),e),Pw=(r,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(n){typeof window<"u"&&(window.customElements.get(r)??window.customElements.define(r,n))}}},Ft=r=>e=>typeof e=="function"?Fw(r,e):Pw(r,e);class Nw{constructor(e){this._memoKey=null,this._lastDeps=null,this._composition=null,this._videos={},this._cleanupVideo=t=>{var i;const n=this.videos[t];n&&(n.node.pause(),n.node.src="",(i=n.hls)==null||i.destroy(),delete this.videos[t])},this.host=e,this.host.addController(this)}set composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}_setupTask(){new Xs(this.host,async([e,t])=>{try{if(!t||e)return;try{this.composition=await bd({config:t,rootWidth:0,rootHeight:0})}catch(i){throw new ya("Video preview data template error",i)}}catch(i){this.composition=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:i,message:i.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,config:this.host.config});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.config];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}}function ws(r,e){return e?e instanceof ShadowRoot?ws(r,e.host):e instanceof HTMLElement&&e.matches(r)?e:ws(r,e.parentNode):null}function CA(r,e={}){const t=Math.max(0,r||0),i=Math.floor(t/3600),n=Math.floor(t%3600/60),s=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${n}`.padStart(2,"0")}:${`${s}`.padStart(2,"0")}`:`${n}:${`${s}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var Ow=Object.defineProperty,Uw=Object.getOwnPropertyDescriptor,vn=(r,e,t,i)=>{for(var n=i>1?void 0:i?Uw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Ow(e,t,n),n};let fi=class extends et{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return _e`<button
2595
+ `],e})(Xi),Pw=(r,e)=>(typeof window<"u"&&(window.customElements.get(r)??window.customElements.define(r,e)),e),Nw=(r,e)=>{const{kind:t,elements:i}=e;return{kind:t,elements:i,finisher(n){typeof window<"u"&&(window.customElements.get(r)??window.customElements.define(r,n))}}},Ft=r=>e=>typeof e=="function"?Pw(r,e):Nw(r,e);class Ow{constructor(e){this._memoKey=null,this._lastDeps=null,this._composition=null,this._videos={},this._cleanupVideo=t=>{var i;const n=this.videos[t];n&&(n.node.pause(),n.node.src="",(i=n.hls)==null||i.destroy(),delete this.videos[t])},this.host=e,this.host.addController(this)}set composition(e){e!==this._composition&&(this._composition=e,this.host.requestUpdate())}get composition(){return this._composition}set videos(e){e!==this._videos&&(this._videos=e,this.host.requestUpdate())}get videos(){return this._videos}_setupTask(){new Xs(this.host,async([e,t])=>{try{if(!t||e)return;try{this.composition=await bd({config:t,rootWidth:0,rootHeight:0})}catch(i){throw new ya("Video preview data template error",i)}}catch(i){this.composition=null,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:i,message:i.message}))}},()=>{const e=JSON.stringify({disabled:this.host.disabled,config:this.host.config});if(this._lastDeps&&this._memoKey===e)return this._lastDeps;const t=[this.host.disabled,this.host.config];return this._memoKey=e,this._lastDeps=t,t})}hostConnected(){this._setupTask()}hostDisconnected(){Object.keys(this.videos).forEach(e=>{this._cleanupVideo(e)}),this.videos={}}}function ws(r,e){return e?e instanceof ShadowRoot?ws(r,e.host):e instanceof HTMLElement&&e.matches(r)?e:ws(r,e.parentNode):null}function CA(r,e={}){const t=Math.max(0,r||0),i=Math.floor(t/3600),n=Math.floor(t%3600/60),s=Math.floor(t%3600%60),o=Math.floor(t%1*1e3);let a=i?`${i}:${`${n}`.padStart(2,"0")}:${`${s}`.padStart(2,"0")}`:`${n}:${`${s}`.padStart(2,"0")}`;return e.includeMs&&(a+=`:${`${o}`.padStart(3,"0")}`),a}var Uw=Object.defineProperty,Gw=Object.getOwnPropertyDescriptor,vn=(r,e,t,i)=>{for(var n=i>1?void 0:i?Gw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Uw(e,t,n),n};let fi=class extends et{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return _e`<button
2596
2596
  class=${it({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"})}
2597
2597
  >
2598
2598
  <slot></slot>
@@ -2834,14 +2834,14 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2834
2834
  <path
2835
2835
  d="M9.853 23.246L4.86 7.688H0L7 27.42h5.52l7.265-19.733h-4.65L9.854 23.246zM95.12 7.08a8.905 8.905 0 00-4.648 1.294V0H86.14v27.419h4.332V16.087a4.656 4.656 0 014.649-4.65 4.656 4.656 0 014.649 4.65v11.332h4.332V16.087c.026-4.966-4.015-9.008-8.981-9.008zM57.188 19.02a4.656 4.656 0 01-4.649 4.649 4.656 4.656 0 01-4.649-4.65V7.689h-4.332V19.02c0 4.966 4.041 8.98 8.981 8.98 4.94 0 8.981-4.04 8.981-8.98V7.688h-4.332V19.02zM30.483 7.133c-5.732 0-10.408 4.675-10.408 10.407s4.676 10.408 10.408 10.408c5.732 0 10.408-4.676 10.408-10.408 0-5.732-4.676-10.407-10.408-10.407zm0 16.483a6.076 6.076 0 116.075-6.076c0 3.355-2.747 6.076-6.075 6.076zM74.517 23.616a6.076 6.076 0 010-12.151 6.132 6.132 0 015.045 2.668l3.592-2.43a10.473 10.473 0 00-8.637-4.57c-5.732 0-10.408 4.675-10.408 10.407s4.676 10.408 10.408 10.408a10.35 10.35 0 008.611-4.596l-3.593-2.43a5.975 5.975 0 01-5.018 2.694z"
2836
2836
  />
2837
- </svg>`};var Gw=Object.defineProperty,Hw=Object.getOwnPropertyDescriptor,ip=(r,e,t,i)=>{for(var n=i>1?void 0:i?Hw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Gw(e,t,n),n};let Ba=class extends et{render(){return!this.icon||!Object.keys(rp).includes(this.icon)?null:rp[this.icon]()}};Ba.styles=[et.styles??[],xt`
2837
+ </svg>`};var Hw=Object.defineProperty,$w=Object.getOwnPropertyDescriptor,ip=(r,e,t,i)=>{for(var n=i>1?void 0:i?$w(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Hw(e,t,n),n};let Ba=class extends et{render(){return!this.icon||!Object.keys(rp).includes(this.icon)?null:rp[this.icon]()}};Ba.styles=[et.styles??[],xt`
2838
2838
  :host {
2839
2839
  display: flex;
2840
2840
  align-items: center;
2841
2841
  justify-content: center;
2842
2842
  flex-shrink: 0;
2843
2843
  }
2844
- `],ip([Ae({type:String})],Ba.prototype,"icon",2),Ba=ip([Ft("vmp-icon")],Ba);var $w=Object.defineProperty,Yw=Object.getOwnPropertyDescriptor,Cn=(r,e,t,i)=>{for(var n=i>1?void 0:i?Yw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&$w(e,t,n),n};let gi=class extends et{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return _e`
2844
+ `],ip([Ae({type:String})],Ba.prototype,"icon",2),Ba=ip([Ft("vmp-icon")],Ba);var Yw=Object.defineProperty,Vw=Object.getOwnPropertyDescriptor,Cn=(r,e,t,i)=>{for(var n=i>1?void 0:i?Vw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Yw(e,t,n),n};let gi=class extends et{constructor(){super(...arguments),this.active=!1,this.size="small",this.rounded="medium",this.weight="light"}render(){return _e`
2845
2845
  <vmp-button
2846
2846
  ?active=${this.active}
2847
2847
  size=${xi(this.size)}
@@ -2868,7 +2868,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2868
2868
  height: 32px;
2869
2869
  width: 32px;
2870
2870
  }
2871
- `],Cn([Ae({type:Boolean})],gi.prototype,"active",2),Cn([Ae({type:String})],gi.prototype,"size",2),Cn([Ae({type:String})],gi.prototype,"rounded",2),Cn([Ae({type:String})],gi.prototype,"weight",2),Cn([Ae({type:String})],gi.prototype,"icon",2),gi=Cn([Ft("vmp-icon-button")],gi);var Vw=Object.defineProperty,Kw=Object.getOwnPropertyDescriptor,Mr=(r,e,t,i)=>{for(var n=i>1?void 0:i?Kw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Vw(e,t,n),n};let Hi=class extends et{constructor(){super(...arguments),this.disabled=!1,this.aspectRatio=1,this.dataResolver=$l,this._currentTime=0,this._sceneController=new Nw(this),this._canvasRef=_t(),this._previewRef=_t(),this._previewTimeRef=_t(),this._handleScrubberMouseEnter=({detail:{x:r,y:e,elementLeft:t,elementRight:i}})=>{var n,s;if((n=this._previewRef)!=null&&n.value){const o=this._previewRef.value.getBoundingClientRect(),a=(s=this._previewRef.value.getRootNode().host)==null?void 0:s.getBoundingClientRect();o&&a&&(this._previewRef.value.style.opacity="1",this._previewRef.value.style.transform=`translate3d(${di(t-a.left,r-a.left-o.width/2,i-a.left-o.width)}px, ${e-a.top-o.height-28}px, 0)`)}},this._handleScrubberMouseMove=({detail:{time:r,x:e,elementLeft:t,elementRight:i}})=>{var n,s,o,a,c,l,u,A,h,d;if(this._currentTime=r,(o=(s=(n=this._sceneController.composition)==null?void 0:n.tracks)==null?void 0:s[0])!=null&&o.scenes){const f=(u=(l=(c=(a=this._sceneController.composition)==null?void 0:a.tracks)==null?void 0:c[0])==null?void 0:l.scenes)==null?void 0:u.find(({start:g,duration:p})=>r>=g&&r<=g+p);if(f&&Lr(f.layout.node).forEach(({key:p})=>{var E,y;const B=$t(f.id,p);if(this._sceneController.videos[B]){const C=this._sceneController.videos[B];(y=(E=C.node).startLoadOnce)==null||y.call(E),C.node.currentTime=r-f.start}}),this._draw(),(A=this._previewRef)!=null&&A.value){const g=this._previewRef.value.getBoundingClientRect(),p=(h=this._previewRef.value.getRootNode().host)==null?void 0:h.getBoundingClientRect();if(g&&p){const E=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[,y]=Array.from(E.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${di(t-p.left,e-p.left-g.width/2,i-p.left-g.width)}px, ${y[1]}px, 0)`}}this._previewTimeRef.value&&this._previewTimeRef.value.setAttribute("content",CA(Math.max(0,Math.min(this._currentTime,(d=this._sceneController.composition)==null?void 0:d.duration))))}},this._handleScrubberMouseLeave=()=>{var r;(r=this._previewRef)!=null&&r.value&&(this._previewRef.value.style.opacity="0")},this._handleScrubberResize=({detail:{y:r}})=>{var e,t;if((e=this._previewRef)!=null&&e.value){const i=this._previewRef.value.getBoundingClientRect(),n=(t=this._previewRef.value.getRootNode().host)==null?void 0:t.getBoundingClientRect();if(i&&n){const s=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[o]=Array.from(s.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${o[1]}px, ${r-n.top-i.height-28}px, 0)`}}}}_draw(r=this._currentTime){this._sceneController.composition&&this._canvasRef.value&&this._sceneController.composition.draw({canvas:this._canvasRef.value,currentTime:Math.max(0,Math.min(r,this._sceneController.composition.duration))})}connectedCallback(){super.connectedCallback();const r=ws("vmp-media-player",this);r==null||r.addEventListener("scrubber:resize",this._handleScrubberResize),r==null||r.addEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),r==null||r.addEventListener("scrubber:mousemove",this._handleScrubberMouseMove),r==null||r.addEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}disconnectedCallback(){super.disconnectedCallback();const r=ws("vmp-media-player",this);r==null||r.removeEventListener("scrubber:resize",this._handleScrubberResize),r==null||r.removeEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),r==null||r.removeEventListener("scrubber:mousemove",this._handleScrubberMouseMove),r==null||r.removeEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}render(){var r,e,t;const{height:i,width:n}=kl({resolution:180,aspectRatio:this.aspectRatio}),s=((t=(e=(r=this._sceneController.composition)==null?void 0:r.tracks)==null?void 0:e[0])==null?void 0:t.scenes.length)??0;return!this.disabled&&s>1?_e`
2871
+ `],Cn([Ae({type:Boolean})],gi.prototype,"active",2),Cn([Ae({type:String})],gi.prototype,"size",2),Cn([Ae({type:String})],gi.prototype,"rounded",2),Cn([Ae({type:String})],gi.prototype,"weight",2),Cn([Ae({type:String})],gi.prototype,"icon",2),gi=Cn([Ft("vmp-icon-button")],gi);var Kw=Object.defineProperty,Ww=Object.getOwnPropertyDescriptor,Mr=(r,e,t,i)=>{for(var n=i>1?void 0:i?Ww(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Kw(e,t,n),n};let Hi=class extends et{constructor(){super(...arguments),this.disabled=!1,this.aspectRatio=1,this.dataResolver=$l,this._currentTime=0,this._sceneController=new Ow(this),this._canvasRef=_t(),this._previewRef=_t(),this._previewTimeRef=_t(),this._handleScrubberMouseEnter=({detail:{x:r,y:e,elementLeft:t,elementRight:i}})=>{var n,s;if((n=this._previewRef)!=null&&n.value){const o=this._previewRef.value.getBoundingClientRect(),a=(s=this._previewRef.value.getRootNode().host)==null?void 0:s.getBoundingClientRect();o&&a&&(this._previewRef.value.style.opacity="1",this._previewRef.value.style.transform=`translate3d(${di(t-a.left,r-a.left-o.width/2,i-a.left-o.width)}px, ${e-a.top-o.height-28}px, 0)`)}},this._handleScrubberMouseMove=({detail:{time:r,x:e,elementLeft:t,elementRight:i}})=>{var n,s,o,a,c,l,u,A,h,d;if(this._currentTime=r,(o=(s=(n=this._sceneController.composition)==null?void 0:n.tracks)==null?void 0:s[0])!=null&&o.scenes){const f=(u=(l=(c=(a=this._sceneController.composition)==null?void 0:a.tracks)==null?void 0:c[0])==null?void 0:l.scenes)==null?void 0:u.find(({start:g,duration:p})=>r>=g&&r<=g+p);if(f&&Lr(f.layout.node).forEach(({key:p})=>{var E,y;const B=$t(f.id,p);if(this._sceneController.videos[B]){const C=this._sceneController.videos[B];(y=(E=C.node).startLoadOnce)==null||y.call(E),C.node.currentTime=r-f.start}}),this._draw(),(A=this._previewRef)!=null&&A.value){const g=this._previewRef.value.getBoundingClientRect(),p=(h=this._previewRef.value.getRootNode().host)==null?void 0:h.getBoundingClientRect();if(g&&p){const E=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[,y]=Array.from(E.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${di(t-p.left,e-p.left-g.width/2,i-p.left-g.width)}px, ${y[1]}px, 0)`}}this._previewTimeRef.value&&this._previewTimeRef.value.setAttribute("content",CA(Math.max(0,Math.min(this._currentTime,(d=this._sceneController.composition)==null?void 0:d.duration))))}},this._handleScrubberMouseLeave=()=>{var r;(r=this._previewRef)!=null&&r.value&&(this._previewRef.value.style.opacity="0")},this._handleScrubberResize=({detail:{y:r}})=>{var e,t;if((e=this._previewRef)!=null&&e.value){const i=this._previewRef.value.getBoundingClientRect(),n=(t=this._previewRef.value.getRootNode().host)==null?void 0:t.getBoundingClientRect();if(i&&n){const s=this._previewRef.value.style.transform||"translate3d(0px, 0px, 0px)",[o]=Array.from(s.matchAll(/([+-]?([0-9]*[.])?[0-9]+)(?=px)\w+/g));this._previewRef.value.style.transform=`translate3d(${o[1]}px, ${r-n.top-i.height-28}px, 0)`}}}}_draw(r=this._currentTime){this._sceneController.composition&&this._canvasRef.value&&this._sceneController.composition.draw({canvas:this._canvasRef.value,currentTime:Math.max(0,Math.min(r,this._sceneController.composition.duration))})}connectedCallback(){super.connectedCallback();const r=ws("vmp-media-player",this);r==null||r.addEventListener("scrubber:resize",this._handleScrubberResize),r==null||r.addEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),r==null||r.addEventListener("scrubber:mousemove",this._handleScrubberMouseMove),r==null||r.addEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}disconnectedCallback(){super.disconnectedCallback();const r=ws("vmp-media-player",this);r==null||r.removeEventListener("scrubber:resize",this._handleScrubberResize),r==null||r.removeEventListener("scrubber:mouseenter",this._handleScrubberMouseEnter),r==null||r.removeEventListener("scrubber:mousemove",this._handleScrubberMouseMove),r==null||r.removeEventListener("scrubber:mouseleave",this._handleScrubberMouseLeave)}render(){var r,e,t;const{height:i,width:n}=kl({resolution:180,aspectRatio:this.aspectRatio}),s=((t=(e=(r=this._sceneController.composition)==null?void 0:r.tracks)==null?void 0:e[0])==null?void 0:t.scenes.length)??0;return!this.disabled&&s>1?_e`
2872
2872
  <div
2873
2873
  ${Dt(this._previewRef)}
2874
2874
  class="preview"
@@ -2915,7 +2915,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2915
2915
  .aspectRatio=${this.aspectRatio}
2916
2916
  .dataResolver=${this.dataResolver}
2917
2917
  ></vmp-video-preview-content>
2918
- `}};Mr([Ae({type:Object})],yn.prototype,"config",2),Mr([Ae({type:Boolean})],yn.prototype,"disabled",2),Mr([Ae({type:Number})],yn.prototype,"aspectRatio",2),Mr([Ae({attribute:!1})],yn.prototype,"dataResolver",2),yn=Mr([Ft("vmp-video-preview")],yn);class Ww extends $n{constructor(e){if(super(e),e.type!==zi.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}update(e,[t]){return t==null||t(e.element),cr}}const np=Zi(Ww);class Jw{constructor(e){this.hiddenControls=[],this._measureRef=_t(),this._prevControlsWidth=0,this._hideables={},this._showables={},this._onResize=t=>{var i,n,s;const o=this._measureRef.value,a=(s=(n=(i=t==null?void 0:t[0])==null?void 0:i.borderBoxSize)==null?void 0:n[0])==null?void 0:s.inlineSize;if(o&&a&&a!==this._prevControlsWidth){Object.keys(this._hideables).forEach(l=>{this._hideables[l].element.style.display=""}),Object.keys(this._showables).forEach(l=>{this._showables[l].element.style.display="none"});const c=[];for(;o.scrollWidth>o.offsetWidth;){const l=Object.keys(this._hideables).find(A=>this._hideables[A].hideIndex===c.length);if(!l)break;const u=this._hideables[l].element;u&&(u.style.display="none"),c.push(l),Object.keys(this._showables).forEach(A=>{this._showables[A].showOn.some(h=>c.includes(h))&&(this._showables[A].element.style.display="flex")})}this.hiddenControls=c,this._prevControlsWidth=a,this.host.requestUpdate()}},this.host=e}measure(){return Dt(this._measureRef)}contain(){return vA(this._onResize)}hide(e,t){return np(i=>{this._hideables[e]={element:i,hideIndex:t}})}show(e,t){return np(i=>{this._showables[e]={element:i,showOn:t}})}}const yA=".tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}";var jw=Object.defineProperty,qw=Object.getOwnPropertyDescriptor,Qs=(r,e,t,i)=>{for(var n=i>1?void 0:i?qw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&jw(e,t,n),n};let $i=class extends et{constructor(){super(...arguments),this.semibold=!1,this.truncate=!1,this.size="medium",this.content=""}render(){return _e`
2918
+ `}};Mr([Ae({type:Object})],yn.prototype,"config",2),Mr([Ae({type:Boolean})],yn.prototype,"disabled",2),Mr([Ae({type:Number})],yn.prototype,"aspectRatio",2),Mr([Ae({attribute:!1})],yn.prototype,"dataResolver",2),yn=Mr([Ft("vmp-video-preview")],yn);class Jw extends $n{constructor(e){if(super(e),e.type!==zi.ELEMENT)throw new Error("Resize directive must be used in an Element expression")}update(e,[t]){return t==null||t(e.element),cr}}const np=Zi(Jw);class jw{constructor(e){this.hiddenControls=[],this._measureRef=_t(),this._prevControlsWidth=0,this._hideables={},this._showables={},this._onResize=t=>{var i,n,s;const o=this._measureRef.value,a=(s=(n=(i=t==null?void 0:t[0])==null?void 0:i.borderBoxSize)==null?void 0:n[0])==null?void 0:s.inlineSize;if(o&&a&&a!==this._prevControlsWidth){Object.keys(this._hideables).forEach(l=>{this._hideables[l].element.style.display=""}),Object.keys(this._showables).forEach(l=>{this._showables[l].element.style.display="none"});const c=[];for(;o.scrollWidth>o.offsetWidth;){const l=Object.keys(this._hideables).find(A=>this._hideables[A].hideIndex===c.length);if(!l)break;const u=this._hideables[l].element;u&&(u.style.display="none"),c.push(l),Object.keys(this._showables).forEach(A=>{this._showables[A].showOn.some(h=>c.includes(h))&&(this._showables[A].element.style.display="flex")})}this.hiddenControls=c,this._prevControlsWidth=a,this.host.requestUpdate()}},this.host=e}measure(){return Dt(this._measureRef)}contain(){return vA(this._onResize)}hide(e,t){return np(i=>{this._hideables[e]={element:i,hideIndex:t}})}show(e,t){return np(i=>{this._showables[e]={element:i,showOn:t}})}}const yA=".tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}";var qw=Object.defineProperty,Xw=Object.getOwnPropertyDescriptor,Qs=(r,e,t,i)=>{for(var n=i>1?void 0:i?Xw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&qw(e,t,n),n};let $i=class extends et{constructor(){super(...arguments),this.semibold=!1,this.truncate=!1,this.size="medium",this.content=""}render(){return _e`
2919
2919
  <div
2920
2920
  part="content"
2921
2921
  class=${it({semibold:this.semibold,truncate:this.truncate,[this.size]:!0})}
@@ -2960,7 +2960,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
2960
2960
  text-overflow: ellipsis;
2961
2961
  overflow: hidden;
2962
2962
  }
2963
- `],Qs([Ae({type:Boolean})],$i.prototype,"semibold",2),Qs([Ae({type:Boolean})],$i.prototype,"truncate",2),Qs([Ae({type:String})],$i.prototype,"size",2),Qs([Ae({type:String})],$i.prototype,"content",2),$i=Qs([Ft("vmp-text")],$i);var Xw=Object.defineProperty,zw=Object.getOwnPropertyDescriptor,Rs=(r,e,t,i)=>{for(var n=i>1?void 0:i?zw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Xw(e,t,n),n};let Yi=class extends et{constructor(){super(...arguments),this.activeItems=[],this.visibleItems=null,this.subItemsActive=null,this.tippy=null,this._contentRef=_t()}_handleBackClick(){this.subItemsActive=null,this.visibleItems=this.items??null}willUpdate(){this.visibleItems=this.visibleItems??this.items??null}updated(){var r,e;const t=(e=(r=this.items)==null?void 0:r.items.find(({id:i})=>this.subItemsActive===i))==null?void 0:e.subItems;this.visibleItems=t??this.items??null,t||(this.subItemsActive=null)}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=Gi(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",trigger:"click",onShow:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}render(){var r,e;return _e`
2963
+ `],Qs([Ae({type:Boolean})],$i.prototype,"semibold",2),Qs([Ae({type:Boolean})],$i.prototype,"truncate",2),Qs([Ae({type:String})],$i.prototype,"size",2),Qs([Ae({type:String})],$i.prototype,"content",2),$i=Qs([Ft("vmp-text")],$i);var zw=Object.defineProperty,Zw=Object.getOwnPropertyDescriptor,Rs=(r,e,t,i)=>{for(var n=i>1?void 0:i?Zw(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&zw(e,t,n),n};let Yi=class extends et{constructor(){super(...arguments),this.activeItems=[],this.visibleItems=null,this.subItemsActive=null,this.tippy=null,this._contentRef=_t()}_handleBackClick(){this.subItemsActive=null,this.visibleItems=this.items??null}willUpdate(){this.visibleItems=this.visibleItems??this.items??null}updated(){var r,e;const t=(e=(r=this.items)==null?void 0:r.items.find(({id:i})=>this.subItemsActive===i))==null?void 0:e.subItems;this.visibleItems=t??this.items??null,t||(this.subItemsActive=null)}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=Gi(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",trigger:"click",onShow:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}render(){var r,e;return _e`
2964
2964
  <slot></slot>
2965
2965
  <div ${Dt(this._contentRef)} class="content">
2966
2966
  <div class="title">
@@ -3048,7 +3048,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3048
3048
  height: 20px;
3049
3049
  width: 20px;
3050
3050
  }
3051
- `],Rs([Ae({type:Object})],Yi.prototype,"items",2),Rs([Ae({type:Array})],Yi.prototype,"activeItems",2),Rs([gt()],Yi.prototype,"visibleItems",2),Rs([gt()],Yi.prototype,"subItemsActive",2),Yi=Rs([Ft("vmp-menu")],Yi);var Zw=Object.defineProperty,eQ=Object.getOwnPropertyDescriptor,BA=(r,e,t,i)=>{for(var n=i>1?void 0:i?eQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&Zw(e,t,n),n};let _s=class extends et{constructor(){super(...arguments),this.content="",this.disabled=!1,this.tippy=null,this._contentRef=_t()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=Gi(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!1,placement:"top",zIndex:1e4,appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}updated(){var r,e;this.disabled?(r=this.tippy)==null||r.disable():(e=this.tippy)==null||e.enable()}render(){return _e`
3051
+ `],Rs([Ae({type:Object})],Yi.prototype,"items",2),Rs([Ae({type:Array})],Yi.prototype,"activeItems",2),Rs([gt()],Yi.prototype,"visibleItems",2),Rs([gt()],Yi.prototype,"subItemsActive",2),Yi=Rs([Ft("vmp-menu")],Yi);var eQ=Object.defineProperty,tQ=Object.getOwnPropertyDescriptor,BA=(r,e,t,i)=>{for(var n=i>1?void 0:i?tQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&eQ(e,t,n),n};let _s=class extends et{constructor(){super(...arguments),this.content="",this.disabled=!1,this.tippy=null,this._contentRef=_t()}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{var r;const e=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"),t=e==null?void 0:e.assignedElements()[0];t&&this._contentRef.value&&(this.tippy=Gi(t,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!1,placement:"top",zIndex:1e4,appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}updated(){var r,e;this.disabled?(r=this.tippy)==null||r.disable():(e=this.tippy)==null||e.enable()}render(){return _e`
3052
3052
  <slot></slot>
3053
3053
  <div ${Dt(this._contentRef)} class="content">
3054
3054
  <vmp-text content=${this.content}></vmp-text>
@@ -3067,7 +3067,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3067
3067
  background: var(--colors-dark-800);
3068
3068
  border-radius: var(--radii-medium);
3069
3069
  }
3070
- `],BA([Ae({type:String})],_s.prototype,"content",2),BA([Ae({type:Boolean})],_s.prototype,"disabled",2),_s=BA([Ft("vmp-tooltip")],_s);var tQ=Object.defineProperty,rQ=Object.getOwnPropertyDescriptor,TA=(r,e,t,i)=>{for(var n=i>1?void 0:i?rQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&tQ(e,t,n),n};let Ds=class extends et{constructor(){super(...arguments),this.volume=1,this.muted=!1,this.tippy=null,this._contentRef=_t(),this._anchorRef=_t(),this._menuOpen=!1}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this._anchorRef.value&&this._contentRef.value&&(this.tippy=Gi(this._anchorRef.value,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",interactiveBorder:20,onShow:()=>{this._menuOpen=!0,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this._menuOpen=!1,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}render(){return _e`
3070
+ `],BA([Ae({type:String})],_s.prototype,"content",2),BA([Ae({type:Boolean})],_s.prototype,"disabled",2),_s=BA([Ft("vmp-tooltip")],_s);var rQ=Object.defineProperty,iQ=Object.getOwnPropertyDescriptor,TA=(r,e,t,i)=>{for(var n=i>1?void 0:i?iQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&rQ(e,t,n),n};let Ds=class extends et{constructor(){super(...arguments),this.volume=1,this.muted=!1,this.tippy=null,this._contentRef=_t(),this._anchorRef=_t(),this._menuOpen=!1}connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this._anchorRef.value&&this._contentRef.value&&(this.tippy=Gi(this._anchorRef.value,{content:this._contentRef.value,allowHTML:!0,arrow:!1,animation:"shift-away-subtle",interactive:!0,placement:"top",interactiveBorder:20,onShow:()=>{this._menuOpen=!0,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!0}))},onHide:()=>{this._menuOpen=!1,this.dispatchEvent(new CustomEvent("menu:toggle",{detail:!1}))},appendTo:()=>this.shadowRoot}))})}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this.tippy)==null||r.destroy()}render(){return _e`
3071
3071
  <vmp-icon-button
3072
3072
  ${Dt(this._anchorRef)}
3073
3073
  icon=${this.muted||this.volume===0?"muted":this.volume<1/3?"volume-low":this.volume<2/3?"volume-medium":"volume-high"}
@@ -3215,7 +3215,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3215
3215
  --volume-slider-height: 8px;
3216
3216
  color: var(--colors-light-800);
3217
3217
  }
3218
- `],TA([Ae({type:Number})],Ds.prototype,"volume",2),TA([Ae({type:Boolean})],Ds.prototype,"muted",2),Ds=TA([Ft("vmp-volume-button")],Ds);var iQ=Object.defineProperty,nQ=Object.getOwnPropertyDescriptor,Ta=(r,e,t,i)=>{for(var n=i>1?void 0:i?nQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&iQ(e,t,n),n};let Bn=class extends et{constructor(){super(...arguments),this.duration=0,this.currentTime=0,this.buffer=[],this._containerRef=_t(),this._handleContainerResize=()=>{var r;const e=(r=this._containerRef.value)==null?void 0:r.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:resize",{detail:e,bubbles:!0,composed:!0}))},this._handleMouseEnter=r=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:mouseenter",{detail:{x:r.clientX,y:r.clientY,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseMove=r=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect(),n=(r.clientX-((t==null?void 0:t.left)??0))/((t==null?void 0:t.width)??1);this.dispatchEvent(new CustomEvent("scrubber:mousemove",{detail:{x:r.clientX,y:r.clientY,time:n*this.duration,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseLeave=r=>{this.dispatchEvent(new CustomEvent("scrubber:mouseleave",{detail:{x:r.clientX,y:r.clientY},bubbles:!0,composed:!0}))}}render(){var r;const e=((r=this.buffer)==null?void 0:r.sort((t,i)=>t.start<i.start?-1:i.start<t.start?1:0).reduce((t,{start:i,end:n},s)=>{const o=t[s-1],a=Math.floor(i),c=Math.ceil(n);return t.push({id:i,start:Math.max(0,a),end:Math.min(c,100)}),o&&o.end>=i-1&&(t[s].start=o.end),t},[]))??[];return _e`
3218
+ `],TA([Ae({type:Number})],Ds.prototype,"volume",2),TA([Ae({type:Boolean})],Ds.prototype,"muted",2),Ds=TA([Ft("vmp-volume-button")],Ds);var nQ=Object.defineProperty,sQ=Object.getOwnPropertyDescriptor,Ta=(r,e,t,i)=>{for(var n=i>1?void 0:i?sQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&nQ(e,t,n),n};let Bn=class extends et{constructor(){super(...arguments),this.duration=0,this.currentTime=0,this.buffer=[],this._containerRef=_t(),this._handleContainerResize=()=>{var r;const e=(r=this._containerRef.value)==null?void 0:r.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:resize",{detail:e,bubbles:!0,composed:!0}))},this._handleMouseEnter=r=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect();this.dispatchEvent(new CustomEvent("scrubber:mouseenter",{detail:{x:r.clientX,y:r.clientY,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseMove=r=>{var e;const t=(e=this._containerRef.value)==null?void 0:e.getBoundingClientRect(),n=(r.clientX-((t==null?void 0:t.left)??0))/((t==null?void 0:t.width)??1);this.dispatchEvent(new CustomEvent("scrubber:mousemove",{detail:{x:r.clientX,y:r.clientY,time:n*this.duration,elementLeft:(t==null?void 0:t.left)??0,elementRight:(t==null?void 0:t.right)??document.body.offsetWidth},bubbles:!0,composed:!0}))},this._handleMouseLeave=r=>{this.dispatchEvent(new CustomEvent("scrubber:mouseleave",{detail:{x:r.clientX,y:r.clientY},bubbles:!0,composed:!0}))}}render(){var r;const e=((r=this.buffer)==null?void 0:r.sort((t,i)=>t.start<i.start?-1:i.start<t.start?1:0).reduce((t,{start:i,end:n},s)=>{const o=t[s-1],a=Math.floor(i),c=Math.ceil(n);return t.push({id:i,start:Math.max(0,a),end:Math.min(c,100)}),o&&o.end>=i-1&&(t[s].start=o.end),t},[]))??[];return _e`
3219
3219
  <div
3220
3220
  class="container"
3221
3221
  ${Dt(this._containerRef)}
@@ -3371,7 +3371,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3371
3371
  --player-scrubber-height: 16px;
3372
3372
  color: var(--colors-light-800);
3373
3373
  }
3374
- `],Ta([Ae({type:Number})],Bn.prototype,"duration",2),Ta([Ae({type:Number})],Bn.prototype,"currentTime",2),Ta([Ae({type:Array})],Bn.prototype,"buffer",2),Bn=Ta([Ft("vmp-progress-scrubber")],Bn);var sQ=Object.defineProperty,oQ=Object.getOwnPropertyDescriptor,pt=(r,e,t,i)=>{for(var n=i>1?void 0:i?oQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&sQ(e,t,n),n};let ut=class extends et{constructor(){super(...arguments),this.resizeHider=new Jw(this),this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.languages=[],this.language="en",this.levels=[],this.level=-1,this.playbackRate=1,this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=IA,this.volumeMenuOpen=!1,this.languageMenuOpen=!1,this.levelsMenuOpen=!1,this.playbackRateMenuOpen=!1,this.settingsMenuOpen=!1}_handleNavigateBackClick(){this.dispatchEvent(new CustomEvent("navigate:back",{bubbles:!0,composed:!0}))}_handleNavigateForwardClick(){this.dispatchEvent(new CustomEvent("navigate:forward",{bubbles:!0,composed:!0}))}_handlePlayClick(){this.dispatchEvent(new CustomEvent("play:click",{bubbles:!0,composed:!0,detail:this.playing}))}_handleCaptionsClick(){this.dispatchEvent(new CustomEvent("captions:click",{bubbles:!0,composed:!0,detail:this.captions}))}_handleFullscreenClick(){this.dispatchEvent(new CustomEvent("fullscreen:click",{bubbles:!0,composed:!0,detail:this.fullscreen}))}_handleVolumeMenuToggle({detail:r}){this.volumeMenuOpen=r}_handleLanguageMenuOpen({detail:r}){this.languageMenuOpen=r}_handleLevelsMenuOpen({detail:r}){this.levelsMenuOpen=r}_handlePlaybackMenuToggle({detail:r}){this.playbackRateMenuOpen=r}_handleSettingsMenuToggle({detail:r}){this.settingsMenuOpen=r}hideMenus(){var r,e;(e=Array.from((r=this.shadowRoot)==null?void 0:r.querySelectorAll("vmp-menu, vmp-tooltip, vmp-volume-button")))==null||e.forEach(t=>{var i;(i=t.tippy)==null||i.hide()})}render(){var r,e,t,i,n,s,o,a,c,l,u,A,h,d,f;const g=((r=this.languages)==null?void 0:r.map(Y=>({id:`language-${Y.value}`,event:"language:click",label:Y.label,value:Y.value})))??[],p={title:"Languages",items:g},E={id:"languages",label:"Languages",subItems:p},y=p.items.find(({value:Y})=>Y===this.language),B=((e=this.levels)==null?void 0:e.map((Y,re)=>{const se=Math.min(Y.width,Y.height);return{id:`level-${re.toString()}`,event:"level:click",label:`${se}p`,value:{resolution:se,level:re}}}))??[],C={title:"Quality",items:[...B.reverse(),{id:"level--1",event:"level:click",label:"Auto",value:{level:-1,resolution:"auto"}}]},x={id:"levels",label:"Quality",subItems:C},Q=(t=C.items)==null?void 0:t.find(({value:Y})=>Y.level===this.level),_=[(g==null?void 0:g.length)&&"languages","levels","playback-rate","captions","fullscreen"].filter(Boolean).filter(Y=>{var re;return(re=this.controls)==null?void 0:re.includes(Y)}),M={title:"Settings",items:[(g==null?void 0:g.length)&&E,Qw,Rw,x,_w].filter(Boolean).filter(({id:Y})=>_.includes(Y)&&this.resizeHider.hiddenControls.includes(Y))},P=(i=this.controls)==null?void 0:i.includes("progress"),D=(n=this.controls)==null?void 0:n.includes("navigation"),$=(s=this.controls)==null?void 0:s.includes("play"),K=(o=this.controls)==null?void 0:o.includes("volume"),ee=(a=this.controls)==null?void 0:a.includes("current-time"),Z=(c=this.controls)==null?void 0:c.includes("duration"),L=(l=this.controls)==null?void 0:l.includes("languages"),U=(u=this.controls)==null?void 0:u.includes("levels"),V=(A=this.controls)==null?void 0:A.includes("speed"),k=(h=this.controls)==null?void 0:h.includes("captions"),R=(d=this.controls)==null?void 0:d.includes("fullscreen"),F=$||K||ee||Z||L||U||V||k||R,J=[this.captions&&"captions",this.fullscreen&&"fullscreen",`language-${this.language}`,`level-${(f=this.level)==null?void 0:f.toString()}`,`playback-rate-${this.playbackRate.toString()}`].filter(Boolean);return _e`
3374
+ `],Ta([Ae({type:Number})],Bn.prototype,"duration",2),Ta([Ae({type:Number})],Bn.prototype,"currentTime",2),Ta([Ae({type:Array})],Bn.prototype,"buffer",2),Bn=Ta([Ft("vmp-progress-scrubber")],Bn);var oQ=Object.defineProperty,aQ=Object.getOwnPropertyDescriptor,pt=(r,e,t,i)=>{for(var n=i>1?void 0:i?aQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&oQ(e,t,n),n};let ut=class extends et{constructor(){super(...arguments),this.resizeHider=new jw(this),this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.languages=[],this.language="en",this.levels=[],this.level=-1,this.playbackRate=1,this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=IA,this.volumeMenuOpen=!1,this.languageMenuOpen=!1,this.levelsMenuOpen=!1,this.playbackRateMenuOpen=!1,this.settingsMenuOpen=!1}_handleNavigateBackClick(){this.dispatchEvent(new CustomEvent("navigate:back",{bubbles:!0,composed:!0}))}_handleNavigateForwardClick(){this.dispatchEvent(new CustomEvent("navigate:forward",{bubbles:!0,composed:!0}))}_handlePlayClick(){this.dispatchEvent(new CustomEvent("play:click",{bubbles:!0,composed:!0,detail:this.playing}))}_handleCaptionsClick(){this.dispatchEvent(new CustomEvent("captions:click",{bubbles:!0,composed:!0,detail:this.captions}))}_handleFullscreenClick(){this.dispatchEvent(new CustomEvent("fullscreen:click",{bubbles:!0,composed:!0,detail:this.fullscreen}))}_handleVolumeMenuToggle({detail:r}){this.volumeMenuOpen=r}_handleLanguageMenuOpen({detail:r}){this.languageMenuOpen=r}_handleLevelsMenuOpen({detail:r}){this.levelsMenuOpen=r}_handlePlaybackMenuToggle({detail:r}){this.playbackRateMenuOpen=r}_handleSettingsMenuToggle({detail:r}){this.settingsMenuOpen=r}hideMenus(){var r,e;(e=Array.from((r=this.shadowRoot)==null?void 0:r.querySelectorAll("vmp-menu, vmp-tooltip, vmp-volume-button")))==null||e.forEach(t=>{var i;(i=t.tippy)==null||i.hide()})}render(){var r,e,t,i,n,s,o,a,c,l,u,A,h,d,f;const g=((r=this.languages)==null?void 0:r.map(Y=>({id:`language-${Y.value}`,event:"language:click",label:Y.label,value:Y.value})))??[],p={title:"Languages",items:g},E={id:"languages",label:"Languages",subItems:p},y=p.items.find(({value:Y})=>Y===this.language),B=((e=this.levels)==null?void 0:e.map((Y,re)=>{const se=Math.min(Y.width,Y.height);return{id:`level-${re.toString()}`,event:"level:click",label:`${se}p`,value:{resolution:se,level:re}}}))??[],C={title:"Quality",items:[...B.reverse(),{id:"level--1",event:"level:click",label:"Auto",value:{level:-1,resolution:"auto"}}]},x={id:"levels",label:"Quality",subItems:C},Q=(t=C.items)==null?void 0:t.find(({value:Y})=>Y.level===this.level),_=[(g==null?void 0:g.length)&&"languages","levels","playback-rate","captions","fullscreen"].filter(Boolean).filter(Y=>{var re;return(re=this.controls)==null?void 0:re.includes(Y)}),M={title:"Settings",items:[(g==null?void 0:g.length)&&E,Rw,_w,x,Dw].filter(Boolean).filter(({id:Y})=>_.includes(Y)&&this.resizeHider.hiddenControls.includes(Y))},P=(i=this.controls)==null?void 0:i.includes("progress"),D=(n=this.controls)==null?void 0:n.includes("navigation"),$=(s=this.controls)==null?void 0:s.includes("play"),K=(o=this.controls)==null?void 0:o.includes("volume"),ee=(a=this.controls)==null?void 0:a.includes("current-time"),Z=(c=this.controls)==null?void 0:c.includes("duration"),L=(l=this.controls)==null?void 0:l.includes("languages"),U=(u=this.controls)==null?void 0:u.includes("levels"),V=(A=this.controls)==null?void 0:A.includes("speed"),k=(h=this.controls)==null?void 0:h.includes("captions"),R=(d=this.controls)==null?void 0:d.includes("fullscreen"),F=$||K||ee||Z||L||U||V||k||R,J=[this.captions&&"captions",this.fullscreen&&"fullscreen",`language-${this.language}`,`level-${(f=this.level)==null?void 0:f.toString()}`,`playback-rate-${this.playbackRate.toString()}`].filter(Boolean);return _e`
3375
3375
  <div
3376
3376
  ${this.resizeHider.measure()}
3377
3377
  ${this.resizeHider.contain()}
@@ -3583,13 +3583,13 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3583
3583
  .hidden {
3584
3584
  display: none;
3585
3585
  }
3586
- `],pt([Ae({type:Boolean})],ut.prototype,"playing",2),pt([Ae({type:Number})],ut.prototype,"volume",2),pt([Ae({type:Boolean})],ut.prototype,"muted",2),pt([Ae({type:Number})],ut.prototype,"currentTime",2),pt([Ae({type:Number})],ut.prototype,"duration",2),pt([Ae({type:Array})],ut.prototype,"languages",2),pt([Ae({type:String})],ut.prototype,"language",2),pt([Ae({type:Array,attribute:!1})],ut.prototype,"levels",2),pt([Ae({type:Number})],ut.prototype,"level",2),pt([Ae({type:Number})],ut.prototype,"playbackRate",2),pt([Ae({type:Array})],ut.prototype,"buffer",2),pt([Ae({type:Boolean})],ut.prototype,"captions",2),pt([Ae({type:Boolean})],ut.prototype,"fullscreen",2),pt([Ae({type:Array})],ut.prototype,"controls",2),pt([gt()],ut.prototype,"volumeMenuOpen",2),pt([gt()],ut.prototype,"languageMenuOpen",2),pt([gt()],ut.prototype,"levelsMenuOpen",2),pt([gt()],ut.prototype,"playbackRateMenuOpen",2),pt([gt()],ut.prototype,"settingsMenuOpen",2),ut=pt([Ft("vmp-player-controls")],ut);var aQ=Object.defineProperty,lQ=Object.getOwnPropertyDescriptor,cQ=(r,e,t,i)=>{for(var n=i>1?void 0:i?lQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&aQ(e,t,n),n};let bA=class extends et{render(){return _e`<vmp-icon icon="loading"></vmp-icon>`}};bA.styles=[et.styles??[],xt`
3586
+ `],pt([Ae({type:Boolean})],ut.prototype,"playing",2),pt([Ae({type:Number})],ut.prototype,"volume",2),pt([Ae({type:Boolean})],ut.prototype,"muted",2),pt([Ae({type:Number})],ut.prototype,"currentTime",2),pt([Ae({type:Number})],ut.prototype,"duration",2),pt([Ae({type:Array})],ut.prototype,"languages",2),pt([Ae({type:String})],ut.prototype,"language",2),pt([Ae({type:Array,attribute:!1})],ut.prototype,"levels",2),pt([Ae({type:Number})],ut.prototype,"level",2),pt([Ae({type:Number})],ut.prototype,"playbackRate",2),pt([Ae({type:Array})],ut.prototype,"buffer",2),pt([Ae({type:Boolean})],ut.prototype,"captions",2),pt([Ae({type:Boolean})],ut.prototype,"fullscreen",2),pt([Ae({type:Array})],ut.prototype,"controls",2),pt([gt()],ut.prototype,"volumeMenuOpen",2),pt([gt()],ut.prototype,"languageMenuOpen",2),pt([gt()],ut.prototype,"levelsMenuOpen",2),pt([gt()],ut.prototype,"playbackRateMenuOpen",2),pt([gt()],ut.prototype,"settingsMenuOpen",2),ut=pt([Ft("vmp-player-controls")],ut);var lQ=Object.defineProperty,cQ=Object.getOwnPropertyDescriptor,AQ=(r,e,t,i)=>{for(var n=i>1?void 0:i?cQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&lQ(e,t,n),n};let bA=class extends et{render(){return _e`<vmp-icon icon="loading"></vmp-icon>`}};bA.styles=[et.styles??[],xt`
3587
3587
  :host {
3588
3588
  display: flex;
3589
3589
  align-items: center;
3590
3590
  justify-content: center;
3591
3591
  }
3592
- `],bA=cQ([Ft("vmp-loading-spinner")],bA);var AQ=Object.defineProperty,uQ=Object.getOwnPropertyDescriptor,sp=(r,e,t,i)=>{for(var n=i>1?void 0:i?uQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&AQ(e,t,n),n};let ba=class extends et{constructor(){super(...arguments),this.caption=""}render(){return _e`
3592
+ `],bA=AQ([Ft("vmp-loading-spinner")],bA);var uQ=Object.defineProperty,hQ=Object.getOwnPropertyDescriptor,sp=(r,e,t,i)=>{for(var n=i>1?void 0:i?hQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&uQ(e,t,n),n};let ba=class extends et{constructor(){super(...arguments),this.caption=""}render(){return _e`
3593
3593
  <div class="container">
3594
3594
  <vmp-text content=${this.caption} size="large"></vmp-text>
3595
3595
  </div>
@@ -3612,7 +3612,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3612
3612
  /* Line height controls the spacing between the cloned boxes so has to override the default */
3613
3613
  line-height: 2.2;
3614
3614
  }
3615
- `],sp([Ae({type:String})],ba.prototype,"caption",2),ba=sp([Ft("vmp-captions")],ba);var hQ=Object.defineProperty,dQ=Object.getOwnPropertyDescriptor,St=(r,e,t,i)=>{for(var n=i>1?void 0:i?dQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&hQ(e,t,n),n};const fQ=3e3;let mt=class extends et{constructor(){super(...arguments),this.loading=!1,this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.languages=[],this.language="en",this.levels=[],this.level=-1,this.playbackRate=1,this.caption="",this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=IA,this.showControls=!0,this._hasTouched=!1,this._playerControlsRef=_t()}_startHideControls(){clearTimeout(this._controlHideTimeout),this._controlHideTimeout=setTimeout(()=>{this.showControls=!1,this._hasTouched=!1},fQ)}_immediateShowControls(){this.showControls=!0,clearTimeout(this._controlHideTimeout)}_immediateHideControls(){this.showControls=!1,this._hasTouched=!1,clearTimeout(this._controlHideTimeout)}willUpdate(r){var e;r.has("playing")&&this.playing&&this._startHideControls(),r.has("showControls")&&this.playing&&!this.showControls&&((e=this._playerControlsRef.value)==null||e.hideMenus())}render(){var r;const e=(r=this.controls)==null?void 0:r.includes("play-large"),t=this.playing&&!this.showControls,i=!!(e&&!this.playing);return _e`
3615
+ `],sp([Ae({type:String})],ba.prototype,"caption",2),ba=sp([Ft("vmp-captions")],ba);var dQ=Object.defineProperty,fQ=Object.getOwnPropertyDescriptor,St=(r,e,t,i)=>{for(var n=i>1?void 0:i?fQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&dQ(e,t,n),n};const gQ=3e3;let mt=class extends et{constructor(){super(...arguments),this.loading=!1,this.playing=!1,this.volume=1,this.muted=!1,this.currentTime=0,this.duration=0,this.languages=[],this.language="en",this.levels=[],this.level=-1,this.playbackRate=1,this.caption="",this.buffer=[],this.captions=!1,this.fullscreen=!1,this.controls=IA,this.showControls=!0,this._hasTouched=!1,this._playerControlsRef=_t()}_startHideControls(){clearTimeout(this._controlHideTimeout),this._controlHideTimeout=setTimeout(()=>{this.showControls=!1,this._hasTouched=!1},gQ)}_immediateShowControls(){this.showControls=!0,clearTimeout(this._controlHideTimeout)}_immediateHideControls(){this.showControls=!1,this._hasTouched=!1,clearTimeout(this._controlHideTimeout)}willUpdate(r){var e;r.has("playing")&&this.playing&&this._startHideControls(),r.has("showControls")&&this.playing&&!this.showControls&&((e=this._playerControlsRef.value)==null||e.hideMenus())}render(){var r;const e=(r=this.controls)==null?void 0:r.includes("play-large"),t=this.playing&&!this.showControls,i=!!(e&&!this.playing);return _e`
3616
3616
  <div
3617
3617
  class=${it({container:!0,hide:t})}
3618
3618
  @mousemove=${()=>{this._immediateShowControls(),this._startHideControls()}}
@@ -3732,7 +3732,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3732
3732
  vmp-captions.hiddenControls {
3733
3733
  transform: translateY(calc(var(--space-small) * -1));
3734
3734
  }
3735
- `],St([Ae({type:Boolean})],mt.prototype,"loading",2),St([Ae({type:Boolean})],mt.prototype,"playing",2),St([Ae({type:Number})],mt.prototype,"volume",2),St([Ae({type:Boolean})],mt.prototype,"muted",2),St([Ae({type:Number})],mt.prototype,"currentTime",2),St([Ae({type:Number})],mt.prototype,"duration",2),St([Ae({type:Array})],mt.prototype,"languages",2),St([Ae({type:String})],mt.prototype,"language",2),St([Ae({type:Array,attribute:!1})],mt.prototype,"levels",2),St([Ae({type:Number})],mt.prototype,"level",2),St([Ae({type:Number})],mt.prototype,"playbackRate",2),St([Ae({type:String})],mt.prototype,"caption",2),St([Ae({type:Array})],mt.prototype,"buffer",2),St([Ae({type:Boolean})],mt.prototype,"captions",2),St([Ae({type:Boolean})],mt.prototype,"fullscreen",2),St([Ae({type:Array})],mt.prototype,"controls",2),St([gt()],mt.prototype,"showControls",2),mt=St([Ft("vmp-player-overlay")],mt);var gQ=Object.defineProperty,pQ=Object.getOwnPropertyDescriptor,ht=(r,e,t,i)=>{for(var n=i>1?void 0:i?pQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&gQ(e,t,n),n};const op=new WeakMap,mQ=1e3/60,EQ=30;let st=class extends et{constructor(){super(...arguments),this.debug=!1,this.propAspectRatio=0,this.preload="auto",this.autoplay=!1,this.loading=!1,this.disabled=!1,this.dataResolver=$l,this.languageResolver=Hy,this._sceneController=new Sw(this),this._drawController=new hw(this),this._observer=null,this._wasPlaying=!1,this._manualMute=this.muted,this._seekerRAF=null,this._seekerTimeout=null,this._lastWaiting=!1,this._lastTimestamp=null,this._lastCurrentTime=null,this._pageHidden=document.visibilityState==="hidden",this._aspectRatio=this.propAspectRatio,this._processing=!1,this._waiting=!1,this._errors=[],this._seeking=!1,this._language=this.propLanguage,this._languages=[],this._captions=!1,this._fullscreen=!1,this._playerRef=_t(),this._canvasRef=_t(),this._initialised=null,this._paused=!0,this._playbackRate=1,this._volume=null,this._muted=null,this._videoResolution=-1,this._handleContainerResize=()=>{var r;if((r=this.shadowRoot)!=null&&r.host){const e=this.shadowRoot.host.clientWidth,t=this.shadowRoot.host.clientHeight;if(e<=0||t<=0)return;this.propAspectRatio||(this._aspectRatio=e/t),Object.values(this.media).forEach(({node:i})=>{i instanceof HTMLVideoElement&&(i.width=e,i.height=t)}),this._updateHlsLevelCap(e,t)}},this._handleCanvasResize=()=>{this.draw()},this._loop=()=>{this._endLoop(),this._pageHidden?this._seekerTimeout=setTimeout(this._seeker,mQ):this._seekerRAF=requestAnimationFrame(this._seeker)},this._endLoop=()=>{this._seekerRAF&&cancelAnimationFrame(this._seekerRAF),this._seekerTimeout&&clearTimeout(this._seekerTimeout),this._seekerRAF=null,this._seekerTimeout=null},this._seeker=(r=performance.now())=>{if(this.composition){if(this._waiting=this._drawController.activeScenes.some(({id:e,layout:t})=>Lr(t.node).some(({key:n})=>{const s=$t(e,n);if(this.media[s]&&this.mediaState[s]){const o=this.media[s],a=this.mediaState[s];return!a||!a.initialised||a.waiting||o.node.readyState<3}})),this.waiting?(this._lastTimestamp=null,this._lastWaiting||this.dispatchEvent(new CustomEvent("waiting"))):this._lastWaiting&&this.dispatchEvent(new CustomEvent("playing")),r-(this._lastTimestamp??0)>1e3/EQ){let e=this._drawController.currentTime;const t=(r-(this._lastTimestamp??r))/1e3*this.playbackRate;this.activeScenes.every(({id:n,layout:s},o)=>Lr(s.node).every(({key:c},l)=>{var u,A;const h=$t(n,c),d=this.media[h];return d.node.ended||d.loop?!0:((A=(u=this._lastCurrentTime)==null?void 0:u[o])==null?void 0:A[l])!==d.node.currentTime}))&&(e+=t),this._lastCurrentTime=this.activeScenes.map(({id:n,layout:s})=>Lr(s.node).map(({key:a})=>{const c=$t(n,a);return this.media[c].node.currentTime})),this._drawController.currentTime=e,this._lastTimestamp=r}this._lastWaiting=this._waiting,this._drawController.currentTime>=this.duration&&(this.pause(),this.dispatchEvent(new CustomEvent("ended")))}this.paused||this._loop()},this._handleError=r=>{this._errors=[...this.errors,r.error],r.error.fatal&&this.pause()},this._handleFullscreenChange=()=>{var r;const e=!!(((r=this.shadowRoot)==null?void 0:r.fullscreenElement)??document.fullscreenElement===this),t=this._fullscreen;this._fullscreen=e,e?(this._aspectRatio=window.screen.width/window.screen.height,this._updateHlsLevelCap(window.screen.width,window.screen.height,!0)):t&&(this.propAspectRatio&&(this._aspectRatio=this.propAspectRatio),requestAnimationFrame(()=>{var i;this._handleContainerResize(),(i=this.shadowRoot)!=null&&i.host&&this._updateHlsLevelCap(this.shadowRoot.host.clientWidth,this.shadowRoot.host.clientHeight,!0)}))},this._handleVisibilityChange=()=>{this._pageHidden=document.visibilityState==="hidden",this.paused||this._loop()}}get aspectRatio(){return this._aspectRatio}get processing(){return this._processing}get waiting(){return!this.paused&&this._waiting}get errors(){return this._errors}get seeking(){return this._seeking}get language(){return this._language}get languages(){return this._languages}get captions(){return this._captions}get fullscreen(){return this._fullscreen}get playerElement(){return this._playerRef.value??null}get canvasElement(){return this._canvasRef.value??null}get initialised(){return this._initialised=this._initialised??new Promise(r=>{const e=setInterval(()=>{!!this.errors.find(i=>i.fatal)&&r(!1),!this.loading&&!this.processing&&this.composition&&this.duration>0&&r(!0)},500);setTimeout(()=>{clearInterval(e),r(!1)},60*1e3)}),this._initialised}get duration(){return this._sceneController.duration}get media(){return this._sceneController.media??{}}get mediaState(){return this._sceneController.mediaState}get composition(){return this._sceneController.composition}envelopeGain(r,e){const{composition:t}=this;if(!t)return 1;let i=op.get(t);i||(i=Ty(t),op.set(t,i));const n=i.get(r);return n?by(n,this.currentTime-e):1}get activeScenes(){return this._drawController.activeScenes}set paused(r){r!==this._paused&&(this._paused=r,this.requestUpdate(),this.dispatchEvent(new CustomEvent(r?"pause":"play")))}get paused(){return this._paused}set playbackRate(r){r!==this._playbackRate&&(this._playbackRate=r,Object.values(this.media).forEach(({node:e,speed:t})=>{e.playbackRate=di(.1,r*t,4)}),this.requestUpdate(),this.dispatchEvent(new CustomEvent("ratechange",{detail:r})))}get playbackRate(){return this._playbackRate}set volume(r){const e=di(0,r,1);e!==this._volume&&(Object.values(this.media).forEach(({node:t,volume:i})=>{t.volume=e*i}),localStorage.setItem("vmp-player-volume/v2",e.toString()),this._volume=e,this._drawController.loadScenes(),e>0&&(this.muted=!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:r})))}get volume(){return this._volume??(this._volume=parseFloat(localStorage.getItem("vmp-player-volume/v2")??"1"))}set muted(r){Object.values(this.media).forEach(({node:e,volume:t})=>{e.muted=t===0||r}),r!==this._muted&&(this._muted=r,localStorage.setItem("vmp-player-muted/v2",r.toString()),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:r?0:this.volume})))}get muted(){return this._muted??(this._muted=this.autoplay||localStorage.getItem("vmp-player-muted/v2")==="true")}get _hlsLevels(){for(const r of Object.values(this.media))if(r.hls&&r.hls.levels.length>0){const e=new Map;for(const t of r.hls.levels){const i=Math.min(t.height,t.width),n=e.get(i);(!n||(t.bitrate??0)>(n.bitrate??0))&&e.set(i,t)}return[...e.values()]}return[]}get _currentLevel(){return this._videoResolution===-1?-1:this._hlsLevels.findIndex(r=>Math.min(r.height,r.width)===this._videoResolution)}set videoResolution(r){var e;r!==this._videoResolution&&(this._videoResolution=r,Object.values(this.media).forEach(({hls:t})=>{if(t)if(r===-1)t.nextLevel=-1;else{const i=t.levels.reduce((n,s,o)=>Math.min(s.height,s.width)!==r?n:n===-1||(s.bitrate??0)>(t.levels[n].bitrate??0)?o:n,-1);i!==-1&&(t.nextLevel=i,t.autoLevelCapping=i)}}),r===-1&&((e=this.shadowRoot)!=null&&e.host)&&this._updateHlsLevelCap(this.shadowRoot.host.clientWidth,this.shadowRoot.host.clientHeight),this.requestUpdate())}get videoResolution(){return this._videoResolution}set currentTime(r){r!==this._drawController.currentTime&&(this._drawController.currentTime=r,this._sceneController.setMediaCurrentTime(r))}get currentTime(){return this._drawController.currentTime}_updateHlsLevelCap(r,e,t=!1){if(r<=0||e<=0||this._videoResolution!==-1)return;const i=window.devicePixelRatio||1,n=Math.min(r,e)*i;Object.values(this.media).forEach(({hls:s})=>{if(s&&s.levels.length>0){let o=0;for(let a=s.levels.length-1;a>=0;a--)if(Math.min(s.levels[a].width,s.levels[a].height)<=n){o=a;break}s.autoLevelCapping=o,t&&(s.nextLevel=o)}})}reset(r=0,e=!1){this._lastTimestamp=null,this._lastCurrentTime=null,this._drawController.currentTime=r,this._sceneController.setMediaCurrentTime(r),e?this.play():this.pause()}clear(){this._drawController.clear()}play(){this.paused=!1,this._lastTimestamp=null,this._lastCurrentTime=null,this.duration>0&&this._drawController.currentTime>=this.duration&&this.reset(0,!0),this._loop()}pause(){this._endLoop(),this.paused=!0,Object.values(this.media).forEach(({node:r})=>{r.pause()})}draw(r,e){return this._drawController.draw(r,e)}drawConfig(r){var e,t,i,n,s,o,a,c,l,u,A;if(!this.composition||!r)return;const h=new Map;for(const d of r.tracks)for(const f of d){if(!("id"in f)||!("type"in f))continue;const g=f;for(const p of this.composition.tracks){const E=p.scenes.find(Q=>Q.id===g.id);if(!E)continue;const y=E.layout.node;typeof g.x=="number"&&(y.x=g.x),typeof g.y=="number"&&(y.y=g.y),typeof g.width=="number"&&(y.width=g.width),typeof g.height=="number"&&(y.height=g.height);const B={};let C=!1;const x=(n=(i=(t=(e=g.root)==null?void 0:e.element)==null?void 0:t.layout)==null?void 0:i.transform)==null?void 0:n.rotation;typeof x=="number"&&(B.rotation=x,C=!0),((c=(a=(o=(s=g.root)==null?void 0:s.element)==null?void 0:o.options)==null?void 0:a.font)==null?void 0:c.size)!=null&&(B.fontSize=g.root.element.options.font.size,C=!0),((A=(u=(l=g.root)==null?void 0:l.element)==null?void 0:u.options)==null?void 0:A.value)!==void 0&&(B.textValue=g.root.element.options.value,C=!0),C&&h.set(g.id,B);break}}this.draw(void 0,h.size>0?h:void 0)}toggleFullscreen(r){r??this.fullscreen?ww():this._playerRef.value&&xw(this._playerRef.value)}connectedCallback(){var r;super.connectedCallback(),this.addEventListener("error",this._handleError),document.addEventListener("fullscreenchange",this._handleFullscreenChange),document.addEventListener("webkitfullscreenchange",this._handleFullscreenChange),document.addEventListener("visibilitychange",this._handleVisibilityChange),(r=this.shadowRoot)!=null&&r.host&&(this._observer=new ResizeObserver(this._handleContainerResize),this._observer.observe(this.shadowRoot.host))}willUpdate(r){r.has("propAspectRatio")&&(this._aspectRatio=this.propAspectRatio),r.has("propLanguage")&&(this._language=this.propLanguage)}updated(r){var e;r.has("propAspectRatio")&&!this.propAspectRatio&&this._handleContainerResize(),this.autoplay&&!this._sceneController.hasPlayed&&!this.processing&&r.get("_processing")&&this.play(),r.has("_processing")&&this.processing&&this.dispatchEvent(new CustomEvent("processing")),r.has("_processing")&&!this.processing&&r.get("_processing")&&(e=this.shadowRoot)!=null&&e.host&&this._updateHlsLevelCap(this.shadowRoot.host.clientWidth,this.shadowRoot.host.clientHeight)}disconnectedCallback(){var r,e;super.disconnectedCallback(),(r=this._observer)==null||r.disconnect(),(e=this.composition)==null||e.cleanup(),document.removeEventListener("fullscreenchange",this._handleFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._handleFullscreenChange),document.removeEventListener("visibilitychange",this._handleVisibilityChange)}_renderStyles(){return this.propAspectRatio?typeof this.propAspectRatio=="number"?_e`
3735
+ `],St([Ae({type:Boolean})],mt.prototype,"loading",2),St([Ae({type:Boolean})],mt.prototype,"playing",2),St([Ae({type:Number})],mt.prototype,"volume",2),St([Ae({type:Boolean})],mt.prototype,"muted",2),St([Ae({type:Number})],mt.prototype,"currentTime",2),St([Ae({type:Number})],mt.prototype,"duration",2),St([Ae({type:Array})],mt.prototype,"languages",2),St([Ae({type:String})],mt.prototype,"language",2),St([Ae({type:Array,attribute:!1})],mt.prototype,"levels",2),St([Ae({type:Number})],mt.prototype,"level",2),St([Ae({type:Number})],mt.prototype,"playbackRate",2),St([Ae({type:String})],mt.prototype,"caption",2),St([Ae({type:Array})],mt.prototype,"buffer",2),St([Ae({type:Boolean})],mt.prototype,"captions",2),St([Ae({type:Boolean})],mt.prototype,"fullscreen",2),St([Ae({type:Array})],mt.prototype,"controls",2),St([gt()],mt.prototype,"showControls",2),mt=St([Ft("vmp-player-overlay")],mt);var pQ=Object.defineProperty,mQ=Object.getOwnPropertyDescriptor,ht=(r,e,t,i)=>{for(var n=i>1?void 0:i?mQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&pQ(e,t,n),n};const op=new WeakMap,EQ=1e3/60,IQ=30;let st=class extends et{constructor(){super(...arguments),this.debug=!1,this.propAspectRatio=0,this.preload="auto",this.autoplay=!1,this.loading=!1,this.disabled=!1,this.dataResolver=$l,this.languageResolver=Hy,this._sceneController=new xw(this),this._drawController=new hw(this),this._observer=null,this._wasPlaying=!1,this._manualMute=this.muted,this._seekerRAF=null,this._seekerTimeout=null,this._lastWaiting=!1,this._lastTimestamp=null,this._lastCurrentTime=null,this._pageHidden=document.visibilityState==="hidden",this._aspectRatio=this.propAspectRatio,this._processing=!1,this._waiting=!1,this._errors=[],this._seeking=!1,this._language=this.propLanguage,this._languages=[],this._captions=!1,this._fullscreen=!1,this._playerRef=_t(),this._canvasRef=_t(),this._initialised=null,this._paused=!0,this._playbackRate=1,this._volume=null,this._muted=null,this._videoResolution=-1,this._handleContainerResize=()=>{var r;if((r=this.shadowRoot)!=null&&r.host){const e=this.shadowRoot.host.clientWidth,t=this.shadowRoot.host.clientHeight;if(e<=0||t<=0)return;this.propAspectRatio||(this._aspectRatio=e/t),Object.values(this.media).forEach(({node:i})=>{i instanceof HTMLVideoElement&&(i.width=e,i.height=t)}),this._updateHlsLevelCap(e,t)}},this._handleCanvasResize=()=>{this.draw()},this._loop=()=>{this._endLoop(),this._pageHidden?this._seekerTimeout=setTimeout(this._seeker,EQ):this._seekerRAF=requestAnimationFrame(this._seeker)},this._endLoop=()=>{this._seekerRAF&&cancelAnimationFrame(this._seekerRAF),this._seekerTimeout&&clearTimeout(this._seekerTimeout),this._seekerRAF=null,this._seekerTimeout=null},this._seeker=(r=performance.now())=>{if(this.composition){if(this._waiting=this._drawController.activeScenes.some(({id:e,layout:t})=>Lr(t.node).some(({key:n})=>{const s=$t(e,n);if(this.media[s]&&this.mediaState[s]){const o=this.media[s],a=this.mediaState[s];return!a||!a.initialised||a.waiting||o.node.readyState<3}})),this.waiting?(this._lastTimestamp=null,this._lastWaiting||this.dispatchEvent(new CustomEvent("waiting"))):this._lastWaiting&&this.dispatchEvent(new CustomEvent("playing")),r-(this._lastTimestamp??0)>1e3/IQ){let e=this._drawController.currentTime;const t=(r-(this._lastTimestamp??r))/1e3*this.playbackRate;this.activeScenes.every(({id:n,layout:s},o)=>Lr(s.node).every(({key:c},l)=>{var u,A;const h=$t(n,c),d=this.media[h];return d.node.ended||d.loop?!0:((A=(u=this._lastCurrentTime)==null?void 0:u[o])==null?void 0:A[l])!==d.node.currentTime}))&&(e+=t),this._lastCurrentTime=this.activeScenes.map(({id:n,layout:s})=>Lr(s.node).map(({key:a})=>{const c=$t(n,a);return this.media[c].node.currentTime})),this._drawController.currentTime=e,this._lastTimestamp=r}this._lastWaiting=this._waiting,this._drawController.currentTime>=this.duration&&(this.pause(),this.dispatchEvent(new CustomEvent("ended")))}this.paused||this._loop()},this._handleError=r=>{this._errors=[...this.errors,r.error],r.error.fatal&&this.pause()},this._handleFullscreenChange=()=>{var r;const e=!!(((r=this.shadowRoot)==null?void 0:r.fullscreenElement)??document.fullscreenElement===this),t=this._fullscreen;this._fullscreen=e,e?(this._aspectRatio=window.screen.width/window.screen.height,this._updateHlsLevelCap(window.screen.width,window.screen.height,!0)):t&&(this.propAspectRatio&&(this._aspectRatio=this.propAspectRatio),requestAnimationFrame(()=>{var i;this._handleContainerResize(),(i=this.shadowRoot)!=null&&i.host&&this._updateHlsLevelCap(this.shadowRoot.host.clientWidth,this.shadowRoot.host.clientHeight,!0)}))},this._handleVisibilityChange=()=>{this._pageHidden=document.visibilityState==="hidden",this.paused||this._loop()}}get aspectRatio(){return this._aspectRatio}get processing(){return this._processing}get waiting(){return!this.paused&&this._waiting}get errors(){return this._errors}get seeking(){return this._seeking}get language(){return this._language}get languages(){return this._languages}get captions(){return this._captions}get fullscreen(){return this._fullscreen}get playerElement(){return this._playerRef.value??null}get canvasElement(){return this._canvasRef.value??null}get initialised(){return this._initialised=this._initialised??new Promise(r=>{const e=setInterval(()=>{!!this.errors.find(i=>i.fatal)&&r(!1),!this.loading&&!this.processing&&this.composition&&this.duration>0&&r(!0)},500);setTimeout(()=>{clearInterval(e),r(!1)},60*1e3)}),this._initialised}get duration(){return this._sceneController.duration}get media(){return this._sceneController.media??{}}get mediaState(){return this._sceneController.mediaState}get composition(){return this._sceneController.composition}envelopeGain(r,e){const{composition:t}=this;if(!t)return 1;let i=op.get(t);i||(i=Ty(t),op.set(t,i));const n=i.get(r);return n?by(n,this.currentTime-e):1}get activeScenes(){return this._drawController.activeScenes}set paused(r){r!==this._paused&&(this._paused=r,this.requestUpdate(),this.dispatchEvent(new CustomEvent(r?"pause":"play")))}get paused(){return this._paused}set playbackRate(r){r!==this._playbackRate&&(this._playbackRate=r,Object.values(this.media).forEach(({node:e,speed:t})=>{e.playbackRate=di(.1,r*t,4)}),this.requestUpdate(),this.dispatchEvent(new CustomEvent("ratechange",{detail:r})))}get playbackRate(){return this._playbackRate}set volume(r){const e=di(0,r,1);e!==this._volume&&(Object.values(this.media).forEach(({node:t,volume:i})=>{t.volume=e*i}),localStorage.setItem("vmp-player-volume/v2",e.toString()),this._volume=e,this._drawController.loadScenes(),e>0&&(this.muted=!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:r})))}get volume(){return this._volume??(this._volume=parseFloat(localStorage.getItem("vmp-player-volume/v2")??"1"))}set muted(r){Object.values(this.media).forEach(({node:e,volume:t})=>{e.muted=t===0||r}),r!==this._muted&&(this._muted=r,localStorage.setItem("vmp-player-muted/v2",r.toString()),this.requestUpdate(),this.dispatchEvent(new CustomEvent("volumechange",{detail:r?0:this.volume})))}get muted(){return this._muted??(this._muted=this.autoplay||localStorage.getItem("vmp-player-muted/v2")==="true")}get _hlsLevels(){for(const r of Object.values(this.media))if(r.hls&&r.hls.levels.length>0){const e=new Map;for(const t of r.hls.levels){const i=Math.min(t.height,t.width),n=e.get(i);(!n||(t.bitrate??0)>(n.bitrate??0))&&e.set(i,t)}return[...e.values()]}return[]}get _currentLevel(){return this._videoResolution===-1?-1:this._hlsLevels.findIndex(r=>Math.min(r.height,r.width)===this._videoResolution)}set videoResolution(r){var e;r!==this._videoResolution&&(this._videoResolution=r,Object.values(this.media).forEach(({hls:t})=>{if(t)if(r===-1)t.nextLevel=-1;else{const i=t.levels.reduce((n,s,o)=>Math.min(s.height,s.width)!==r?n:n===-1||(s.bitrate??0)>(t.levels[n].bitrate??0)?o:n,-1);i!==-1&&(t.nextLevel=i,t.autoLevelCapping=i)}}),r===-1&&((e=this.shadowRoot)!=null&&e.host)&&this._updateHlsLevelCap(this.shadowRoot.host.clientWidth,this.shadowRoot.host.clientHeight),this.requestUpdate())}get videoResolution(){return this._videoResolution}set currentTime(r){r!==this._drawController.currentTime&&(this._drawController.currentTime=r,this._sceneController.setMediaCurrentTime(r))}get currentTime(){return this._drawController.currentTime}_updateHlsLevelCap(r,e,t=!1){if(r<=0||e<=0||this._videoResolution!==-1)return;const i=window.devicePixelRatio||1,n=Math.min(r,e)*i;Object.values(this.media).forEach(({hls:s})=>{if(s&&s.levels.length>0){let o=0;for(let a=s.levels.length-1;a>=0;a--)if(Math.min(s.levels[a].width,s.levels[a].height)<=n){o=a;break}s.autoLevelCapping=o,t&&(s.nextLevel=o)}})}reset(r=0,e=!1){this._lastTimestamp=null,this._lastCurrentTime=null,this._drawController.currentTime=r,this._sceneController.setMediaCurrentTime(r),e?this.play():this.pause()}clear(){this._drawController.clear()}play(){this.paused=!1,this._lastTimestamp=null,this._lastCurrentTime=null,this.duration>0&&this._drawController.currentTime>=this.duration&&this.reset(0,!0),this._loop()}pause(){this._endLoop(),this.paused=!0,Object.values(this.media).forEach(({node:r})=>{r.pause()})}draw(r,e){return this._drawController.draw(r,e)}drawConfig(r){var e,t,i,n,s,o,a,c,l,u,A;if(!this.composition||!r)return;const h=new Map;for(const d of r.tracks)for(const f of d){if(!("id"in f)||!("type"in f))continue;const g=f;for(const p of this.composition.tracks){const E=p.scenes.find(Q=>Q.id===g.id);if(!E)continue;const y=E.layout.node;typeof g.x=="number"&&(y.x=g.x),typeof g.y=="number"&&(y.y=g.y),typeof g.width=="number"&&(y.width=g.width),typeof g.height=="number"&&(y.height=g.height);const B={};let C=!1;const x=(n=(i=(t=(e=g.root)==null?void 0:e.element)==null?void 0:t.layout)==null?void 0:i.transform)==null?void 0:n.rotation;typeof x=="number"&&(B.rotation=x,C=!0),((c=(a=(o=(s=g.root)==null?void 0:s.element)==null?void 0:o.options)==null?void 0:a.font)==null?void 0:c.size)!=null&&(B.fontSize=g.root.element.options.font.size,C=!0),((A=(u=(l=g.root)==null?void 0:l.element)==null?void 0:u.options)==null?void 0:A.value)!==void 0&&(B.textValue=g.root.element.options.value,C=!0),C&&h.set(g.id,B);break}}this.draw(void 0,h.size>0?h:void 0)}toggleFullscreen(r){r??this.fullscreen?Qw():this._playerRef.value&&ww(this._playerRef.value)}connectedCallback(){var r;super.connectedCallback(),this.addEventListener("error",this._handleError),document.addEventListener("fullscreenchange",this._handleFullscreenChange),document.addEventListener("webkitfullscreenchange",this._handleFullscreenChange),document.addEventListener("visibilitychange",this._handleVisibilityChange),(r=this.shadowRoot)!=null&&r.host&&(this._observer=new ResizeObserver(this._handleContainerResize),this._observer.observe(this.shadowRoot.host))}willUpdate(r){r.has("propAspectRatio")&&(this._aspectRatio=this.propAspectRatio),r.has("propLanguage")&&(this._language=this.propLanguage)}updated(r){var e;r.has("propAspectRatio")&&!this.propAspectRatio&&this._handleContainerResize(),this.autoplay&&!this._sceneController.hasPlayed&&!this.processing&&r.get("_processing")&&this.play(),r.has("_processing")&&this.processing&&this.dispatchEvent(new CustomEvent("processing")),r.has("_processing")&&!this.processing&&r.get("_processing")&&(e=this.shadowRoot)!=null&&e.host&&this._updateHlsLevelCap(this.shadowRoot.host.clientWidth,this.shadowRoot.host.clientHeight)}disconnectedCallback(){var r,e;super.disconnectedCallback(),(r=this._observer)==null||r.disconnect(),(e=this.composition)==null||e.cleanup(),document.removeEventListener("fullscreenchange",this._handleFullscreenChange),document.removeEventListener("webkitfullscreenchange",this._handleFullscreenChange),document.removeEventListener("visibilitychange",this._handleVisibilityChange)}_renderStyles(){return this.propAspectRatio?typeof this.propAspectRatio=="number"?_e`
3736
3736
  <style>
3737
3737
  :host {
3738
3738
  aspect-ratio: ${this.propAspectRatio};
@@ -3864,7 +3864,7 @@ Schedule: ${c.map(d=>ui(d))}`),u.length&&this.log(`Removed events ${u}`),this.pl
3864
3864
  top: 0;
3865
3865
  left: 0;
3866
3866
  }
3867
- `],ht([Ae({type:Boolean})],st.prototype,"debug",2),ht([Ae({type:Object})],st.prototype,"config",2),ht([Ae({type:String,attribute:"language"})],st.prototype,"propLanguage",2),ht([Ae({type:Number,attribute:"aspectratio"})],st.prototype,"propAspectRatio",2),ht([Ae({type:String})],st.prototype,"preload",2),ht([Ae({type:Boolean})],st.prototype,"autoplay",2),ht([Ae({type:Boolean})],st.prototype,"loading",2),ht([Ae({type:Boolean})],st.prototype,"disabled",2),ht([Ae({type:Array})],st.prototype,"controls",2),ht([Ae({attribute:!1})],st.prototype,"dataResolver",2),ht([Ae({attribute:!1})],st.prototype,"languageResolver",2),ht([gt()],st.prototype,"_pageHidden",2),ht([gt()],st.prototype,"_aspectRatio",2),ht([gt()],st.prototype,"_processing",2),ht([gt()],st.prototype,"_waiting",2),ht([gt()],st.prototype,"_errors",2),ht([gt()],st.prototype,"_seeking",2),ht([gt()],st.prototype,"_language",2),ht([gt()],st.prototype,"_languages",2),ht([gt()],st.prototype,"_captions",2),ht([gt()],st.prototype,"_fullscreen",2),st=ht([Ft("vmp-media-player")],st);var IQ=Object.defineProperty,vQ=Object.getOwnPropertyDescriptor,Rt=(r,e,t,i)=>{for(var n=i>1?void 0:i?vQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&IQ(e,t,n),n};return ct.PlayerEmbed=class extends Xi{constructor(){super(...arguments),this.env="prod",this.apiKey="",this.disableTracking=!1,this.trackingSource="embedded_player",this.preload="auto",this.autoplay=!1,this.aspectRatio=0,this.eventController=new Yp(this,["durationchange","ended","error","loadeddata","pause","stalled","play","playing","ratechange","scenechange","scenesupdate","seeking","seeked","timeupdate","volumechange","processing","waiting","video:loadeddata","video:seeking","video:seeked","video:play","video:playing","video:pause","video:waiting","video:stalled","video:timeupdate","video:ended","video:error"]),this._fetcherController=new fm(this),this._trackingController=new _y(this),this._mediaPlayerRef=_t()}get fetching(){return this._fetcherController.fetching}get waiting(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.waiting}get initialised(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.initialised}get seeking(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.seeking}get paused(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.paused}get captions(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.captions}get fullscreen(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.fullscreen}get duration(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.duration}set currentTime(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.currentTime=e)}get currentTime(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.currentTime)??0}set playbackRate(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.playbackRate=e)}get playbackRate(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.playbackRate)??1}set volume(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.volume=e)}get volume(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.volume)??1}set muted(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.muted=e)}get muted(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.muted)??!1}get mediaState(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.mediaState}get mediaPlayer(){return this._mediaPlayerRef.value}play(){var e;(e=this._mediaPlayerRef.value)==null||e.play()}pause(){var e;(e=this._mediaPlayerRef.value)==null||e.pause()}reset(e=0,t=!1){var i;(i=this._mediaPlayerRef.value)==null||i.reset(e,t)}_renderStyles(){return this.aspectRatio?typeof this.aspectRatio=="number"?_e`
3867
+ `],ht([Ae({type:Boolean})],st.prototype,"debug",2),ht([Ae({type:Object})],st.prototype,"config",2),ht([Ae({type:String,attribute:"language"})],st.prototype,"propLanguage",2),ht([Ae({type:Number,attribute:"aspectratio"})],st.prototype,"propAspectRatio",2),ht([Ae({type:String})],st.prototype,"preload",2),ht([Ae({type:Boolean})],st.prototype,"autoplay",2),ht([Ae({type:Boolean})],st.prototype,"loading",2),ht([Ae({type:Boolean})],st.prototype,"disabled",2),ht([Ae({type:Array})],st.prototype,"controls",2),ht([Ae({attribute:!1})],st.prototype,"dataResolver",2),ht([Ae({attribute:!1})],st.prototype,"languageResolver",2),ht([gt()],st.prototype,"_pageHidden",2),ht([gt()],st.prototype,"_aspectRatio",2),ht([gt()],st.prototype,"_processing",2),ht([gt()],st.prototype,"_waiting",2),ht([gt()],st.prototype,"_errors",2),ht([gt()],st.prototype,"_seeking",2),ht([gt()],st.prototype,"_language",2),ht([gt()],st.prototype,"_languages",2),ht([gt()],st.prototype,"_captions",2),ht([gt()],st.prototype,"_fullscreen",2),st=ht([Ft("vmp-media-player")],st);var vQ=Object.defineProperty,CQ=Object.getOwnPropertyDescriptor,Rt=(r,e,t,i)=>{for(var n=i>1?void 0:i?CQ(e,t):e,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(e,t,n):o(n))||n);return i&&n&&vQ(e,t,n),n};return ct.PlayerEmbed=class extends Xi{constructor(){super(...arguments),this.env="prod",this.apiKey="",this.disableTracking=!1,this.trackingSource="embedded_player",this.preload="auto",this.autoplay=!1,this.aspectRatio=0,this.eventController=new Yp(this,["durationchange","ended","error","loadeddata","pause","stalled","play","playing","ratechange","scenechange","scenesupdate","seeking","seeked","timeupdate","volumechange","processing","waiting","video:loadeddata","video:seeking","video:seeked","video:play","video:playing","video:pause","video:waiting","video:stalled","video:timeupdate","video:ended","video:error"]),this._fetcherController=new fm(this),this._trackingController=new _y(this),this._mediaPlayerRef=_t()}get fetching(){return this._fetcherController.fetching}get waiting(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.waiting}get initialised(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.initialised}get seeking(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.seeking}get paused(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.paused}get captions(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.captions}get fullscreen(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.fullscreen}get duration(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.duration}set currentTime(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.currentTime=e)}get currentTime(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.currentTime)??0}set playbackRate(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.playbackRate=e)}get playbackRate(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.playbackRate)??1}set volume(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.volume=e)}get volume(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.volume)??1}set muted(e){this._mediaPlayerRef.value&&(this._mediaPlayerRef.value.muted=e)}get muted(){var e;return((e=this._mediaPlayerRef.value)==null?void 0:e.muted)??!1}get mediaState(){var e;return(e=this._mediaPlayerRef.value)==null?void 0:e.mediaState}get mediaPlayer(){return this._mediaPlayerRef.value}play(){var e;(e=this._mediaPlayerRef.value)==null||e.play()}pause(){var e;(e=this._mediaPlayerRef.value)==null||e.pause()}reset(e=0,t=!1){var i;(i=this._mediaPlayerRef.value)==null||i.reset(e,t)}_renderStyles(){return this.aspectRatio?typeof this.aspectRatio=="number"?_e`
3868
3868
  <style>
3869
3869
  :host {
3870
3870
  aspect-ratio: ${this.aspectRatio};