@vouchfor/embeds 8.3.2 → 8.3.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 CHANGED
@@ -195,7 +195,7 @@ class FetcherController {
195
195
  return this._fetching;
196
196
  }
197
197
  }
198
- const version = "8.3.2";
198
+ const version = "8.3.3";
199
199
  const packageJson = {
200
200
  version
201
201
  };
@@ -2473,7 +2473,7 @@ vec4 transition(vec2 uv) {
2473
2473
  return mix(a, b, step(0.0+p.y,progress));
2474
2474
  }
2475
2475
  `,author:"Jake Nelson",license:"MIT",createdAt:"Wed, 1 Nov 2017 15:24:36 -0500",updatedAt:"Thu, 2 Nov 2017 18:37:42 -0500"}];const bd=Ql(Ny);var Sd;function Oy(i){if(typeof i=="string"){const[e,t]=i.split(":");return Math.min(parseFloat(e),parseFloat(t))}return i}function Uy(i){if(typeof i=="string"){const[e,t]=i.split(":"),r=parseFloat(e),n=parseFloat(t);return r/n}return i}function ac({resolution:i,aspectRatio:e}){const t=Oy(i),r=Uy(e),n=r>=1,s=Math.min(n?t*r:t/r,t),o=Math.max(n?t*r:t/r,t);return{resolution:t,aspectRatio:r,height:Math.round(n?s:o),width:Math.round(n?o:s)}}const xd={linear:XE,easeIn:wl,easeInOut:eI,easeOut:ZE,circIn:yh,circInOut:tI,circOut:Ch,backIn:_l,backInOut:rI,backOut:iI,anticipate:nI,bounceIn:lI,bounceInOut:cI,bounceOut:xo},Jo=Zu((i,e,{clamp:t=!0,ease:r="easeIn",...n}={})=>KE(i,e,{...n,clamp:t,ease:xd[r]}),{cacheKey:([i,e,t])=>JSON.stringify({from:i,to:e,options:t})}),Gy={type:"clip",processor:{getTargetState:i=>({clip:{x:i.coordinates.x,y:i.coordinates.y,width:i.dimensions.width,height:i.dimensions.height}}),interpolateState:({value:i,easing:e,progress:t,from:r})=>{const n=r.clip??{x:0,y:0,width:1,height:1},s={x:i.coordinates.x,y:i.coordinates.y,width:i.dimensions.width,height:i.dimensions.height};return{clip:Jo([0,1],[n,s],{ease:e})(t)}}}},jo={type:"fade",processor:{getTargetState:i=>({opacity:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({opacity:Jo([0,1],[r.opacity,i],{ease:e})(t)})}},Hy={type:"scale",processor:{getTargetState:i=>({scale:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({scale:Jo([0,1],[r.scale,i],{ease:e})(t)})}},wd={type:"translate",processor:{getTargetState:i=>({translation:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({translation:Jo([0,1],[r.translation,i],{ease:e})(t)})}},$y=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],Yy=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Vy=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],Ky=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Es={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:$y},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},lc={type:"switch",name:"reverseExit",label:"Reverse exit animation"},Wy=.2,Jy=1;function jy(i,e){const t=i==="both"?e/2:e;return Math.min(Jy,t)}function Is({speed:i,timing:e,elementDuration:t}){const r=jy(e,t),n=Math.min(Wy,r),s=Math.max(0,Math.min(100,i))/100;return r-s*(r-n)}const qy="easeOut";function vs(i){return{values:e=>{var t;return{timing:e.timing??"both",speed:[e.speed??50],...((t=i==null?void 0:i.values)==null?void 0:t.call(i,e))??{}}},options:e=>{var t;return{timing:e.timing,speed:e.speed[0],easing:qy,...((t=i==null?void 0:i.options)==null?void 0:t.call(i,e))??{}}}}}function gr({timing:i,duration:e,elementDuration:t,easing:r,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const l=[],c=i==="both"||i==="enter",u=i==="both"||i==="exit",A=Math.max(0,t-e);if(c?(l.push({time:0,value:s,easing:r}),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:r});const h=n?s:o;l.push({time:t,value:h,easing:r})}return l}const _d="fade",zy={type:_d,name:"Fade",options:{...Es},transform:vs(),generate:(i,e)=>{const t=Is({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:jo}}}},Qd="pan",Rd=.25,Dd="left";function Ld(i,e,t){switch(i){case"left":return{x:e.width*t,y:0};case"right":return{x:-e.width*t,y:0};default:return Ld(Dd,e,t)}}function Xy(i){return{x:-i.x,y:-i.y}}const Zy={type:Qd,name:"Pan",options:{...Es,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Vy},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:i=>`${(i*100).toFixed(0)}%`}},reverseExit:lc},transform:vs({values:i=>({direction:i.direction??Dd,distance:[i.distance??Rd],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Is({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Rd,n=Ld(i.direction,e.elementDimensions,r),s=Xy(n);return{fade:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:jo},translate:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:wd}}}},kd="pop",Md=.5,eC={type:kd,name:"Pop",options:{...Es},transform:vs(),generate:(i,e)=>{const t=Is({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:jo},scale:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:Md,exitTo:Md,restValue:1}),renderer:Hy}}}},Fd="rise",Pd=50,tC="up";function iC(i,e){switch(i){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const rC={type:Fd,name:"Rise",options:{...Es,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Ky},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:i=>`${i}px`}},reverseExit:lc},transform:vs({values:i=>({direction:i.direction??tC,distance:[i.distance??Pd],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Is({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Pd,{enterY:n,exitY:s}=iC(i.direction,r);return{fade:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:jo},translate:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:{x:0,y:n},exitTo:{x:0,y:s},restValue:{x:0,y:0}}),renderer:wd}}}},Nd="wipe",cc="left";function dn(i){switch(i){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 dn(cc)}}function Od(i){switch(i){case"left":return dn("right");case"right":return dn("left");case"up":return dn("down");case"down":return dn("up");default:return Od(cc)}}const nC={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},sC={type:Nd,name:"Wipe",options:{...Es,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Yy},reverseExit:lc},transform:vs({values:i=>({direction:i.direction??cc,reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Is({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=dn(i.direction),n=Od(i.direction);return{clip:{keyframes:gr({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:r,exitTo:n,restValue:nC}),renderer:Gy}}}},oC={[_d]:zy,[Fd]:rC,[kd]:eC,[Qd]:Zy,[Nd]:sC};function aC(i,e){const{type:t,...r}=i,n=oC[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(r,e)}function lC({animation:i,sceneTime:e}){const t=i.keyframes;if(!t||t.length===0)return null;const r=[...t].sort((s,o)=>s.time-o.time);if(e<r[0].time)return null;const n=r[r.length-1];if(e>=n.time)return i.renderer.processor.getTargetState(n.value);for(let s=0;s<r.length-1;s++){const o=r[s],a=r[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=i.renderer.processor.getTargetState(o.value);return i.renderer.processor.interpolateState({easing:u,progress:c,from:A,value:a.value})}}return null}function cC(i,e,t){const{preset:r,...n}=i;if(!r)return n;const s=aC(r,{elementDuration:e,elementDimensions:t});return{...n,...s}}function Ud({layout:i,sceneTime:e,animations:t,elementDuration:r=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=i==null?void 0:i.transform)==null?void 0:s.opacity)??1,translation:{x:((a=(o=i==null?void 0:i.transform)==null?void 0:o.translate)==null?void 0:a.x)??0,y:((c=(l=i==null?void 0:i.transform)==null?void 0:l.translate)==null?void 0:c.y)??0},scale:((u=i==null?void 0:i.transform)==null?void 0:u.scale)??1,rotation:((A=i==null?void 0:i.transform)==null?void 0:A.rotation)??0,dimensions:{widthRatio:((d=(h=i==null?void 0:i.transform)==null?void 0:h.dimension)==null?void 0:d.widthRatio)??1,heightRatio:((g=(f=i==null?void 0:i.transform)==null?void 0:f.dimension)==null?void 0:g.heightRatio)??1}};if(!t)return p;const I=cC(t,r,n);for(const C of Object.values(I)){if(!C)continue;const B=lC({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const AC=[];for(let i=0;i<256;++i)AC.push((i+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function uC(i=.4,e=.4){const t=Math.max(.1,Math.min(.8,i)),r=Math.max(.2,Math.min(.6,e)),s=(1-t)/2,a=1-r;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 qo=64;function hC(){const i=[],e={x:.5,y:.5},t=.5;for(let r=0;r<qo;r++){const n=r/qo*2*Math.PI,s=e.x+t*Math.cos(n),o=e.y+t*Math.sin(n);i.push({x:s,y:o})}return i}function dC(i=1){const e=[],t={x:.5,y:.5};let r,n;i>=1?(r=.5,n=.5/i):(r=.5*i,n=.5);for(let s=0;s<qo;s++){const o=s/qo*2*Math.PI,a=t.x+r*Math.cos(o),l=t.y+n*Math.sin(o);e.push({x:a,y:l})}return e}function fC(){const i=[];for(let t=0;t<=100;t++){const r=t/100*2*Math.PI,n=16*Math.sin(r)**3,s=-(13*Math.cos(r)-5*Math.cos(2*r)-2*Math.cos(3*r)-Math.cos(4*r)),o=(n+16)/32,a=(s+13)/26;i.push({x:o,y:a})}return i}function Gd(i=0,e=1){if(i===0)return[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:0,y:1}];const t=i*Math.PI/180,r=Math.tan(t)/e;return[{x:Math.max(0,Math.min(1,0+r)),y:0},{x:Math.max(0,Math.min(1,1+r)),y:0},{x:Math.max(0,Math.min(1,1-r)),y:1},{x:Math.max(0,Math.min(1,0-r)),y:1}]}function zo(i){if(i<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let c=0;c<i;c++){const u=c*2*Math.PI/i-Math.PI/2,A=Math.cos(u),h=Math.sin(u);t.push({x:A,y:h})}const r=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-r,l=o-s;for(const c of t){const u=(c.x-r)/a,A=(c.y-s)/l;e.push({x:u,y:A})}return e}function Hd(i=90){const e=i*Math.PI/180,r=.5/Math.tan(e),s=1/(1+Math.abs(r)*2),o=r*s;return[{x:.5+o,y:0},{x:1,y:.5},{x:.5-o,y:1},{x:0,y:.5}]}function gC(i=5,e=.4){const t=[];for(let n=0;n<i*2;n++){const s=n*Math.PI/i-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 pC(i="isosceles",e={}){switch(i){case"equilateral":return mC();case"isosceles":return $d(e.baseAngle??60);case"right":return EC(e.rightAnglePosition??"bottom-left");case"scalene":return IC(e.angles??[60,60,60])}}function mC(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function $d(i){const e=i*Math.PI/180,t=.5/Math.tan(e),r=Math.max(.1,Math.min(2,t));return[{x:.5,y:1-Math.min(1,r)},{x:0,y:1},{x:1,y:1}]}function EC(i){switch(i){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 IC(i){return $d(i[0])}function vC(i={},e=1){const{type:t="rectangle",customPolygon:r,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:l,regularPolygon:c}=i;switch(t){case"rectangle":return Gd(0,e);case"parallelogram":return Gd((n==null?void 0:n.angle)??30,e);case"triangle":return pC((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 Hd((o==null?void 0:o.angle)??90);case"diamond":return Hd(90);case"pentagon":return zo(5);case"hexagon":return zo(6);case"octagon":return zo(8);case"star":return gC((l==null?void 0:l.points)??5,(l==null?void 0:l.innerRadius)??.4);case"arrow":return uC((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return fC();case"circle":return hC();case"ellipse":return dC(e);case"custom-polygon":if(!(r!=null&&r.points)||r.points.length<3)throw new Error("Custom polygon must have at least 3 points");return r.points;default:return zo((c==null?void 0:c.sides)??6)}}function yC(i,e){let t=!1;const r=i.x,n=i.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&&r<(c-a)*(n-l)/(u-l)+a&&(t=!t)}return t}function CC(i,e){let t=1,r=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;yC({x:o,y:i},e)&&(t=Math.min(t,o),r=Math.max(r,o))}return r>=t?{left:t,right:r}:null}function BC(i){const e=Math.min(...i.map(l=>l.y)),t=Math.max(...i.map(l=>l.y));let r={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:CC(c,i)})}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 I=0;I<p;I++){const C=l+Math.floor(I/(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 I=f-d,C=I*h;C>n&&(n=C,r={x:d,y:c,width:I,height:h})}}}return r}function TC(i,e=1){const t=vC(i,e);if(t.length<3)return{top:0,right:0,bottom:0,left:0};if(i.type==="rectangle")return{top:0,right:0,bottom:0,left:0};const r=BC(t),n=r.y,s=r.x,o=1-(r.x+r.width),a=1-(r.y+r.height);return{top:Math.max(0,n),right:Math.max(0,o),bottom:Math.max(0,a),left:Math.max(0,s)}}function bC(i){return typeof i=="number"?{topLeft:i,topRight:i,bottomRight:i,bottomLeft:i}:{topLeft:(i==null?void 0:i.topLeft)??0,topRight:(i==null?void 0:i.topRight)??0,bottomRight:(i==null?void 0:i.bottomRight)??0,bottomLeft:(i==null?void 0:i.bottomLeft)??0}}function SC(i,e){return typeof i=="number"?{top:i*e,right:i*e,bottom:i*e,left:i*e}:typeof i=="string"?{top:i,right:i,bottom:i,left:i}:{top:typeof i.top=="number"?i.top*e:i.top,right:typeof i.right=="number"?i.right*e:i.right,bottom:typeof i.bottom=="number"?i.bottom*e:i.bottom,left:typeof i.left=="number"?i.left*e:i.left}}function xC(i,e){return typeof i=="number"?{top:i*e,right:i*e,bottom:i*e,left:i*e}:typeof i=="string"?{top:i,right:i,bottom:i,left:i}:{top:(typeof i.top=="number"?i.top*e:i.top)??0,right:(typeof i.right=="number"?i.right*e:i.right)??0,bottom:(typeof i.bottom=="number"?i.bottom*e:i.bottom)??0,left:(typeof i.left=="number"?i.left*e:i.left)??0}}function wC(i,e){return typeof i=="number"?{top:i*e,right:i*e,bottom:i*e,left:i*e}:typeof i=="string"?{top:i,right:i,bottom:i,left:i}:{top:(typeof i.top=="number"?i.top*e:i.top)??0,right:(typeof i.right=="number"?i.right*e:i.right)??0,bottom:(typeof i.bottom=="number"?i.bottom*e:i.bottom)??0,left:(typeof i.left=="number"?i.left*e:i.left)??0}}const _C=Ti(()=>Bh.loadYoga());function Yd(i,e,{layout:t,scale:r=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:I,direction:C="column",align:B="start",alignSelf:y,justify:x="start"}=t??{},Q={static:i.POSITION_TYPE_STATIC,relative:i.POSITION_TYPE_RELATIVE,absolute:i.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(Q[n]),typeof s<"u"){const{top:D,right:$,bottom:J,left:ee}=SC(s,r);typeof D<"u"&&e.setPosition(i.EDGE_TOP,D),typeof $<"u"&&e.setPosition(i.EDGE_RIGHT,$),typeof J<"u"&&e.setPosition(i.EDGE_BOTTOM,J),typeof ee<"u"&&e.setPosition(i.EDGE_LEFT,ee)}const R={row:i.FLEX_DIRECTION_ROW,column:i.FLEX_DIRECTION_COLUMN,"row-reverse":i.FLEX_DIRECTION_ROW_REVERSE,"column-reverse":i.FLEX_DIRECTION_COLUMN_REVERSE};e.setFlexDirection(R[C]);const F={start:i.ALIGN_FLEX_START,end:i.ALIGN_FLEX_END,center:i.ALIGN_CENTER,stretch:i.ALIGN_STRETCH};e.setAlignItems(F[B]),y&&e.setAlignSelf(F[y]);const P={start:i.JUSTIFY_FLEX_START,end:i.JUSTIFY_FLEX_END,center:i.JUSTIFY_CENTER,"space-between":i.JUSTIFY_SPACE_BETWEEN,"space-around":i.JUSTIFY_SPACE_AROUND,"space-evenly":i.JUSTIFY_SPACE_EVENLY};if(e.setJustifyContent(P[x]),typeof p<"u"){const{top:D,right:$,bottom:J,left:ee}=xC(p,r);e.setMargin(i.EDGE_TOP,D),e.setMargin(i.EDGE_RIGHT,$),e.setMargin(i.EDGE_BOTTOM,J),e.setMargin(i.EDGE_LEFT,ee)}if(typeof I<"u"){const{top:D,right:$,bottom:J,left:ee}=wC(I,r);e.setPadding(i.EDGE_TOP,D),e.setPadding(i.EDGE_RIGHT,$),e.setPadding(i.EDGE_BOTTOM,J),e.setPadding(i.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(i.GUTTER_ALL,(g??0)*r),typeof o<"u"&&e.setWidth(typeof o=="number"?o*r:o),typeof a<"u"&&e.setHeight(typeof a=="number"?a*r:a),typeof l<"u"&&e.setMinWidth(typeof l=="number"?l*r:l),typeof c<"u"&&e.setMinHeight(typeof c=="number"?c*r:c),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*r:u),typeof A<"u"&&e.setMaxHeight(typeof A=="number"?A*r:A)}async function Vd({id:i,yoga:e,index:t,parent:r,element:n,resolvers:s}){var o,a,l;const{layout:c={},config:u={},options:A={},renderer:h}=n,d=e.Node.create();Yd(e,d,{layout:c}),r.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:i,config:u,options:A}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:i,config:u,options:A}))??null);const g=[];for await(const[p,I]of((l=n.children)==null?void 0:l.entries())??[])g.push(await Vd({id:i,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:bC(c.radius),element:n,renderer:h,config:u,options:A,dependencies:f,childNodes:g}}function Kd(i,e,t=0,r=0){const{top:n,left:s}=i.getComputedLayout(),{top:o,left:a,width:l,height:c}=e.node.getComputedLayout(),u=t+a,A=r+o,h=e.childNodes.map(d=>Kd(i,d,u,A));return{...e,x:s+u,y:n+A,width:l,height:c,childNodes:h}}async function Ac({yoga:i,root:e,tree:t,measureCanvas:r}){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&&r){e.calculateLayout();const A=await c({node:n,options:s,dependencies:o,measureCanvas:r});A&&n.setWidth(A)}if(u&&r){e.calculateLayout();const A=await u({node:n,options:s,dependencies:o,measureCanvas:r});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 I,C;g<p?(I=g/p,C=1):(I=1,C=p/g),s.crop={x:(1-I)/2,y:(1-C)/2,width:I,height:C}}}}}if(await Ac({yoga:i,root:e,tree:l,measureCanvas:r}),s!=null&&s.shape){const A=n.getComputedWidth(),h=n.getComputedHeight(),d=TC(s.shape,A/h);n.setPadding(i.EDGE_TOP,d.top*h),n.setPadding(i.EDGE_RIGHT,d.right*A),n.setPadding(i.EDGE_BOTTOM,d.bottom*h),n.setPadding(i.EDGE_LEFT,d.left*A)}}e.calculateLayout(),await Ac({yoga:i,root:e,tree:l,measureCanvas:r})}}async function Wd({id:i,root:e,resolvers:t,measureCanvas:r}){const n=await _C(),s=n.Node.create();Yd(n,s,{layout:e.layout});const o=await Vd({id:i,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await Ac({yoga:n,root:s,tree:[o],measureCanvas:r});const{top:a,left:l,width:c,height:u}=s.getComputedLayout(),A={root:{x:l,y:a,width:c,height:u},node:Kd(s,o)};return s.freeRecursive(),A}function Jd(){var i=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"},r={},n={};r.L=1,n[1]="L",Object.keys(t).forEach(function(ue,Le){r[ue]=1<<Le+1,n[r[ue]]=ue}),Object.freeze(r);var s=r.LRI|r.RLI|r.FSI,o=r.L|r.R|r.AL,a=r.B|r.S|r.WS|r.ON|r.FSI|r.LRI|r.RLI|r.PDI,l=r.BN|r.RLE|r.LRE|r.RLO|r.LRO|r.PDF,c=r.S|r.WS|r.B|s|r.PDI|l,u=null;function A(){if(!u){u=new Map;var ue=function(be){if(t.hasOwnProperty(be)){var le=0;t[be].split(",").forEach(function(ge){var ve=ge.split("+"),Te=ve[0],Ce=ve[1];Te=parseInt(Te,36),Ce=Ce?parseInt(Ce,36):0,u.set(le+=Te,r[be]);for(var Ue=0;Ue<Ce;Ue++)u.set(++le,r[be])})}};for(var Le in t)ue(Le)}}function h(ue){return A(),u.get(ue.codePointAt(0))||r.L}function d(ue){return n[h(ue)]}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(ue,Le){var be=36,le=0,ge=new Map,ve=Le&&new Map,Te;return ue.split(",").forEach(function Ce(Ue){if(Ue.indexOf("+")!==-1)for(var T=+Ue;T--;)Ce(Te);else{Te=Ue;var m=Ue.split(">"),E=m[0],w=m[1];E=String.fromCodePoint(le+=parseInt(E,be)),w=String.fromCodePoint(le+=parseInt(w,be)),ge.set(E,w),Le&&ve.set(w,E)}}),{map:ge,reverseMap:ve}}var p,I,C;function B(){if(!p){var ue=g(f.pairs,!0),Le=ue.map,be=ue.reverseMap;p=Le,I=be,C=g(f.canonical,!1).map}}function y(ue){return B(),p.get(ue)||null}function x(ue){return B(),I.get(ue)||null}function Q(ue){return B(),C.get(ue)||null}var R=r.L,F=r.R,P=r.EN,D=r.ES,$=r.ET,J=r.AN,ee=r.CS,Z=r.B,k=r.S,O=r.ON,V=r.BN,L=r.NSM,_=r.AL,M=r.LRO,W=r.RLO,Y=r.LRE,ie=r.RLE,ae=r.PDF,fe=r.LRI,Ee=r.RLI,Pe=r.FSI,we=r.PDI;function Ne(ue,Le){for(var be=125,le=new Uint32Array(ue.length),ge=0;ge<ue.length;ge++)le[ge]=h(ue[ge]);var ve=new Map;function Te(Wt,Bi){var Jt=le[Wt];le[Wt]=Bi,ve.set(Jt,ve.get(Jt)-1),Jt&a&&ve.set(a,ve.get(a)-1),ve.set(Bi,(ve.get(Bi)||0)+1),Bi&a&&ve.set(a,(ve.get(a)||0)+1)}for(var Ce=new Uint8Array(ue.length),Ue=new Map,T=[],m=null,E=0;E<ue.length;E++)m||T.push(m={start:E,end:ue.length-1,level:Le==="rtl"?1:Le==="ltr"?0:q0(E,!1)}),le[E]&Z&&(m.end=E,m=null);for(var w=ie|Y|W|M|s|we|ae|Z,U=function(Wt){return Wt+(Wt&1?1:2)},j=function(Wt){return Wt+(Wt&1?2:1)},X=0;X<T.length;X++){m=T[X];var G=[{_level:m.level,_override:0,_isolate:0}],se=void 0,he=0,Be=0,ye=0;ve.clear();for(var $e=m.start;$e<=m.end;$e++){var ze=le[$e];if(se=G[G.length-1],ve.set(ze,(ve.get(ze)||0)+1),ze&a&&ve.set(a,(ve.get(a)||0)+1),ze&w)if(ze&(ie|Y)){Ce[$e]=se._level;var Bt=(ze===ie?j:U)(se._level);Bt<=be&&!he&&!Be?G.push({_level:Bt,_override:0,_isolate:0}):he||Be++}else if(ze&(W|M)){Ce[$e]=se._level;var Xi=(ze===W?j:U)(se._level);Xi<=be&&!he&&!Be?G.push({_level:Xi,_override:ze&W?F:R,_isolate:0}):he||Be++}else if(ze&s){ze&Pe&&(ze=q0($e+1,!0)===1?Ee:fe),Ce[$e]=se._level,se._override&&Te($e,se._override);var Tt=(ze===Ee?j:U)(se._level);Tt<=be&&he===0&&Be===0?(ye++,G.push({_level:Tt,_override:0,_isolate:1,_isolInitIndex:$e})):he++}else if(ze&we){if(he>0)he--;else if(ye>0){for(Be=0;!G[G.length-1]._isolate;)G.pop();var Ii=G[G.length-1]._isolInitIndex;Ii!=null&&(Ue.set(Ii,$e),Ue.set($e,Ii)),G.pop(),ye--}se=G[G.length-1],Ce[$e]=se._level,se._override&&Te($e,se._override)}else ze&ae?(he===0&&(Be>0?Be--:!se._isolate&&G.length>1&&(G.pop(),se=G[G.length-1])),Ce[$e]=se._level):ze&Z&&(Ce[$e]=m.level);else Ce[$e]=se._level,se._override&&ze!==V&&Te($e,se._override)}for(var Zt=[],bt=null,ei=m.start;ei<=m.end;ei++){var Zi=le[ei];if(!(Zi&l)){var er=Ce[ei],Wa=Zi&s,vi=Zi===we;bt&&er===bt._level?(bt._end=ei,bt._endsWithIsolInit=Wa):Zt.push(bt={_start:ei,_end:ei,_level:er,_startsWithPDI:vi,_endsWithIsolInit:Wa})}}for(var js=[],kn=0;kn<Zt.length;kn++){var Pt=Zt[kn];if(!Pt._startsWithPDI||Pt._startsWithPDI&&!Ue.has(Pt._start)){for(var Mn=[bt=Pt],tn=void 0;bt&&bt._endsWithIsolInit&&(tn=Ue.get(bt._end))!=null;)for(var Sr=kn+1;Sr<Zt.length;Sr++)if(Zt[Sr]._start===tn){Mn.push(bt=Zt[Sr]);break}for(var Gi=[],rn=0;rn<Mn.length;rn++)for(var Fn=Mn[rn],qs=Fn._start;qs<=Fn._end;qs++)Gi.push(qs);for(var ZA=Ce[Gi[0]],Ja=m.level,Pn=Gi[0]-1;Pn>=0;Pn--)if(!(le[Pn]&l)){Ja=Ce[Pn];break}var zs=Gi[Gi.length-1],eu=Ce[zs],ja=m.level;if(!(le[zs]&s)){for(var Nn=zs+1;Nn<=m.end;Nn++)if(!(le[Nn]&l)){ja=Ce[Nn];break}}js.push({_seqIndices:Gi,_sosType:Math.max(Ja,ZA)%2?F:R,_eosType:Math.max(ja,eu)%2?F:R})}}for(var Xs=0;Xs<js.length;Xs++){var On=js[Xs],_e=On._seqIndices,nn=On._sosType,tu=On._eosType,tr=Ce[_e[0]]&1?F:R;if(ve.get(L))for(var Un=0;Un<_e.length;Un++){var Zs=_e[Un];if(le[Zs]&L){for(var xr=nn,Gn=Un-1;Gn>=0;Gn--)if(!(le[_e[Gn]]&l)){xr=le[_e[Gn]];break}Te(Zs,xr&(s|we)?O:xr)}}if(ve.get(P))for(var Hn=0;Hn<_e.length;Hn++){var eo=_e[Hn];if(le[eo]&P)for(var wr=Hn-1;wr>=-1;wr--){var di=wr===-1?nn:le[_e[wr]];if(di&o){di===_&&Te(eo,J);break}}}if(ve.get(_))for(var _r=0;_r<_e.length;_r++){var to=_e[_r];le[to]&_&&Te(to,F)}if(ve.get(D)||ve.get(ee))for(var b=1;b<_e.length-1;b++){var S=_e[b];if(le[S]&(D|ee)){for(var N=0,H=0,z=b-1;z>=0&&(N=le[_e[z]],!!(N&l));z--);for(var te=b+1;te<_e.length&&(H=le[_e[te]],!!(H&l));te++);N===H&&(le[S]===D?N===P:N&(P|J))&&Te(S,N)}}if(ve.get(P))for(var oe=0;oe<_e.length;oe++){var ce=_e[oe];if(le[ce]&P){for(var de=oe-1;de>=0&&le[_e[de]]&($|l);de--)Te(_e[de],P);for(oe++;oe<_e.length&&le[_e[oe]]&($|l|P);oe++)le[_e[oe]]!==P&&Te(_e[oe],P)}}if(ve.get($)||ve.get(D)||ve.get(ee))for(var Ae=0;Ae<_e.length;Ae++){var Ie=_e[Ae];if(le[Ie]&($|D|ee)){Te(Ie,O);for(var Re=Ae-1;Re>=0&&le[_e[Re]]&l;Re--)Te(_e[Re],O);for(var Je=Ae+1;Je<_e.length&&le[_e[Je]]&l;Je++)Te(_e[Je],O)}}if(ve.get(P))for(var lt=0,Ze=nn;lt<_e.length;lt++){var Nt=_e[lt],Ut=le[Nt];Ut&P?Ze===R&&Te(Nt,R):Ut&o&&(Ze=Ut)}if(ve.get(a)){var yi=F|P|J,fi=yi|R,sn=[];{for(var ir=[],$n=0;$n<_e.length;$n++)if(le[_e[$n]]&a){var io=ue[_e[$n]],G0=void 0;if(y(io)!==null)if(ir.length<63)ir.push({char:io,seqIndex:$n});else break;else if((G0=x(io))!==null)for(var ro=ir.length-1;ro>=0;ro--){var iu=ir[ro].char;if(iu===G0||iu===x(Q(io))||y(Q(iu))===io){sn.push([ir[ro].seqIndex,$n]),ir.length=ro;break}}}sn.sort(function(Wt,Bi){return Wt[0]-Bi[0]})}for(var ru=0;ru<sn.length;ru++){for(var H0=sn[ru],qa=H0[0],nu=H0[1],$0=!1,Ci=0,su=qa+1;su<nu;su++){var Y0=_e[su];if(le[Y0]&fi){$0=!0;var V0=le[Y0]&yi?F:R;if(V0===tr){Ci=V0;break}}}if($0&&!Ci){Ci=nn;for(var ou=qa-1;ou>=0;ou--){var K0=_e[ou];if(le[K0]&fi){var W0=le[K0]&yi?F:R;W0!==tr?Ci=W0:Ci=tr;break}}}if(Ci){if(le[_e[qa]]=le[_e[nu]]=Ci,Ci!==tr){for(var no=qa+1;no<_e.length;no++)if(!(le[_e[no]]&l)){h(ue[_e[no]])&L&&(le[_e[no]]=Ci);break}}if(Ci!==tr){for(var so=nu+1;so<_e.length;so++)if(!(le[_e[so]]&l)){h(ue[_e[so]])&L&&(le[_e[so]]=Ci);break}}}}for(var Qr=0;Qr<_e.length;Qr++)if(le[_e[Qr]]&a){for(var J0=Qr,au=Qr,lu=nn,oo=Qr-1;oo>=0;oo--)if(le[_e[oo]]&l)J0=oo;else{lu=le[_e[oo]]&yi?F:R;break}for(var j0=tu,ao=Qr+1;ao<_e.length;ao++)if(le[_e[ao]]&(a|l))au=ao;else{j0=le[_e[ao]]&yi?F:R;break}for(var cu=J0;cu<=au;cu++)le[_e[cu]]=lu===j0?lu:tr;Qr=au}}}for(var ti=m.start;ti<=m.end;ti++){var uQ=Ce[ti],za=le[ti];if(uQ&1?za&(R|P|J)&&Ce[ti]++:za&F?Ce[ti]++:za&(J|P)&&(Ce[ti]+=2),za&l&&(Ce[ti]=ti===0?m.level:Ce[ti-1]),ti===m.end||h(ue[ti])&(k|Z))for(var Xa=ti;Xa>=0&&h(ue[Xa])&c;Xa--)Ce[Xa]=m.level}}return{levels:Ce,paragraphs:T};function q0(Wt,Bi){for(var Jt=Wt;Jt<ue.length;Jt++){var Rr=le[Jt];if(Rr&(F|_))return 1;if(Rr&(Z|R)||Bi&&Rr===we)return 0;if(Rr&s){var z0=hQ(Jt);Jt=z0===-1?ue.length:z0}}return 0}function hQ(Wt){for(var Bi=1,Jt=Wt+1;Jt<ue.length;Jt++){var Rr=le[Jt];if(Rr&Z)break;if(Rr&we){if(--Bi===0)return Jt}else Rr&s&&Bi++}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",Me;function We(){if(!Me){var ue=g(pe,!0),Le=ue.map,be=ue.reverseMap;be.forEach(function(le,ge){Le.set(ge,le)}),Me=Le}}function Oe(ue){return We(),Me.get(ue)||null}function Xe(ue,Le,be,le){var ge=ue.length;be=Math.max(0,be==null?0:+be),le=Math.min(ge-1,le==null?ge-1:+le);for(var ve=new Map,Te=be;Te<=le;Te++)if(Le[Te]&1){var Ce=Oe(ue[Te]);Ce!==null&&ve.set(Te,Ce)}return ve}function De(ue,Le,be,le){var ge=ue.length;be=Math.max(0,be==null?0:+be),le=Math.min(ge-1,le==null?ge-1:+le);var ve=[];return Le.paragraphs.forEach(function(Te){var Ce=Math.max(be,Te.start),Ue=Math.min(le,Te.end);if(Ce<Ue){for(var T=Le.levels.slice(Ce,Ue+1),m=Ue;m>=Ce&&h(ue[m])&c;m--)T[m]=Te.level;for(var E=Te.level,w=1/0,U=0;U<T.length;U++){var j=T[U];j>E&&(E=j),j<w&&(w=j|1)}for(var X=E;X>=w;X--)for(var G=0;G<T.length;G++)if(T[G]>=X){for(var se=G;G+1<T.length&&T[G+1]>=X;)G++;G>se&&ve.push([se+Ce,G+Ce])}}}),ve}function Qe(ue,Le,be,le){var ge=He(ue,Le,be,le),ve=[].concat(ue);return ge.forEach(function(Te,Ce){ve[Ce]=(Le.levels[Te]&1?Oe(ue[Te]):null)||ue[Te]}),ve.join("")}function He(ue,Le,be,le){for(var ge=De(ue,Le,be,le),ve=[],Te=0;Te<ue.length;Te++)ve[Te]=Te;return ge.forEach(function(Ce){for(var Ue=Ce[0],T=Ce[1],m=ve.slice(Ue,T+1),E=m.length;E--;)ve[T-E]=m[E]}),ve}return e.closingToOpeningBracket=x,e.getBidiCharType=h,e.getBidiCharTypeName=d,e.getCanonicalBracket=Q,e.getEmbeddingLevels=Ne,e.getMirroredCharacter=Oe,e.getMirroredCharactersMap=Xe,e.getReorderSegments=De,e.getReorderedIndices=He,e.getReorderedString=Qe,e.openingToClosingBracket=y,Object.defineProperty(e,"__esModule",{value:!0}),e}({});return i}const jd=Object.freeze(Object.defineProperty({__proto__:null,default:Jd},Symbol.toStringTag,{value:"Module"})),QC=typeof jd=="function"?jd:Jd;function RC(i,e){return i==="start"?e==="rtl"?"right":"left":i==="end"?e==="rtl"?"left":"right":i??"left"}const qd=QC();function DC(i){var e;if(!i)return"ltr";try{const{paragraphs:t}=qd.getEmbeddingLevels(i);return(((e=t[0])==null?void 0:e.level)??0)%2===1?"rtl":"ltr"}catch{return"ltr"}}function LC(i){return{order:i.map((e,t)=>t),directions:i.map(()=>"ltr"),baseDirection:"ltr"}}function kC(i,e){var t;if(!i.length)return{order:[],directions:[],baseDirection:e??"ltr"};try{const r=i.map(({text:d})=>d).join(" "),{levels:n,paragraphs:s}=qd.getEmbeddingLevels(r,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 i)l.push(n[c]??o),c+=d.text.length+1;const u=i.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 I=u.slice(f,g).reverse();u.splice(f,I.length,...I),f=-1}}}const h=l.map(d=>d%2===1?"rtl":"ltr");return{order:u,directions:h,baseDirection:a}}catch{return LC(i)}}const MC=500;function FC(){const i=new Map,e={has:t=>i.has(t),get:t=>i.get(t),set:(t,r)=>{if(i.size>=MC&&!i.has(t)){const n=i.keys().next();n.done||i.delete(n.value)}i.set(t,r)},delete:t=>i.delete(t),clear:()=>i.clear()};return typeof document<"u"&&"fonts"in document&&document.fonts.addEventListener("loadingdone",()=>e.clear()),e}let uc;function PC(){return uc===void 0&&(uc=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"word"}):null),uc}const zd=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function NC(i){return i.split(`
2476
- `).map(e=>{if(!e)return[];const t=[];for(const r of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(r))t.push({text:r,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(zd.test(r))for(const n of Xd(r))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:r,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function Xd(i){const e=[];let t=!1,r="";const n=PC();if(!n)return[{text:i,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(i)){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:r+=s}return r&&e.length>0?e[0].text=r+e[0].text:r&&e.push({text:r,spaceBefore:t}),e}function OC(i){const e=[];for(const t of i){const n=zd.test(t.text)||/\s/.test(t.text)?Xd(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 UC=/(?<value>\d+\.?\d*)(?=px)/,hc=1;function GC(i,e){const t=typeof i=="string"?NC(i):[OC(i)];return e?t.map(r=>r.map(n=>({...n,text:n.text.toUpperCase()}))):t}function HC({context:i,groups:e,appendedFont:t,fontSizes:r,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:l}){const c=[],u=h=>{const d=r[h%r.length];return{fontSize:d,font:t.replace(UC,d.toString())}},A=(h,d)=>(i.font=h,i.letterSpacing=`${a}px`,i.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},I="",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},I="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const F=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=F?A(p.font,F).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:F}};let Q=x();const R=l?A(p.font,I+Q.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&R>n+hc&&p.items.length>0&&(B(),Q=x()),s&&l&&p.items.length===0&&Q.width>n+hc){let F=y.text;for(;F.length>0;){let P="";for(const $ of F){const J=A(p.font,P+$).width+o;if(P&&J>n+hc)break;P+=$}F=F.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:""}),I=P,p.lineWidth=D.width+o*p.items.length,F.length>0&&B()}C="";continue}p.items.push(Q),I+=Q.gapText+y.text,p.lineWidth=l?A(p.font,I).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,C=""}l&&C&&(p.items.length>0||c.length===d)&&(I+=C,p.lineWidth=A(p.font,I).width+o*p.items.length),(p.items.length>0||c.length===d)&&B()}return c}const Zd=[{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 ef({text:i,font:e}){let t=e;return Zd.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}function tf(i){return Math.max(i??1,.5)}function $C({measured:i,index:e,lineTop:t,dx:r,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:l}){const{items:c,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=i;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=tf(a),I=A*p+l,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+l/2,{order:x,directions:Q,baseDirection:R}=kC(c.map(({token:Z})=>({text:Z.text})),o),F=c.map(({gapBefore:Z})=>Z);let P=r+g+l/2;const D=[];x.forEach((Z,k)=>{const O=c[Z];P+=F[k],D.push({...O.token,x:P,baselineY:y,width:O.width,lineIndex:e,direction:Q[Z],font:u,metrics:O.metrics}),P+=O.width});const $=[],J=[];D.forEach((Z,k)=>{const O=$[$.length-1];if(O&&O.direction===Z.direction){const V=Math.max(O.x+O.width,Z.x+Z.width);O.tokens.push(Z),O.x=Math.min(O.x,Z.x),O.width=V-O.x,J[J.length-1].push(x[k])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),J.push([x[k]])}),$.forEach((Z,k)=>{const O=[...J[k]].sort((V,L)=>V-L);Z.text=O.map((V,L)=>L===0?c[V].token.text:`${c[V].gapText}${c[V].token.text}`).join("")});const ee=o??R;return{index:e,box:{x:r+g,y:t,width:h,height:I},baselineY:y,direction:ee,runs:$,tokens:D}}function YC(i){const{context:e,text:t,font:r,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}=i,I=GC(t,p),C=I.flat().map(({text:Q})=>Q).join(" "),B=ef({font:r,text:C}),y=u??DC(C),x=RC(c,y);try{e.save();const Q=HC({context:e,groups:I,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),R=[];let F=o;for(let ee=0;ee<Q.length;ee++){const Z=$C({measured:Q[ee],index:ee,lineTop:F,dx:s,dw:l,align:x,direction:u,lineHeight:A,strokeWidth:f});R.push(Z),F+=Z.box.height+h}const P=Q[Q.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*tf(A))/2):0,$=R.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,R.length-1)+D,J=R.length?{x:Math.min(...R.map(({box:ee})=>ee.x)),y:Math.min(...R.map(({box:ee})=>ee.y)),width:Math.max(...R.map(({box:ee})=>ee.x+ee.width))-Math.min(...R.map(({box:ee})=>ee.x)),height:Math.max(...R.map(({box:ee})=>ee.y+ee.height))-Math.min(...R.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:R,totalHeight:$,blockBox:J,direction:y,font:B}}finally{e.restore()}}Zu(YC,{cache:FC(),cacheKey:([i])=>JSON.stringify([i.text,i.font,i.fontSizes,i.dx,i.dy,i.dw,i.maxW,i.align,i.direction,i.lineHeight,i.lineGap,i.letterSpacing,i.strokeWidth,i.wrap,i.uppercase])});function VC(i){return i.slice(0,1).toUpperCase()+i.slice(1)}Object.keys(xd).map(i=>({label:VC(i),value:i,data:i}));function rf(){return document.createElement("canvas")}function ri(i){let e=0;for(const t of i)Array.isArray(t)?e+=ri(t):e+=t;return e}function Xo(i){return i.map(({type:e,duration:t},r)=>{var n,s,o,a;if(e==="transition"){const l=((n=i[r-2])==null?void 0:n.type)==="transition"?i[r-2]:null,c=((s=i[r-1])==null?void 0:s.duration)??1/0,u=((o=i[r+1])==null?void 0:o.duration)??1/0,A=((a=i[r+2])==null?void 0:a.type)==="transition"?i[r+2]:null;return Math.min(l?c/2:c,t,A?u/2:u)*-1}return t})}function KC(i){if(i===null||typeof i!="object")return!1;if(Object.getPrototypeOf(i)===null)return!0;let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function WC(i){return i.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}AI.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${WC(i)}"`:KC(i)||Array.isArray(i)?JSON.stringify(i):i);function JC(i){return i.some(({type:e})=>e==="text")}function jC(i){return i.some(({type:e})=>e==="caption")}function qC(i){return i.some(({type:e})=>e==="audio")}function zC(i){return i.some(({type:e})=>e==="video"||e==="image")}function dc(i){return i.type==="audio"}const XC="3";async function ZC({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await Wd({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function eB({track:i}){const e=Xo(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const l=ri(e.slice(0,a));return s.push(ZC({scene:o,start:l})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const l=ri(e.slice(0,a));return s.push({type:o.type,id:o.id,start:l,config:o,duration:o.duration}),s},[]),n=i.map(({id:s})=>t.find(({id:o})=>o===s)??r.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:r,mergedScenes:n,config:i,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function nf({node:i,canvases:e,sceneTime:t,sceneDuration:r,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=i.element.layout)!=null&&l.transform)?{...i.element.layout,transform:{...i.element.layout.transform,rotation:a.rotation}}:i.element.layout,g=Ud({layout:f,sceneTime:t,animations:i.element.animations,elementDuration:r,elementDimensions:{width:i.width,height:i.height}}),{opacity:p,translation:I,scale:C,clip:B,dimensions:y,rotation:x}=g,Q=i.width*y.widthRatio,R=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||x!==0)&&(d.translate(i.x+Q/2,i.y+R/2),d.scale(C,C),d.rotate(x*Math.PI/180),d.translate(-(i.x+Q/2),-(i.y+R/2))),B){d.beginPath();const D={x:i.x+B.x*Q,y:i.y+B.y*R,width:B.width*Q,height:B.height*R};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(i.x,i.y,Q,R),d.globalAlpha=D}const F=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...i.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((c=i.options)!=null&&c.font)?{font:{...i.options.font,size:a.fontSize}}:{}}:i.options,P=(a==null?void 0:a.fontSize)!=null&&((u=i.dependencies)!=null&&u.font)?{...i.dependencies,font:{...i.dependencies.font,size:a.fontSize}}:i.dependencies;await((h=(A=i.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:i.x,dy:i.y,dw:Q,dh:R,radius:i.radius,options:F,dependencies:P}));for await(const D of i.childNodes)await nf({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function tB({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await nf({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function Zo({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=rf}){var a,l;const{id:c,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),x=await Wd({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:r,measureCanvas:y}),Q=async(R,F)=>{const P=Math.max(0,R-t);p.width=p.height=0,p.width=n,p.height=s,await tB({debug:i,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:c,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function iB({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Xo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="caption"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(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=ri(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 I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.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 rB({groups:i,tracks:e}){const t=i.map(s=>new Set(s.sceneIds)),r=i.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];dc(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let l,c=1/0;for(let u=0;u<i.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=i[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(r.map(s=>[s.id,s]));for(const s of r){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return r}function nB({group:i,currentTime:e,activeMembers:t,fallbackDimensions:r}){if(!i.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=i.bounds,c=(l==null?void 0:l.width)??r.width,u=(l==null?void 0:l.height)??r.height;return Ud({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:c,height:u}})}function sf({group:i,animationState:e,targetCtx:t,fallbackDimensions:r}){const n=i.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??r.width,l=(n==null?void 0:n.height)??r.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 sB({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Xo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="video"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(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=ri(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 I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.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 oB({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Xo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="text"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(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=ri(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 I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.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 aB=(((Sd=bd)==null?void 0:Sd.default)??bd).reduce((i,e)=>(i[e.name]=e,i),{});function lB(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function cB({name:i,to:e,from:t,progress:r,width:n,height:s,glContext:o,contextResources:a,returnPixels:l=!0}){var c,u,A;const h=lB(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=Yo)==null?void 0:c.default)??Yo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=Yo)==null?void 0:u.default)??Yo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((A=Td)==null?void 0:A.default)??Td)(o,aB[i])),h.transitions[i].draw(r,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 AB(i){for(const[e,t]of i.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(r=>{r.dispose()}),i.delete(e)}function uB({name:i,to:e,from:t,progress:r,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),cB({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function of({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=rf,drawTransition:o=uB}){var a;const l=new Map,c=await Promise.all(e.tracks.map(async I=>{if(zC(I))return{...await sB({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(JC(I))return{...await oB({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(jC(I))return{...await iB({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(qC(I))return{...await eB({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?rB({groups:e.groups,tracks:c}):[],A=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)A.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=A.get(I.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:I,currentTime:C,overrides:B,signal:y})=>{const x=I.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,I.width,I.height),x.save(),x.fillStyle="black",x.fillRect(0,0,I.width,I.height),x.restore();const Q=new Map;for(const D of c)if(!dc(D))for(const $ of D.scenes){if(C<$.start||C>=$.start+$.duration)continue;const J=$.layout,ee=J==null?void 0:J.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)??I.width,height:(ee==null?void 0:ee.height)??I.height};let k=A.get($.id);for(;k;)k.animations&&(Q.has(k.id)||Q.set(k.id,[]),Q.get(k.id).push(Z)),k=k.parentGroupId?d.get(k.parentGroupId):void 0}const R=new Map;function F(D){if(R.has(D.id))return R.get(D.id);const $=nB({group:D,currentTime:C,activeMembers:Q.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return R.set(D.id,$),$}function P(D,$,J){const ee=f({id:J});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const k=ee[Z],O=F(k);O&&sf({group:k,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.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(dc($))continue;const{scenes:J,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=I.width,Z.height=I.height;const k=Z.getContext("2d");if(!k)continue;const O=J.filter(({start:_,duration:M})=>C>=_&&C<_+M);if(O.length===0)continue;const V=ee.find(({start:_,duration:M})=>C>=_&&C<_+M),L=!!(V&&V.to&&V.from&&V.duration>0);for await(const _ of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:W,id:Y}=_;if(await(W==null?void 0:W(C,B==null?void 0:B.get(Y))),y!=null&&y.aborted)return;L&&(V.to.id===Y||V.from.id===Y)||P(k,M,Y)}if(L){const{name:_,to:M,from:W,duration:Y,transitionCanvas:ie}=V;ie.width=ie.height=0,ie.width=Z.width,ie.height=Z.height;const ae=Math.min(1,Math.max(0,(C-M.start)/Y));if(await o({name:_,progress:ae,contextResources:l,to:M.sceneCanvas,from:W.sceneCanvas,canvas:ie}),y!=null&&y.aborted)return;const fe=new Set(f({id:W.id})),Ee=new Set(f({id:M.id})),we=[...fe].filter(Ne=>Ee.has(Ne)).sort((Ne,pe)=>Ne.depth-pe.depth);if(we.length===0)k.drawImage(ie,0,0,ie.width,ie.height);else{k.save();for(const Ne of we){const pe=F(Ne);pe&&sf({group:Ne,animationState:pe,targetCtx:k,fallbackDimensions:{width:I.width,height:I.height}})}k.drawImage(ie,0,0,ie.width,ie.height),k.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{AB(l)},tracks:c,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...c.map(({duration:I})=>I))}}const hB={version:"8.3.2"};function dB(i){const{publicApiUrl:e}=Co(i),t=cr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function fB(i){var s,o,a,l,c,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:cr()};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"),r=(u=(c=window.sessionStorage)==null?void 0:c.getItem)==null?void 0:u.call(c,"vouch-uid-tab");const n=cr();return e||(e=dB(i),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=cr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=cr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",r)),{client:t,tab:r,request:n,visitor:e}}function gB(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function pB(i="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,"/"))??[],r={};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());r[l]=a}}),{source:i,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:hB.version,templateVersion:XC,...r}}const af=1;class mB{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=gB(r,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...r,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Co(this.host.env),{client:r,tab:n,request:s,visitor:o}=fB(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":r,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":pB(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+af&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]}},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:r}})=>{this._answersViewed[r]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[r]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:r,node:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:r,node:n},this._streamLatestTime[r]=n.currentTime,this._streamStartTime[r]||(this._streamStartTime[r]=n.currentTime,this._streamLatestTime[r]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:r}})=>{this._streamLatestTime[r]>this._streamStartTime[r]+af&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]},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,r,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),(r=this.host.mediaPlayer)==null||r.addEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,r,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),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var fc={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof hr<"u"&&hr,r=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 hr<"u"&&hr||{},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(k){return k&&DataView.prototype.isPrototypeOf(k)}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(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function d(k){return typeof k!="string"&&(k=String(k)),k}function f(k){var O={next:function(){var V=k.shift();return{done:V===void 0,value:V}}};return l.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(k){this.map={},k instanceof g?k.forEach(function(O,V){this.append(V,O)},this):Array.isArray(k)?k.forEach(function(O){if(O.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+O.length);this.append(O[0],O[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(O){this.append(O,k[O])},this)}g.prototype.append=function(k,O){k=h(k),O=d(O);var V=this.map[k];this.map[k]=V?V+", "+O:O},g.prototype.delete=function(k){delete this.map[h(k)]},g.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},g.prototype.set=function(k,O){this.map[h(k)]=d(O)},g.prototype.forEach=function(k,O){for(var V in this.map)this.map.hasOwnProperty(V)&&k.call(O,this.map[V],V,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(O,V){k.push(V)}),f(k)},g.prototype.values=function(){var k=[];return this.forEach(function(O){k.push(O)}),f(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(O,V){k.push([V,O])}),f(k)},l.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function I(k){return new Promise(function(O,V){k.onload=function(){O(k.result)},k.onerror=function(){V(k.error)}})}function C(k){var O=new FileReader,V=I(O);return O.readAsArrayBuffer(k),V}function B(k){var O=new FileReader,V=I(O),L=/charset=([A-Za-z0-9_-]+)/.exec(k.type),_=L?L[1]:"utf-8";return O.readAsText(k,_),V}function y(k){for(var O=new Uint8Array(k),V=new Array(O.length),L=0;L<O.length;L++)V[L]=String.fromCharCode(O[L]);return V.join("")}function x(k){if(k.slice)return k.slice(0);var O=new Uint8Array(k.byteLength);return O.set(new Uint8Array(k)),O.buffer}function Q(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:l.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:l.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():l.arrayBuffer&&l.blob&&c(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||A(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="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(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var k=p(this);if(k)return k;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 k=p(this);return k||(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 k=p(this);if(k)return k;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 R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(k){var O=k.toUpperCase();return R.indexOf(O)>-1?O:k}function P(k,O){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var V=O.body;if(k instanceof P){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,O.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!V&&k._bodyInit!=null&&(V=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new g(O.headers)),this.method=F(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal||function(){if("AbortController"in a){var M=new AbortController;return M.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")&&(O.cache==="no-store"||O.cache==="no-cache")){var L=/([?&])_=[^&]*/;if(L.test(this.url))this.url=this.url.replace(L,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(k){var O=new FormData;return k.trim().split("&").forEach(function(V){if(V){var L=V.split("="),_=L.shift().replace(/\+/g," "),M=L.join("=").replace(/\+/g," ");O.append(decodeURIComponent(_),decodeURIComponent(M))}}),O}function $(k){var O=new g,V=k.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(L){return L.indexOf(`
2476
+ `).map(e=>{if(!e)return[];const t=[];for(const r of e.match(/\S+|\s+/g)??[])if(/^\s+$/.test(r))t.push({text:r,logicalIndex:t.length,whitespace:!0,spaceBefore:!1});else if(zd.test(r))for(const n of Xd(r))t.push({text:n.text,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});else t.push({text:r,logicalIndex:t.length,whitespace:!1,spaceBefore:!1});return t})}function Xd(i){const e=[];let t=!1,r="";const n=PC();if(!n)return[{text:i,spaceBefore:!1}];for(const{segment:s,isWordLike:o}of n.segment(i)){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:r+=s}return r&&e.length>0?e[0].text=r+e[0].text:r&&e.push({text:r,spaceBefore:t}),e}function OC(i){const e=[];for(const t of i){const n=zd.test(t.text)||/\s/.test(t.text)?Xd(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 UC=/(?<value>\d+\.?\d*)(?=px)/,hc=1;function GC(i,e){const t=typeof i=="string"?NC(i):[OC(i)];return e?t.map(r=>r.map(n=>({...n,text:n.text.toUpperCase()}))):t}function HC({context:i,groups:e,appendedFont:t,fontSizes:r,maxW:n,wrap:s,strokeWidth:o,letterSpacing:a,wholeLineMeasure:l}){const c=[],u=h=>{const d=r[h%r.length];return{fontSize:d,font:t.replace(UC,d.toString())}},A=(h,d)=>(i.font=h,i.letterSpacing=`${a}px`,i.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},I="",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},I="",C=""};for(const y of h){if(y.whitespace){C+=y.text;continue}const x=()=>{const F=p.items.length>0&&y.spaceBefore&&!C?" ":C,P=F?A(p.font,F).width:0,D=A(p.font,y.text);return{token:y,metrics:D,width:D.width+o,gapBefore:P,gapText:F}};let Q=x();const R=l?A(p.font,I+Q.gapText+y.text).width+o*(p.items.length+1):p.lineWidth+Q.gapBefore+Q.width;if(s&&R>n+hc&&p.items.length>0&&(B(),Q=x()),s&&l&&p.items.length===0&&Q.width>n+hc){let F=y.text;for(;F.length>0;){let P="";for(const $ of F){const J=A(p.font,P+$).width+o;if(P&&J>n+hc)break;P+=$}F=F.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:""}),I=P,p.lineWidth=D.width+o*p.items.length,F.length>0&&B()}C="";continue}p.items.push(Q),I+=Q.gapText+y.text,p.lineWidth=l?A(p.font,I).width+o*p.items.length:p.lineWidth+Q.gapBefore+Q.width,C=""}l&&C&&(p.items.length>0||c.length===d)&&(I+=C,p.lineWidth=A(p.font,I).width+o*p.items.length),(p.items.length>0||c.length===d)&&B()}return c}const Zd=[{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 ef({text:i,font:e}){let t=e;return Zd.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}function tf(i){return Math.max(i??1,.5)}function $C({measured:i,index:e,lineTop:t,dx:r,dw:n,align:s,direction:o,lineHeight:a,strokeWidth:l}){const{items:c,font:u,fontSize:A,lineWidth:h,fontAscent:d,fontDescent:f}=i;let g=0;s==="center"?g=(n-h)/2:s==="right"&&(g=n-h);const p=tf(a),I=A*p+l,C=(p-1)*A/2,B=(A+d-f)/2,y=t+C+B+l/2,{order:x,directions:Q,baseDirection:R}=kC(c.map(({token:Z})=>({text:Z.text})),o),F=c.map(({gapBefore:Z})=>Z);let P=r+g+l/2;const D=[];x.forEach((Z,k)=>{const O=c[Z];P+=F[k],D.push({...O.token,x:P,baselineY:y,width:O.width,lineIndex:e,direction:Q[Z],font:u,metrics:O.metrics}),P+=O.width});const $=[],J=[];D.forEach((Z,k)=>{const O=$[$.length-1];if(O&&O.direction===Z.direction){const V=Math.max(O.x+O.width,Z.x+Z.width);O.tokens.push(Z),O.x=Math.min(O.x,Z.x),O.width=V-O.x,J[J.length-1].push(x[k])}else $.push({text:"",x:Z.x,width:Z.width,direction:Z.direction,tokens:[Z]}),J.push([x[k]])}),$.forEach((Z,k)=>{const O=[...J[k]].sort((V,L)=>V-L);Z.text=O.map((V,L)=>L===0?c[V].token.text:`${c[V].gapText}${c[V].token.text}`).join("")});const ee=o??R;return{index:e,box:{x:r+g,y:t,width:h,height:I},baselineY:y,direction:ee,runs:$,tokens:D}}function YC(i){const{context:e,text:t,font:r,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}=i,I=GC(t,p),C=I.flat().map(({text:Q})=>Q).join(" "),B=ef({font:r,text:C}),y=u??DC(C),x=RC(c,y);try{e.save();const Q=HC({context:e,groups:I,appendedFont:B,fontSizes:n,maxW:a,wrap:g,strokeWidth:f,letterSpacing:d,wholeLineMeasure:typeof t=="string"}),R=[];let F=o;for(let ee=0;ee<Q.length;ee++){const Z=$C({measured:Q[ee],index:ee,lineTop:F,dx:s,dw:l,align:x,direction:u,lineHeight:A,strokeWidth:f});R.push(Z),F+=Z.box.height+h}const P=Q[Q.length-1],D=P?Math.max(0,(P.fontAscent+P.fontDescent-P.fontSize*tf(A))/2):0,$=R.reduce((ee,{box:Z})=>ee+Z.height,0)+h*Math.max(0,R.length-1)+D,J=R.length?{x:Math.min(...R.map(({box:ee})=>ee.x)),y:Math.min(...R.map(({box:ee})=>ee.y)),width:Math.max(...R.map(({box:ee})=>ee.x+ee.width))-Math.min(...R.map(({box:ee})=>ee.x)),height:Math.max(...R.map(({box:ee})=>ee.y+ee.height))-Math.min(...R.map(({box:ee})=>ee.y))}:{x:s,y:o,width:0,height:0};return{lines:R,totalHeight:$,blockBox:J,direction:y,font:B}}finally{e.restore()}}Zu(YC,{cache:FC(),cacheKey:([i])=>JSON.stringify([i.text,i.font,i.fontSizes,i.dx,i.dy,i.dw,i.maxW,i.align,i.direction,i.lineHeight,i.lineGap,i.letterSpacing,i.strokeWidth,i.wrap,i.uppercase])});function VC(i){return i.slice(0,1).toUpperCase()+i.slice(1)}Object.keys(xd).map(i=>({label:VC(i),value:i,data:i}));function rf(){return document.createElement("canvas")}function ri(i){let e=0;for(const t of i)Array.isArray(t)?e+=ri(t):e+=t;return e}function Xo(i){return i.map(({type:e,duration:t},r)=>{var n,s,o,a;if(e==="transition"){const l=((n=i[r-2])==null?void 0:n.type)==="transition"?i[r-2]:null,c=((s=i[r-1])==null?void 0:s.duration)??1/0,u=((o=i[r+1])==null?void 0:o.duration)??1/0,A=((a=i[r+2])==null?void 0:a.type)==="transition"?i[r+2]:null;return Math.min(l?c/2:c,t,A?u/2:u)*-1}return t})}function KC(i){if(i===null||typeof i!="object")return!1;if(Object.getPrototypeOf(i)===null)return!0;let e=i;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e}function WC(i){return i.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/"/g,'\\"')}AI.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${WC(i)}"`:KC(i)||Array.isArray(i)?JSON.stringify(i):i);function JC(i){return i.some(({type:e})=>e==="text")}function jC(i){return i.some(({type:e})=>e==="caption")}function qC(i){return i.some(({type:e})=>e==="audio")}function zC(i){return i.some(({type:e})=>e==="video"||e==="image")}function dc(i){return i.type==="audio"}const XC="3";async function ZC({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await Wd({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function eB({track:i}){const e=Xo(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const l=ri(e.slice(0,a));return s.push(ZC({scene:o,start:l})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const l=ri(e.slice(0,a));return s.push({type:o.type,id:o.id,start:l,config:o,duration:o.duration}),s},[]),n=i.map(({id:s})=>t.find(({id:o})=>o===s)??r.find(({id:o})=>o===s)).filter(Boolean);return{type:"audio",scenes:t,gapScenes:r,mergedScenes:n,config:i,duration:Math.max(...n.map(({start:s,duration:o})=>s+o))}}async function nf({node:i,canvases:e,sceneTime:t,sceneDuration:r,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=i.element.layout)!=null&&l.transform)?{...i.element.layout,transform:{...i.element.layout.transform,rotation:a.rotation}}:i.element.layout,g=Ud({layout:f,sceneTime:t,animations:i.element.animations,elementDuration:r,elementDimensions:{width:i.width,height:i.height}}),{opacity:p,translation:I,scale:C,clip:B,dimensions:y,rotation:x}=g,Q=i.width*y.widthRatio,R=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||x!==0)&&(d.translate(i.x+Q/2,i.y+R/2),d.scale(C,C),d.rotate(x*Math.PI/180),d.translate(-(i.x+Q/2),-(i.y+R/2))),B){d.beginPath();const D={x:i.x+B.x*Q,y:i.y+B.y*R,width:B.width*Q,height:B.height*R};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(i.x,i.y,Q,R),d.globalAlpha=D}const F=(a==null?void 0:a.fontSize)!=null||(a==null?void 0:a.textValue)!=null?{...i.options,...a.textValue!=null?{value:a.textValue}:{},...a.fontSize!=null&&((c=i.options)!=null&&c.font)?{font:{...i.options.font,size:a.fontSize}}:{}}:i.options,P=(a==null?void 0:a.fontSize)!=null&&((u=i.dependencies)!=null&&u.font)?{...i.dependencies,font:{...i.dependencies.font,size:a.fontSize}}:i.dependencies;await((h=(A=i.renderer)==null?void 0:A.render)==null?void 0:h.call(A,{canvases:e,sceneTime:t,dx:i.x,dy:i.y,dw:Q,dh:R,radius:i.radius,options:F,dependencies:P}));for await(const D of i.childNodes)await nf({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function tB({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await nf({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function Zo({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=rf}){var a,l;const{id:c,x:u,y:A,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),x=await Wd({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:r,measureCanvas:y}),Q=async(R,F)=>{const P=Math.max(0,R-t);p.width=p.height=0,p.width=n,p.height=s,await tB({debug:i,layout:x,sceneTime:P,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:c,type:e.type,start:t,duration:g,layout:x,sceneCanvas:p,draw:Q,config:e,childScenes:[]}}async function iB({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Xo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="caption"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(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=ri(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 I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.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 rB({groups:i,tracks:e}){const t=i.map(s=>new Set(s.sceneIds)),r=i.map((s,o)=>{const a=[];for(let u=0;u<e.length;u++){const A=e[u];dc(A)||A.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let l,c=1/0;for(let u=0;u<i.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=i[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(r.map(s=>[s.id,s]));for(const s of r){let o=0,a=s;for(;a!=null&&a.parentGroupId;)o++,a=n.get(a.parentGroupId);s.depth=o}return r}function nB({group:i,currentTime:e,activeMembers:t,fallbackDimensions:r}){if(!i.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=i.bounds,c=(l==null?void 0:l.width)??r.width,u=(l==null?void 0:l.height)??r.height;return Ud({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:c,height:u}})}function sf({group:i,animationState:e,targetCtx:t,fallbackDimensions:r}){const n=i.bounds,s=(n==null?void 0:n.x)??0,o=(n==null?void 0:n.y)??0,a=(n==null?void 0:n.width)??r.width,l=(n==null?void 0:n.height)??r.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 sB({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Xo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="video"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(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=ri(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 I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.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 oB({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=Xo(e),a=await Promise.all(e.reduce((A,h,d)=>{const f=ri(o.slice(0,d));return h.type==="text"&&A.push(Zo({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),A},[])),l=e.reduce((A,h,d)=>{if(h.type!=="gap")return A;const f=ri(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=ri(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 I;return p===((I=e[d+1])==null?void 0:I.id)}),from:a.find(({id:p})=>{var I;return p===((I=e[d-1])==null?void 0:I.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 aB=(((Sd=bd)==null?void 0:Sd.default)??bd).reduce((i,e)=>(i[e.name]=e,i),{});function lB(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function cB({name:i,to:e,from:t,progress:r,width:n,height:s,glContext:o,contextResources:a,returnPixels:l=!0}){var c,u,A;const h=lB(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=Yo)==null?void 0:c.default)??Yo)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=Yo)==null?void 0:u.default)??Yo)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((A=Td)==null?void 0:A.default)??Td)(o,aB[i])),h.transitions[i].draw(r,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 AB(i){for(const[e,t]of i.entries())t.buffer&&e.deleteBuffer(t.buffer),t.fromTexture&&t.fromTexture.dispose(),t.toTexture&&t.toTexture.dispose(),Object.values(t.transitions).forEach(r=>{r.dispose()}),i.delete(e)}function uB({name:i,to:e,from:t,progress:r,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),cB({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function of({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=rf,drawTransition:o=uB}){var a;const l=new Map,c=await Promise.all(e.tracks.map(async I=>{if(zC(I))return{...await sB({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(JC(I))return{...await oB({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(jC(I))return{...await iB({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(qC(I))return{...await eB({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?rB({groups:e.groups,tracks:c}):[],A=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)A.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=A.get(I.id);for(;B;)B.animations&&C.push(B),B=B.parentGroupId?d.get(B.parentGroupId):void 0;return C}return{draw:async({canvas:I,currentTime:C,overrides:B,signal:y})=>{const x=I.getContext("2d");if(!x)return;x.globalAlpha=1,x.globalCompositeOperation="source-over",x.clearRect(0,0,I.width,I.height),x.save(),x.fillStyle="black",x.fillRect(0,0,I.width,I.height),x.restore();const Q=new Map;for(const D of c)if(!dc(D))for(const $ of D.scenes){if(C<$.start||C>=$.start+$.duration)continue;const J=$.layout,ee=J==null?void 0:J.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)??I.width,height:(ee==null?void 0:ee.height)??I.height};let k=A.get($.id);for(;k;)k.animations&&(Q.has(k.id)||Q.set(k.id,[]),Q.get(k.id).push(Z)),k=k.parentGroupId?d.get(k.parentGroupId):void 0}const R=new Map;function F(D){if(R.has(D.id))return R.get(D.id);const $=nB({group:D,currentTime:C,activeMembers:Q.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return R.set(D.id,$),$}function P(D,$,J){const ee=f({id:J});if(ee.length===0){D.drawImage($,0,0,$.width,$.height);return}D.save();for(let Z=ee.length-1;Z>=0;Z--){const k=ee[Z],O=F(k);O&&sf({group:k,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.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(dc($))continue;const{scenes:J,transitions:ee,trackCanvas:Z}=$;Z.width=Z.height=0,Z.width=I.width,Z.height=I.height;const k=Z.getContext("2d");if(!k)continue;const O=J.filter(({start:_,duration:M})=>C>=_&&C<_+M);if(O.length===0)continue;const V=ee.find(({start:_,duration:M})=>C>=_&&C<_+M),L=!!(V&&V.to&&V.from&&V.duration>0);for await(const _ of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:W,id:Y}=_;if(await(W==null?void 0:W(C,B==null?void 0:B.get(Y))),y!=null&&y.aborted)return;L&&(V.to.id===Y||V.from.id===Y)||P(k,M,Y)}if(L){const{name:_,to:M,from:W,duration:Y,transitionCanvas:ie}=V;ie.width=ie.height=0,ie.width=Z.width,ie.height=Z.height;const ae=Math.min(1,Math.max(0,(C-M.start)/Y));if(await o({name:_,progress:ae,contextResources:l,to:M.sceneCanvas,from:W.sceneCanvas,canvas:ie}),y!=null&&y.aborted)return;const fe=new Set(f({id:W.id})),Ee=new Set(f({id:M.id})),we=[...fe].filter(Ne=>Ee.has(Ne)).sort((Ne,pe)=>Ne.depth-pe.depth);if(we.length===0)k.drawImage(ie,0,0,ie.width,ie.height);else{k.save();for(const Ne of we){const pe=F(Ne);pe&&sf({group:Ne,animationState:pe,targetCtx:k,fallbackDimensions:{width:I.width,height:I.height}})}k.drawImage(ie,0,0,ie.width,ie.height),k.restore()}}x.drawImage(Z,0,0,Z.width,Z.height)}},cleanup:()=>{AB(l)},tracks:c,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...c.map(({duration:I})=>I))}}const hB={version:"8.3.3"};function dB(i){const{publicApiUrl:e}=Co(i),t=cr();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function fB(i){var s,o,a,l,c,u,A,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:cr()};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"),r=(u=(c=window.sessionStorage)==null?void 0:c.getItem)==null?void 0:u.call(c,"vouch-uid-tab");const n=cr();return e||(e=dB(i),(h=(A=window.localStorage)==null?void 0:A.setItem)==null||h.call(A,"vouch-uid-visitor",e)),t||(t=cr(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=cr(),(p=(g=window.sessionStorage)==null?void 0:g.setItem)==null||p.call(g,"vouch-uid-tab",r)),{client:t,tab:r,request:n,visitor:e}}function gB(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function pB(i="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,"/"))??[],r={};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());r[l]=a}}),{source:i,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:hB.version,templateVersion:XC,...r}}const af=1;class mB{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=gB(r,this.host.vouch);!n||this.host.disableTracking||this._batchedEvents.push({event:t,payload:{...r,senderId:this.host.senderId,vouchId:n,time:new Date().toISOString()}})},this._sendTrackingEvent=()=>{if(this._batchedEvents.length<=0)return;const{publicApiUrl:t}=Co(this.host.env),{client:r,tab:n,request:s,visitor:o}=fB(this.host.env);navigator.sendBeacon(`${t}/api/batchevents`,JSON.stringify({payload:{events:this._batchedEvents},context:{"x-uid-client":r,"x-uid-tab":n,"x-uid-request":s,"x-uid-visitor":o,"x-reporting-metadata":pB(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+af&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]}},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:r}})=>{this._answersViewed[r]||(this._createTrackingEvent("VOUCH_RESPONSE_VIEWED",{answerId:t}),this._answersViewed[r]=!0)},this._handleVideoTimeUpdate=({detail:{id:t,key:r,node:n}})=>{this.host.paused||(this._currentlyPlayingVideo={id:t,key:r,node:n},this._streamLatestTime[r]=n.currentTime,this._streamStartTime[r]||(this._streamStartTime[r]=n.currentTime,this._streamLatestTime[r]=n.currentTime))},this._handleVideoPause=({detail:{id:t,key:r}})=>{this._streamLatestTime[r]>this._streamStartTime[r]+af&&this._createTrackingEvent("VIDEO_STREAMED",{answerId:t,streamStart:this._streamStartTime[r],streamEnd:this._streamLatestTime[r]}),delete this._streamStartTime[r],delete this._streamLatestTime[r]},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,r,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),(r=this.host.mediaPlayer)==null||r.addEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.addEventListener("video:timeupdate",this._handleVideoTimeUpdate)})}hostDisconnected(){var e,t,r,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),(r=this.host.mediaPlayer)==null||r.removeEventListener("video:pause",this._handleVideoPause),(n=this.host.mediaPlayer)==null||n.removeEventListener("video:timeupdate",this._handleVideoTimeUpdate)}}var fc={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof hr<"u"&&hr,r=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 hr<"u"&&hr||{},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(k){return k&&DataView.prototype.isPrototypeOf(k)}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(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function h(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function d(k){return typeof k!="string"&&(k=String(k)),k}function f(k){var O={next:function(){var V=k.shift();return{done:V===void 0,value:V}}};return l.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(k){this.map={},k instanceof g?k.forEach(function(O,V){this.append(V,O)},this):Array.isArray(k)?k.forEach(function(O){if(O.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+O.length);this.append(O[0],O[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(O){this.append(O,k[O])},this)}g.prototype.append=function(k,O){k=h(k),O=d(O);var V=this.map[k];this.map[k]=V?V+", "+O:O},g.prototype.delete=function(k){delete this.map[h(k)]},g.prototype.get=function(k){return k=h(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(h(k))},g.prototype.set=function(k,O){this.map[h(k)]=d(O)},g.prototype.forEach=function(k,O){for(var V in this.map)this.map.hasOwnProperty(V)&&k.call(O,this.map[V],V,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(O,V){k.push(V)}),f(k)},g.prototype.values=function(){var k=[];return this.forEach(function(O){k.push(O)}),f(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(O,V){k.push([V,O])}),f(k)},l.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function I(k){return new Promise(function(O,V){k.onload=function(){O(k.result)},k.onerror=function(){V(k.error)}})}function C(k){var O=new FileReader,V=I(O);return O.readAsArrayBuffer(k),V}function B(k){var O=new FileReader,V=I(O),L=/charset=([A-Za-z0-9_-]+)/.exec(k.type),_=L?L[1]:"utf-8";return O.readAsText(k,_),V}function y(k){for(var O=new Uint8Array(k),V=new Array(O.length),L=0;L<O.length;L++)V[L]=String.fromCharCode(O[L]);return V.join("")}function x(k){if(k.slice)return k.slice(0);var O=new Uint8Array(k.byteLength);return O.set(new Uint8Array(k)),O.buffer}function Q(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:l.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:l.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():l.arrayBuffer&&l.blob&&c(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||A(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="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(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var k=p(this);if(k)return k;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 k=p(this);return k||(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 k=p(this);if(k)return k;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 R=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(k){var O=k.toUpperCase();return R.indexOf(O)>-1?O:k}function P(k,O){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var V=O.body;if(k instanceof P){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,O.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!V&&k._bodyInit!=null&&(V=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=O.credentials||this.credentials||"same-origin",(O.headers||!this.headers)&&(this.headers=new g(O.headers)),this.method=F(O.method||this.method||"GET"),this.mode=O.mode||this.mode||null,this.signal=O.signal||this.signal||function(){if("AbortController"in a){var M=new AbortController;return M.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")&&(O.cache==="no-store"||O.cache==="no-cache")){var L=/([?&])_=[^&]*/;if(L.test(this.url))this.url=this.url.replace(L,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function D(k){var O=new FormData;return k.trim().split("&").forEach(function(V){if(V){var L=V.split("="),_=L.shift().replace(/\+/g," "),M=L.join("=").replace(/\+/g," ");O.append(decodeURIComponent(_),decodeURIComponent(M))}}),O}function $(k){var O=new g,V=k.replace(/\r?\n[\t ]+/g," ");return V.split("\r").map(function(L){return L.indexOf(`
2477
2477
  `)===0?L.substr(1,L.length):L}).forEach(function(L){var _=L.split(":"),M=_.shift().trim();if(M){var W=_.join(":").trim();try{O.append(M,W)}catch(Y){console.warn("Response "+Y.message)}}}),O}Q.call(P.prototype);function J(k,O){if(!(this instanceof J))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(O||(O={}),this.type="default",this.status=O.status===void 0?200:O.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=O.statusText===void 0?"":""+O.statusText,this.headers=new g(O.headers),this.url=O.url||"",this._initBody(k)}Q.call(J.prototype),J.prototype.clone=function(){return new J(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},J.error=function(){var k=new J(null,{status:200,statusText:""});return k.ok=!1,k.status=0,k.type="error",k};var ee=[301,302,303,307,308];J.redirect=function(k,O){if(ee.indexOf(O)===-1)throw new RangeError("Invalid status code");return new J(null,{status:O,headers:{location:k}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(O,V){this.message=O,this.name=V;var L=Error(O);this.stack=L.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Z(k,O){return new Promise(function(V,L){var _=new P(k,O);if(_.signal&&_.signal.aborted)return L(new o.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function W(){M.abort()}M.onload=function(){var ae={statusText:M.statusText,headers:$(M.getAllResponseHeaders()||"")};_.url.indexOf("file://")===0&&(M.status<200||M.status>599)?ae.status=200:ae.status=M.status,ae.url="responseURL"in M?M.responseURL:ae.headers.get("X-Request-URL");var fe="response"in M?M.response:M.responseText;setTimeout(function(){V(new J(fe,ae))},0)},M.onerror=function(){setTimeout(function(){L(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){L(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){L(new o.DOMException("Aborted","AbortError"))},0)};function Y(ae){try{return ae===""&&a.location.href?a.location.href:ae}catch{return ae}}if(M.open(_.method,Y(_.url),!0),_.credentials==="include"?M.withCredentials=!0:_.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(l.blob?M.responseType="blob":l.arrayBuffer&&(M.responseType="arraybuffer")),O&&typeof O.headers=="object"&&!(O.headers instanceof g||a.Headers&&O.headers instanceof a.Headers)){var ie=[];Object.getOwnPropertyNames(O.headers).forEach(function(ae){ie.push(h(ae)),M.setRequestHeader(ae,d(O.headers[ae]))}),_.headers.forEach(function(ae,fe){ie.indexOf(fe)===-1&&M.setRequestHeader(fe,ae)})}else _.headers.forEach(function(ae,fe){M.setRequestHeader(fe,ae)});_.signal&&(_.signal.addEventListener("abort",W),M.onreadystatechange=function(){M.readyState===4&&_.signal.removeEventListener("abort",W)}),M.send(typeof _._bodyInit>"u"?null:_._bodyInit)})}return Z.polyfill=!0,a.fetch||(a.fetch=Z,a.Headers=g,a.Request=P,a.Response=J),o.Headers=g,o.Request=P,o.Response=J,o.fetch=Z,o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var n=t.fetch?t:r;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,i.exports=e})(fc,fc.exports);var EB=fc.exports;const lf=Ql(EB);async function IB(i){var e;try{if((e=await lf(i,{method:"HEAD"}))!=null&&e.ok)return i}catch{return}}async function gc({sources:i}){const e=i==null?void 0:i.filter(Boolean),t=e==null?void 0:e.find(s=>s.startsWith("blob:")),r=e==null?void 0:e.find(s=>!s.startsWith("http")&&!s.startsWith("blob:"));if(t||r)return t??r;let n=e[0];if(e.length>0){const s=e.map(a=>IB(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function vB(i){try{return(await lf(i)).text()}catch{return null}}async function yB(i){return i=i.trim(),i.startsWith("http")||i.startsWith("blob:")?vB(i):i}function CB(i){if(typeof i=="string"){const[e,t]=i.split(":");return parseFloat(e)/parseFloat(t)}return i}const BB=Ti(async({original:i,translation:e,originalLanguage:t="",translationLanguage:r=""},{language:n})=>{var s,o;const a={[(s=r==null?void 0:r.split("-"))==null?void 0:s[0]]:e,[(o=t==null?void 0:t.split("-"))==null?void 0:o[0]]:i},l=(n&&a[n])??i;return l?yB(l):null},{cacheKey:([i,{language:e}])=>JSON.stringify({...i,language:e})});function TB(i){var e;return((e=i==null?void 0:i.items)==null?void 0:e.map(t=>{var r;return{text:(r=t.alternatives[0])==null?void 0:r.content,start:t.start_time,end:t.end_time}}))??[]}const bB=Ti(async i=>{var e,t,r,n,s,o,a,l,c,u,A;const[h,d,f]=await Promise.all([gc({sources:[(t=(e=i==null?void 0:i.answer)==null?void 0:e.media)==null?void 0:t.video,(n=(r=i==null?void 0:i.answer)==null?void 0:r.media)==null?void 0:n.input]}),gc({sources:[(o=(s=i==null?void 0:i.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),gc({sources:[((l=(a=i==null?void 0:i.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((A=(u=(c=i==null?void 0:i.answer)==null?void 0:c.media)==null?void 0:u.videos)==null?void 0:A.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([i])=>{var e,t,r,n,s,o,a,l,c,u,A;return JSON.stringify({video:(t=(e=i==null?void 0:i.answer)==null?void 0:e.media)==null?void 0:t.video,input:(n=(r=i==null?void 0:i.answer)==null?void 0:r.media)==null?void 0:n.input,playlist:(o=(s=i==null?void 0:i.answer)==null?void 0:s.media)==null?void 0:o.playlist,preview:((l=(a=i==null?void 0:i.answer)==null?void 0:a.media)==null?void 0:l.reducedQuality)??((A=(u=(c=i==null?void 0:i.answer)==null?void 0:c.media)==null?void 0:u.videos)==null?void 0:A.xs)})}});function cf(i){var e,t,r,n,s,o,a,l,c,u,A,h;const d=((t=(e=i==null?void 0:i.answer)==null?void 0:e.contact)==null?void 0:t.name)==="Anonymous"?"":((s=(n=(r=i==null?void 0:i.answer)==null?void 0:r.contact)==null?void 0:n.name)==null?void 0:s.trim())??"",f=((l=(a=(o=i==null?void 0:i.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:l.name)==="Not Supplied"?"":((h=(A=(u=(c=i==null?void 0:i.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 SB(i){var e,t;const r=(t=(e=i==null?void 0:i.answer)==null?void 0:e.contact)==null?void 0:t.roleTitle,n=r==null?void 0:r.split(" ");return{roleTitle:r,roleWords:n,firstRoleWord:n==null?void 0:n[0],remainingRoleWords:n==null?void 0:n.slice(1).join(" ")}}async function xB(i,e,t){var r,n,s;const o=(r=e==null?void 0:e.answer)==null?void 0:r.id;return((s=(n=i==null?void 0:i.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 pc({data:i,rootData:e,index:t},r){var n,s,o,a,l,c,u,A,h,d,f,g,p,I,C,B,y,x,Q,R,F,P,D,$,J;const ee=(n=e==null?void 0:e.answer)==null?void 0:n.metadata;(ee==null?void 0:ee.aspectRatio)!=null&&(ee.aspectRatio=CB(ee.aspectRatio));const[Z,k,O]=await Promise.all([xB(i,e,t),bB(e),BB({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:(I=(p=(g=e==null?void 0:e.answer)==null?void 0:g.transcription)==null?void 0:p.translation)==null?void 0:I.language},r)]),V=cf(e),L=SB(e);return{...k,...V,...L,key:Z,captions:O,wordTimings:TB((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?((R=(Q=(x=(y=i==null?void 0:i.questions)==null?void 0:y.items)==null?void 0:x[t-1])==null?void 0:Q.answer)==null?void 0:R.label)??((D=(P=(F=i==null?void 0:i.questions)==null?void 0:F.items)==null?void 0:P[t-1])==null?void 0:D.title)??null:null,isFirstInstanceOfName:t?((J=($=i==null?void 0:i.questions)==null?void 0:$.items)==null?void 0:J.findIndex(_=>cf(_).name===V.name))===t:!0}}const ea={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 wB({data:i}){var e,t;return((t=(e=i==null?void 0:i.questions)==null?void 0:e.items)==null?void 0:t.reduce((r,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&&ea[h]&&!r.find(f=>f.value===h)&&r.push({value:h,label:ea[h]}),d&&ea[d]&&!r.find(f=>f.value===d)&&r.push({value:d,label:ea[d]}),r},[]))??[]}/**
2478
2478
  * @license
2479
2479
  * Copyright 2018 Google LLC