@vouchfor/embeds 8.7.2 → 8.7.3
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.
- package/dist/es/embeds.js +2 -2
- package/dist/iife/dialog-embed/embed.iife.js +3 -3
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/embeds.iife.js +3 -3
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +3 -3
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/iife/embeds.iife.js
CHANGED
|
@@ -2459,7 +2459,7 @@ vec4 transition(vec2 uv) {
|
|
|
2459
2459
|
return mix(a, b, step(0.0+p.y,progress));
|
|
2460
2460
|
}
|
|
2461
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 jh=Al(Hv);var qh;function $v(r){if(typeof r=="string"){const[e,t]=r.split(":");return Math.min(parseFloat(e),parseFloat(t))}return r}function Yv(r){if(typeof r=="string"){const[e,t]=r.split(":"),i=parseFloat(e),n=parseFloat(t);return i/n}return r}function Gl({resolution:r,aspectRatio:e}){const t=$v(r),i=Yv(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 Xh({canvas:r,width:e,height:t,scaleFactor:i=1}){r.width=e*i,r.height=t*i}function Vv({context:r,scaleFactor:e=1}){r.scale(e,e)}function Kv({source:r,sx:e,sy:t,sw:i,sh:n,dx:s,dy:o,dw:a,dh:l}){const c=(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??c,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)),l<0&&(o+=l,l=Math.abs(l));const A=Math.max(e,0),h=Math.min(e+i,c),d=Math.max(t,0),f=Math.min(t+n,u),g=a/i,p=l/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 Wv({context:r,source:e,crop:t,flip:i,format:n="letterbox",posX:s,posY:o,scaleFactor:a=1,drawAreaWidth:l,drawAreaHeight:c,sourceWidth:u,sourceHeight:A,cropCanvas:h}){const{x:d,y:f,width:g,height:p}=t??{},E=u*(d??0),C=A*(f??0),B=u*Math.min(1-(d??0),g??1),y=A*Math.min(1-(f??0),p??1);let x=E,Q=C,_=B,M=y,P=B,D=y;if(Xh({scaleFactor:a,canvas:h,width:B,height:y}),n==="crop"){const K=l/c,ee=B/y,Z=ee>K?B-y*K:0,L=ee<K?y-B/K:0;Xh({scaleFactor:a,canvas:h,width:B+Z,height:y+L}),x+=Z/2,Q+=L/2,_-=Z,M-=L,P+=Z,D+=L}const $=h.getContext("2d");if($){Vv({scaleFactor:a,context:$});const K=Kv({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+l,o),r.scale(-1,1),r.drawImage(h,0,0,l,c),r.restore()):r.drawImage(h,s,o,l,c)}const zh={linear:rE,easeIn:ll,easeInOut:nE,easeOut:iE,circIn:Vu,circInOut:sE,circOut:Ku,backIn:cl,backInOut:aE,backOut:oE,anticipate:lE,bounceIn:hE,bounceInOut:dE,bounceOut:Ao},Do=Bu((r,e,{clamp:t=!0,ease:i="easeIn",...n}={})=>qm(r,e,{...n,clamp:t,ease:zh[i]}),{cacheKey:([r,e,t])=>JSON.stringify({from:r,to:e,options:t})}),Jv={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:Do([0,1],[n,s],{ease:e})(t)}}}},Lo={type:"fade",processor:{getTargetState:r=>({opacity:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({opacity:Do([0,1],[i.opacity,r],{ease:e})(t)})}},jv={type:"scale",processor:{getTargetState:r=>({scale:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({scale:Do([0,1],[i.scale,r],{ease:e})(t)})}},Zh={type:"translate",processor:{getTargetState:r=>({translation:r}),interpolateState:({value:r,easing:e,progress:t,from:i})=>({translation:Do([0,1],[i.translation,r],{ease:e})(t)})}},qv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Xv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],zv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Zv=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],os={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:qv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},Hl={type:"switch",name:"reverseExit",label:"Reverse exit animation"},ey=.2,ty=3;function ry(r,e){const t=r==="both"?e/2:e;return Math.min(ty,t)}function as({speed:r,timing:e,elementDuration:t}){const i=ry(e,t),n=Math.min(ey,i),s=Math.max(0,Math.min(100,r))/100;return i-s*(i-n)}const iy="easeOut";function ls(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:iy,...((t=r==null?void 0:r.options)==null?void 0:t.call(r,e))??{}}}}}function ui({timing:r,duration:e,elementDuration:t,easing:i,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const l=[],c=r==="both"||r==="enter",u=r==="both"||r==="exit",A=Math.max(0,t-e);if(c?(l.push({time:0,value:s,easing:i}),l.push({time:e,value:a,easing:"linear"})):l.push({time:0,value:a,easing:"linear"}),u){A>e&&l.push({time:A,value:a,easing:i});const h=n?s:o;l.push({time:t,value:h,easing:i})}return l}const ed="fade",ny={type:ed,name:"Fade",options:{...os},transform:ls(),generate:(r,e)=>{const t=as({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Lo}}}},td="pan",rd=.25,id="left";function nd(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 nd(id,e,t)}}function sy(r){return{x:-r.x,y:-r.y}}const oy={type:td,name:"Pan",options:{...os,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:zv},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:r=>`${(r*100).toFixed(0)}%`}},reverseExit:Hl},transform:ls({values:r=>({direction:r.direction??id,distance:[r.distance??rd],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=as({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??rd,n=nd(r.direction,e.elementDimensions,i),s=sy(n);return{fade:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Lo},translate:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Zh}}}},sd="pop",od=.5,ay={type:sd,name:"Pop",options:{...os},transform:ls(),generate:(r,e)=>{const t=as({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration});return{fade:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Lo},scale:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:od,exitTo:od,restValue:1}),renderer:jv}}}},ad="rise",ld=50,ly="up";function cy(r,e){switch(r){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const Ay={type:ad,name:"Rise",options:{...os,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Zv},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:r=>`${r}px`}},reverseExit:Hl},transform:ls({values:r=>({direction:r.direction??ly,distance:[r.distance??ld],reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,distance:r.distance[0],reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=as({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=r.distance??ld,{enterY:n,exitY:s}=cy(r.direction,i);return{fade:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Lo},translate:{keyframes:ui({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:Zh}}}},cd="wipe",$l="left";function on(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 on($l)}}function Ad(r){switch(r){case"left":return on("right");case"right":return on("left");case"up":return on("down");case"down":return on("up");default:return Ad($l)}}const uy={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},hy={type:cd,name:"Wipe",options:{...os,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Xv},reverseExit:Hl},transform:ls({values:r=>({direction:r.direction??$l,reverseExit:r.reverseExit??!1}),options:r=>({direction:r.direction,reverseExit:r.reverseExit})}),generate:(r,e)=>{const t=as({speed:r.speed,timing:r.timing,elementDuration:e.elementDuration}),i=on(r.direction),n=Ad(r.direction);return{clip:{keyframes:ui({timing:r.timing,duration:t,elementDuration:e.elementDuration,easing:r.easing,reverseExit:r.reverseExit,enterFrom:i,exitTo:n,restValue:uy}),renderer:Jv}}}},dy={[ed]:ny,[ad]:Ay,[sd]:ay,[td]:oy,[cd]:hy};function fy(r,e){const{type:t,...i}=r,n=dy[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(i,e)}function gy({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 l=a.time-o.time,c=l===0?0:(e-o.time)/l,u=o.easing||"linear",A=r.renderer.processor.getTargetState(o.value);return r.renderer.processor.interpolateState({easing:u,progress:c,from:A,value:a.value})}}return null}function py(r,e,t){const{preset:i,...n}=r;if(!i)return n;const s=fy(i,{elementDuration:e,elementDimensions:t});return{...n,...s}}function ud({layout:r,sceneTime:e,animations:t,elementDuration:i=5,elementDimensions:n={width:100,height:100}}){var s,o,a,l,c,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:((c=(l=r==null?void 0:r.transform)==null?void 0:l.translate)==null?void 0:c.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=py(t,i,n);for(const C of Object.values(E)){if(!C)continue;const B=gy({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const my=[];for(let r=0;r<256;++r)my.push((r+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Ey="audio",hd=r=>`${r.toFixed(1)}s`,Iy={type:Ey,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:hd}},fadeOut:{type:"slider",name:"fadeOut",label:"Fade out",min:0,max:5,step:.1,transform:{format:hd}},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]})}},Vr=1.8;function vy({context:r,x:e,y:t,width:i,height:n,radii:s}){let o,a,l,c;typeof s=="number"?o=a=l=c=s:[o,a,l,c]=s,r.beginPath(),r.moveTo(e+Math.min(n/Vr,o),t),r.lineTo(e+i-Math.min(n/Vr,a),t),r.quadraticCurveTo(e+i,t,e+i,t+Math.min(n/Vr,a)),r.lineTo(e+i,t+n-Math.min(n/Vr,l)),r.quadraticCurveTo(e+i,t+n,e+i-Math.min(n/Vr,l),t+n),r.lineTo(e+Math.min(n/Vr,c),t+n),r.quadraticCurveTo(e,t+n,e,t+n-Math.min(n/Vr,c)),r.lineTo(e,t+Math.min(n/Vr,o)),r.quadraticCurveTo(e,t,e+Math.min(n/Vr,o),t),r.closePath()}function yy({context:r,x:e,y:t,width:i,height:n,radii:s,clip:o=!1,debug:a=!1}){vy({context:r,x:e,y:t,width:i,height:n,radii:s}),a&&(r.strokeStyle="blue",r.stroke()),o&&r.clip()}function dd(){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,l=i.BN|i.RLE|i.LRE|i.RLO|i.LRO|i.PDF,c=i.S|i.WS|i.B|s|i.PDI|l,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 ae=z.split("+"),Ae=ae[0],he=ae[1];Ae=parseInt(Ae,36),he=he?parseInt(he,36):0,u.set(G+=Ae,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,ae=w&&new Map,Ae;return m.split(",").forEach(function he(ve){if(ve.indexOf("+")!==-1)for(var Be=+ve;Be--;)he(Ae);else{Ae=ve;var Le=ve.split(">"),Pe=Le[0],rt=Le[1];Pe=String.fromCodePoint(G+=parseInt(Pe,N)),rt=String.fromCodePoint(G+=parseInt(rt,N)),z.set(Pe,rt),w&&ae.set(rt,Pe)}}),{map:z,reverseMap:ae}}var p,E,C;function B(){if(!p){var m=g(f.pairs,!0),w=m.map,N=m.reverseMap;p=w,E=N,C=g(f.canonical,!1).map}}function y(m){return B(),p.get(m)||null}function x(m){return B(),E.get(m)||null}function Q(m){return B(),C.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,oe=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 ae=new Map;function Ae(Kt,Br){var Wt=G[Kt];G[Kt]=Br,ae.set(Wt,ae.get(Wt)-1),Wt&a&&ae.set(a,ae.get(a)-1),ae.set(Br,(ae.get(Br)||0)+1),Br&a&&ae.set(a,(ae.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:xp(Pe,!1)}),G[Pe]&Z&&(Le.end=Pe,Le=null);for(var rt=re|Y|J|F|s|be|oe|Z,at=function(Kt){return Kt+(Kt&1?1:2)},Ct=function(Kt){return Kt+(Kt&1?2:1)},nt=0;nt<Be.length;nt++){Le=Be[nt];var j=[{_level:Le.level,_override:0,_isolate:0}],ue=void 0,ye=0,Me=0,Ne=0;ae.clear();for(var Oe=Le.start;Oe<=Le.end;Oe++){var Je=G[Oe];if(ue=j[j.length-1],ae.set(Je,(ae.get(Je)||0)+1),Je&a&&ae.set(a,(ae.get(a)||0)+1),Je&rt)if(Je&(re|Y)){he[Oe]=ue._level;var Bt=(Je===re?Ct:at)(ue._level);Bt<=N&&!ye&&!Me?j.push({_level:Bt,_override:0,_isolate:0}):ye||Me++}else if(Je&(J|F)){he[Oe]=ue._level;var Zr=(Je===J?Ct:at)(ue._level);Zr<=N&&!ye&&!Me?j.push({_level:Zr,_override:Je&J?M:_,_isolate:0}):ye||Me++}else if(Je&s){Je&De&&(Je=xp(Oe+1,!0)===1?me:fe),he[Oe]=ue._level,ue._override&&Ae(Oe,ue._override);var Tt=(Je===me?Ct:at)(ue._level);Tt<=N&&ye===0&&Me===0?(Ne++,j.push({_level:Tt,_override:0,_isolate:1,_isolInitIndex:Oe})):ye++}else if(Je&be){if(ye>0)ye--;else if(Ne>0){for(Me=0;!j[j.length-1]._isolate;)j.pop();var Ir=j[j.length-1]._isolInitIndex;Ir!=null&&(ve.set(Ir,Oe),ve.set(Oe,Ir)),j.pop(),Ne--}ue=j[j.length-1],he[Oe]=ue._level,ue._override&&Ae(Oe,ue._override)}else Je&oe?(ye===0&&(Me>0?Me--:!ue._isolate&&j.length>1&&(j.pop(),ue=j[j.length-1])),he[Oe]=ue._level):Je&Z&&(he[Oe]=Le.level);else he[Oe]=ue._level,ue._override&&Je!==V&&Ae(Oe,ue._override)}for(var zt=[],bt=null,Zt=Le.start;Zt<=Le.end;Zt++){var ei=G[Zt];if(!(ei&l)){var ti=he[Zt],La=ei&s,vr=ei===be;bt&&ti===bt._level?(bt._end=Zt,bt._endsWithIsolInit=La):zt.push(bt={_start:Zt,_end:Zt,_level:ti,_startsWithPDI:vr,_endsWithIsolInit:La})}}for(var Ns=[],xn=0;xn<zt.length;xn++){var Mt=zt[xn];if(!Mt._startsWithPDI||Mt._startsWithPDI&&!ve.has(Mt._start)){for(var wn=[bt=Mt],ji=void 0;bt&&bt._endsWithIsolInit&&(ji=ve.get(bt._end))!=null;)for(var Ci=xn+1;Ci<zt.length;Ci++)if(zt[Ci]._start===ji){wn.push(bt=zt[Ci]);break}for(var Ur=[],qi=0;qi<wn.length;qi++)for(var Qn=wn[qi],Os=Qn._start;Os<=Qn._end;Os++)Ur.push(Os);for(var kA=he[Ur[0]],ka=Le.level,Rn=Ur[0]-1;Rn>=0;Rn--)if(!(G[Rn]&l)){ka=he[Rn];break}var Us=Ur[Ur.length-1],MA=he[Us],Ma=Le.level;if(!(G[Us]&s)){for(var _n=Us+1;_n<=Le.end;_n++)if(!(G[_n]&l)){Ma=he[_n];break}}Ns.push({_seqIndices:Ur,_sosType:Math.max(ka,kA)%2?M:_,_eosType:Math.max(Ma,MA)%2?M:_})}}for(var Gs=0;Gs<Ns.length;Gs++){var Dn=Ns[Gs],Te=Dn._seqIndices,Xi=Dn._sosType,FA=Dn._eosType,ri=he[Te[0]]&1?M:_;if(ae.get(k))for(var Ln=0;Ln<Te.length;Ln++){var Hs=Te[Ln];if(G[Hs]&k){for(var Bi=Xi,kn=Ln-1;kn>=0;kn--)if(!(G[Te[kn]]&l)){Bi=G[Te[kn]];break}Ae(Hs,Bi&(s|be)?U:Bi)}}if(ae.get(P))for(var Mn=0;Mn<Te.length;Mn++){var $s=Te[Mn];if(G[$s]&P)for(var Ti=Mn-1;Ti>=-1;Ti--){var ur=Ti===-1?Xi:G[Te[Ti]];if(ur&o){ur===R&&Ae($s,K);break}}}if(ae.get(R))for(var bi=0;bi<Te.length;bi++){var Ys=Te[bi];G[Ys]&R&&Ae(Ys,M)}if(ae.get(D)||ae.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&l));X--);for(var te=T+1;te<Te.length&&(H=G[Te[te]],!!(H&l));te++);O===H&&(G[b]===D?O===P:O&(P|K))&&Ae(b,O)}}if(ae.get(P))for(var se=0;se<Te.length;se++){var le=Te[se];if(G[le]&P){for(var de=se-1;de>=0&&G[Te[de]]&($|l);de--)Ae(Te[de],P);for(se++;se<Te.length&&G[Te[se]]&($|l|P);se++)G[Te[se]]!==P&&Ae(Te[se],P)}}if(ae.get($)||ae.get(D)||ae.get(ee))for(var ce=0;ce<Te.length;ce++){var Ee=Te[ce];if(G[Ee]&($|D|ee)){Ae(Ee,U);for(var Se=ce-1;Se>=0&&G[Te[Se]]&l;Se--)Ae(Te[Se],U);for(var Ve=ce+1;Ve<Te.length&&G[Te[Ve]]&l;Ve++)Ae(Te[Ve],U)}}if(ae.get(P))for(var lt=0,je=Xi;lt<Te.length;lt++){var Ft=Te[lt],Nt=G[Ft];Nt&P?je===_&&Ae(Ft,_):Nt&o&&(je=Nt)}if(ae.get(a)){var yr=M|P|K,hr=yr|_,zi=[];{for(var ii=[],Fn=0;Fn<Te.length;Fn++)if(G[Te[Fn]]&a){var Vs=m[Te[Fn]],Ep=void 0;if(y(Vs)!==null)if(ii.length<63)ii.push({char:Vs,seqIndex:Fn});else break;else if((Ep=x(Vs))!==null)for(var Ks=ii.length-1;Ks>=0;Ks--){var PA=ii[Ks].char;if(PA===Ep||PA===x(Q(Vs))||y(Q(PA))===Vs){zi.push([ii[Ks].seqIndex,Fn]),ii.length=Ks;break}}}zi.sort(function(Kt,Br){return Kt[0]-Br[0]})}for(var NA=0;NA<zi.length;NA++){for(var Ip=zi[NA],Fa=Ip[0],OA=Ip[1],vp=!1,Cr=0,UA=Fa+1;UA<OA;UA++){var yp=Te[UA];if(G[yp]&hr){vp=!0;var Cp=G[yp]&yr?M:_;if(Cp===ri){Cr=Cp;break}}}if(vp&&!Cr){Cr=Xi;for(var GA=Fa-1;GA>=0;GA--){var Bp=Te[GA];if(G[Bp]&hr){var Tp=G[Bp]&yr?M:_;Tp!==ri?Cr=Tp:Cr=ri;break}}}if(Cr){if(G[Te[Fa]]=G[Te[OA]]=Cr,Cr!==ri){for(var Ws=Fa+1;Ws<Te.length;Ws++)if(!(G[Te[Ws]]&l)){h(m[Te[Ws]])&k&&(G[Te[Ws]]=Cr);break}}if(Cr!==ri){for(var Js=OA+1;Js<Te.length;Js++)if(!(G[Te[Js]]&l)){h(m[Te[Js]])&k&&(G[Te[Js]]=Cr);break}}}}for(var Si=0;Si<Te.length;Si++)if(G[Te[Si]]&a){for(var bp=Si,HA=Si,$A=Xi,js=Si-1;js>=0;js--)if(G[Te[js]]&l)bp=js;else{$A=G[Te[js]]&yr?M:_;break}for(var Sp=FA,qs=Si+1;qs<Te.length;qs++)if(G[Te[qs]]&(a|l))HA=qs;else{Sp=G[Te[qs]]&yr?M:_;break}for(var YA=bp;YA<=HA;YA++)G[Te[YA]]=$A===Sp?$A:ri;Si=HA}}}for(var er=Le.start;er<=Le.end;er++){var GQ=he[er],Pa=G[er];if(GQ&1?Pa&(_|P|K)&&he[er]++:Pa&M?he[er]++:Pa&(K|P)&&(he[er]+=2),Pa&l&&(he[er]=er===0?Le.level:he[er-1]),er===Le.end||h(m[er])&(L|Z))for(var Na=er;Na>=0&&h(m[Na])&c;Na--)he[Na]=Le.level}}return{levels:he,paragraphs:Be};function xp(Kt,Br){for(var Wt=Kt;Wt<m.length;Wt++){var xi=G[Wt];if(xi&(M|R))return 1;if(xi&(Z|_)||Br&&xi===be)return 0;if(xi&s){var wp=HQ(Wt);Wt=wp===-1?m.length:wp}}return 0}function HQ(Kt){for(var Br=1,Wt=Kt+1;Wt<m.length;Wt++){var xi=G[Wt];if(xi&Z)break;if(xi&be){if(--Br===0)return Wt}else xi&s&&Br++}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 _e(m){return He(),xe.get(m)||null}function ze(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 ae=new Map,Ae=N;Ae<=G;Ae++)if(w[Ae]&1){var he=_e(m[Ae]);he!==null&&ae.set(Ae,he)}return ae}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 ae=[];return w.paragraphs.forEach(function(Ae){var he=Math.max(N,Ae.start),ve=Math.min(G,Ae.end);if(he<ve){for(var Be=w.levels.slice(he,ve+1),Le=ve;Le>=he&&h(m[Le])&c;Le--)Be[Le]=Ae.level;for(var Pe=Ae.level,rt=1/0,at=0;at<Be.length;at++){var Ct=Be[at];Ct>Pe&&(Pe=Ct),Ct<rt&&(rt=Ct|1)}for(var nt=Pe;nt>=rt;nt--)for(var j=0;j<Be.length;j++)if(Be[j]>=nt){for(var ue=j;j+1<Be.length&&Be[j+1]>=nt;)j++;j>ue&&ae.push([ue+he,j+he])}}}),ae}function S(m,w,N,G){var z=I(m,w,N,G),ae=[].concat(m);return z.forEach(function(Ae,he){ae[he]=(w.levels[Ae]&1?_e(m[Ae]):null)||m[Ae]}),ae.join("")}function I(m,w,N,G){for(var z=we(m,w,N,G),ae=[],Ae=0;Ae<m.length;Ae++)ae[Ae]=Ae;return z.forEach(function(he){for(var ve=he[0],Be=he[1],Le=ae.slice(ve,Be+1),Pe=Le.length;Pe--;)ae[Be-Pe]=Le[Pe]}),ae}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=Q,e.getEmbeddingLevels=ke,e.getMirroredCharacter=_e,e.getMirroredCharactersMap=ze,e.getReorderSegments=we,e.getReorderedIndices=I,e.getReorderedString=S,e.openingToClosingBracket=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return r}const fd=Object.freeze(Object.defineProperty({__proto__:null,default:dd},Symbol.toStringTag,{value:"Module"})),Cy=typeof fd=="function"?fd:dd;function By(r,e){return r==="start"?e==="rtl"?"right":"left":r==="end"?e==="rtl"?"left":"right":r??"left"}const gd=Cy();function Ty(r){var e;if(!r)return"ltr";try{const{paragraphs:t}=gd.getEmbeddingLevels(r);return(((e=t[0])==null?void 0:e.level)??0)%2===1?"rtl":"ltr"}catch{return"ltr"}}function by(r){return{order:r.map((e,t)=>t),directions:r.map(()=>"ltr"),baseDirection:"ltr"}}function Sy(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}=gd.getEmbeddingLevels(i,e),o=((t=s[0])==null?void 0:t.level)??0,a=o%2===1?"rtl":"ltr",l=[];let c=0;for(const d of r)l.push(n[c]??o),c+=d.text.length+1;const u=r.map((d,f)=>f),A=Math.max(...l);for(let d=A;d>=1;d--){let f=-1;for(let g=0;g<=u.length;g++){const p=g<u.length&&l[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=l.map(d=>d%2===1?"rtl":"ltr");return{order:u,directions:h,baseDirection:a}}catch{return by(r)}}const xy=500;function wy(){const r=new Map,e={has:t=>r.has(t),get:t=>r.get(t),set:(t,i)=>{if(r.size>=xy&&!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 Yl;function Qy(){return Yl===void 0&&(Yl=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"word"}):null),Yl}const pd=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function Ry(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(pd.test(i))for(const n of md(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 md(r){const e=[];let t=!1,i="";const n=Qy();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 _y(r){const e=[];for(const t of r){const n=pd.test(t.text)||/\s/.test(t.text)?md(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((l,c)=>l+[...c.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((l,c)=>{const u=[...l.text].length/s*o,A=a,h=c===n.length-1?t.end:a+u;a=h,e.push({text:l.text,logicalIndex:e.length,whitespace:!1,spaceBefore:c===0?e.length>0:l.spaceBefore,timing:{id:t.id,subIndex:c,start:A,end:h}})})}return e}const Dy=/(?<value>\d+\.?\d*)(?=px)/,Vl=1;function Ly(r,e){const t=typeof r=="string"?Ry(r):[_y(r)];return e?t.map(i=>i.map(n=>({...n,text:n.text.toUpperCase()}))):t}function ky({context:r,groups:e,appendedFont:t,fontSizes:i,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:l}){const c=[],u=h=>{const d=i[h%i.length];return{fontSize:d,font:t.replace(Dy,d.toString())}},A=(h,d)=>(r.font=h,r.letterSpacing=`${a}px`,r.measureText(d));for(const h of e){const d=c.length,{fontSize:f,font:g}=u(c.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},E="",C="";const B=()=>{const y=A(p.font,"");p.fontAscent=y.fontBoundingBoxAscent,p.fontDescent=y.fontBoundingBoxDescent,c.push(p);const x=u(c.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},E="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const M=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=M?A(p.font,M).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:M}};let Q=x();const _=l?A(p.font,E+Q.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&_>n+Vl&&p.items.length>0&&(B(),Q=x()),s&&l&&p.items.length===0&&Q.width>n+Vl){let M=y.text;for(;M.length>0;){let P="";for(const $ of M){const K=A(p.font,P+$).width+o;if(P&&K>n+Vl)break;P+=$}M=M.slice(P.length);const D=A(p.font,P);p.items.push({token:{...y,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()}C="";continue}p.items.push(Q),E+=Q.gapText+y.text,p.lineWidth=l?A(p.font,E).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,C=""}l&&C&&(p.items.length>0||c.length===d)&&(E+=C,p.lineWidth=A(p.font,E).width+o*p.items.length),(p.items.length>0||c.length===d)&&B()}return c}const Ed=[{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 Id({text:r,font:e}){let t=e;return Ed.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}function vd(r){return Math.max(r??1,.5)}function My({measured:r,index:e,lineTop:t,dx:i,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:l}){const{items:c,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=vd(a),E=A*p+l,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+l/2,{order:x,directions:Q,baseDirection:_}=Sy(c.map(({token:Z})=>({text:Z.text})),o),M=c.map(({gapBefore:Z})=>Z);let P=i+g+l/2;const D=[];x.forEach((Z,L)=>{const U=c[Z];P+=M[L],D.push({...U.token,x:P,baselineY:y,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?c[V].token.text:`${c[V].gapText}${c[V].token.text}`).join("")});const ee=o??_;return{index:e,box:{x:i+g,y:t,width:h,height:E},baselineY:y,direction:ee,runs:$,tokens:D}}function Fy(r){const{context:e,text:t,font:i,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:l=a,align:c="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=r,E=Ly(t,p),C=E.flat().map(({text:Q})=>Q).join(" "),B=Id({font:i,text:C}),y=u??Ty(C),x=By(c,y);try{e.save();const Q=ky({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=My({measured:Q[ee],index:ee,lineTop:M,dx:s,dw:l,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*vd(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:y,font:B}}finally{e.restore()}}Bu(Fy,{cache:wy(),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 Py(r){return r.slice(0,1).toUpperCase()+r.slice(1)}Object.keys(zh).map(r=>({label:Py(r),value:r,data:r}));const Ny=fr(()=>Wu.loadYoga());function Oy(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 ko=64;function Uy(){const r=[],e={x:.5,y:.5},t=.5;for(let i=0;i<ko;i++){const n=i/ko*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 Gy(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<ko;s++){const o=s/ko*2*Math.PI,a=t.x+i*Math.cos(o),l=t.y+n*Math.sin(o);e.push({x:a,y:l})}return e}function Hy(){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 yd(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 Mo(r){if(r<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let c=0;c<r;c++){const u=c*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(c=>c.x)),n=Math.max(...t.map(c=>c.x)),s=Math.min(...t.map(c=>c.y)),o=Math.max(...t.map(c=>c.y)),a=n-i,l=o-s;for(const c of t){const u=(c.x-i)/a,A=(c.y-s)/l;e.push({x:u,y:A})}return e}function Cd(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 $y(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),l=.5+o*Math.sin(s);t.push({x:a,y:l})}return t}function Yy(r="isosceles",e={}){switch(r){case"equilateral":return Vy();case"isosceles":return Bd(e.baseAngle??60);case"right":return Ky(e.rightAnglePosition??"bottom-left");case"scalene":return Wy(e.angles??[60,60,60])}}function Vy(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Bd(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 Ky(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 Wy(r){return Bd(r[0])}function Jy(r={},e=1){const{type:t="rectangle",customPolygon:i,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:l,regularPolygon:c}=r;switch(t){case"rectangle":return yd(0,e);case"parallelogram":return yd((n==null?void 0:n.angle)??30,e);case"triangle":return Yy((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 Cd((o==null?void 0:o.angle)??90);case"diamond":return Cd(90);case"pentagon":return Mo(5);case"hexagon":return Mo(6);case"octagon":return Mo(8);case"star":return $y((l==null?void 0:l.points)??5,(l==null?void 0:l.innerRadius)??.4);case"arrow":return Oy((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return Hy();case"circle":return Uy();case"ellipse":return Gy(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 Mo((c==null?void 0:c.sides)??6)}}function jy(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,l=e[s].y,c=e[o].x,u=e[o].y;l>n!=u>n&&i<(c-a)*(n-l)/(u-l)+a&&(t=!t)}return t}function qy(r,e){let t=1,i=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;jy({x:o,y:r},e)&&(t=Math.min(t,o),i=Math.max(i,o))}return i>=t?{left:t,right:i}:null}function Xy(r){const e=Math.min(...r.map(l=>l.y)),t=Math.max(...r.map(l=>l.y));let i={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let l=0;l<=s;l++){const c=e+l*o;a.push({y:c,span:qy(c,r)})}for(let l=0;l<a.length-1;l++){const c=a[l].y;for(let u=l+1;u<a.length;u++){const h=a[u].y-c;let d=0,f=1,g=!0;const p=Math.min(5,u-l+1);for(let E=0;E<p;E++){const C=l+Math.floor(E/(p-1)*(u-l)),B=a[C].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,C=E*h;C>n&&(n=C,i={x:d,y:c,width:E,height:h})}}}return i}function zy(r,e=1){const t=Jy(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=Xy(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 Zy="video",eC=.01,Td=(r,e)=>Math.abs(r-e)<=e*eC,tC={type:Zy,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(),l=o/a;return s>l||Td(s,l)?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 Td(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:l})=>{const{crop:c,flip:u=!1,format:A="letterbox",speed:h=1}=o,d=l.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:C,bottomLeft:B,bottomRight:y}=n;yy({context:d,x:r,y:e,width:t,height:i,radii:[E,C,y,B]}),d.clip(),Wv({context:d,crop:c,flip:u,format:A,sourceWidth:g,sourceHeight:p,source:f,posX:r,posY:e,drawAreaWidth:t,drawAreaHeight:i,cropCanvas:l.cropCanvas,letterboxCanvas:l.letterboxCanvas}),d.restore()}}};function rr(r){let e=0;for(const t of r)Array.isArray(t)?e+=rr(t):e+=t;return e}function Fo(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const l=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,c=((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(l?c/2:c,t,A?u/2:u)*-1}return t})}function Kl(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(...Kl(n,e));return i}function bd(r){return r===null||typeof r=="number"&&!Number.isFinite(r)}function rC(r){const e={};for(const[t,i]of Object.entries(r))bd(i)||(typeof i=="object"&&!Array.isArray(i)?e[t]=Object.fromEntries(Object.entries(i).filter(([,n])=>!bd(n))):e[t]=i);return e}function iC(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 nC(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 sC(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 oC(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 Sd(r,e,{layout:t,scale:i=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:l,minHeight:c,maxWidth:u,maxHeight:A,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:E,direction:C="column",align:B="start",alignSelf:y,justify:x="start"}=rC(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}=nC(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(_[C]);const M={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(M[B]),y&&e.setAlignSelf(M[y]);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}=sC(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}=oC(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 l<"u"&&e.setMinWidth(typeof l=="number"?l*i:l),typeof c<"u"&&e.setMinHeight(typeof c=="number"?c*i:c),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*i:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*i:A)}async function xd({id:r,yoga:e,index:t,parent:i,element:n,resolvers:s}){var o,a,l;const{layout:c={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();Sd(e,d,{layout:c}),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((l=n.children)==null?void 0:l.entries())??[])g.push(await xd({id:r,yoga:e,index:p,parent:d,element:E,resolvers:s}));return{node:d,radius:iC(c.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function wd(r,e,t=0,i=0){const{top:n,left:s}=r.getComputedLayout(),{top:o,left:a,width:l,height:c}=e.node.getComputedLayout(),u=t+a,A=i+o,h=e.childNodes.map(d=>wd(r,d,u,A));return{...e,x:s+u,y:n+A,width:l,height:c,childNodes:h}}async function Wl({yoga:r,root:e,tree:t,measureCanvas:i}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:l}of t){if(a){const{width:c,height:u}=a;if(c&&i){e.calculateLayout();const A=await c({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,C;g<p?(E=g/p,C=1):(E=1,C=p/g),s.crop={x:(1-E)/2,y:(1-C)/2,width:E,height:C}}}}}if(await Wl({yoga:r,root:e,tree:l,measureCanvas:i}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=zy(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 Wl({yoga:r,root:e,tree:l,measureCanvas:i})}}async function Qd({id:r,root:e,resolvers:t,measureCanvas:i}){const n=await Ny(),s=n.Node.create();Sd(n,s,{layout:e.layout});const o=await xd({id:r,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Wl({yoga:n,root:s,tree:[o],measureCanvas:i});const{top:a,left:l,width:c,height:u}=s.getComputedLayout(),A={root:{x:l,y:a,width:c,height:u},node:wd(s,o)};return s.freeRecursive(),A}function Rd(){return document.createElement("canvas")}function aC(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 lC(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,'\\"')}xE.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${lC(r)}"`:aC(r)||Array.isArray(r)?JSON.stringify(r):r);function cC(r){return r.some(({type:e})=>e==="text")}function AC(r){return r.some(({type:e})=>e==="caption")}function uC(r){return r.some(({type:e})=>e==="audio")}function hC(r){return r.some(({type:e})=>e==="video"||e==="image")}function Po(r){return r.type==="audio"}function dC(r){return r.type==="video"}const fC="3";async function gC({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Qd({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function pC({track:r}){const e=Fo(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const l=rr(e.slice(0,a));return s.push(gC({scene:o,start:l})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const l=rr(e.slice(0,a));return s.push({type:o.type,id:o.id,start:l,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 _d({node:r,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var l,c,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&&((l=r.element.layout)!=null&&l.transform)?{...r.element.layout,transform:{...r.element.layout.transform,rotation:a.rotation}}:r.element.layout,g=ud({layout:f,sceneTime:t,animations:r.element.animations,elementDuration:i,elementDimensions:{width:r.width,height:r.height}}),{opacity:p,translation:E,scale:C,clip:B,dimensions:y,rotation:x}=g,Q=r.width*y.widthRatio,_=r.height*y.heightRatio;if(d.globalAlpha=p*n,(E.x||E.y)&&d.translate(E.x,E.y),(C!==1||x!==0)&&(d.translate(r.x+Q/2,r.y+_/2),d.scale(C,C),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&&((c=r.options)!=null&&c.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 _d({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function mC({layout:r,canvases:e,sceneTime:t,sceneDuration:i,debug:n=!1,override:s}){const{node:o}=r;await _d({debug:n,node:o,canvases:e,sceneDuration:i,sceneTime:t,override:s})}async function No({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=Rd}){var a,l;const{id:c,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),E=o(),C=o(),B=o(),y=o(),x=await Qd({id:c,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??((l=f.element.layout)==null?void 0:l.height)}}},resolvers:i,measureCanvas:y}),Q=async(_,M)=>{const P=Math.max(0,_-t);p.width=p.height=0,p.width=n,p.height=s,await mC({debug:r,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:E,letterboxCanvas:C,posterCanvas:B},override:M})};return{id:c,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function EC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Fo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=rr(o.slice(0,d));return h.type==="caption"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=rr(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=rr(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function IC({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];Po(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let l,c=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<c&&(l=r[u].id,c=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:l,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 vC({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),l=r.bounds,c=(l==null?void 0:l.width)??i.width,u=(l==null?void 0:l.height)??i.height;return ud({sceneTime:a,animations:r.animations,elementDuration:o,elementDimensions:{width:c,height:u}})}function Dd({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,l=(n==null?void 0:n.height)??i.height,{opacity:c,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=c,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+l/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*l,h.width*a,h.height*l),t.clip())}async function yC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Fo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=rr(o.slice(0,d));return h.type==="video"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=rr(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=rr(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function CC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Fo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=rr(o.slice(0,d));return h.type==="text"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=rr(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=rr(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const BC=(((qh=jh)==null?void 0:qh.default)??jh).reduce((r,e)=>(r[e.name]=e,r),{});function TC(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function bC({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:l=!0}){var c,u,A;const h=TC(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=(((c=wo)==null?void 0:c.default)??wo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=wo)==null?void 0:u.default)??wo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((A=Jh)==null?void 0:A.default)??Jh)(o,BC[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!l)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 SC(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 xC({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),bC({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function Ld({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=Rd,drawTransition:o=xC}){var a;const l=new Map,c=await Promise.all(e.tracks.map(async E=>{if(hC(E))return{...await yC({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(cC(E))return{...await CC({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(AC(E))return{...await EC({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(uC(E))return{...await pC({track:E}),config:E};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?IC({groups:e.groups,tracks:c}):[],A=new Map,h=[...u].sort((E,C)=>E.depth-C.depth);for(const E of h)for(const C of E.sceneIds)A.set(C,E);const d=new Map(u.map(E=>[E.id,E]));function f(E){const C=[];let B=A.get(E.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:E,currentTime:C,overrides:B,signal:y})=>{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 c)if(!Po(D))for(const $ of D.scenes){if(C<$.start||C>=$.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 $=vC({group:D,currentTime:C,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&&Dd({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<c.length;D++){if(y!=null&&y.aborted)return;const $=c[D];if(Po($))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})=>C>=R&&C<R+F);if(U.length===0)continue;const V=ee.find(({start:R,duration:F})=>C>=R&&C<R+F),k=!!(V&&V.to&&V.from&&V.duration>0);for await(const R of U){if(y!=null&&y.aborted)return;const{sceneCanvas:F,draw:J,id:Y}=R;if(await(J==null?void 0:J(C,B==null?void 0:B.get(Y))),y!=null&&y.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 oe=Math.min(1,Math.max(0,(C-F.start)/Y));if(await o({name:R,progress:oe,contextResources:l,to:F.sceneCanvas,from:J.sceneCanvas,canvas:re}),y!=null&&y.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&&Dd({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:()=>{SC(l)},tracks:c,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...c.map(({duration:E})=>E))}}const cs=.3,Oo=.5,wC=1;function QC(r){return r.tracks.flatMap(t=>t.scenes).filter(dC).filter(t=>{var i;const n=Kl(t.config.root.element,"video")[0];if(!n||(i=n.config)!=null&&i.alpha)return!1;const{volume:s}=tC.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<wC?t[t.length-1]={start:n.start,end:Math.max(n.end,i.end)}:t.push(i),t},[])}const RC=r=>Math.round(r*1e6)/1e6;function _C(r,e,t){return e.reduce((i,{start:n,end:s})=>r<=n-cs||r>=s+Oo?i:r<n?Math.min(i,1-(1-t)*(r-(n-cs))/cs):r<=s?Math.min(i,t):Math.min(i,t+(1-t)*(r-s)/Oo),1)}function DC(r,e){const t=Kl(r.config.root.element,"audio")[0],{duration:i}=r;if(!t||i<=0)return null;const n=Iy.transform.values(t.options??{}),[s]=n.duckLevel,[o]=n.fadeIn,[a]=n.fadeOut,l=n.duck&&s<1?e.map(({start:A,end:h})=>({start:A-r.start,end:h-r.start})).filter(({start:A,end:h})=>A-cs<i&&h+Oo>0):[];if(o<=0&&a<=0&&l.length===0)return null;const c=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)]:[],...l.flatMap(({start:A,end:h})=>[A-cs,A,h,h+Oo])];return[...new Set(u.filter(A=>A>=0&&A<=i).map(RC))].sort((A,h)=>A-h).map(A=>({time:A,gain:c(A)*_C(A,l,s)}))}function LC(r){const e=QC(r),t=new Map;for(const i of r.tracks)if(Po(i))for(const n of i.scenes){const s=DC(n,e);s&&t.set(n.id,s)}return t}function kC(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 MC={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 FC(r){const{publicApiUrl:e}=so(r),t=oi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function PC(r){var s,o,a,l,c,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:oi()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(l=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:l.call(a,"vouch-uid-client"),i=(u=(c=window.sessionStorage)==null?void 0:c.getItem)==null?void 0:u.call(c,"vouch-uid-tab");const n=oi();return e||(e=FC(r),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=oi(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=oi(),(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 NC(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function OC(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 l=o.toLowerCase().replace(/[-_][a-z0-9]/g,c=>c.slice(-1).toUpperCase());i[l]=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:MC.version,templateVersion:fC,...i}}const kd=1;class UC{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=NC(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}=so(this.host.env),{client:i,tab:n,request:s,visitor:o}=PC(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":OC(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+kd&&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]+kd&&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 Jl={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof li<"u"&&li,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 li<"u"&&li||{},l={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 c(L){return L&&DataView.prototype.isPrototypeOf(L)}if(l.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 l.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)},l.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 C(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 y(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:l.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:l.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():l.arrayBuffer&&l.blob&&c(L)?(this._bodyArrayBuffer=x(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.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):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.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(l.blob)return this.blob().then(C);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(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.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(`
|
|
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(pd.test(i))for(const n of md(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 md(r){const e=[];let t=!1,i="";const n=Qy();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 _y(r){const e=[];for(const t of r){const n=pd.test(t.text)||/\s/.test(t.text)?md(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((l,c)=>l+[...c.text].length,0),o=t.end-t.start;let a=t.start;n.forEach((l,c)=>{const u=[...l.text].length/s*o,A=a,h=c===n.length-1?t.end:a+u;a=h,e.push({text:l.text,logicalIndex:e.length,whitespace:!1,spaceBefore:c===0?e.length>0:l.spaceBefore,timing:{id:t.id,subIndex:c,start:A,end:h}})})}return e}const Dy=/(?<value>\d+\.?\d*)(?=px)/,Vl=1;function Ly(r,e){const t=typeof r=="string"?Ry(r):[_y(r)];return e?t.map(i=>i.map(n=>({...n,text:n.text.toUpperCase()}))):t}function ky({context:r,groups:e,appendedFont:t,fontSizes:i,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:l}){const c=[],u=h=>{const d=i[h%i.length];return{fontSize:d,font:t.replace(Dy,d.toString())}},A=(h,d)=>(r.font=h,r.letterSpacing=`${a}px`,r.measureText(d));for(const h of e){const d=c.length,{fontSize:f,font:g}=u(c.length);let p={items:[],font:g,fontSize:f,lineWidth:0,fontAscent:0,fontDescent:0},E="",C="";const B=()=>{const y=A(p.font,"");p.fontAscent=y.fontBoundingBoxAscent,p.fontDescent=y.fontBoundingBoxDescent,c.push(p);const x=u(c.length);p={items:[],font:x.font,fontSize:x.fontSize,lineWidth:0,fontAscent:0,fontDescent:0},E="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const M=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=M?A(p.font,M).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:M}};let Q=x();const _=l?A(p.font,E+Q.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&_>n+Vl&&p.items.length>0&&(B(),Q=x()),s&&l&&p.items.length===0&&Q.width>n+Vl){let M=y.text;for(;M.length>0;){let P="";for(const $ of M){const K=A(p.font,P+$).width+o;if(P&&K>n+Vl)break;P+=$}M=M.slice(P.length);const D=A(p.font,P);p.items.push({token:{...y,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()}C="";continue}p.items.push(Q),E+=Q.gapText+y.text,p.lineWidth=l?A(p.font,E).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,C=""}l&&C&&(p.items.length>0||c.length===d)&&(E+=C,p.lineWidth=A(p.font,E).width+o*p.items.length),(p.items.length>0||c.length===d)&&B()}return c}const Ed=[{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 Id({text:r,font:e}){let t=e;return Ed.forEach(({family:i,regex:n})=>{n.exec(r)&&(t+=`, ${i}`)}),t}function vd(r){return Math.max(r??1,.5)}function My({measured:r,index:e,lineTop:t,dx:i,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:l}){const{items:c,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=vd(a),E=A*p+l,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+l/2,{order:x,directions:Q,baseDirection:_}=Sy(c.map(({token:Z})=>({text:Z.text})),o),M=c.map(({gapBefore:Z})=>Z);let P=i+g+l/2;const D=[];x.forEach((Z,L)=>{const U=c[Z];P+=M[L],D.push({...U.token,x:P,baselineY:y,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?c[V].token.text:`${c[V].gapText}${c[V].token.text}`).join("")});const ee=o??_;return{index:e,box:{x:i+g,y:t,width:h,height:E},baselineY:y,direction:ee,runs:$,tokens:D}}function Fy(r){const{context:e,text:t,font:i,fontSizes:n,dx:s=0,dy:o=0,maxW:a=1/0,dw:l=a,align:c="left",direction:u,lineHeight:A,lineGap:h=0,letterSpacing:d=0,strokeWidth:f=0,wrap:g=!0,uppercase:p=!1}=r,E=Ly(t,p),C=E.flat().map(({text:Q})=>Q).join(" "),B=Id({font:i,text:C}),y=u??Ty(C),x=By(c,y);try{e.save();const Q=ky({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=My({measured:Q[ee],index:ee,lineTop:M,dx:s,dw:l,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*vd(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:y,font:B}}finally{e.restore()}}Bu(Fy,{cache:wy(),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 Py(r){return r.slice(0,1).toUpperCase()+r.slice(1)}Object.keys(zh).map(r=>({label:Py(r),value:r,data:r}));const Ny=fr(()=>Wu.loadYoga());function Oy(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 ko=64;function Uy(){const r=[],e={x:.5,y:.5},t=.5;for(let i=0;i<ko;i++){const n=i/ko*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 Gy(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<ko;s++){const o=s/ko*2*Math.PI,a=t.x+i*Math.cos(o),l=t.y+n*Math.sin(o);e.push({x:a,y:l})}return e}function Hy(){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 yd(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 Mo(r){if(r<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let c=0;c<r;c++){const u=c*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(c=>c.x)),n=Math.max(...t.map(c=>c.x)),s=Math.min(...t.map(c=>c.y)),o=Math.max(...t.map(c=>c.y)),a=n-i,l=o-s;for(const c of t){const u=(c.x-i)/a,A=(c.y-s)/l;e.push({x:u,y:A})}return e}function Cd(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 $y(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),l=.5+o*Math.sin(s);t.push({x:a,y:l})}return t}function Yy(r="isosceles",e={}){switch(r){case"equilateral":return Vy();case"isosceles":return Bd(e.baseAngle??60);case"right":return Ky(e.rightAnglePosition??"bottom-left");case"scalene":return Wy(e.angles??[60,60,60])}}function Vy(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Bd(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 Ky(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 Wy(r){return Bd(r[0])}function Jy(r={},e=1){const{type:t="rectangle",customPolygon:i,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:l,regularPolygon:c}=r;switch(t){case"rectangle":return yd(0,e);case"parallelogram":return yd((n==null?void 0:n.angle)??30,e);case"triangle":return Yy((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 Cd((o==null?void 0:o.angle)??90);case"diamond":return Cd(90);case"pentagon":return Mo(5);case"hexagon":return Mo(6);case"octagon":return Mo(8);case"star":return $y((l==null?void 0:l.points)??5,(l==null?void 0:l.innerRadius)??.4);case"arrow":return Oy((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return Hy();case"circle":return Uy();case"ellipse":return Gy(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 Mo((c==null?void 0:c.sides)??6)}}function jy(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,l=e[s].y,c=e[o].x,u=e[o].y;l>n!=u>n&&i<(c-a)*(n-l)/(u-l)+a&&(t=!t)}return t}function qy(r,e){let t=1,i=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;jy({x:o,y:r},e)&&(t=Math.min(t,o),i=Math.max(i,o))}return i>=t?{left:t,right:i}:null}function Xy(r){const e=Math.min(...r.map(l=>l.y)),t=Math.max(...r.map(l=>l.y));let i={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let l=0;l<=s;l++){const c=e+l*o;a.push({y:c,span:qy(c,r)})}for(let l=0;l<a.length-1;l++){const c=a[l].y;for(let u=l+1;u<a.length;u++){const h=a[u].y-c;let d=0,f=1,g=!0;const p=Math.min(5,u-l+1);for(let E=0;E<p;E++){const C=l+Math.floor(E/(p-1)*(u-l)),B=a[C].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,C=E*h;C>n&&(n=C,i={x:d,y:c,width:E,height:h})}}}return i}function zy(r,e=1){const t=Jy(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=Xy(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 Zy="video",eC=.01,Td=(r,e)=>Math.abs(r-e)<=e*eC,tC={type:Zy,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(),l=o/a;return s>l||Td(s,l)?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 Td(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:l})=>{const{crop:c,flip:u=!1,format:A="letterbox",speed:h=1}=o,d=l.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:C,bottomLeft:B,bottomRight:y}=n;yy({context:d,x:r,y:e,width:t,height:i,radii:[E,C,y,B]}),d.clip(),Wv({context:d,crop:c,flip:u,format:A,sourceWidth:g,sourceHeight:p,source:f,posX:r,posY:e,drawAreaWidth:t,drawAreaHeight:i,cropCanvas:l.cropCanvas,letterboxCanvas:l.letterboxCanvas}),d.restore()}}};function rr(r){let e=0;for(const t of r)Array.isArray(t)?e+=rr(t):e+=t;return e}function Fo(r){return r.map(({type:e,duration:t},i)=>{var n,s,o,a;if(e==="transition"){const l=((n=r[i-2])==null?void 0:n.type)==="transition"?r[i-2]:null,c=((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(l?c/2:c,t,A?u/2:u)*-1}return t})}function Kl(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(...Kl(n,e));return i}function bd(r){return r===null||typeof r=="number"&&!Number.isFinite(r)}function rC(r){const e={};for(const[t,i]of Object.entries(r))bd(i)||(typeof i=="object"&&!Array.isArray(i)?e[t]=Object.fromEntries(Object.entries(i).filter(([,n])=>!bd(n))):e[t]=i);return e}function iC(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 nC(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 sC(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 oC(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 Sd(r,e,{layout:t,scale:i=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:l,minHeight:c,maxWidth:u,maxHeight:A,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:E,direction:C="column",align:B="start",alignSelf:y,justify:x="start"}=rC(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}=nC(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(_[C]);const M={start:r.ALIGN_FLEX_START,end:r.ALIGN_FLEX_END,center:r.ALIGN_CENTER,stretch:r.ALIGN_STRETCH};e.setAlignItems(M[B]),y&&e.setAlignSelf(M[y]);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}=sC(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}=oC(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 l<"u"&&e.setMinWidth(typeof l=="number"?l*i:l),typeof c<"u"&&e.setMinHeight(typeof c=="number"?c*i:c),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*i:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*i:A)}async function xd({id:r,yoga:e,index:t,parent:i,element:n,resolvers:s}){var o,a,l;const{layout:c={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();Sd(e,d,{layout:c}),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((l=n.children)==null?void 0:l.entries())??[])g.push(await xd({id:r,yoga:e,index:p,parent:d,element:E,resolvers:s}));return{node:d,radius:iC(c.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function wd(r,e,t=0,i=0){const{top:n,left:s}=r.getComputedLayout(),{top:o,left:a,width:l,height:c}=e.node.getComputedLayout(),u=t+a,A=i+o,h=e.childNodes.map(d=>wd(r,d,u,A));return{...e,x:s+u,y:n+A,width:l,height:c,childNodes:h}}async function Wl({yoga:r,root:e,tree:t,measureCanvas:i}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:l}of t){if(a){const{width:c,height:u}=a;if(c&&i){e.calculateLayout();const A=await c({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,C;g<p?(E=g/p,C=1):(E=1,C=p/g),s.crop={x:(1-E)/2,y:(1-C)/2,width:E,height:C}}}}}if(await Wl({yoga:r,root:e,tree:l,measureCanvas:i}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=zy(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 Wl({yoga:r,root:e,tree:l,measureCanvas:i})}}async function Qd({id:r,root:e,resolvers:t,measureCanvas:i}){const n=await Ny(),s=n.Node.create();Sd(n,s,{layout:e.layout});const o=await xd({id:r,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Wl({yoga:n,root:s,tree:[o],measureCanvas:i});const{top:a,left:l,width:c,height:u}=s.getComputedLayout(),A={root:{x:l,y:a,width:c,height:u},node:wd(s,o)};return s.freeRecursive(),A}function Rd(){return document.createElement("canvas")}function aC(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 lC(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,'\\"')}xE.filters.define("parse",r=>typeof r>"u"?null:typeof r=="string"?`"${lC(r)}"`:aC(r)||Array.isArray(r)?JSON.stringify(r):r);function cC(r){return r.some(({type:e})=>e==="text")}function AC(r){return r.some(({type:e})=>e==="caption")}function uC(r){return r.some(({type:e})=>e==="audio")}function hC(r){return r.some(({type:e})=>e==="video"||e==="image")}function Po(r){return r.type==="audio"}function dC(r){return r.type==="video"}const fC="3";async function gC({scene:r,start:e=0}){const{id:t,root:i,duration:n}=r,s=await Qd({id:t,root:i});return{type:r.type,start:e,duration:n,layout:s,id:r.id,config:r}}async function pC({track:r}){const e=Fo(r),t=await Promise.all(r.reduce((s,o,a)=>{if(o.type!=="audio")return s;const l=rr(e.slice(0,a));return s.push(gC({scene:o,start:l})),s},[])),i=r.reduce((s,o,a)=>{if(o.type!=="gap")return s;const l=rr(e.slice(0,a));return s.push({type:o.type,id:o.id,start:l,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 _d({node:r,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var l,c,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&&((l=r.element.layout)!=null&&l.transform)?{...r.element.layout,transform:{...r.element.layout.transform,rotation:a.rotation}}:r.element.layout,g=ud({layout:f,sceneTime:t,animations:r.element.animations,elementDuration:i,elementDimensions:{width:r.width,height:r.height}}),{opacity:p,translation:E,scale:C,clip:B,dimensions:y,rotation:x}=g,Q=r.width*y.widthRatio,_=r.height*y.heightRatio;if(d.globalAlpha=p*n,(E.x||E.y)&&d.translate(E.x,E.y),(C!==1||x!==0)&&(d.translate(r.x+Q/2,r.y+_/2),d.scale(C,C),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&&((c=r.options)!=null&&c.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 _d({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:i,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function mC({layout:r,canvases:e,sceneTime:t,sceneDuration:i,debug:n=!1,override:s}){const{node:o}=r;await _d({debug:n,node:o,canvases:e,sceneDuration:i,sceneTime:t,override:s})}async function No({debug:r=!1,scene:e,start:t=0,resolvers:i,rootWidth:n,rootHeight:s,canvasFactory:o=Rd}){var a,l;const{id:c,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),E=o(),C=o(),B=o(),y=o(),x=await Qd({id:c,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??((l=f.element.layout)==null?void 0:l.height)}}},resolvers:i,measureCanvas:y}),Q=async(_,M)=>{const P=Math.max(0,_-t);p.width=p.height=0,p.width=n,p.height=s,await mC({debug:r,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:E,letterboxCanvas:C,posterCanvas:B},override:M})};return{id:c,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function EC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Fo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=rr(o.slice(0,d));return h.type==="caption"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=rr(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=rr(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}function IC({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];Po(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let l,c=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<c&&(l=r[u].id,c=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:l,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 vC({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),l=r.bounds,c=(l==null?void 0:l.width)??i.width,u=(l==null?void 0:l.height)??i.height;return ud({sceneTime:a,animations:r.animations,elementDuration:o,elementDimensions:{width:c,height:u}})}function Dd({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,l=(n==null?void 0:n.height)??i.height,{opacity:c,translation:u,scale:A,clip:h,rotation:d}=e;if(t.globalAlpha*=c,(u.x||u.y)&&t.translate(u.x,u.y),A!==1||d!==0){const f=s+a/2,g=o+l/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*l,h.width*a,h.height*l),t.clip())}async function yC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Fo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=rr(o.slice(0,d));return h.type==="video"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=rr(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=rr(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(0,...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}async function CC({debug:r=!1,track:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}){const o=Fo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=rr(o.slice(0,d));return h.type==="text"&&A.push(No({debug:r,scene:h,start:f,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=rr(o.slice(0,d));return A.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),A},[]),c=e.reduce((A,h,d)=>{if(h.type!=="transition")return A;const f=h.duration,g=rr(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)??l.find(({id:h})=>h===A)??c.find(({id:h})=>h===A)).filter(Boolean);return{type:"text",scenes:a,gapScenes:l,transitions:c,mergedScenes:u,duration:Math.max(...u.map(({start:A,duration:h})=>A+h)),trackCanvas:s()}}const BC=(((qh=jh)==null?void 0:qh.default)??jh).reduce((r,e)=>(r[e.name]=e,r),{});function TC(r,e){return r.has(e)||r.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),r.get(e)}function bC({name:r,to:e,from:t,progress:i,width:n,height:s,glContext:o,contextResources:a,returnPixels:l=!0}){var c,u,A;const h=TC(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=(((c=wo)==null?void 0:c.default)??wo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=wo)==null?void 0:u.default)??wo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[r]||(h.transitions[r]=(((A=Jh)==null?void 0:A.default)??Jh)(o,BC[r])),h.transitions[r].draw(i,h.fromTexture,h.toTexture,n,s),!l)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 SC(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 xC({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),bC({name:r,to:e,from:t,progress:i,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function Ld({debug:r=!1,config:e,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s=Rd,drawTransition:o=xC}){var a;const l=new Map,c=await Promise.all(e.tracks.map(async E=>{if(hC(E))return{...await yC({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(cC(E))return{...await CC({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(AC(E))return{...await EC({debug:r,track:E,resolvers:t,rootWidth:i,rootHeight:n,canvasFactory:s}),config:E};if(uC(E))return{...await pC({track:E}),config:E};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?IC({groups:e.groups,tracks:c}):[],A=new Map,h=[...u].sort((E,C)=>E.depth-C.depth);for(const E of h)for(const C of E.sceneIds)A.set(C,E);const d=new Map(u.map(E=>[E.id,E]));function f(E){const C=[];let B=A.get(E.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:E,currentTime:C,overrides:B,signal:y})=>{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 c)if(!Po(D))for(const $ of D.scenes){if(C<$.start||C>=$.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 $=vC({group:D,currentTime:C,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&&Dd({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<c.length;D++){if(y!=null&&y.aborted)return;const $=c[D];if(Po($))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})=>C>=R&&C<R+F);if(U.length===0)continue;const V=ee.find(({start:R,duration:F})=>C>=R&&C<R+F),k=!!(V&&V.to&&V.from&&V.duration>0);for await(const R of U){if(y!=null&&y.aborted)return;const{sceneCanvas:F,draw:J,id:Y}=R;if(await(J==null?void 0:J(C,B==null?void 0:B.get(Y))),y!=null&&y.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 oe=Math.min(1,Math.max(0,(C-F.start)/Y));if(await o({name:R,progress:oe,contextResources:l,to:F.sceneCanvas,from:J.sceneCanvas,canvas:re}),y!=null&&y.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&&Dd({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:()=>{SC(l)},tracks:c,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...c.map(({duration:E})=>E))}}const cs=.3,Oo=.5,wC=1;function QC(r){return r.tracks.flatMap(t=>t.scenes).filter(dC).filter(t=>{var i;const n=Kl(t.config.root.element,"video")[0];if(!n||(i=n.config)!=null&&i.alpha)return!1;const{volume:s}=tC.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<wC?t[t.length-1]={start:n.start,end:Math.max(n.end,i.end)}:t.push(i),t},[])}const RC=r=>Math.round(r*1e6)/1e6;function _C(r,e,t){return e.reduce((i,{start:n,end:s})=>r<=n-cs||r>=s+Oo?i:r<n?Math.min(i,1-(1-t)*(r-(n-cs))/cs):r<=s?Math.min(i,t):Math.min(i,t+(1-t)*(r-s)/Oo),1)}function DC(r,e){const t=Kl(r.config.root.element,"audio")[0],{duration:i}=r;if(!t||i<=0)return null;const n=Iy.transform.values(t.options??{}),[s]=n.duckLevel,[o]=n.fadeIn,[a]=n.fadeOut,l=n.duck&&s<1?e.map(({start:A,end:h})=>({start:A-r.start,end:h-r.start})).filter(({start:A,end:h})=>A-cs<i&&h+Oo>0):[];if(o<=0&&a<=0&&l.length===0)return null;const c=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)]:[],...l.flatMap(({start:A,end:h})=>[A-cs,A,h,h+Oo])];return[...new Set(u.filter(A=>A>=0&&A<=i).map(RC))].sort((A,h)=>A-h).map(A=>({time:A,gain:c(A)*_C(A,l,s)}))}function LC(r){const e=QC(r),t=new Map;for(const i of r.tracks)if(Po(i))for(const n of i.scenes){const s=DC(n,e);s&&t.set(n.id,s)}return t}function kC(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 MC={name:"@vouchfor/embeds",version:"8.7.3",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.3",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 FC(r){const{publicApiUrl:e}=so(r),t=oi();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function PC(r){var s,o,a,l,c,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:oi()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(l=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:l.call(a,"vouch-uid-client"),i=(u=(c=window.sessionStorage)==null?void 0:c.getItem)==null?void 0:u.call(c,"vouch-uid-tab");const n=oi();return e||(e=FC(r),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=oi(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),i||(i=oi(),(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 NC(r,e){return r&&"vouchId"in r?r.vouchId:(e==null?void 0:e.id)??null}function OC(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 l=o.toLowerCase().replace(/[-_][a-z0-9]/g,c=>c.slice(-1).toUpperCase());i[l]=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:MC.version,templateVersion:fC,...i}}const kd=1;class UC{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,i)=>{const n=NC(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}=so(this.host.env),{client:i,tab:n,request:s,visitor:o}=PC(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":OC(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:i}=this._currentlyPlayingVideo;this._streamLatestTime[i]>this._streamStartTime[i]+kd&&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]+kd&&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 Jl={exports:{}};(function(r,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof li<"u"&&li,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 li<"u"&&li||{},l={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 c(L){return L&&DataView.prototype.isPrototypeOf(L)}if(l.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 l.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)},l.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 C(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 y(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:l.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:l.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():l.arrayBuffer&&l.blob&&c(L)?(this._bodyArrayBuffer=x(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.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):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.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(l.blob)return this.blob().then(C);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(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.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 oe={statusText:F.statusText,headers:$(F.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(F.status<200||F.status>599)?oe.status=200:oe.status=F.status,oe.url="responseURL"in F?F.responseURL:oe.headers.get("X-Request-URL");var fe="response"in F?F.response:F.responseText;setTimeout(function(){V(new K(fe,oe))},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(oe){try{return oe===""&&a.location.href?a.location.href:oe}catch{return oe}}if(F.open(R.method,Y(R.url),!0),R.credentials==="include"?F.withCredentials=!0:R.credentials==="omit"&&(F.withCredentials=!1),"responseType"in F&&(l.blob?F.responseType="blob":l.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(oe){re.push(h(oe)),F.setRequestHeader(oe,d(U.headers[oe]))}),R.headers.forEach(function(oe,fe){re.indexOf(fe)===-1&&F.setRequestHeader(fe,oe)})}else R.headers.forEach(function(oe,fe){F.setRequestHeader(fe,oe)});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})(Jl,Jl.exports);var GC=Jl.exports;const Md=Al(GC);async function HC(r){var e;try{if((e=await Md(r,{method:"HEAD"}))!=null&&e.ok)return r}catch{return}}async function jl({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=>HC(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function $C(r){try{return(await Md(r)).text()}catch{return null}}async function YC(r){return r=r.trim(),r.startsWith("http")||r.startsWith("blob:")?$C(r):r}function VC(r){if(typeof r=="string"){const[e,t]=r.split(":");return parseFloat(e)/parseFloat(t)}return r}const KC=fr(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},l=(n&&a[n])??r;return l?YC(l):null},{cacheKey:([r,{language:e}])=>JSON.stringify({...r,language:e})});function WC(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 JC=fr(async r=>{var e,t,i,n,s,o,a,l,c,u,A;const[h,d,f]=await Promise.all([jl({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]}),jl({sources:[(o=(s=r==null?void 0:r.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),jl({sources:[((l=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((A=(u=(c=r==null?void 0:r.answer)==null?void 0:c.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,l,c,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:((l=(a=r==null?void 0:r.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((A=(u=(c=r==null?void 0:r.answer)==null?void 0:c.media)==null?void 0:u.videos)==null?void 0:A.xs)})}});function Fd(r){var e,t,i,n,s,o,a,l,c,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=((l=(a=(o=r==null?void 0:r.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:l.name)==="Not Supplied"?"":((h=(A=(u=(c=r==null?void 0:r.answer)==null?void 0:c.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 jC(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 qC(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((l,c)=>{var u;return((u=c==null?void 0:c.answer)==null?void 0:u.id)===o?(l??0)+1:l},0))<=1?o:`${o}-${t}`}async function ql({data:r,rootData:e,index:t},i){var n,s,o,a,l,c,u,A,h,d,f,g,p,E,C,B,y,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=VC(ee.aspectRatio));const[Z,L,U]=await Promise.all([qC(r,e,t),JC(e),KC({original:((o=(s=e==null?void 0:e.answer)==null?void 0:s.media)==null?void 0:o.captions)??((l=(a=e==null?void 0:e.answer)==null?void 0:a.captions)==null?void 0:l.current),translation:((u=(c=e==null?void 0:e.answer)==null?void 0:c.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=Fd(e),k=jC(e);return{...L,...V,...k,key:Z,captions:U,wordTimings:WC((C=e==null?void 0:e.answer)==null?void 0:C.transcription),answerLabel:((B=e==null?void 0:e.answer)==null?void 0:B.label)??(e==null?void 0:e.title),prevAnswerLabel:t?((_=(Q=(x=(y=r==null?void 0:r.questions)==null?void 0:y.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=>Fd(R).name===V.name))===t:!0}}const Uo={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 XC({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,l,c,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=(c=(l=n==null?void 0:n.answer)==null?void 0:l.transcription)==null?void 0:c.translation)==null?void 0:u.language)==null?void 0:A.split("-")[0];return h&&Uo[h]&&!i.find(f=>f.value===h)&&i.push({value:h,label:Uo[h]}),d&&Uo[d]&&!i.find(f=>f.value===d)&&i.push({value:d,label:Uo[d]}),i},[]))??[]}/**
|
|
2464
2464
|
* @license
|
|
2465
2465
|
* Copyright 2018 Google LLC
|
|
@@ -2511,7 +2511,7 @@ Schedule: ${l.map(d=>mi(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 y0=(r,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},C0=rn(class extends Kn{constructor(r){if(super(r),r.type!==tn.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=Wp(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=[]),l=[];let c,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])l[d]=Li(n[A],s[d]),A++,d++;else if(a[h]===o[f])l[f]=Li(n[h],s[f]),h--,f--;else if(a[A]===o[f])l[f]=Li(n[A],s[f]),Vn(r,l[f+1],n[A]),A++,f--;else if(a[h]===o[d])l[d]=Li(n[h],s[d]),Vn(r,n[A],n[h]),h--,d++;else if(c===void 0&&(c=y0(o,d,f),u=y0(a,A,h)),c.has(a[A]))if(c.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const E=Vn(r,n[A]);Li(E,s[d]),l[d]=E}else l[d]=Li(p,s[d]),Vn(r,n[A],p),n[g]=null;d++}else ja(n[h]),h--;else ja(n[A]),A++;for(;d<=f;){const g=Vn(r,l[f+1]);Li(g,s[d]),l[d++]=g}for(;A<=h;){const g=n[A++];g!==null&&ja(g)}return this.ut=o,Kp(r,l),dr}});var Ht="top",ar="bottom",lr="right",$t="left",aA="auto",Ts=[Ht,ar,lr,$t],En="start",bs="end",$S="clippingParents",B0="viewport",Ss="popper",YS="reference",T0=Ts.reduce(function(r,e){return r.concat([e+"-"+En,e+"-"+bs])},[]),b0=[].concat(Ts,[aA]).reduce(function(r,e){return r.concat([e,e+"-"+En,e+"-"+bs])},[]),VS="beforeRead",KS="read",WS="afterRead",JS="beforeMain",jS="main",qS="afterMain",XS="beforeWrite",zS="write",ZS="afterWrite",ex=[VS,KS,WS,JS,jS,qS,XS,zS,ZS];function kr(r){return r?(r.nodeName||"").toLowerCase():null}function qt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Hi(r){var e=qt(r).Element;return r instanceof e||r instanceof Element}function cr(r){var e=qt(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function lA(r){if(typeof ShadowRoot>"u")return!1;var e=qt(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function tx(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];!cr(s)||!kr(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 rx(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(l,c){return l[c]="",l},{});!cr(n)||!kr(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const S0={name:"applyStyles",enabled:!0,phase:"write",fn:tx,effect:rx,requires:["computeStyles"]};function Mr(r){return r.split("-")[0]}var $i=Math.max,ya=Math.min,In=Math.round;function cA(){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 x0(){return!/^((?!chrome|android).)*safari/i.test(cA())}function vn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=r.getBoundingClientRect(),n=1,s=1;e&&cr(r)&&(n=r.offsetWidth>0&&In(i.width)/r.offsetWidth||1,s=r.offsetHeight>0&&In(i.height)/r.offsetHeight||1);var o=Hi(r)?qt(r):window,a=o.visualViewport,l=!x0()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/n,u=(i.top+(l&&a?a.offsetTop:0))/s,A=i.width/n,h=i.height/s;return{width:A,height:h,top:u,right:c+A,bottom:u+h,left:c,x:c,y:u}}function AA(r){var e=vn(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 w0(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&lA(t)){var i=e;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function zr(r){return qt(r).getComputedStyle(r)}function ix(r){return["table","td","th"].indexOf(kr(r))>=0}function Ei(r){return((Hi(r)?r.ownerDocument:r.document)||window.document).documentElement}function Ca(r){return kr(r)==="html"?r:r.assignedSlot||r.parentNode||(lA(r)?r.host:null)||Ei(r)}function Q0(r){return!cr(r)||zr(r).position==="fixed"?null:r.offsetParent}function nx(r){var e=/firefox/i.test(cA()),t=/Trident/i.test(cA());if(t&&cr(r)){var i=zr(r);if(i.position==="fixed")return null}var n=Ca(r);for(lA(n)&&(n=n.host);cr(n)&&["html","body"].indexOf(kr(n))<0;){var s=zr(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 xs(r){for(var e=qt(r),t=Q0(r);t&&ix(t)&&zr(t).position==="static";)t=Q0(t);return t&&(kr(t)==="html"||kr(t)==="body"&&zr(t).position==="static")?e:t||nx(r)||e}function uA(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function ws(r,e,t){return $i(r,ya(e,t))}function sx(r,e,t){var i=ws(r,e,t);return i>t?t:i}function R0(){return{top:0,right:0,bottom:0,left:0}}function _0(r){return Object.assign({},R0(),r)}function D0(r,e){return e.reduce(function(t,i){return t[i]=r,t},{})}var ox=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,_0(typeof e!="number"?e:D0(e,Ts))};function ax(r){var e,t=r.state,i=r.name,n=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Mr(t.placement),l=uA(a),c=[$t,lr].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var A=ox(n.padding,t),h=AA(s),d=l==="y"?Ht:$t,f=l==="y"?ar:lr,g=t.rects.reference[u]+t.rects.reference[l]-o[l]-t.rects.popper[u],p=o[l]-t.rects.reference[l],E=xs(s),C=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,B=g/2-p/2,y=A[d],x=C-h[u]-A[f],Q=C/2-h[u]/2+B,_=ws(y,Q,x),M=l;t.modifiersData[i]=(e={},e[M]=_,e.centerOffset=_-Q,e)}}function lx(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)||w0(e.elements.popper,n)&&(e.elements.arrow=n))}const cx={name:"arrow",enabled:!0,phase:"main",fn:ax,effect:lx,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yn(r){return r.split("-")[1]}var Ax={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ux(r,e){var t=r.x,i=r.y,n=e.devicePixelRatio||1;return{x:In(t*n)/n||0,y:In(i*n)/n||0}}function L0(r){var e,t=r.popper,i=r.popperRect,n=r.placement,s=r.variation,o=r.offsets,a=r.position,l=r.gpuAcceleration,c=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"),C=o.hasOwnProperty("y"),B=$t,y=Ht,x=window;if(c){var Q=xs(t),_="clientHeight",M="clientWidth";if(Q===qt(t)&&(Q=Ei(t),zr(Q).position!=="static"&&a==="absolute"&&(_="scrollHeight",M="scrollWidth")),Q=Q,n===Ht||(n===$t||n===lr)&&s===bs){y=ar;var P=A&&Q===x&&x.visualViewport?x.visualViewport.height:Q[_];g-=P-i.height,g*=l?1:-1}if(n===$t||(n===Ht||n===ar)&&s===bs){B=lr;var D=A&&Q===x&&x.visualViewport?x.visualViewport.width:Q[M];d-=D-i.width,d*=l?1:-1}}var $=Object.assign({position:a},c&&Ax),K=u===!0?ux({x:d,y:g},qt(t)):{x:d,y:g};if(d=K.x,g=K.y,l){var ee;return Object.assign({},$,(ee={},ee[y]=C?"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[y]=C?g+"px":"",e[B]=E?d+"px":"",e.transform="",e))}function hx(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,l=a===void 0?!0:a,c={placement:Mr(e.placement),variation:yn(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,L0(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,L0(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const dx={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:hx,data:{}};var Ba={passive:!0};function fx(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,l=qt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",t.update,Ba)}),a&&l.addEventListener("resize",t.update,Ba),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",t.update,Ba)}),a&&l.removeEventListener("resize",t.update,Ba)}}const gx={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fx,data:{}};var px={left:"right",right:"left",bottom:"top",top:"bottom"};function Ta(r){return r.replace(/left|right|bottom|top/g,function(e){return px[e]})}var mx={start:"end",end:"start"};function k0(r){return r.replace(/start|end/g,function(e){return mx[e]})}function hA(r){var e=qt(r),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function dA(r){return vn(Ei(r)).left+hA(r).scrollLeft}function Ex(r,e){var t=qt(r),i=Ei(r),n=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var c=x0();(c||!c&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+dA(r),y:l}}function Ix(r){var e,t=Ei(r),i=hA(r),n=(e=r.ownerDocument)==null?void 0:e.body,s=$i(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=$i(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+dA(r),l=-i.scrollTop;return zr(n||t).direction==="rtl"&&(a+=$i(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function fA(r){var e=zr(r),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function M0(r){return["html","body","#document"].indexOf(kr(r))>=0?r.ownerDocument.body:cr(r)&&fA(r)?r:M0(Ca(r))}function Qs(r,e){var t;e===void 0&&(e=[]);var i=M0(r),n=i===((t=r.ownerDocument)==null?void 0:t.body),s=qt(i),o=n?[s].concat(s.visualViewport||[],fA(i)?i:[]):i,a=e.concat(o);return n?a:a.concat(Qs(Ca(o)))}function gA(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function vx(r,e){var t=vn(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 F0(r,e,t){return e===B0?gA(Ex(r,t)):Hi(e)?vx(e,t):gA(Ix(Ei(r)))}function yx(r){var e=Qs(Ca(r)),t=["absolute","fixed"].indexOf(zr(r).position)>=0,i=t&&cr(r)?xs(r):r;return Hi(i)?e.filter(function(n){return Hi(n)&&w0(n,i)&&kr(n)!=="body"}):[]}function Cx(r,e,t,i){var n=e==="clippingParents"?yx(r):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,c){var u=F0(r,c,i);return l.top=$i(u.top,l.top),l.right=ya(u.right,l.right),l.bottom=ya(u.bottom,l.bottom),l.left=$i(u.left,l.left),l},F0(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 P0(r){var e=r.reference,t=r.element,i=r.placement,n=i?Mr(i):null,s=i?yn(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case Ht:l={x:o,y:e.y-t.height};break;case ar:l={x:o,y:e.y+e.height};break;case lr:l={x:e.x+e.width,y:a};break;case $t:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=n?uA(n):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case En:l[c]=l[c]-(e[u]/2-t[u]/2);break;case bs:l[c]=l[c]+(e[u]/2-t[u]/2);break}}return l}function Rs(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,l=a===void 0?$S:a,c=t.rootBoundary,u=c===void 0?B0:c,A=t.elementContext,h=A===void 0?Ss:A,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,E=_0(typeof p!="number"?p:D0(p,Ts)),C=h===Ss?YS:Ss,B=r.rects.popper,y=r.elements[f?C:h],x=Cx(Hi(y)?y:y.contextElement||Ei(r.elements.popper),l,u,o),Q=vn(r.elements.reference),_=P0({reference:Q,element:B,strategy:"absolute",placement:n}),M=gA(Object.assign({},B,_)),P=h===Ss?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===Ss&&$){var K=$[n];Object.keys(D).forEach(function(ee){var Z=[lr,ar].indexOf(ee)>=0?1:-1,L=[Ht,ar].indexOf(ee)>=0?"y":"x";D[ee]+=K[L]*Z})}return D}function Bx(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?b0:l,u=yn(i),A=u?a?T0:T0.filter(function(f){return yn(f)===u}):Ts,h=A.filter(function(f){return c.indexOf(f)>=0});h.length===0&&(h=A);var d=h.reduce(function(f,g){return f[g]=Rs(r,{placement:g,boundary:n,rootBoundary:s,padding:o})[Mr(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function Tx(r){if(Mr(r)===aA)return[];var e=Ta(r);return[k0(r),e,k0(e)]}function bx(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,l=t.fallbackPlacements,c=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=Mr(p),C=E===p,B=l||(C||!f?[Ta(p)]:Tx(p)),y=[p].concat(B).reduce(function(oe,fe){return oe.concat(Mr(fe)===aA?Bx(e,{placement:fe,boundary:u,rootBoundary:A,padding:c,flipVariations:f,allowedAutoPlacements:g}):fe)},[]),x=e.rects.reference,Q=e.rects.popper,_=new Map,M=!0,P=y[0],D=0;D<y.length;D++){var $=y[D],K=Mr($),ee=yn($)===En,Z=[Ht,ar].indexOf(K)>=0,L=Z?"width":"height",U=Rs(e,{placement:$,boundary:u,rootBoundary:A,altBoundary:h,padding:c}),V=Z?ee?lr:$t:ee?ar:Ht;x[L]>Q[L]&&(V=Ta(V));var k=Ta(V),R=[];if(s&&R.push(U[K]<=0),a&&R.push(U[V]<=0,U[k]<=0),R.every(function(oe){return oe})){P=$,M=!1;break}_.set($,R)}if(M)for(var F=f?3:1,J=function(fe){var me=y.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 Sx={name:"flip",enabled:!0,phase:"main",fn:bx,requiresIfExists:["offset"],data:{_skip:!1}};function N0(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 O0(r){return[Ht,lr,ar,$t].some(function(e){return r[e]>=0})}function xx(r){var e=r.state,t=r.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Rs(e,{elementContext:"reference"}),a=Rs(e,{altBoundary:!0}),l=N0(o,i),c=N0(a,n,s),u=O0(l),A=O0(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":A})}const wx={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xx};function Qx(r,e,t){var i=Mr(r),n=[$t,Ht].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,[$t,lr].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Rx(r){var e=r.state,t=r.options,i=r.name,n=t.offset,s=n===void 0?[0,0]:n,o=b0.reduce(function(u,A){return u[A]=Qx(A,e.rects,s),u},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}const _x={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rx};function Dx(r){var e=r.state,t=r.name;e.modifiersData[t]=P0({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Lx={name:"popperOffsets",enabled:!0,phase:"read",fn:Dx,data:{}};function kx(r){return r==="x"?"y":"x"}function Mx(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,l=t.boundary,c=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=Rs(e,{boundary:l,rootBoundary:c,padding:A,altBoundary:u}),E=Mr(e.placement),C=yn(e.placement),B=!C,y=uA(E),x=kx(y),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=y==="y"?Ht:$t,L=y==="y"?ar:lr,U=y==="y"?"height":"width",V=Q[y],k=V+p[Z],R=V-p[L],F=d?-M[U]/2:0,J=C===En?_[U]:M[U],Y=C===En?-M[U]:-_[U],re=e.elements.arrow,oe=d&&re?AA(re):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:R0(),me=fe[Z],De=fe[L],be=ws(0,_[U],oe[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&&xs(e.elements.arrow),He=xe?y==="y"?xe.clientTop||0:xe.clientLeft||0:0,_e=(ee=$==null?void 0:$[y])!=null?ee:0,ze=V+ke-_e-He,we=V+pe-_e,S=ws(d?ya(k,ze):k,V,d?$i(R,we):R);Q[y]=S,K[y]=S-V}if(a){var I,m=y==="x"?Ht:$t,w=y==="x"?ar:lr,N=Q[x],G=x==="y"?"height":"width",z=N+p[m],ae=N-p[w],Ae=[Ht,$t].indexOf(E)!==-1,he=(I=$==null?void 0:$[x])!=null?I:0,ve=Ae?z:N-_[G]-M[G]-he+D.altAxis,Be=Ae?N+_[G]+M[G]-he-D.altAxis:ae,Le=d&&Ae?sx(ve,N,Be):ws(d?ve:z,N,d?Be:ae);Q[x]=Le,K[x]=Le-N}e.modifiersData[i]=K}}const Fx={name:"preventOverflow",enabled:!0,phase:"main",fn:Mx,requiresIfExists:["offset"]};function Px(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Nx(r){return r===qt(r)||!cr(r)?hA(r):Px(r)}function Ox(r){var e=r.getBoundingClientRect(),t=In(e.width)/r.offsetWidth||1,i=In(e.height)/r.offsetHeight||1;return t!==1||i!==1}function Ux(r,e,t){t===void 0&&(t=!1);var i=cr(e),n=cr(e)&&Ox(e),s=Ei(e),o=vn(r,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((kr(e)!=="body"||fA(s))&&(a=Nx(e)),cr(e)?(l=vn(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=dA(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Gx(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 l=e.get(a);l&&n(l)}}),i.push(s)}return r.forEach(function(s){t.has(s.name)||n(s)}),i}function Hx(r){var e=Gx(r);return ex.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function $x(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function Yx(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 U0={placement:"bottom",modifiers:[],strategy:"absolute"};function G0(){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 Vx(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?U0:n;return function(a,l,c){c===void 0&&(c=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},U0,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},A=[],h=!1,d={state:u,setOptions:function(E){var C=typeof E=="function"?E(u.options):E;g(),u.options=Object.assign({},s,u.options,C),u.scrollParents={reference:Hi(a)?Qs(a):a.contextElement?Qs(a.contextElement):[],popper:Qs(l)};var B=Hx(Yx([].concat(i,u.options.modifiers)));return u.orderedModifiers=B.filter(function(y){return y.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var E=u.elements,C=E.reference,B=E.popper;if(G0(C,B)){u.rects={reference:Ux(C,xs(B),u.options.strategy==="fixed"),popper:AA(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 y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var x=u.orderedModifiers[y],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:$x(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!G0(a,l))return d;d.setOptions(c).then(function(p){!h&&c.onFirstUpdate&&c.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var E=p.name,C=p.options,B=C===void 0?{}:C,y=p.effect;if(typeof y=="function"){var x=y({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 Kx=[gx,Lx,dx,S0,_x,Sx,Fx,cx,wx],Wx=Vx({defaultModifiers:Kx}),Jx="tippy-box",H0="tippy-content",jx="tippy-backdrop",$0="tippy-arrow",Y0="tippy-svg-arrow",Yi={passive:!0,capture:!0},V0=function(){return document.body};function pA(r,e,t){if(Array.isArray(r)){var i=r[e];return i??(Array.isArray(t)?t[e]:t)}return r}function mA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function K0(r,e){return typeof r=="function"?r.apply(void 0,e):r}function W0(r,e){if(e===0)return r;var t;return function(i){clearTimeout(t),t=setTimeout(function(){r(i)},e)}}function qx(r){return r.split(/\s+/).filter(Boolean)}function Cn(r){return[].concat(r)}function J0(r,e){r.indexOf(e)===-1&&r.push(e)}function Xx(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function zx(r){return r.split("-")[0]}function ba(r){return[].slice.call(r)}function j0(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function _s(){return document.createElement("div")}function Sa(r){return["Element","Fragment"].some(function(e){return mA(r,e)})}function Zx(r){return mA(r,"NodeList")}function ew(r){return mA(r,"MouseEvent")}function tw(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function rw(r){return Sa(r)?[r]:Zx(r)?ba(r):Array.isArray(r)?r:ba(document.querySelectorAll(r))}function EA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function q0(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function iw(r){var e,t=Cn(r),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function nw(r,e){var t=e.clientX,i=e.clientY;return r.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,l=a.interactiveBorder,c=zx(o.placement),u=o.modifiersData.offset;if(!u)return!0;var A=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,d=c==="right"?u.left.x:0,f=c==="left"?u.right.x:0,g=s.top-i+A>l,p=i-s.bottom-h>l,E=s.left-t+d>l,C=t-s.right-f>l;return g||p||E||C})}function IA(r,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){r[i](n,t)})}function X0(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 Fr={isTouch:!1},z0=0;function sw(){Fr.isTouch||(Fr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Z0))}function Z0(){var r=performance.now();r-z0<20&&(Fr.isTouch=!1,document.removeEventListener("mousemove",Z0)),z0=r}function ow(){var r=document.activeElement;if(tw(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function aw(){document.addEventListener("touchstart",sw,Yi),window.addEventListener("blur",ow)}var lw=typeof window<"u"&&typeof document<"u",cw=lw?!!window.msCrypto:!1,Aw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},uw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Er=Object.assign({appendTo:V0,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},Aw,uw),hw=Object.keys(Er),dw=function(e){var t=Object.keys(e);t.forEach(function(i){Er[i]=e[i]})};function ep(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=Er[s])!=null?a:o}return i},{});return Object.assign({},r,t)}function fw(r,e){var t=e?Object.keys(ep(Object.assign({},Er,{plugins:e}))):hw,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 tp(r,e){var t=Object.assign({},e,{content:K0(e.content,[r])},e.ignoreAttributes?{}:fw(r,e.plugins));return t.aria=Object.assign({},Er.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 gw=function(){return"innerHTML"};function vA(r,e){r[gw()]=e}function rp(r){var e=_s();return r===!0?e.className=$0:(e.className=Y0,Sa(r)?e.appendChild(r):vA(e,r)),e}function ip(r,e){Sa(e.content)?(vA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?vA(r,e.content):r.textContent=e.content)}function yA(r){var e=r.firstElementChild,t=ba(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(H0)}),arrow:t.find(function(i){return i.classList.contains($0)||i.classList.contains(Y0)}),backdrop:t.find(function(i){return i.classList.contains(jx)})}}function np(r){var e=_s(),t=_s();t.className=Jx,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=_s();i.className=H0,i.setAttribute("data-state","hidden"),ip(i,r.props),e.appendChild(t),t.appendChild(i),n(r.props,r.props);function n(s,o){var a=yA(e),l=a.box,c=a.content,u=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&ip(c,r.props),o.arrow?u?s.arrow!==o.arrow&&(l.removeChild(u),l.appendChild(rp(o.arrow))):l.appendChild(rp(o.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:n}}np.$$tippy=!0;var pw=1,xa=[],CA=[];function mw(r,e){var t=tp(r,Object.assign({},Er,ep(j0(e)))),i,n,s,o=!1,a=!1,l=!1,c=!1,u,A,h,d=[],f=W0(ze,t.interactiveDebounce),g,p=pw++,E=null,C=Xx(t.plugins),B={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:p,reference:r,popper:_s(),popperInstance:E,props:t,state:B,plugins:C,clearDelayTimeouts:ve,setProps:Be,setContent:Le,show:Pe,hide:rt,hideWithInteractivity:at,enable:Ae,disable:he,unmount:Ct,destroy:nt};if(!t.render)return y;var x=t.render(y),Q=x.popper,_=x.onUpdate;Q.setAttribute("data-tippy-root",""),Q.id="tippy-"+y.id,y.popper=Q,r._tippy=y,Q._tippy=y;var M=C.map(function(j){return j.fn(y)}),P=r.hasAttribute("aria-expanded");return xe(),F(),V(),k("onCreate",[y]),t.showOnCreate&&z(),Q.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),Q.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",f)}),y;function D(){var j=y.props.touch;return Array.isArray(j)?j:[j,0]}function $(){return D()[0]==="hold"}function K(){var j;return!!((j=y.props.render)!=null&&j.$$tippy)}function ee(){return g||r}function Z(){var j=ee().parentNode;return j?iw(j):document}function L(){return yA(Q)}function U(j){return y.state.isMounted&&!y.state.isVisible||Fr.isTouch||u&&u.type==="focus"?0:pA(y.props.delay,j?0:1,Er.delay)}function V(j){j===void 0&&(j=!1),Q.style.pointerEvents=y.props.interactive&&!j?"":"none",Q.style.zIndex=""+y.props.zIndex}function k(j,ue,ye){if(ye===void 0&&(ye=!0),M.forEach(function(Ne){Ne[j]&&Ne[j].apply(Ne,ue)}),ye){var Me;(Me=y.props)[j].apply(Me,ue)}}function R(){var j=y.props.aria;if(j.content){var ue="aria-"+j.content,ye=Q.id,Me=Cn(y.props.triggerTarget||r);Me.forEach(function(Ne){var Oe=Ne.getAttribute(ue);if(y.state.isVisible)Ne.setAttribute(ue,Oe?Oe+" "+ye:ye);else{var Je=Oe&&Oe.replace(ye,"").trim();Je?Ne.setAttribute(ue,Je):Ne.removeAttribute(ue)}})}}function F(){if(!(P||!y.props.aria.expanded)){var j=Cn(y.props.triggerTarget||r);j.forEach(function(ue){y.props.interactive?ue.setAttribute("aria-expanded",y.state.isVisible&&ue===ee()?"true":"false"):ue.removeAttribute("aria-expanded")})}}function J(){Z().removeEventListener("mousemove",f),xa=xa.filter(function(j){return j!==f})}function Y(j){if(!(Fr.isTouch&&(l||j.type==="mousedown"))){var ue=j.composedPath&&j.composedPath()[0]||j.target;if(!(y.props.interactive&&X0(Q,ue))){if(Cn(y.props.triggerTarget||r).some(function(ye){return X0(ye,ue)})){if(Fr.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else k("onClickOutside",[y,j]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),a=!0,setTimeout(function(){a=!1}),y.state.isMounted||me())}}}function re(){l=!0}function oe(){l=!1}function fe(){var j=Z();j.addEventListener("mousedown",Y,!0),j.addEventListener("touchend",Y,Yi),j.addEventListener("touchstart",oe,Yi),j.addEventListener("touchmove",re,Yi)}function me(){var j=Z();j.removeEventListener("mousedown",Y,!0),j.removeEventListener("touchend",Y,Yi),j.removeEventListener("touchstart",oe,Yi),j.removeEventListener("touchmove",re,Yi)}function De(j,ue){ke(j,function(){!y.state.isVisible&&Q.parentNode&&Q.parentNode.contains(Q)&&ue()})}function be(j,ue){ke(j,ue)}function ke(j,ue){var ye=L().box;function Me(Ne){Ne.target===ye&&(IA(ye,"remove",Me),ue())}if(j===0)return ue();IA(ye,"remove",A),IA(ye,"add",Me),A=Me}function pe(j,ue,ye){ye===void 0&&(ye=!1);var Me=Cn(y.props.triggerTarget||r);Me.forEach(function(Ne){Ne.addEventListener(j,ue,ye),d.push({node:Ne,eventType:j,handler:ue,options:ye})})}function xe(){$()&&(pe("touchstart",_e,{passive:!0}),pe("touchend",we,{passive:!0})),qx(y.props.trigger).forEach(function(j){if(j!=="manual")switch(pe(j,_e),j){case"mouseenter":pe("mouseleave",we);break;case"focus":pe(cw?"focusout":"blur",S);break;case"focusin":pe("focusout",S);break}})}function He(){d.forEach(function(j){var ue=j.node,ye=j.eventType,Me=j.handler,Ne=j.options;ue.removeEventListener(ye,Me,Ne)}),d=[]}function _e(j){var ue,ye=!1;if(!(!y.state.isEnabled||I(j)||a)){var Me=((ue=u)==null?void 0:ue.type)==="focus";u=j,g=j.currentTarget,F(),!y.state.isVisible&&ew(j)&&xa.forEach(function(Ne){return Ne(j)}),j.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?ye=!0:z(j),j.type==="click"&&(o=!ye),ye&&!Me&&ae(j)}}function ze(j){var ue=j.target,ye=ee().contains(ue)||Q.contains(ue);if(!(j.type==="mousemove"&&ye)){var Me=G().concat(Q).map(function(Ne){var Oe,Je=Ne._tippy,Bt=(Oe=Je.popperInstance)==null?void 0:Oe.state;return Bt?{popperRect:Ne.getBoundingClientRect(),popperState:Bt,props:t}:null}).filter(Boolean);nw(Me,j)&&(J(),ae(j))}}function we(j){var ue=I(j)||y.props.trigger.indexOf("click")>=0&&o;if(!ue){if(y.props.interactive){y.hideWithInteractivity(j);return}ae(j)}}function S(j){y.props.trigger.indexOf("focusin")<0&&j.target!==ee()||y.props.interactive&&j.relatedTarget&&Q.contains(j.relatedTarget)||ae(j)}function I(j){return Fr.isTouch?$()!==j.type.indexOf("touch")>=0:!1}function m(){w();var j=y.props,ue=j.popperOptions,ye=j.placement,Me=j.offset,Ne=j.getReferenceClientRect,Oe=j.moveTransition,Je=K()?yA(Q).arrow:null,Bt=Ne?{getBoundingClientRect:Ne,contextElement:Ne.contextElement||ee()}:r,Zr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(zt){var bt=zt.state;if(K()){var Zt=L(),ei=Zt.box;["placement","reference-hidden","escaped"].forEach(function(ti){ti==="placement"?ei.setAttribute("data-placement",bt.placement):bt.attributes.popper["data-popper-"+ti]?ei.setAttribute("data-"+ti,""):ei.removeAttribute("data-"+ti)}),bt.attributes.popper={}}}},Tt=[{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}},Zr];K()&&Je&&Tt.push({name:"arrow",options:{element:Je,padding:3}}),Tt.push.apply(Tt,(ue==null?void 0:ue.modifiers)||[]),y.popperInstance=Wx(Bt,Q,Object.assign({},ue,{placement:ye,onFirstUpdate:h,modifiers:Tt}))}function w(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function N(){var j=y.props.appendTo,ue,ye=ee();y.props.interactive&&j===V0||j==="parent"?ue=ye.parentNode:ue=K0(j,[ye]),ue.contains(Q)||ue.appendChild(Q),y.state.isMounted=!0,m()}function G(){return ba(Q.querySelectorAll("[data-tippy-root]"))}function z(j){y.clearDelayTimeouts(),j&&k("onTrigger",[y,j]),fe();var ue=U(!0),ye=D(),Me=ye[0],Ne=ye[1];Fr.isTouch&&Me==="hold"&&Ne&&(ue=Ne),ue?i=setTimeout(function(){y.show()},ue):y.show()}function ae(j){if(y.clearDelayTimeouts(),k("onUntrigger",[y,j]),!y.state.isVisible){me();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&o)){var ue=U(!1);ue?n=setTimeout(function(){y.state.isVisible&&y.hide()},ue):s=requestAnimationFrame(function(){y.hide()})}}function Ae(){y.state.isEnabled=!0}function he(){y.hide(),y.state.isEnabled=!1}function ve(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function Be(j){if(!y.state.isDestroyed){k("onBeforeUpdate",[y,j]),He();var ue=y.props,ye=tp(r,Object.assign({},ue,j0(j),{ignoreAttributes:!0}));y.props=ye,xe(),ue.interactiveDebounce!==ye.interactiveDebounce&&(J(),f=W0(ze,ye.interactiveDebounce)),ue.triggerTarget&&!ye.triggerTarget?Cn(ue.triggerTarget).forEach(function(Me){Me.removeAttribute("aria-expanded")}):ye.triggerTarget&&r.removeAttribute("aria-expanded"),F(),V(),_&&_(ue,ye),y.popperInstance&&(m(),G().forEach(function(Me){requestAnimationFrame(Me._tippy.popperInstance.forceUpdate)})),k("onAfterUpdate",[y,j])}}function Le(j){y.setProps({content:j})}function Pe(){var j=y.state.isVisible,ue=y.state.isDestroyed,ye=!y.state.isEnabled,Me=Fr.isTouch&&!y.props.touch,Ne=pA(y.props.duration,0,Er.duration);if(!(j||ue||ye||Me)&&!ee().hasAttribute("disabled")&&(k("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,K()&&(Q.style.visibility="visible"),V(),fe(),y.state.isMounted||(Q.style.transition="none"),K()){var Oe=L(),Je=Oe.box,Bt=Oe.content;EA([Je,Bt],0)}h=function(){var Tt;if(!(!y.state.isVisible||c)){if(c=!0,Q.offsetHeight,Q.style.transition=y.props.moveTransition,K()&&y.props.animation){var Ir=L(),zt=Ir.box,bt=Ir.content;EA([zt,bt],Ne),q0([zt,bt],"visible")}R(),F(),J0(CA,y),(Tt=y.popperInstance)==null||Tt.forceUpdate(),k("onMount",[y]),y.props.animation&&K()&&be(Ne,function(){y.state.isShown=!0,k("onShown",[y])})}},N()}}function rt(){var j=!y.state.isVisible,ue=y.state.isDestroyed,ye=!y.state.isEnabled,Me=pA(y.props.duration,1,Er.duration);if(!(j||ue||ye)&&(k("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,o=!1,K()&&(Q.style.visibility="hidden"),J(),me(),V(!0),K()){var Ne=L(),Oe=Ne.box,Je=Ne.content;y.props.animation&&(EA([Oe,Je],Me),q0([Oe,Je],"hidden"))}R(),F(),y.props.animation?K()&&De(Me,y.unmount):y.unmount()}}function at(j){Z().addEventListener("mousemove",f),J0(xa,f),f(j)}function Ct(){y.state.isVisible&&y.hide(),y.state.isMounted&&(w(),G().forEach(function(j){j._tippy.unmount()}),Q.parentNode&&Q.parentNode.removeChild(Q),CA=CA.filter(function(j){return j!==y}),y.state.isMounted=!1,k("onHidden",[y]))}function nt(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),He(),delete r._tippy,y.state.isDestroyed=!0,k("onDestroy",[y]))}}function Vi(r,e){e===void 0&&(e={});var t=Er.plugins.concat(e.plugins||[]);aw();var i=Object.assign({},e,{plugins:t}),n=rw(r),s=n.reduce(function(o,a){var l=a&&mw(a,i);return l&&o.push(l),o},[]);return Sa(r)?s[0]:s}Vi.defaultProps=Er,Vi.setDefaultProps=dw,Vi.currentInput=Fr,Object.assign({},S0,{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)}}),Vi.setDefaultProps({render:np});function Yt(r,e){return`${r}-${e}`}function Pr(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(Pr).filter(Boolean)),i}function Ew(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 wa extends Error{constructor(e,t,i=!1){super(),this.fatal=!1,this.fatal=i,t instanceof Error&&(this.stack=t.stack),this.message=[e,Ew(t)].filter(Boolean).join(" - ")}}function Ii(r,e,t){return Math.min(Math.max(e,r),t)}const Iw=5;function vw(r,e){return r.length!==e.length||r.some((t,i)=>t!==e[i])}class yw{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=Qt(),this._controls=Qt(),this._drawAbort=null,this.host=e}set activeScenes(e){vw(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=Ii(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,l)=>a.concat(l.scenes.filter(({start:c,duration:u})=>s>=c&&s<c+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((i=this.host.composition)==null?void 0:i.tracks.reduce((a,l)=>a.concat(l.scenes.filter(({start:c})=>s>=c-Iw&&s<c)),[]))??[],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 Rt(this._canvas)}controls(){return Rt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Pr(e.layout.node).forEach(({key:i})=>{var n,s,o;const{id:a,start:l,duration:c}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,A=Yt(a,i);if(this.host.media[A]){const h=this.host.media[A],{speed:d,volume:f,hls:g,node:p,start:E,duration:C}=h,B=this.host.mediaState[A];p&&B&&(p.currentTime>=E+C||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,E):B.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=Ii(0,this.host.volume*(f??1)*this.host.envelopeGain(a,l),1),p.playbackRate=Ii(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${l}-${c}`,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,l/this.host.duration*100),end:Math.min((l+c)/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=>Pr(i.layout.node).map(async({key:s})=>{const o=Yt(i.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:l}=a,c=this.host.mediaState[o];if(!this.activeScenes.includes(i))l.paused||l.pause();else if(c&&!this.host.waiting&&!this.host.loading&&!this.host.paused&&l.paused&&!l.ended&&c.initialised)try{await l.play()}catch(A){throw new wa("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 Cw=fr(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()}),sp=fr(async(r,e,t)=>new FontFace(r,await Cw(t),{weight:e,style:"normal"}).load(),{cacheKey:([r,e,t])=>`${r}|${e}|${t}`}),Bw=fr(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?sp(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??""}`}});fr(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(c=>c.family===e.name&&c.weight===i);if(a)return a;const l=await sp(e.name,i,o);return document.fonts.add(l),l}))).filter(i=>i!==null)},{cacheKey:([r])=>JSON.stringify(r)});function Tw(r){return r.startsWith("data:")?r.split(",")[0]:r.split(/[?#]/)[0]}function op(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 bw(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 Sw(r,e){const t=URL.createObjectURL(await bw(r,e));try{const i=e.endsWith(".svg")?`${t}#${e}`:t;return await op(i,null,`Failed to decode image: ${e}`)}finally{URL.revokeObjectURL(t)}}const xw=fr(async r=>{const e=Tw(r);try{return await Sw(r,e)}catch(t){return op(r,"anonymous",`Failed to load image: ${e}`).catch(()=>{throw t})}}),ww=fr(async({options:r})=>{const e=await Bw(r.font);return e&&document.fonts.add(e),{font:r.font}}),Qw=fr(async({config:r})=>r.src?{image:await xw(r.src)}:{image:null},{cacheKey:([{config:r}])=>JSON.stringify(r)});async function BA(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 ap(r,e){if(r.type==="video"&&r.alpha)return(e?r.alpha.mov:r.alpha.webm)||void 0}function Rw(r,e){return ap(r,e)??r.src}function TA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function _w(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Dw({config:r,elementSize:e}){return new Promise(async t=>{let i=null;const{type:n,key:s,duration:o}=r,a=Rw(r,TA());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 l=!1;if(i.startLoadOnce=()=>{l||(i.preload="auto",i.load(),l=!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 c=async()=>{const u=await BA(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",c)};i.addEventListener("loadedmetadata",c)}})}function Lw({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,l=!1;const c=new or({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])}}});c.on(or.Events.BUFFER_CODECS,async(u,A)=>{var h,d;if(l)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){l=!0,o||c==null||c.stopLoad();const E=t??await BA(s);n({key:r,hls:c,node:s,aspectRatio:g/p,totalDuration:E})}}),c.on(or.Events.LEVEL_LOADED,async()=>{setTimeout(async()=>{if(l)return;l=!0,o||c==null||c.stopLoad();const u=t??await BA(s),A=c.levels[c.levels.length-1];n({key:r,hls:c,node:s,aspectRatio:A.width/A.height,totalDuration:u})},2e3)}),i&&c.on(or.Events.MANIFEST_PARSED,()=>{const u=window.devicePixelRatio||1,A=Math.min(i.width,i.height)*u;let h=0;for(let d=c.levels.length-1;d>=0;d--)if(Math.min(c.levels[d].width,c.levels[d].height)<=A){h=d;break}c.autoLevelCapping=h}),c.loadSource(e),c.attachMedia(s),c.startLoadOnce=(u=-1,A)=>{if(c&&!o){const h=c.levels.findIndex(d=>Math.min(d.height,d.width)===A);o=!0,c.startLoad(u),h!==-1&&(c.currentLevel=h)}}})}function kw({config:r,elementSize:e}){const{playlist:t}=r;return!ap(r,TA())&&t&&!TA()&&or.isSupported()?Lw({key:r.key,playlist:t,duration:r.duration??0,elementSize:e}):Dw({config:r,elementSize:e})}const Mw=.25;let Fw=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=fr(async(t,i)=>{var n,s,o,a;const{key:l}=i,c=((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 kw({config:i,elementSize:{width:c,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:l,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=Yt(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=Yt(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=Yt(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=Yt(t,i),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Pr(a.layout.node).map(({id:c})=>c)).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[Yt(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[Yt(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 wa(`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 l=(a=n.listeners)==null?void 0:a[s];l&&n.node.removeEventListener(s,l)}}),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 io(this.host,async([e,t,i,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,l=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:c})=>t===c))&&(this.host._language=(s=this.host._languages[0])==null?void 0:s.value),e){const{width:c,height:u}=Gl({aspectRatio:i,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await Ld({debug:n,config:e,resolvers:{text:ww,image:Qw,video:async({id:g,config:p,options:E})=>{const{media:C,source:B}=await this._mediaFactory(g,{...p,...E});return{video:B,aspectRatio:C.aspectRatio}}},rootWidth:c,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new wa("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=Pr(g.layout.node);for(const E of p){const{media:C,listeners:B}=await this._mediaFactory(g.id,E),y=Yt(g.id,C.key);d.push(y);const x=(E.startOffset??0)*C.totalDuration,Q=(1-(E.endOffset??0))*C.totalDuration;A[y]={...C,listeners:B,start:x,duration:Q-x,speed:E.speed??1,volume:E.volume??1,loop:E.loop??!1},h[y]={initialised:!C,waiting:!!C,...this.mediaState[y]}}}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(c){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>[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;Pr(o.node).filter(({key:c})=>!i||c===i).forEach(({key:c})=>{const u=Yt(s,c);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=Ii(A.start,d+A.start,A.start+A.duration);if(n&&!A.node.paused&&Math.abs(A.node.currentTime-f)<Mw)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 Pw(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function Nw(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const bA=["progress","play-large","navigation","play","volume","current-time","duration","levels","speed","captions","fullscreen","preview"],Ow={id:"captions",event:"captions:click",label:"Closed Captions"},Uw={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},lp={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}]},Gw={id:"playbackRate",label:"Playback playbackRate",subItems:lp};class Hw extends du{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==tn.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)),dr}}const SA=rn(Hw),$w=HS(()=>{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=Ed.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]}),Nr={"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"},Yw={colors:Nr,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 ${Nr["dark-100"]}`,medium:`0 .125rem .625rem ${Nr["dark-100"]}`,large:`0 .25rem 1rem ${Nr["dark-50"]}`,xl:`.25rem .25rem 1rem ${Nr["dark-250"]}`,xxl:`0 .25rem 2rem ${Nr["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${Nr["dark-250"]}`,toolbar:`0 -.625rem .625rem ${Nr["dark-50"]}`,text:`0 0 .25rem ${Nr["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:Nr["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},cp=OS(Yw,{delimiter:"-"}),Vw=Object.keys(cp).map(r=>Pn(`:host { --${r}: ${cp[r]}; }`)),tt=(r=>{const e=class extends r{firstUpdated(){$w().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Vw,Et`
|
|
2514
|
+
*/const y0=(r,e,t)=>{const i=new Map;for(let n=e;n<=t;n++)i.set(r[n],n);return i},C0=rn(class extends Kn{constructor(r){if(super(r),r.type!==tn.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=Wp(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=[]),l=[];let c,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])l[d]=Li(n[A],s[d]),A++,d++;else if(a[h]===o[f])l[f]=Li(n[h],s[f]),h--,f--;else if(a[A]===o[f])l[f]=Li(n[A],s[f]),Vn(r,l[f+1],n[A]),A++,f--;else if(a[h]===o[d])l[d]=Li(n[h],s[d]),Vn(r,n[A],n[h]),h--,d++;else if(c===void 0&&(c=y0(o,d,f),u=y0(a,A,h)),c.has(a[A]))if(c.has(a[h])){const g=u.get(o[d]),p=g!==void 0?n[g]:null;if(p===null){const E=Vn(r,n[A]);Li(E,s[d]),l[d]=E}else l[d]=Li(p,s[d]),Vn(r,n[A],p),n[g]=null;d++}else ja(n[h]),h--;else ja(n[A]),A++;for(;d<=f;){const g=Vn(r,l[f+1]);Li(g,s[d]),l[d++]=g}for(;A<=h;){const g=n[A++];g!==null&&ja(g)}return this.ut=o,Kp(r,l),dr}});var Ht="top",ar="bottom",lr="right",$t="left",aA="auto",Ts=[Ht,ar,lr,$t],En="start",bs="end",$S="clippingParents",B0="viewport",Ss="popper",YS="reference",T0=Ts.reduce(function(r,e){return r.concat([e+"-"+En,e+"-"+bs])},[]),b0=[].concat(Ts,[aA]).reduce(function(r,e){return r.concat([e,e+"-"+En,e+"-"+bs])},[]),VS="beforeRead",KS="read",WS="afterRead",JS="beforeMain",jS="main",qS="afterMain",XS="beforeWrite",zS="write",ZS="afterWrite",ex=[VS,KS,WS,JS,jS,qS,XS,zS,ZS];function kr(r){return r?(r.nodeName||"").toLowerCase():null}function qt(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function Hi(r){var e=qt(r).Element;return r instanceof e||r instanceof Element}function cr(r){var e=qt(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function lA(r){if(typeof ShadowRoot>"u")return!1;var e=qt(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function tx(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];!cr(s)||!kr(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 rx(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(l,c){return l[c]="",l},{});!cr(n)||!kr(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const S0={name:"applyStyles",enabled:!0,phase:"write",fn:tx,effect:rx,requires:["computeStyles"]};function Mr(r){return r.split("-")[0]}var $i=Math.max,ya=Math.min,In=Math.round;function cA(){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 x0(){return!/^((?!chrome|android).)*safari/i.test(cA())}function vn(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=r.getBoundingClientRect(),n=1,s=1;e&&cr(r)&&(n=r.offsetWidth>0&&In(i.width)/r.offsetWidth||1,s=r.offsetHeight>0&&In(i.height)/r.offsetHeight||1);var o=Hi(r)?qt(r):window,a=o.visualViewport,l=!x0()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/n,u=(i.top+(l&&a?a.offsetTop:0))/s,A=i.width/n,h=i.height/s;return{width:A,height:h,top:u,right:c+A,bottom:u+h,left:c,x:c,y:u}}function AA(r){var e=vn(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 w0(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&lA(t)){var i=e;do{if(i&&r.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function zr(r){return qt(r).getComputedStyle(r)}function ix(r){return["table","td","th"].indexOf(kr(r))>=0}function Ei(r){return((Hi(r)?r.ownerDocument:r.document)||window.document).documentElement}function Ca(r){return kr(r)==="html"?r:r.assignedSlot||r.parentNode||(lA(r)?r.host:null)||Ei(r)}function Q0(r){return!cr(r)||zr(r).position==="fixed"?null:r.offsetParent}function nx(r){var e=/firefox/i.test(cA()),t=/Trident/i.test(cA());if(t&&cr(r)){var i=zr(r);if(i.position==="fixed")return null}var n=Ca(r);for(lA(n)&&(n=n.host);cr(n)&&["html","body"].indexOf(kr(n))<0;){var s=zr(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 xs(r){for(var e=qt(r),t=Q0(r);t&&ix(t)&&zr(t).position==="static";)t=Q0(t);return t&&(kr(t)==="html"||kr(t)==="body"&&zr(t).position==="static")?e:t||nx(r)||e}function uA(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function ws(r,e,t){return $i(r,ya(e,t))}function sx(r,e,t){var i=ws(r,e,t);return i>t?t:i}function R0(){return{top:0,right:0,bottom:0,left:0}}function _0(r){return Object.assign({},R0(),r)}function D0(r,e){return e.reduce(function(t,i){return t[i]=r,t},{})}var ox=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,_0(typeof e!="number"?e:D0(e,Ts))};function ax(r){var e,t=r.state,i=r.name,n=r.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=Mr(t.placement),l=uA(a),c=[$t,lr].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var A=ox(n.padding,t),h=AA(s),d=l==="y"?Ht:$t,f=l==="y"?ar:lr,g=t.rects.reference[u]+t.rects.reference[l]-o[l]-t.rects.popper[u],p=o[l]-t.rects.reference[l],E=xs(s),C=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,B=g/2-p/2,y=A[d],x=C-h[u]-A[f],Q=C/2-h[u]/2+B,_=ws(y,Q,x),M=l;t.modifiersData[i]=(e={},e[M]=_,e.centerOffset=_-Q,e)}}function lx(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)||w0(e.elements.popper,n)&&(e.elements.arrow=n))}const cx={name:"arrow",enabled:!0,phase:"main",fn:ax,effect:lx,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yn(r){return r.split("-")[1]}var Ax={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ux(r,e){var t=r.x,i=r.y,n=e.devicePixelRatio||1;return{x:In(t*n)/n||0,y:In(i*n)/n||0}}function L0(r){var e,t=r.popper,i=r.popperRect,n=r.placement,s=r.variation,o=r.offsets,a=r.position,l=r.gpuAcceleration,c=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"),C=o.hasOwnProperty("y"),B=$t,y=Ht,x=window;if(c){var Q=xs(t),_="clientHeight",M="clientWidth";if(Q===qt(t)&&(Q=Ei(t),zr(Q).position!=="static"&&a==="absolute"&&(_="scrollHeight",M="scrollWidth")),Q=Q,n===Ht||(n===$t||n===lr)&&s===bs){y=ar;var P=A&&Q===x&&x.visualViewport?x.visualViewport.height:Q[_];g-=P-i.height,g*=l?1:-1}if(n===$t||(n===Ht||n===ar)&&s===bs){B=lr;var D=A&&Q===x&&x.visualViewport?x.visualViewport.width:Q[M];d-=D-i.width,d*=l?1:-1}}var $=Object.assign({position:a},c&&Ax),K=u===!0?ux({x:d,y:g},qt(t)):{x:d,y:g};if(d=K.x,g=K.y,l){var ee;return Object.assign({},$,(ee={},ee[y]=C?"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[y]=C?g+"px":"",e[B]=E?d+"px":"",e.transform="",e))}function hx(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,l=a===void 0?!0:a,c={placement:Mr(e.placement),variation:yn(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,L0(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,L0(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const dx={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:hx,data:{}};var Ba={passive:!0};function fx(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,l=qt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",t.update,Ba)}),a&&l.addEventListener("resize",t.update,Ba),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",t.update,Ba)}),a&&l.removeEventListener("resize",t.update,Ba)}}const gx={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fx,data:{}};var px={left:"right",right:"left",bottom:"top",top:"bottom"};function Ta(r){return r.replace(/left|right|bottom|top/g,function(e){return px[e]})}var mx={start:"end",end:"start"};function k0(r){return r.replace(/start|end/g,function(e){return mx[e]})}function hA(r){var e=qt(r),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function dA(r){return vn(Ei(r)).left+hA(r).scrollLeft}function Ex(r,e){var t=qt(r),i=Ei(r),n=t.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var c=x0();(c||!c&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+dA(r),y:l}}function Ix(r){var e,t=Ei(r),i=hA(r),n=(e=r.ownerDocument)==null?void 0:e.body,s=$i(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=$i(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+dA(r),l=-i.scrollTop;return zr(n||t).direction==="rtl"&&(a+=$i(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function fA(r){var e=zr(r),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function M0(r){return["html","body","#document"].indexOf(kr(r))>=0?r.ownerDocument.body:cr(r)&&fA(r)?r:M0(Ca(r))}function Qs(r,e){var t;e===void 0&&(e=[]);var i=M0(r),n=i===((t=r.ownerDocument)==null?void 0:t.body),s=qt(i),o=n?[s].concat(s.visualViewport||[],fA(i)?i:[]):i,a=e.concat(o);return n?a:a.concat(Qs(Ca(o)))}function gA(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function vx(r,e){var t=vn(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 F0(r,e,t){return e===B0?gA(Ex(r,t)):Hi(e)?vx(e,t):gA(Ix(Ei(r)))}function yx(r){var e=Qs(Ca(r)),t=["absolute","fixed"].indexOf(zr(r).position)>=0,i=t&&cr(r)?xs(r):r;return Hi(i)?e.filter(function(n){return Hi(n)&&w0(n,i)&&kr(n)!=="body"}):[]}function Cx(r,e,t,i){var n=e==="clippingParents"?yx(r):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,c){var u=F0(r,c,i);return l.top=$i(u.top,l.top),l.right=ya(u.right,l.right),l.bottom=ya(u.bottom,l.bottom),l.left=$i(u.left,l.left),l},F0(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 P0(r){var e=r.reference,t=r.element,i=r.placement,n=i?Mr(i):null,s=i?yn(i):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case Ht:l={x:o,y:e.y-t.height};break;case ar:l={x:o,y:e.y+e.height};break;case lr:l={x:e.x+e.width,y:a};break;case $t:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=n?uA(n):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case En:l[c]=l[c]-(e[u]/2-t[u]/2);break;case bs:l[c]=l[c]+(e[u]/2-t[u]/2);break}}return l}function Rs(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,l=a===void 0?$S:a,c=t.rootBoundary,u=c===void 0?B0:c,A=t.elementContext,h=A===void 0?Ss:A,d=t.altBoundary,f=d===void 0?!1:d,g=t.padding,p=g===void 0?0:g,E=_0(typeof p!="number"?p:D0(p,Ts)),C=h===Ss?YS:Ss,B=r.rects.popper,y=r.elements[f?C:h],x=Cx(Hi(y)?y:y.contextElement||Ei(r.elements.popper),l,u,o),Q=vn(r.elements.reference),_=P0({reference:Q,element:B,strategy:"absolute",placement:n}),M=gA(Object.assign({},B,_)),P=h===Ss?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===Ss&&$){var K=$[n];Object.keys(D).forEach(function(ee){var Z=[lr,ar].indexOf(ee)>=0?1:-1,L=[Ht,ar].indexOf(ee)>=0?"y":"x";D[ee]+=K[L]*Z})}return D}function Bx(r,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?b0:l,u=yn(i),A=u?a?T0:T0.filter(function(f){return yn(f)===u}):Ts,h=A.filter(function(f){return c.indexOf(f)>=0});h.length===0&&(h=A);var d=h.reduce(function(f,g){return f[g]=Rs(r,{placement:g,boundary:n,rootBoundary:s,padding:o})[Mr(g)],f},{});return Object.keys(d).sort(function(f,g){return d[f]-d[g]})}function Tx(r){if(Mr(r)===aA)return[];var e=Ta(r);return[k0(r),e,k0(e)]}function bx(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,l=t.fallbackPlacements,c=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=Mr(p),C=E===p,B=l||(C||!f?[Ta(p)]:Tx(p)),y=[p].concat(B).reduce(function(oe,fe){return oe.concat(Mr(fe)===aA?Bx(e,{placement:fe,boundary:u,rootBoundary:A,padding:c,flipVariations:f,allowedAutoPlacements:g}):fe)},[]),x=e.rects.reference,Q=e.rects.popper,_=new Map,M=!0,P=y[0],D=0;D<y.length;D++){var $=y[D],K=Mr($),ee=yn($)===En,Z=[Ht,ar].indexOf(K)>=0,L=Z?"width":"height",U=Rs(e,{placement:$,boundary:u,rootBoundary:A,altBoundary:h,padding:c}),V=Z?ee?lr:$t:ee?ar:Ht;x[L]>Q[L]&&(V=Ta(V));var k=Ta(V),R=[];if(s&&R.push(U[K]<=0),a&&R.push(U[V]<=0,U[k]<=0),R.every(function(oe){return oe})){P=$,M=!1;break}_.set($,R)}if(M)for(var F=f?3:1,J=function(fe){var me=y.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 Sx={name:"flip",enabled:!0,phase:"main",fn:bx,requiresIfExists:["offset"],data:{_skip:!1}};function N0(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 O0(r){return[Ht,lr,ar,$t].some(function(e){return r[e]>=0})}function xx(r){var e=r.state,t=r.name,i=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Rs(e,{elementContext:"reference"}),a=Rs(e,{altBoundary:!0}),l=N0(o,i),c=N0(a,n,s),u=O0(l),A=O0(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:A},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":A})}const wx={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xx};function Qx(r,e,t){var i=Mr(r),n=[$t,Ht].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,[$t,lr].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}function Rx(r){var e=r.state,t=r.options,i=r.name,n=t.offset,s=n===void 0?[0,0]:n,o=b0.reduce(function(u,A){return u[A]=Qx(A,e.rects,s),u},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=o}const _x={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rx};function Dx(r){var e=r.state,t=r.name;e.modifiersData[t]=P0({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Lx={name:"popperOffsets",enabled:!0,phase:"read",fn:Dx,data:{}};function kx(r){return r==="x"?"y":"x"}function Mx(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,l=t.boundary,c=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=Rs(e,{boundary:l,rootBoundary:c,padding:A,altBoundary:u}),E=Mr(e.placement),C=yn(e.placement),B=!C,y=uA(E),x=kx(y),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=y==="y"?Ht:$t,L=y==="y"?ar:lr,U=y==="y"?"height":"width",V=Q[y],k=V+p[Z],R=V-p[L],F=d?-M[U]/2:0,J=C===En?_[U]:M[U],Y=C===En?-M[U]:-_[U],re=e.elements.arrow,oe=d&&re?AA(re):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:R0(),me=fe[Z],De=fe[L],be=ws(0,_[U],oe[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&&xs(e.elements.arrow),He=xe?y==="y"?xe.clientTop||0:xe.clientLeft||0:0,_e=(ee=$==null?void 0:$[y])!=null?ee:0,ze=V+ke-_e-He,we=V+pe-_e,S=ws(d?ya(k,ze):k,V,d?$i(R,we):R);Q[y]=S,K[y]=S-V}if(a){var I,m=y==="x"?Ht:$t,w=y==="x"?ar:lr,N=Q[x],G=x==="y"?"height":"width",z=N+p[m],ae=N-p[w],Ae=[Ht,$t].indexOf(E)!==-1,he=(I=$==null?void 0:$[x])!=null?I:0,ve=Ae?z:N-_[G]-M[G]-he+D.altAxis,Be=Ae?N+_[G]+M[G]-he-D.altAxis:ae,Le=d&&Ae?sx(ve,N,Be):ws(d?ve:z,N,d?Be:ae);Q[x]=Le,K[x]=Le-N}e.modifiersData[i]=K}}const Fx={name:"preventOverflow",enabled:!0,phase:"main",fn:Mx,requiresIfExists:["offset"]};function Px(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function Nx(r){return r===qt(r)||!cr(r)?hA(r):Px(r)}function Ox(r){var e=r.getBoundingClientRect(),t=In(e.width)/r.offsetWidth||1,i=In(e.height)/r.offsetHeight||1;return t!==1||i!==1}function Ux(r,e,t){t===void 0&&(t=!1);var i=cr(e),n=cr(e)&&Ox(e),s=Ei(e),o=vn(r,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((kr(e)!=="body"||fA(s))&&(a=Nx(e)),cr(e)?(l=vn(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=dA(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Gx(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 l=e.get(a);l&&n(l)}}),i.push(s)}return r.forEach(function(s){t.has(s.name)||n(s)}),i}function Hx(r){var e=Gx(r);return ex.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function $x(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function Yx(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 U0={placement:"bottom",modifiers:[],strategy:"absolute"};function G0(){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 Vx(r){r===void 0&&(r={});var e=r,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?U0:n;return function(a,l,c){c===void 0&&(c=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},U0,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},A=[],h=!1,d={state:u,setOptions:function(E){var C=typeof E=="function"?E(u.options):E;g(),u.options=Object.assign({},s,u.options,C),u.scrollParents={reference:Hi(a)?Qs(a):a.contextElement?Qs(a.contextElement):[],popper:Qs(l)};var B=Hx(Yx([].concat(i,u.options.modifiers)));return u.orderedModifiers=B.filter(function(y){return y.enabled}),f(),d.update()},forceUpdate:function(){if(!h){var E=u.elements,C=E.reference,B=E.popper;if(G0(C,B)){u.rects={reference:Ux(C,xs(B),u.options.strategy==="fixed"),popper:AA(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 y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var x=u.orderedModifiers[y],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:$x(function(){return new Promise(function(p){d.forceUpdate(),p(u)})}),destroy:function(){g(),h=!0}};if(!G0(a,l))return d;d.setOptions(c).then(function(p){!h&&c.onFirstUpdate&&c.onFirstUpdate(p)});function f(){u.orderedModifiers.forEach(function(p){var E=p.name,C=p.options,B=C===void 0?{}:C,y=p.effect;if(typeof y=="function"){var x=y({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 Kx=[gx,Lx,dx,S0,_x,Sx,Fx,cx,wx],Wx=Vx({defaultModifiers:Kx}),Jx="tippy-box",H0="tippy-content",jx="tippy-backdrop",$0="tippy-arrow",Y0="tippy-svg-arrow",Yi={passive:!0,capture:!0},V0=function(){return document.body};function pA(r,e,t){if(Array.isArray(r)){var i=r[e];return i??(Array.isArray(t)?t[e]:t)}return r}function mA(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function K0(r,e){return typeof r=="function"?r.apply(void 0,e):r}function W0(r,e){if(e===0)return r;var t;return function(i){clearTimeout(t),t=setTimeout(function(){r(i)},e)}}function qx(r){return r.split(/\s+/).filter(Boolean)}function Cn(r){return[].concat(r)}function J0(r,e){r.indexOf(e)===-1&&r.push(e)}function Xx(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function zx(r){return r.split("-")[0]}function ba(r){return[].slice.call(r)}function j0(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function _s(){return document.createElement("div")}function Sa(r){return["Element","Fragment"].some(function(e){return mA(r,e)})}function Zx(r){return mA(r,"NodeList")}function ew(r){return mA(r,"MouseEvent")}function tw(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function rw(r){return Sa(r)?[r]:Zx(r)?ba(r):Array.isArray(r)?r:ba(document.querySelectorAll(r))}function EA(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function q0(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function iw(r){var e,t=Cn(r),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function nw(r,e){var t=e.clientX,i=e.clientY;return r.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,l=a.interactiveBorder,c=zx(o.placement),u=o.modifiersData.offset;if(!u)return!0;var A=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,d=c==="right"?u.left.x:0,f=c==="left"?u.right.x:0,g=s.top-i+A>l,p=i-s.bottom-h>l,E=s.left-t+d>l,C=t-s.right-f>l;return g||p||E||C})}function IA(r,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){r[i](n,t)})}function X0(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 Fr={isTouch:!1},z0=0;function sw(){Fr.isTouch||(Fr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Z0))}function Z0(){var r=performance.now();r-z0<20&&(Fr.isTouch=!1,document.removeEventListener("mousemove",Z0)),z0=r}function ow(){var r=document.activeElement;if(tw(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function aw(){document.addEventListener("touchstart",sw,Yi),window.addEventListener("blur",ow)}var lw=typeof window<"u"&&typeof document<"u",cw=lw?!!window.msCrypto:!1,Aw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},uw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Er=Object.assign({appendTo:V0,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},Aw,uw),hw=Object.keys(Er),dw=function(e){var t=Object.keys(e);t.forEach(function(i){Er[i]=e[i]})};function ep(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=Er[s])!=null?a:o}return i},{});return Object.assign({},r,t)}function fw(r,e){var t=e?Object.keys(ep(Object.assign({},Er,{plugins:e}))):hw,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 tp(r,e){var t=Object.assign({},e,{content:K0(e.content,[r])},e.ignoreAttributes?{}:fw(r,e.plugins));return t.aria=Object.assign({},Er.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 gw=function(){return"innerHTML"};function vA(r,e){r[gw()]=e}function rp(r){var e=_s();return r===!0?e.className=$0:(e.className=Y0,Sa(r)?e.appendChild(r):vA(e,r)),e}function ip(r,e){Sa(e.content)?(vA(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?vA(r,e.content):r.textContent=e.content)}function yA(r){var e=r.firstElementChild,t=ba(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(H0)}),arrow:t.find(function(i){return i.classList.contains($0)||i.classList.contains(Y0)}),backdrop:t.find(function(i){return i.classList.contains(jx)})}}function np(r){var e=_s(),t=_s();t.className=Jx,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=_s();i.className=H0,i.setAttribute("data-state","hidden"),ip(i,r.props),e.appendChild(t),t.appendChild(i),n(r.props,r.props);function n(s,o){var a=yA(e),l=a.box,c=a.content,u=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&ip(c,r.props),o.arrow?u?s.arrow!==o.arrow&&(l.removeChild(u),l.appendChild(rp(o.arrow))):l.appendChild(rp(o.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:n}}np.$$tippy=!0;var pw=1,xa=[],CA=[];function mw(r,e){var t=tp(r,Object.assign({},Er,ep(j0(e)))),i,n,s,o=!1,a=!1,l=!1,c=!1,u,A,h,d=[],f=W0(ze,t.interactiveDebounce),g,p=pw++,E=null,C=Xx(t.plugins),B={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:p,reference:r,popper:_s(),popperInstance:E,props:t,state:B,plugins:C,clearDelayTimeouts:ve,setProps:Be,setContent:Le,show:Pe,hide:rt,hideWithInteractivity:at,enable:Ae,disable:he,unmount:Ct,destroy:nt};if(!t.render)return y;var x=t.render(y),Q=x.popper,_=x.onUpdate;Q.setAttribute("data-tippy-root",""),Q.id="tippy-"+y.id,y.popper=Q,r._tippy=y,Q._tippy=y;var M=C.map(function(j){return j.fn(y)}),P=r.hasAttribute("aria-expanded");return xe(),F(),V(),k("onCreate",[y]),t.showOnCreate&&z(),Q.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),Q.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&Z().addEventListener("mousemove",f)}),y;function D(){var j=y.props.touch;return Array.isArray(j)?j:[j,0]}function $(){return D()[0]==="hold"}function K(){var j;return!!((j=y.props.render)!=null&&j.$$tippy)}function ee(){return g||r}function Z(){var j=ee().parentNode;return j?iw(j):document}function L(){return yA(Q)}function U(j){return y.state.isMounted&&!y.state.isVisible||Fr.isTouch||u&&u.type==="focus"?0:pA(y.props.delay,j?0:1,Er.delay)}function V(j){j===void 0&&(j=!1),Q.style.pointerEvents=y.props.interactive&&!j?"":"none",Q.style.zIndex=""+y.props.zIndex}function k(j,ue,ye){if(ye===void 0&&(ye=!0),M.forEach(function(Ne){Ne[j]&&Ne[j].apply(Ne,ue)}),ye){var Me;(Me=y.props)[j].apply(Me,ue)}}function R(){var j=y.props.aria;if(j.content){var ue="aria-"+j.content,ye=Q.id,Me=Cn(y.props.triggerTarget||r);Me.forEach(function(Ne){var Oe=Ne.getAttribute(ue);if(y.state.isVisible)Ne.setAttribute(ue,Oe?Oe+" "+ye:ye);else{var Je=Oe&&Oe.replace(ye,"").trim();Je?Ne.setAttribute(ue,Je):Ne.removeAttribute(ue)}})}}function F(){if(!(P||!y.props.aria.expanded)){var j=Cn(y.props.triggerTarget||r);j.forEach(function(ue){y.props.interactive?ue.setAttribute("aria-expanded",y.state.isVisible&&ue===ee()?"true":"false"):ue.removeAttribute("aria-expanded")})}}function J(){Z().removeEventListener("mousemove",f),xa=xa.filter(function(j){return j!==f})}function Y(j){if(!(Fr.isTouch&&(l||j.type==="mousedown"))){var ue=j.composedPath&&j.composedPath()[0]||j.target;if(!(y.props.interactive&&X0(Q,ue))){if(Cn(y.props.triggerTarget||r).some(function(ye){return X0(ye,ue)})){if(Fr.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else k("onClickOutside",[y,j]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),a=!0,setTimeout(function(){a=!1}),y.state.isMounted||me())}}}function re(){l=!0}function oe(){l=!1}function fe(){var j=Z();j.addEventListener("mousedown",Y,!0),j.addEventListener("touchend",Y,Yi),j.addEventListener("touchstart",oe,Yi),j.addEventListener("touchmove",re,Yi)}function me(){var j=Z();j.removeEventListener("mousedown",Y,!0),j.removeEventListener("touchend",Y,Yi),j.removeEventListener("touchstart",oe,Yi),j.removeEventListener("touchmove",re,Yi)}function De(j,ue){ke(j,function(){!y.state.isVisible&&Q.parentNode&&Q.parentNode.contains(Q)&&ue()})}function be(j,ue){ke(j,ue)}function ke(j,ue){var ye=L().box;function Me(Ne){Ne.target===ye&&(IA(ye,"remove",Me),ue())}if(j===0)return ue();IA(ye,"remove",A),IA(ye,"add",Me),A=Me}function pe(j,ue,ye){ye===void 0&&(ye=!1);var Me=Cn(y.props.triggerTarget||r);Me.forEach(function(Ne){Ne.addEventListener(j,ue,ye),d.push({node:Ne,eventType:j,handler:ue,options:ye})})}function xe(){$()&&(pe("touchstart",_e,{passive:!0}),pe("touchend",we,{passive:!0})),qx(y.props.trigger).forEach(function(j){if(j!=="manual")switch(pe(j,_e),j){case"mouseenter":pe("mouseleave",we);break;case"focus":pe(cw?"focusout":"blur",S);break;case"focusin":pe("focusout",S);break}})}function He(){d.forEach(function(j){var ue=j.node,ye=j.eventType,Me=j.handler,Ne=j.options;ue.removeEventListener(ye,Me,Ne)}),d=[]}function _e(j){var ue,ye=!1;if(!(!y.state.isEnabled||I(j)||a)){var Me=((ue=u)==null?void 0:ue.type)==="focus";u=j,g=j.currentTarget,F(),!y.state.isVisible&&ew(j)&&xa.forEach(function(Ne){return Ne(j)}),j.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||o)&&y.props.hideOnClick!==!1&&y.state.isVisible?ye=!0:z(j),j.type==="click"&&(o=!ye),ye&&!Me&&ae(j)}}function ze(j){var ue=j.target,ye=ee().contains(ue)||Q.contains(ue);if(!(j.type==="mousemove"&&ye)){var Me=G().concat(Q).map(function(Ne){var Oe,Je=Ne._tippy,Bt=(Oe=Je.popperInstance)==null?void 0:Oe.state;return Bt?{popperRect:Ne.getBoundingClientRect(),popperState:Bt,props:t}:null}).filter(Boolean);nw(Me,j)&&(J(),ae(j))}}function we(j){var ue=I(j)||y.props.trigger.indexOf("click")>=0&&o;if(!ue){if(y.props.interactive){y.hideWithInteractivity(j);return}ae(j)}}function S(j){y.props.trigger.indexOf("focusin")<0&&j.target!==ee()||y.props.interactive&&j.relatedTarget&&Q.contains(j.relatedTarget)||ae(j)}function I(j){return Fr.isTouch?$()!==j.type.indexOf("touch")>=0:!1}function m(){w();var j=y.props,ue=j.popperOptions,ye=j.placement,Me=j.offset,Ne=j.getReferenceClientRect,Oe=j.moveTransition,Je=K()?yA(Q).arrow:null,Bt=Ne?{getBoundingClientRect:Ne,contextElement:Ne.contextElement||ee()}:r,Zr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(zt){var bt=zt.state;if(K()){var Zt=L(),ei=Zt.box;["placement","reference-hidden","escaped"].forEach(function(ti){ti==="placement"?ei.setAttribute("data-placement",bt.placement):bt.attributes.popper["data-popper-"+ti]?ei.setAttribute("data-"+ti,""):ei.removeAttribute("data-"+ti)}),bt.attributes.popper={}}}},Tt=[{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}},Zr];K()&&Je&&Tt.push({name:"arrow",options:{element:Je,padding:3}}),Tt.push.apply(Tt,(ue==null?void 0:ue.modifiers)||[]),y.popperInstance=Wx(Bt,Q,Object.assign({},ue,{placement:ye,onFirstUpdate:h,modifiers:Tt}))}function w(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function N(){var j=y.props.appendTo,ue,ye=ee();y.props.interactive&&j===V0||j==="parent"?ue=ye.parentNode:ue=K0(j,[ye]),ue.contains(Q)||ue.appendChild(Q),y.state.isMounted=!0,m()}function G(){return ba(Q.querySelectorAll("[data-tippy-root]"))}function z(j){y.clearDelayTimeouts(),j&&k("onTrigger",[y,j]),fe();var ue=U(!0),ye=D(),Me=ye[0],Ne=ye[1];Fr.isTouch&&Me==="hold"&&Ne&&(ue=Ne),ue?i=setTimeout(function(){y.show()},ue):y.show()}function ae(j){if(y.clearDelayTimeouts(),k("onUntrigger",[y,j]),!y.state.isVisible){me();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&o)){var ue=U(!1);ue?n=setTimeout(function(){y.state.isVisible&&y.hide()},ue):s=requestAnimationFrame(function(){y.hide()})}}function Ae(){y.state.isEnabled=!0}function he(){y.hide(),y.state.isEnabled=!1}function ve(){clearTimeout(i),clearTimeout(n),cancelAnimationFrame(s)}function Be(j){if(!y.state.isDestroyed){k("onBeforeUpdate",[y,j]),He();var ue=y.props,ye=tp(r,Object.assign({},ue,j0(j),{ignoreAttributes:!0}));y.props=ye,xe(),ue.interactiveDebounce!==ye.interactiveDebounce&&(J(),f=W0(ze,ye.interactiveDebounce)),ue.triggerTarget&&!ye.triggerTarget?Cn(ue.triggerTarget).forEach(function(Me){Me.removeAttribute("aria-expanded")}):ye.triggerTarget&&r.removeAttribute("aria-expanded"),F(),V(),_&&_(ue,ye),y.popperInstance&&(m(),G().forEach(function(Me){requestAnimationFrame(Me._tippy.popperInstance.forceUpdate)})),k("onAfterUpdate",[y,j])}}function Le(j){y.setProps({content:j})}function Pe(){var j=y.state.isVisible,ue=y.state.isDestroyed,ye=!y.state.isEnabled,Me=Fr.isTouch&&!y.props.touch,Ne=pA(y.props.duration,0,Er.duration);if(!(j||ue||ye||Me)&&!ee().hasAttribute("disabled")&&(k("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,K()&&(Q.style.visibility="visible"),V(),fe(),y.state.isMounted||(Q.style.transition="none"),K()){var Oe=L(),Je=Oe.box,Bt=Oe.content;EA([Je,Bt],0)}h=function(){var Tt;if(!(!y.state.isVisible||c)){if(c=!0,Q.offsetHeight,Q.style.transition=y.props.moveTransition,K()&&y.props.animation){var Ir=L(),zt=Ir.box,bt=Ir.content;EA([zt,bt],Ne),q0([zt,bt],"visible")}R(),F(),J0(CA,y),(Tt=y.popperInstance)==null||Tt.forceUpdate(),k("onMount",[y]),y.props.animation&&K()&&be(Ne,function(){y.state.isShown=!0,k("onShown",[y])})}},N()}}function rt(){var j=!y.state.isVisible,ue=y.state.isDestroyed,ye=!y.state.isEnabled,Me=pA(y.props.duration,1,Er.duration);if(!(j||ue||ye)&&(k("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,o=!1,K()&&(Q.style.visibility="hidden"),J(),me(),V(!0),K()){var Ne=L(),Oe=Ne.box,Je=Ne.content;y.props.animation&&(EA([Oe,Je],Me),q0([Oe,Je],"hidden"))}R(),F(),y.props.animation?K()&&De(Me,y.unmount):y.unmount()}}function at(j){Z().addEventListener("mousemove",f),J0(xa,f),f(j)}function Ct(){y.state.isVisible&&y.hide(),y.state.isMounted&&(w(),G().forEach(function(j){j._tippy.unmount()}),Q.parentNode&&Q.parentNode.removeChild(Q),CA=CA.filter(function(j){return j!==y}),y.state.isMounted=!1,k("onHidden",[y]))}function nt(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),He(),delete r._tippy,y.state.isDestroyed=!0,k("onDestroy",[y]))}}function Vi(r,e){e===void 0&&(e={});var t=Er.plugins.concat(e.plugins||[]);aw();var i=Object.assign({},e,{plugins:t}),n=rw(r),s=n.reduce(function(o,a){var l=a&&mw(a,i);return l&&o.push(l),o},[]);return Sa(r)?s[0]:s}Vi.defaultProps=Er,Vi.setDefaultProps=dw,Vi.currentInput=Fr,Object.assign({},S0,{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)}}),Vi.setDefaultProps({render:np});function Yt(r,e){return`${r}-${e}`}function Pr(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(Pr).filter(Boolean)),i}function Ew(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 wa extends Error{constructor(e,t,i=!1){super(),this.fatal=!1,this.fatal=i,t instanceof Error&&(this.stack=t.stack),this.message=[e,Ew(t)].filter(Boolean).join(" - ")}}function Ii(r,e,t){return Math.min(Math.max(e,r),t)}const Iw=5;function vw(r,e){return r.length!==e.length||r.some((t,i)=>t!==e[i])}class yw{constructor(e){this._caption="",this._currentTime=0,this._activeScenes=[],this._upcomingScenes=[],this._canvas=Qt(),this._controls=Qt(),this._drawAbort=null,this.host=e}set activeScenes(e){vw(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=Ii(0,e,this.host.duration);this.activeScenes=((t=this.host.composition)==null?void 0:t.tracks.reduce((a,l)=>a.concat(l.scenes.filter(({start:c,duration:u})=>s>=c&&s<c+u)),[]))??[];const o=s!==this.currentTime;this._currentTime=s,this._upcomingScenes=((i=this.host.composition)==null?void 0:i.tracks.reduce((a,l)=>a.concat(l.scenes.filter(({start:c})=>s>=c-Iw&&s<c)),[]))??[],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 Rt(this._canvas)}controls(){return Rt(this._controls)}loadScenes(){[...this.activeScenes,...this._upcomingScenes].forEach(e=>{Pr(e.layout.node).forEach(({key:i})=>{var n,s,o;const{id:a,start:l,duration:c}=e,u=this.host.currentTime>0||this.host.preload==="auto"||!this.host.paused,A=Yt(a,i);if(this.host.media[A]){const h=this.host.media[A],{speed:d,volume:f,hls:g,node:p,start:E,duration:C}=h,B=this.host.mediaState[A];p&&B&&(p.currentTime>=E+C||p.ended||u&&(g?(n=g.startLoadOnce)==null||n.call(g,E):B.initialised||(s=p.startLoadOnce)==null||s.call(p),p.volume=Ii(0,this.host.volume*(f??1)*this.host.envelopeGain(a,l),1),p.playbackRate=Ii(.1,this.host.playbackRate*(d??1),4)))}else if(u){const h=`${l}-${c}`,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,l/this.host.duration*100),end:Math.min((l+c)/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=>Pr(i.layout.node).map(async({key:s})=>{const o=Yt(i.id,s);if(this.host.media[o]){const a=this.host.media[o],{node:l}=a,c=this.host.mediaState[o];if(!this.activeScenes.includes(i))l.paused||l.pause();else if(c&&!this.host.waiting&&!this.host.loading&&!this.host.paused&&l.paused&&!l.ended&&c.initialised)try{await l.play()}catch(A){throw new wa("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 Cw=fr(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()}),sp=fr(async(r,e,t)=>new FontFace(r,await Cw(t),{weight:e,style:"normal"}).load(),{cacheKey:([r,e,t])=>`${r}|${e}|${t}`}),Bw=fr(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?sp(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??""}`}});fr(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(c=>c.family===e.name&&c.weight===i);if(a)return a;const l=await sp(e.name,i,o);return document.fonts.add(l),l}))).filter(i=>i!==null)},{cacheKey:([r])=>JSON.stringify(r)});function Tw(r){return r.startsWith("data:")?r.split(",")[0]:r.split(/[?#]/)[0]}function op(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 bw(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 Sw(r,e){const t=URL.createObjectURL(await bw(r,e));try{const i=e.endsWith(".svg")?`${t}#${e}`:t;return await op(i,null,`Failed to decode image: ${e}`)}finally{URL.revokeObjectURL(t)}}const xw=fr(async r=>{const e=Tw(r);try{return await Sw(r,e)}catch(t){return op(r,"anonymous",`Failed to load image: ${e}`).catch(()=>{throw t})}}),ww=fr(async({options:r})=>{const e=await Bw(r.font);return e&&document.fonts.add(e),{font:r.font}}),Qw=fr(async({config:r})=>r.src?{image:await xw(r.src)}:{image:null},{cacheKey:([{config:r}])=>JSON.stringify(r)});async function BA(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 ap(r,e){if(r.type==="video"&&r.alpha)return(e?r.alpha.mov:r.alpha.webm)||void 0}function Rw(r,e){return ap(r,e)??r.src}function TA(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function _w(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Dw({config:r,elementSize:e}){return new Promise(async t=>{let i=null;const{type:n,key:s,duration:o}=r,a=Rw(r,TA());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 l=!1;if(i.startLoadOnce=()=>{l||(i.preload="auto",i.load(),l=!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 c=async()=>{const u=await BA(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",c)};i.addEventListener("loadedmetadata",c)}})}function Lw({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,l=!1;const c=new or({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])}}});c.on(or.Events.BUFFER_CODECS,async(u,A)=>{var h,d;if(l)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){l=!0,o||c==null||c.stopLoad();const E=t??await BA(s);n({key:r,hls:c,node:s,aspectRatio:g/p,totalDuration:E})}}),c.on(or.Events.LEVEL_LOADED,async()=>{setTimeout(async()=>{if(l)return;l=!0,o||c==null||c.stopLoad();const u=t??await BA(s),A=c.levels[c.levels.length-1];n({key:r,hls:c,node:s,aspectRatio:A.width/A.height,totalDuration:u})},2e3)}),i&&c.on(or.Events.MANIFEST_PARSED,()=>{const u=window.devicePixelRatio||1,A=Math.min(i.width,i.height)*u;let h=0;for(let d=c.levels.length-1;d>=0;d--)if(Math.min(c.levels[d].width,c.levels[d].height)<=A){h=d;break}c.autoLevelCapping=h}),c.loadSource(e),c.attachMedia(s),c.startLoadOnce=(u=-1,A)=>{if(c&&!o){const h=c.levels.findIndex(d=>Math.min(d.height,d.width)===A);o=!0,c.startLoad(u),h!==-1&&(c.currentLevel=h)}}})}function kw({config:r,elementSize:e}){const{playlist:t}=r;return!ap(r,TA())&&t&&!TA()&&or.isSupported()?Lw({key:r.key,playlist:t,duration:r.duration??0,elementSize:e}):Dw({config:r,elementSize:e})}const Mw=.25;let Fw=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=fr(async(t,i)=>{var n,s,o,a;const{key:l}=i,c=((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 kw({config:i,elementSize:{width:c,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:l,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=Yt(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=Yt(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=Yt(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=Yt(t,i),o=this.mediaState[s];o!=null&&o.initialised&&(this.host.draw(),this.host.activeScenes.flatMap(a=>Pr(a.layout.node).map(({id:c})=>c)).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[Yt(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[Yt(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 wa(`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 l=(a=n.listeners)==null?void 0:a[s];l&&n.node.removeEventListener(s,l)}}),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 io(this.host,async([e,t,i,n])=>{var s,o;this._compositionController.abort(),this._compositionController=new AbortController;const a=this._compositionController,l=this._delayProcessing();try{if(this.host._errors=[],(!t||!this.host._languages.find(({value:c})=>t===c))&&(this.host._language=(s=this.host._languages[0])==null?void 0:s.value),e){const{width:c,height:u}=Gl({aspectRatio:i,resolution:1080});try{(o=this.composition)==null||o.cleanup();const f=await Ld({debug:n,config:e,resolvers:{text:ww,image:Qw,video:async({id:g,config:p,options:E})=>{const{media:C,source:B}=await this._mediaFactory(g,{...p,...E});return{video:B,aspectRatio:C.aspectRatio}}},rootWidth:c,rootHeight:u});if(a.signal.aborted)return;this.composition=f}catch(f){throw new wa("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=Pr(g.layout.node);for(const E of p){const{media:C,listeners:B}=await this._mediaFactory(g.id,E),y=Yt(g.id,C.key);d.push(y);const x=(E.startOffset??0)*C.totalDuration,Q=(1-(E.endOffset??0))*C.totalDuration;A[y]={...C,listeners:B,start:x,duration:Q-x,speed:E.speed??1,volume:E.volume??1,loop:E.loop??!1},h[y]={initialised:!C,waiting:!!C,...this.mediaState[y]}}}if(a.signal.aborted)return;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(c){this.composition=null,this.duration=0,this.host.dispatchEvent(new ErrorEvent("error",{composed:!0,bubbles:!0,error:c,message:c.message}))}finally{l.abort(),this.host._processing=!1}},()=>[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;Pr(o.node).filter(({key:c})=>!i||c===i).forEach(({key:c})=>{const u=Yt(s,c);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=Ii(A.start,d+A.start,A.start+A.duration);if(n&&!A.node.paused&&Math.abs(A.node.currentTime-f)<Mw)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(){this._compositionController.abort(),Object.keys(this.media).forEach(e=>{this._cleanupMedia(e)}),this.media={}}};function Pw(r){r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullscreen?r.webkitRequestFullscreen():r.msRequestFullscreen&&r.msRequestFullscreen()}function Nw(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}const bA=["progress","play-large","navigation","play","volume","current-time","duration","levels","speed","captions","fullscreen","preview"],Ow={id:"captions",event:"captions:click",label:"Closed Captions"},Uw={id:"fullscreen",event:"fullscreen:click",label:"Full Screen"},lp={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}]},Gw={id:"playbackRate",label:"Playback playbackRate",subItems:lp};class Hw extends du{constructor(e){if(super(e),this.element=null,this.observer=void 0,e.type!==tn.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)),dr}}const SA=rn(Hw),$w=HS(()=>{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=Ed.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]}),Nr={"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"},Yw={colors:Nr,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 ${Nr["dark-100"]}`,medium:`0 .125rem .625rem ${Nr["dark-100"]}`,large:`0 .25rem 1rem ${Nr["dark-50"]}`,xl:`.25rem .25rem 1rem ${Nr["dark-250"]}`,xxl:`0 .25rem 2rem ${Nr["dark-100"]}`,xxxl:`.25rem .25rem 3rem ${Nr["dark-250"]}`,toolbar:`0 -.625rem .625rem ${Nr["dark-50"]}`,text:`0 0 .25rem ${Nr["dark-250"]}`},timings:{fast:".1s",normal:".2s",slow:".3s"},easings:{linear:"linear"},focusOutline:{width:".2rem",color:Nr["dark-400"]},iconSizes:{small:"0.75rem",medium:"1rem",large:"1.5rem"}},cp=OS(Yw,{delimiter:"-"}),Vw=Object.keys(cp).map(r=>Pn(`:host { --${r}: ${cp[r]}; }`)),tt=(r=>{const e=class extends r{firstUpdated(){$w().forEach(({load:s,font:o})=>{document.fonts.add(o),s&&o.load()})}};return e.styles=[(r==null?void 0:r.styles)??[],Vw,Et`
|
|
2515
2515
|
:host {
|
|
2516
2516
|
font-family: var(--fontFamilies-sans);
|
|
2517
2517
|
font-size: var(--fontSizes-medium);
|
|
@@ -3732,7 +3732,7 @@ Schedule: ${l.map(d=>mi(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
|
-
`],wt([ne({type:Boolean})],mt.prototype,"loading",2),wt([ne({type:Boolean})],mt.prototype,"playing",2),wt([ne({type:Number})],mt.prototype,"volume",2),wt([ne({type:Boolean})],mt.prototype,"muted",2),wt([ne({type:Number})],mt.prototype,"currentTime",2),wt([ne({type:Number})],mt.prototype,"duration",2),wt([ne({type:Array})],mt.prototype,"languages",2),wt([ne({type:String})],mt.prototype,"language",2),wt([ne({type:Array,attribute:!1})],mt.prototype,"levels",2),wt([ne({type:Number})],mt.prototype,"level",2),wt([ne({type:Number})],mt.prototype,"playbackRate",2),wt([ne({type:String})],mt.prototype,"caption",2),wt([ne({type:Array})],mt.prototype,"buffer",2),wt([ne({type:Boolean})],mt.prototype,"captions",2),wt([ne({type:Boolean})],mt.prototype,"fullscreen",2),wt([ne({type:Array})],mt.prototype,"controls",2),wt([ft()],mt.prototype,"showControls",2),mt=wt([Pt("vmp-player-overlay")],mt);var bQ=Object.defineProperty,SQ=Object.getOwnPropertyDescriptor,ht=(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&&bQ(e,t,n),n};const fp=new WeakMap,xQ=1e3/60,wQ=30;let ot=class extends tt{constructor(){super(...arguments),this.debug=!1,this.propAspectRatio=0,this.preload="auto",this.autoplay=!1,this.loading=!1,this.disabled=!1,this.dataResolver=ql,this.languageResolver=XC,this._sceneController=new Fw(this),this._drawController=new yw(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=Qt(),this._canvasRef=Qt(),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,xQ):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})=>Pr(t.node).some(({key:n})=>{const s=Yt(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/wQ){let e=this._drawController.currentTime;const t=(r-(this._lastTimestamp??r))/1e3*this.playbackRate;this.activeScenes.every(({id:n,layout:s},o)=>Pr(s.node).every(({key:l},c)=>{var u,A;const h=Yt(n,l),d=this.media[h];return d.node.ended||d.loop?!0:((A=(u=this._lastCurrentTime)==null?void 0:u[o])==null?void 0:A[c])!==d.node.currentTime}))&&(e+=t),this._lastCurrentTime=this.activeScenes.map(({id:n,layout:s})=>Pr(s.node).map(({key:a})=>{const l=Yt(n,a);return this.media[l].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=fp.get(t);i||(i=LC(t),fp.set(t,i));const n=i.get(r);return n?kC(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=Ii(.1,r*t,4)}),this.requestUpdate(),this.dispatchEvent(new CustomEvent("ratechange",{detail:r})))}get playbackRate(){return this._playbackRate}set volume(r){const e=Ii(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,l,c,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 C=E.layout.node;typeof g.x=="number"&&(C.x=g.x),typeof g.y=="number"&&(C.y=g.y),typeof g.width=="number"&&(C.width=g.width),typeof g.height=="number"&&(C.height=g.height);const B={};let y=!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,y=!0),((l=(a=(o=(s=g.root)==null?void 0:s.element)==null?void 0:o.options)==null?void 0:a.font)==null?void 0:l.size)!=null&&(B.fontSize=g.root.element.options.font.size,y=!0),((A=(u=(c=g.root)==null?void 0:c.element)==null?void 0:u.options)==null?void 0:A.value)!==void 0&&(B.textValue=g.root.element.options.value,y=!0),y&&h.set(g.id,B);break}}this.draw(void 0,h.size>0?h:void 0)}toggleFullscreen(r){r??this.fullscreen?Nw():this._playerRef.value&&Pw(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"?Re`
|
|
3735
|
+
`],wt([ne({type:Boolean})],mt.prototype,"loading",2),wt([ne({type:Boolean})],mt.prototype,"playing",2),wt([ne({type:Number})],mt.prototype,"volume",2),wt([ne({type:Boolean})],mt.prototype,"muted",2),wt([ne({type:Number})],mt.prototype,"currentTime",2),wt([ne({type:Number})],mt.prototype,"duration",2),wt([ne({type:Array})],mt.prototype,"languages",2),wt([ne({type:String})],mt.prototype,"language",2),wt([ne({type:Array,attribute:!1})],mt.prototype,"levels",2),wt([ne({type:Number})],mt.prototype,"level",2),wt([ne({type:Number})],mt.prototype,"playbackRate",2),wt([ne({type:String})],mt.prototype,"caption",2),wt([ne({type:Array})],mt.prototype,"buffer",2),wt([ne({type:Boolean})],mt.prototype,"captions",2),wt([ne({type:Boolean})],mt.prototype,"fullscreen",2),wt([ne({type:Array})],mt.prototype,"controls",2),wt([ft()],mt.prototype,"showControls",2),mt=wt([Pt("vmp-player-overlay")],mt);var bQ=Object.defineProperty,SQ=Object.getOwnPropertyDescriptor,ht=(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&&bQ(e,t,n),n};const fp=new WeakMap,xQ=1e3/60,wQ=30;let ot=class extends tt{constructor(){super(...arguments),this.debug=!1,this.propAspectRatio=0,this.preload="auto",this.autoplay=!1,this.loading=!1,this.disabled=!1,this.dataResolver=ql,this.languageResolver=XC,this._sceneController=new Fw(this),this._drawController=new yw(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=Qt(),this._canvasRef=Qt(),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,xQ):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})=>Pr(t.node).some(({key:n})=>{const s=Yt(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/wQ){let e=this._drawController.currentTime;const t=(r-(this._lastTimestamp??r))/1e3*this.playbackRate;this.activeScenes.every(({id:n,layout:s},o)=>Pr(s.node).every(({key:l},c)=>{var u,A;const h=Yt(n,l),d=this.media[h];return!d||d.node.ended||d.loop?!0:((A=(u=this._lastCurrentTime)==null?void 0:u[o])==null?void 0:A[c])!==d.node.currentTime}))&&(e+=t),this._lastCurrentTime=this.activeScenes.map(({id:n,layout:s})=>Pr(s.node).map(({key:a})=>{var l;const c=Yt(n,a);return(l=this.media[c])==null?void 0:l.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=fp.get(t);i||(i=LC(t),fp.set(t,i));const n=i.get(r);return n?kC(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=Ii(.1,r*t,4)}),this.requestUpdate(),this.dispatchEvent(new CustomEvent("ratechange",{detail:r})))}get playbackRate(){return this._playbackRate}set volume(r){const e=Ii(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,l,c,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 C=E.layout.node;typeof g.x=="number"&&(C.x=g.x),typeof g.y=="number"&&(C.y=g.y),typeof g.width=="number"&&(C.width=g.width),typeof g.height=="number"&&(C.height=g.height);const B={};let y=!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,y=!0),((l=(a=(o=(s=g.root)==null?void 0:s.element)==null?void 0:o.options)==null?void 0:a.font)==null?void 0:l.size)!=null&&(B.fontSize=g.root.element.options.font.size,y=!0),((A=(u=(c=g.root)==null?void 0:c.element)==null?void 0:u.options)==null?void 0:A.value)!==void 0&&(B.textValue=g.root.element.options.value,y=!0),y&&h.set(g.id,B);break}}this.draw(void 0,h.size>0?h:void 0)}toggleFullscreen(r){r??this.fullscreen?Nw():this._playerRef.value&&Pw(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(),this._endLoop(),this._paused=!0,(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"?Re`
|
|
3736
3736
|
<style>
|
|
3737
3737
|
:host {
|
|
3738
3738
|
aspect-ratio: ${this.propAspectRatio};
|