@vouchfor/embeds 8.0.3 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/embeds.js +1 -1
- package/dist/iife/dialog-embed/embed.iife.js +1 -1
- package/dist/iife/dialog-embed/embed.iife.js.map +1 -1
- package/dist/iife/embeds.iife.js +1 -1
- package/dist/iife/embeds.iife.js.map +1 -1
- package/dist/iife/player-embed/embed.iife.js +1 -1
- package/dist/iife/player-embed/embed.iife.js.map +1 -1
- package/package.json +4 -4
|
@@ -2472,7 +2472,7 @@ vec4 transition(vec2 uv) {
|
|
|
2472
2472
|
vec4 b=getToColor(p);
|
|
2473
2473
|
return mix(a, b, step(0.0+p.y,progress));
|
|
2474
2474
|
}
|
|
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 Ih=Da(yv);var vh;function Cv(i){if(typeof i=="string"){const[e,t]=i.split(":");return Math.min(parseFloat(e),parseFloat(t))}return i}function Bv(i){if(typeof i=="string"){const[e,t]=i.split(":"),r=parseFloat(e),n=parseFloat(t);return r/n}return i}function Al({resolution:i,aspectRatio:e}){const t=Cv(i),r=Bv(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 yh={linear:Mm,easeIn:_a,easeInOut:Pm,easeOut:Fm,circIn:gu,circInOut:Nm,circOut:pu,backIn:Ra,backInOut:Um,backOut:Om,anticipate:Gm,bounceIn:Vm,bounceInOut:Km,bounceOut:Rs},zs=Wc((i,e,{clamp:t=!0,ease:r="easeIn",...n}={})=>wm(i,e,{...n,clamp:t,ease:yh[r]}),{cacheKey:([i,e,t])=>JSON.stringify({from:i,to:e,options:t})}),Tv={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:zs([0,1],[n,s],{ease:e})(t)}}}},Zs={type:"fade",processor:{getTargetState:i=>({opacity:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({opacity:zs([0,1],[r.opacity,i],{ease:e})(t)})}},Sv={type:"scale",processor:{getTargetState:i=>({scale:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({scale:zs([0,1],[r.scale,i],{ease:e})(t)})}},Ch={type:"translate",processor:{getTargetState:i=>({translation:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({translation:zs([0,1],[r.translation,i],{ease:e})(t)})}},bv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],xv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Qv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],wv=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Fn={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:bv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},cl={type:"switch",name:"reverseExit",label:"Reverse exit animation"},_v=.2,Rv=1;function Dv(i,e){const t=i==="both"?e/2:e;return Math.min(Rv,t)}function Pn({speed:i,timing:e,elementDuration:t}){const r=Dv(e,t),n=Math.min(_v,r),s=Math.max(0,Math.min(100,i))/100;return r-s*(r-n)}const Lv="easeOut";function Nn(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:Lv,...((t=i==null?void 0:i.options)==null?void 0:t.call(i,e))??{}}}}}function Yi({timing:i,duration:e,elementDuration:t,easing:r,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const A=[],l=i==="both"||i==="enter",u=i==="both"||i==="exit",c=Math.max(0,t-e);if(l?(A.push({time:0,value:s,easing:r}),A.push({time:e,value:a,easing:"linear"})):A.push({time:0,value:a,easing:"linear"}),u){c>e&&A.push({time:c,value:a,easing:r});const h=n?s:o;A.push({time:t,value:h,easing:r})}return A}const Bh="fade",kv={type:Bh,name:"Fade",options:{...Fn},transform:Nn(),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs}}}},Th="pan",Sh=.25,bh="left";function xh(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 xh(bh,e,t)}}function Mv(i){return{x:-i.x,y:-i.y}}const Fv={type:Th,name:"Pan",options:{...Fn,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Qv},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:i=>`${(i*100).toFixed(0)}%`}},reverseExit:cl},transform:Nn({values:i=>({direction:i.direction??bh,distance:[i.distance??Sh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Sh,n=xh(i.direction,e.elementDimensions,r),s=Mv(n);return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs},translate:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Ch}}}},Qh="pop",wh=.5,Pv={type:Qh,name:"Pop",options:{...Fn},transform:Nn(),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs},scale:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:wh,exitTo:wh,restValue:1}),renderer:Sv}}}},_h="rise",Rh=50,Nv="up";function Ov(i,e){switch(i){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const Uv={type:_h,name:"Rise",options:{...Fn,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:wv},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:i=>`${i}px`}},reverseExit:cl},transform:Nn({values:i=>({direction:i.direction??Nv,distance:[i.distance??Rh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Rh,{enterY:n,exitY:s}=Ov(i.direction,r);return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs},translate:{keyframes:Yi({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:Ch}}}},Dh="wipe",ul="left";function Pr(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 Pr(ul)}}function Lh(i){switch(i){case"left":return Pr("right");case"right":return Pr("left");case"up":return Pr("down");case"down":return Pr("up");default:return Lh(ul)}}const Gv={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},$v={type:Dh,name:"Wipe",options:{...Fn,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:xv},reverseExit:cl},transform:Nn({values:i=>({direction:i.direction??ul,reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=Pr(i.direction),n=Lh(i.direction);return{clip:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:r,exitTo:n,restValue:Gv}),renderer:Tv}}}},Hv={[Bh]:kv,[_h]:Uv,[Qh]:Pv,[Th]:Fv,[Dh]:$v};function Yv(i,e){const{type:t,...r}=i,n=Hv[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(r,e)}function Vv({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 A=a.time-o.time,l=A===0?0:(e-o.time)/A,u=o.easing||"linear",c=i.renderer.processor.getTargetState(o.value);return i.renderer.processor.interpolateState({easing:u,progress:l,from:c,value:a.value})}}return null}function Kv(i,e,t){const{preset:r,...n}=i;if(!r)return n;const s=Yv(r,{elementDuration:e,elementDimensions:t});return{...n,...s}}function kh({layout:i,sceneTime:e,animations:t,elementDuration:r=5,elementDimensions:n={width:100,height:100}}){var s,o,a,A,l,u,c,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:((l=(A=i==null?void 0:i.transform)==null?void 0:A.translate)==null?void 0:l.y)??0},scale:((u=i==null?void 0:i.transform)==null?void 0:u.scale)??1,rotation:((c=i==null?void 0:i.transform)==null?void 0:c.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=Kv(t,r,n);for(const C of Object.values(I)){if(!C)continue;const B=Vv({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const Wv=[];for(let i=0;i<256;++i)Wv.push((i+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function qv(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 eo=64;function Jv(){const i=[],e={x:.5,y:.5},t=.5;for(let r=0;r<eo;r++){const n=r/eo*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 jv(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<eo;s++){const o=s/eo*2*Math.PI,a=t.x+r*Math.cos(o),A=t.y+n*Math.sin(o);e.push({x:a,y:A})}return e}function Xv(){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 Mh(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 to(i){if(i<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let l=0;l<i;l++){const u=l*2*Math.PI/i-Math.PI/2,c=Math.cos(u),h=Math.sin(u);t.push({x:c,y:h})}const r=Math.min(...t.map(l=>l.x)),n=Math.max(...t.map(l=>l.x)),s=Math.min(...t.map(l=>l.y)),o=Math.max(...t.map(l=>l.y)),a=n-r,A=o-s;for(const l of t){const u=(l.x-r)/a,c=(l.y-s)/A;e.push({x:u,y:c})}return e}function Fh(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 zv(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),A=.5+o*Math.sin(s);t.push({x:a,y:A})}return t}function Zv(i="isosceles",e={}){switch(i){case"equilateral":return ey();case"isosceles":return Ph(e.baseAngle??60);case"right":return ty(e.rightAnglePosition??"bottom-left");case"scalene":return iy(e.angles??[60,60,60])}}function ey(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Ph(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 ty(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 iy(i){return Ph(i[0])}function ry(i={},e=1){const{type:t="rectangle",customPolygon:r,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:A,regularPolygon:l}=i;switch(t){case"rectangle":return Mh(0,e);case"parallelogram":return Mh((n==null?void 0:n.angle)??30,e);case"triangle":return Zv((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 Fh((o==null?void 0:o.angle)??90);case"diamond":return Fh(90);case"pentagon":return to(5);case"hexagon":return to(6);case"octagon":return to(8);case"star":return zv((A==null?void 0:A.points)??5,(A==null?void 0:A.innerRadius)??.4);case"arrow":return qv((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return Xv();case"circle":return Jv();case"ellipse":return jv(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 to((l==null?void 0:l.sides)??6)}}function ny(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,A=e[s].y,l=e[o].x,u=e[o].y;A>n!=u>n&&r<(l-a)*(n-A)/(u-A)+a&&(t=!t)}return t}function sy(i,e){let t=1,r=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;ny({x:o,y:i},e)&&(t=Math.min(t,o),r=Math.max(r,o))}return r>=t?{left:t,right:r}:null}function oy(i){const e=Math.min(...i.map(A=>A.y)),t=Math.max(...i.map(A=>A.y));let r={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let A=0;A<=s;A++){const l=e+A*o;a.push({y:l,span:sy(l,i)})}for(let A=0;A<a.length-1;A++){const l=a[A].y;for(let u=A+1;u<a.length;u++){const h=a[u].y-l;let d=0,f=1,g=!0;const p=Math.min(5,u-A+1);for(let I=0;I<p;I++){const C=A+Math.floor(I/(p-1)*(u-A)),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:l,width:I,height:h})}}}return r}function ay(i,e=1){const t=ry(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=oy(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 ly(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 Ay(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 cy(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 uy(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 hy=dr(()=>mu.loadYoga());function Nh(i,e,{layout:t,scale:r=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:A,minHeight:l,maxWidth:u,maxHeight:c,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:I,direction:C="column",align:B="start",alignSelf:y,justify:Q="start"}=t??{},_={static:i.POSITION_TYPE_STATIC,relative:i.POSITION_TYPE_RELATIVE,absolute:i.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(_[n]),typeof s<"u"){const{top:D,right:K,bottom:X,left:ie}=Ay(s,r);typeof D<"u"&&e.setPosition(i.EDGE_TOP,D),typeof K<"u"&&e.setPosition(i.EDGE_RIGHT,K),typeof X<"u"&&e.setPosition(i.EDGE_BOTTOM,X),typeof ie<"u"&&e.setPosition(i.EDGE_LEFT,ie)}const k={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(k[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 U={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(U[Q]),typeof p<"u"){const{top:D,right:K,bottom:X,left:ie}=cy(p,r);e.setMargin(i.EDGE_TOP,D),e.setMargin(i.EDGE_RIGHT,K),e.setMargin(i.EDGE_BOTTOM,X),e.setMargin(i.EDGE_LEFT,ie)}if(typeof I<"u"){const{top:D,right:K,bottom:X,left:ie}=uy(I,r);e.setPadding(i.EDGE_TOP,D),e.setPadding(i.EDGE_RIGHT,K),e.setPadding(i.EDGE_BOTTOM,X),e.setPadding(i.EDGE_LEFT,ie)}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 A<"u"&&e.setMinWidth(typeof A=="number"?A*r:A),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*r:l),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*r:u),typeof c<"u"&&e.setMaxHeight(typeof c=="number"?c*r:c)}async function Oh({id:i,yoga:e,index:t,parent:r,element:n,resolvers:s}){var o,a,A;const{layout:l={},config:u={},options:c={},renderer:h}=n,d=e.Node.create();Nh(e,d,{layout:l}),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:c}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:i,config:u,options:c}))??null);const g=[];for await(const[p,I]of((A=n.children)==null?void 0:A.entries())??[])g.push(await Oh({id:i,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:ly(l.radius),element:n,renderer:h,config:u,options:c,dependencies:f,childNodes:g}}function Uh(i,e,t=0,r=0){const{top:n,left:s}=i.getComputedLayout(),{top:o,left:a,width:A,height:l}=e.node.getComputedLayout(),u=t+a,c=r+o,h=e.childNodes.map(d=>Uh(i,d,u,c));return{...e,x:s+u,y:n+c,width:A,height:l,childNodes:h}}async function hl({yoga:i,root:e,tree:t,measureCanvas:r}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:A}of t){if(a){const{width:l,height:u}=a;if(l&&r){e.calculateLayout();const c=await l({node:n,options:s,dependencies:o,measureCanvas:r});c&&n.setWidth(c)}if(u&&r){e.calculateLayout();const c=await u({node:n,options:s,dependencies:o,measureCanvas:r});c&&n.setHeight(c)}if((s==null?void 0:s.format)==="crop"&&(o!=null&&o.aspectRatio)&&(a.type==="video"||a.type==="image")){const c=s.crop;if(!c||c.x===0&&c.y===0&&c.width===1&&c.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 hl({yoga:i,root:e,tree:A,measureCanvas:r}),s!=null&&s.shape){const c=n.getComputedWidth(),h=n.getComputedHeight(),d=ay(s.shape,c/h);n.setPadding(i.EDGE_TOP,d.top*h),n.setPadding(i.EDGE_RIGHT,d.right*c),n.setPadding(i.EDGE_BOTTOM,d.bottom*h),n.setPadding(i.EDGE_LEFT,d.left*c)}}e.calculateLayout(),await hl({yoga:i,root:e,tree:A,measureCanvas:r})}}async function Gh({id:i,root:e,resolvers:t,measureCanvas:r}){const n=await hy(),s=n.Node.create();Nh(n,s,{layout:e.layout});const o=await Oh({id:i,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await hl({yoga:n,root:s,tree:[o],measureCanvas:r});const{top:a,left:A,width:l,height:u}=s.getComputedLayout(),c={root:{x:A,y:a,width:l,height:u},node:Uh(s,o)};return s.freeRecursive(),c}const $h=/(?<value>\d+\.?\d*)(?=px)/;function dl({words:i,spaceMetrics:e,strokeWidth:t=0}){return i.reduce((r,n,s)=>{const o=n.metrics.width+t,a=s<i.length-1?e.width:0;return r+o+a},0)}Wc(({context:i,font:e,fontSizes:t,words:r,maxW:n=1/0,strokeWidth:s=0,letterSpacing:o=0})=>{try{i.save(),i.letterSpacing=`${o}px`,i.font=e.replace($h,t[0].toString());const a=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");if(r.length<=0)return[];const A=i.measureText(r[0].text);return r.slice(1).reduce((l,u)=>{const c=l[l.length-1],h=i.measureText(u.text),d={...u,metrics:h},f=[...c.words,d],g=dl({strokeWidth:s,words:f,spaceMetrics:c.spaceMetrics});if(g>n){const p=t[l.length%t.length];i.font=e.replace($h,p.toString());const I=i.measureText(" "),C=i.measureText(u.text),B=[{...u,metrics:C}],y=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");l=[...l,{allMetrics:y,spaceMetrics:I,lineWidth:dl({strokeWidth:s,spaceMetrics:I,words:B}),font:i.font,words:B,lineHeight:y.actualBoundingBoxAscent+y.actualBoundingBoxDescent+s}]}else l[l.length-1]={...c,lineWidth:g,words:f};return l},[{allMetrics:a,lineWidth:dl({strokeWidth:s,words:[{...r[0],metrics:A}],spaceMetrics:i.measureText(" ")}),lineHeight:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent+s,font:i.font,words:[{...r[0],metrics:A}],spaceMetrics:i.measureText(" ")}])}finally{i.restore()}},{cacheKey:([{font:i,fontSizes:e,words:t,maxW:r,strokeWidth:n,letterSpacing:s}])=>`${i}_${JSON.stringify(e)}_${JSON.stringify(t)}_${r}_${n}_${s}`});function dy(i){return i.slice(0,1).toUpperCase()+i.slice(1)}const Hh=[{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"}];function fy({text:i,font:e}){let t=e;return Hh.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}Object.keys(yh).map(i=>({label:dy(i),value:i,data:i}));function Yh(){return document.createElement("canvas")}function Yt(i){let e=0;for(const t of i)Array.isArray(t)?e+=Yt(t):e+=t;return e}function io(i){return i.map(({type:e,duration:t},r)=>{var n,s,o,a;if(e==="transition"){const A=((n=i[r-2])==null?void 0:n.type)==="transition"?i[r-2]:null,l=((s=i[r-1])==null?void 0:s.duration)??1/0,u=((o=i[r+1])==null?void 0:o.duration)??1/0,c=((a=i[r+2])==null?void 0:a.type)==="transition"?i[r+2]:null;return Math.min(A?l/2:l,t,c?u/2:u)*-1}return t})}function gy(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 py(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,'\\"')}Wm.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${py(i)}"`:gy(i)||Array.isArray(i)?JSON.stringify(i):i);function my(i){return i.some(({type:e})=>e==="text")}function Ey(i){return i.some(({type:e})=>e==="caption")}function Iy(i){return i.some(({type:e})=>e==="audio")}function vy(i){return i.some(({type:e})=>e==="video"||e==="image")}function fl(i){return i.type==="audio"}const yy="3";async function Cy({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await Gh({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function By({track:i}){const e=io(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const A=Yt(e.slice(0,a));return s.push(Cy({scene:o,start:A})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const A=Yt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:A,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 Vh({node:i,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var A,l,u,c,h;const d=e.sceneCanvas.getContext("2d");if(d){d.save(),d.setTransform(s);const f=(a==null?void 0:a.rotation)!=null&&((A=i.element.layout)!=null&&A.transform)?{...i.element.layout,transform:{...i.element.layout.transform,rotation:a.rotation}}:i.element.layout,g=kh({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:Q}=g,_=i.width*y.widthRatio,k=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||Q!==0)&&(d.translate(i.x+_/2,i.y+k/2),d.scale(C,C),d.rotate(Q*Math.PI/180),d.translate(-(i.x+_/2),-(i.y+k/2))),B){d.beginPath();const D={x:i.x+B.x*_,y:i.y+B.y*k,width:B.width*_,height:B.height*k};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,_,k),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&&((l=i.options)!=null&&l.font)?{font:{...i.options.font,size:a.fontSize}}:{}}:i.options,U=(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=(c=i.renderer)==null?void 0:c.render)==null?void 0:h.call(c,{canvases:e,sceneTime:t,dx:i.x,dy:i.y,dw:_,dh:k,radius:i.radius,options:F,dependencies:U}));for await(const D of i.childNodes)await Vh({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function Ty({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await Vh({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function ro({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=Yh}){var a,A;const{id:l,x:u,y:c,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),Q=await Gh({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof c=="number"?{position:"absolute",inset:{top:c,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((A=f.element.layout)==null?void 0:A.height)}}},resolvers:r,measureCanvas:y}),_=async(k,F)=>{const U=Math.max(0,k-t);p.width=p.height=0,p.width=n,p.height=s,await Ty({debug:i,layout:Q,sceneTime:U,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:l,type:e.type,start:t,duration:g,layout:Q,sceneCanvas:p,draw:_,config:e,childScenes:[]}}async function Sy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=io(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Yt(o.slice(0,d));return h.type==="caption"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Yt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Yt(o.slice(0,d))-f;return c.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)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}function by({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 c=e[u];fl(c)||c.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let A,l=1/0;for(let u=0;u<i.length;u++){if(o===u)continue;const c=t[u];s.sceneIds.every(d=>c.has(d))&&c.size>t[o].size&&c.size<l&&(A=i[u].id,l=c.size)}return{id:s.id,sceneIds:s.sceneIds,animations:s.animations,bounds:s.bounds,topmostTrackIndex:a.length>0?Math.max(...a):-1,parentGroupId:A,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 xy({group:i,currentTime:e,activeMembers:t,fallbackDimensions:r}){if(!i.animations||t.length===0)return null;const n=Math.min(...t.map(c=>c.start)),o=Math.max(...t.map(c=>c.end))-n,a=Math.max(0,e-n),A=i.bounds,l=(A==null?void 0:A.width)??r.width,u=(A==null?void 0:A.height)??r.height;return kh({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function Kh({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,A=(n==null?void 0:n.height)??r.height,{opacity:l,translation:u,scale:c,clip:h,rotation:d}=e;if(t.globalAlpha*=l,(u.x||u.y)&&t.translate(u.x,u.y),c!==1||d!==0){const f=s+a/2,g=o+A/2;t.translate(f,g),t.scale(c,c),t.rotate(d*Math.PI/180),t.translate(-f,-g)}h&&(t.beginPath(),t.rect(s+h.x*a,o+h.y*A,h.width*a,h.height*A),t.clip())}async function Qy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=io(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Yt(o.slice(0,d));return h.type==="video"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Yt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Yt(o.slice(0,d))-f;return c.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)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}async function wy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=io(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Yt(o.slice(0,d));return h.type==="text"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Yt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Yt(o.slice(0,d))-f;return c.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)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"text",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}const _y=(((vh=Ih)==null?void 0:vh.default)??Ih).reduce((i,e)=>(i[e.name]=e,i),{});function Ry(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function Dy({name:i,to:e,from:t,progress:r,width:n,height:s,glContext:o,contextResources:a,returnPixels:A=!0}){var l,u,c;const h=Ry(a,o);if(o.disable(o.DEPTH_TEST),h.buffer?o.bindBuffer(o.ARRAY_BUFFER,h.buffer):(h.buffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h.buffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),o.STATIC_DRAW)),o.viewport(0,0,n,s),h.fromTexture?h.fromTexture.setPixels(t):(h.fromTexture=(((l=qs)==null?void 0:l.default)??qs)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=qs)==null?void 0:u.default)??qs)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((c=Eh)==null?void 0:c.default)??Eh)(o,_y[i])),h.transitions[i].draw(r,h.fromTexture,h.toTexture,n,s),!A)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 Ly(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 ky({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),Dy({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function Wh({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=Yh,drawTransition:o=ky}){var a;const A=new Map,l=await Promise.all(e.tracks.map(async I=>{if(vy(I))return{...await Qy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(my(I))return{...await wy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Ey(I))return{...await Sy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Iy(I))return{...await By({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?by({groups:e.groups,tracks:l}):[],c=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)c.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=c.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 Q=I.getContext("2d");if(!Q)return;Q.globalAlpha=1,Q.globalCompositeOperation="source-over",Q.clearRect(0,0,I.width,I.height),Q.save(),Q.fillStyle="black",Q.fillRect(0,0,I.width,I.height),Q.restore();const _=new Map;for(const D of l)if(!fl(D))for(const K of D.scenes){if(C<K.start||C>=K.start+K.duration)continue;const X=K.layout,ie=X==null?void 0:X.node,re={start:K.start,end:K.start+K.duration,x:(ie==null?void 0:ie.x)??0,y:(ie==null?void 0:ie.y)??0,width:(ie==null?void 0:ie.width)??I.width,height:(ie==null?void 0:ie.height)??I.height};let L=c.get(K.id);for(;L;)L.animations&&(_.has(L.id)||_.set(L.id,[]),_.get(L.id).push(re)),L=L.parentGroupId?d.get(L.parentGroupId):void 0}const k=new Map;function F(D){if(k.has(D.id))return k.get(D.id);const K=xy({group:D,currentTime:C,activeMembers:_.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return k.set(D.id,K),K}function U(D,K,X){const ie=f({id:X});if(ie.length===0){D.drawImage(K,0,0,K.width,K.height);return}D.save();for(let re=ie.length-1;re>=0;re--){const L=ie[re],O=F(L);O&&Kh({group:L,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage(K,0,0,K.width,K.height),D.restore()}for(let D=0;D<l.length;D++){if(y!=null&&y.aborted)return;const K=l[D];if(fl(K))continue;const{scenes:X,transitions:ie,trackCanvas:re}=K;re.width=re.height=0,re.width=I.width,re.height=I.height;const L=re.getContext("2d");if(!L)continue;const O=X.filter(({start:x,duration:M})=>C>=x&&C<x+M);if(O.length===0)continue;const W=ie.find(({start:x,duration:M})=>C>=x&&C<x+M),R=!!(W&&W.to&&W.from&&W.duration>0);for await(const x of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:V,id:H}=x;if(await(V==null?void 0:V(C,B==null?void 0:B.get(H))),y!=null&&y.aborted)return;R&&(W.to.id===H||W.from.id===H)||U(L,M,H)}if(R){const{name:x,to:M,from:V,duration:H,transitionCanvas:te}=W;te.width=te.height=0,te.width=re.width,te.height=re.height;const ne=Math.min(1,Math.max(0,(C-M.start)/H));if(await o({name:x,progress:ne,contextResources:A,to:M.sceneCanvas,from:V.sceneCanvas,canvas:te}),y!=null&&y.aborted)return;const he=new Set(f({id:V.id})),ge=new Set(f({id:M.id})),Ce=[...he].filter(_e=>ge.has(_e)).sort((_e,fe)=>_e.depth-fe.depth);if(Ce.length===0)L.drawImage(te,0,0,te.width,te.height);else{L.save();for(const _e of Ce){const fe=F(_e);fe&&Kh({group:_e,animationState:fe,targetCtx:L,fallbackDimensions:{width:I.width,height:I.height}})}L.drawImage(te,0,0,te.width,te.height),L.restore()}}Q.drawImage(re,0,0,re.width,re.height)}},cleanup:()=>{Ly(A)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:I})=>I))}}const My={version:"8.0.3"};function Fy(i){const{publicApiUrl:e}=bs(i),t=ur();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Py(i){var s,o,a,A,l,u,c,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:ur()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),r=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=ur();return e||(e=Fy(i),(h=(c=window.localStorage)==null?void 0:c.setItem)==null||h.call(c,"vouch-uid-visitor",e)),t||(t=ur(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=ur(),(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 Ny(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function Oy(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 A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());r[A]=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:My.version,templateVersion:yy,...r}}const qh=1;class Uy{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=Ny(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}=bs(this.host.env),{client:r,tab:n,request:s,visitor:o}=Py(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":Oy(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+qh&&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]+qh&&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 gl={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Gi<"u"&&Gi,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 Gi<"u"&&Gi||{},A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(L){return L&&DataView.prototype.isPrototypeOf(L)}if(A.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var O={next:function(){var W=L.shift();return{done:W===void 0,value:W}}};return A.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(L){this.map={},L instanceof g?L.forEach(function(O,W){this.append(W,O)},this):Array.isArray(L)?L.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):L&&Object.getOwnPropertyNames(L).forEach(function(O){this.append(O,L[O])},this)}g.prototype.append=function(L,O){L=h(L),O=d(O);var W=this.map[L];this.map[L]=W?W+", "+O:O},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,O){this.map[h(L)]=d(O)},g.prototype.forEach=function(L,O){for(var W in this.map)this.map.hasOwnProperty(W)&&L.call(O,this.map[W],W,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(O,W){L.push(W)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(O){L.push(O)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(O,W){L.push([W,O])}),f(L)},A.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function I(L){return new Promise(function(O,W){L.onload=function(){O(L.result)},L.onerror=function(){W(L.error)}})}function C(L){var O=new FileReader,W=I(O);return O.readAsArrayBuffer(L),W}function B(L){var O=new FileReader,W=I(O),R=/charset=([A-Za-z0-9_-]+)/.exec(L.type),x=R?R[1]:"utf-8";return O.readAsText(L,x),W}function y(L){for(var O=new Uint8Array(L),W=new Array(O.length),R=0;R<O.length;R++)W[R]=String.fromCharCode(O[R]);return W.join("")}function Q(L){if(L.slice)return L.slice(0);var O=new Uint8Array(L.byteLength);return O.set(new Uint8Array(L)),O.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:A.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:A.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():A.arrayBuffer&&A.blob&&l(L)?(this._bodyArrayBuffer=Q(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||c(L))?this._bodyArrayBuffer=Q(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(A.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var k=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(L){var O=L.toUpperCase();return k.indexOf(O)>-1?O:L}function U(L,O){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var W=O.body;if(L instanceof U){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,O.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!W&&L._bodyInit!=null&&(W=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);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")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(W),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var x=/\?/;this.url+=(x.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function D(L){var O=new FormData;return L.trim().split("&").forEach(function(W){if(W){var R=W.split("="),x=R.shift().replace(/\+/g," "),M=R.join("=").replace(/\+/g," ");O.append(decodeURIComponent(x),decodeURIComponent(M))}}),O}function K(L){var O=new g,W=L.replace(/\r?\n[\t ]+/g," ");return W.split("\r").map(function(R){return R.indexOf(`
|
|
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 Ih=Da(yv);var vh;function Cv(i){if(typeof i=="string"){const[e,t]=i.split(":");return Math.min(parseFloat(e),parseFloat(t))}return i}function Bv(i){if(typeof i=="string"){const[e,t]=i.split(":"),r=parseFloat(e),n=parseFloat(t);return r/n}return i}function Al({resolution:i,aspectRatio:e}){const t=Cv(i),r=Bv(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 yh={linear:Mm,easeIn:_a,easeInOut:Pm,easeOut:Fm,circIn:gu,circInOut:Nm,circOut:pu,backIn:Ra,backInOut:Um,backOut:Om,anticipate:Gm,bounceIn:Vm,bounceInOut:Km,bounceOut:Rs},zs=Wc((i,e,{clamp:t=!0,ease:r="easeIn",...n}={})=>wm(i,e,{...n,clamp:t,ease:yh[r]}),{cacheKey:([i,e,t])=>JSON.stringify({from:i,to:e,options:t})}),Tv={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:zs([0,1],[n,s],{ease:e})(t)}}}},Zs={type:"fade",processor:{getTargetState:i=>({opacity:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({opacity:zs([0,1],[r.opacity,i],{ease:e})(t)})}},Sv={type:"scale",processor:{getTargetState:i=>({scale:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({scale:zs([0,1],[r.scale,i],{ease:e})(t)})}},Ch={type:"translate",processor:{getTargetState:i=>({translation:i}),interpolateState:({value:i,easing:e,progress:t,from:r})=>({translation:zs([0,1],[r.translation,i],{ease:e})(t)})}},bv=[{label:"Both",value:"both"},{label:"At start",value:"enter"},{label:"At end",value:"exit"}],xv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"},{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Qv=[{value:"left",icon:"arrow-left"},{value:"right",icon:"arrow-right"}],wv=[{value:"up",icon:"arrow-up"},{value:"down",icon:"arrow-down"}],Fn={timing:{type:"buttonRadio",name:"timing",label:"Animate",options:bv},speed:{type:"slider",name:"speed",label:"Speed",min:0,max:100,step:1}},cl={type:"switch",name:"reverseExit",label:"Reverse exit animation"},_v=.2,Rv=1;function Dv(i,e){const t=i==="both"?e/2:e;return Math.min(Rv,t)}function Pn({speed:i,timing:e,elementDuration:t}){const r=Dv(e,t),n=Math.min(_v,r),s=Math.max(0,Math.min(100,i))/100;return r-s*(r-n)}const Lv="easeOut";function Nn(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:Lv,...((t=i==null?void 0:i.options)==null?void 0:t.call(i,e))??{}}}}}function Yi({timing:i,duration:e,elementDuration:t,easing:r,reverseExit:n=!1,enterFrom:s,exitTo:o,restValue:a}){const A=[],l=i==="both"||i==="enter",u=i==="both"||i==="exit",c=Math.max(0,t-e);if(l?(A.push({time:0,value:s,easing:r}),A.push({time:e,value:a,easing:"linear"})):A.push({time:0,value:a,easing:"linear"}),u){c>e&&A.push({time:c,value:a,easing:r});const h=n?s:o;A.push({time:t,value:h,easing:r})}return A}const Bh="fade",kv={type:Bh,name:"Fade",options:{...Fn},transform:Nn(),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs}}}},Th="pan",Sh=.25,bh="left";function xh(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 xh(bh,e,t)}}function Mv(i){return{x:-i.x,y:-i.y}}const Fv={type:Th,name:"Pan",options:{...Fn,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:Qv},distance:{type:"slider",name:"distance",label:"Distance",min:.1,max:1,step:.05,transform:{format:i=>`${(i*100).toFixed(0)}%`}},reverseExit:cl},transform:Nn({values:i=>({direction:i.direction??bh,distance:[i.distance??Sh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Sh,n=xh(i.direction,e.elementDimensions,r),s=Mv(n);return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs},translate:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:n,exitTo:s,restValue:{x:0,y:0}}),renderer:Ch}}}},Qh="pop",wh=.5,Pv={type:Qh,name:"Pop",options:{...Fn},transform:Nn(),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration});return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs},scale:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:"backOut",enterFrom:wh,exitTo:wh,restValue:1}),renderer:Sv}}}},_h="rise",Rh=50,Nv="up";function Ov(i,e){switch(i){case"down":return{enterY:-e,exitY:e};case"up":default:return{enterY:e,exitY:-e}}}const Uv={type:_h,name:"Rise",options:{...Fn,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:wv},distance:{type:"slider",name:"distance",label:"Distance",min:5,max:100,step:5,transform:{format:i=>`${i}px`}},reverseExit:cl},transform:Nn({values:i=>({direction:i.direction??Nv,distance:[i.distance??Rh],reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,distance:i.distance[0],reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=i.distance??Rh,{enterY:n,exitY:s}=Ov(i.direction,r);return{fade:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:0,exitTo:0,restValue:1}),renderer:Zs},translate:{keyframes:Yi({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:Ch}}}},Dh="wipe",ul="left";function Pr(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 Pr(ul)}}function Lh(i){switch(i){case"left":return Pr("right");case"right":return Pr("left");case"up":return Pr("down");case"down":return Pr("up");default:return Lh(ul)}}const Gv={coordinates:{x:0,y:0},dimensions:{width:1,height:1}},$v={type:Dh,name:"Wipe",options:{...Fn,direction:{type:"buttonRadio",name:"direction",label:"Direction",options:xv},reverseExit:cl},transform:Nn({values:i=>({direction:i.direction??ul,reverseExit:i.reverseExit??!1}),options:i=>({direction:i.direction,reverseExit:i.reverseExit})}),generate:(i,e)=>{const t=Pn({speed:i.speed,timing:i.timing,elementDuration:e.elementDuration}),r=Pr(i.direction),n=Lh(i.direction);return{clip:{keyframes:Yi({timing:i.timing,duration:t,elementDuration:e.elementDuration,easing:i.easing,reverseExit:i.reverseExit,enterFrom:r,exitTo:n,restValue:Gv}),renderer:Tv}}}},Hv={[Bh]:kv,[_h]:Uv,[Qh]:Pv,[Th]:Fv,[Dh]:$v};function Yv(i,e){const{type:t,...r}=i,n=Hv[t];if(!n)throw new Error(`Unknown preset type: ${t}`);return n.generate(r,e)}function Vv({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 A=a.time-o.time,l=A===0?0:(e-o.time)/A,u=o.easing||"linear",c=i.renderer.processor.getTargetState(o.value);return i.renderer.processor.interpolateState({easing:u,progress:l,from:c,value:a.value})}}return null}function Kv(i,e,t){const{preset:r,...n}=i;if(!r)return n;const s=Yv(r,{elementDuration:e,elementDimensions:t});return{...n,...s}}function kh({layout:i,sceneTime:e,animations:t,elementDuration:r=5,elementDimensions:n={width:100,height:100}}){var s,o,a,A,l,u,c,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:((l=(A=i==null?void 0:i.transform)==null?void 0:A.translate)==null?void 0:l.y)??0},scale:((u=i==null?void 0:i.transform)==null?void 0:u.scale)??1,rotation:((c=i==null?void 0:i.transform)==null?void 0:c.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=Kv(t,r,n);for(const C of Object.values(I)){if(!C)continue;const B=Vv({animation:C,sceneTime:e});B&&(p={...p,...B})}return p}const Wv=[];for(let i=0;i<256;++i)Wv.push((i+256).toString(16).slice(1));typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function qv(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 eo=64;function Jv(){const i=[],e={x:.5,y:.5},t=.5;for(let r=0;r<eo;r++){const n=r/eo*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 jv(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<eo;s++){const o=s/eo*2*Math.PI,a=t.x+r*Math.cos(o),A=t.y+n*Math.sin(o);e.push({x:a,y:A})}return e}function Xv(){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 Mh(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 to(i){if(i<3)throw new Error("A polygon must have at least 3 sides");const e=[],t=[];for(let l=0;l<i;l++){const u=l*2*Math.PI/i-Math.PI/2,c=Math.cos(u),h=Math.sin(u);t.push({x:c,y:h})}const r=Math.min(...t.map(l=>l.x)),n=Math.max(...t.map(l=>l.x)),s=Math.min(...t.map(l=>l.y)),o=Math.max(...t.map(l=>l.y)),a=n-r,A=o-s;for(const l of t){const u=(l.x-r)/a,c=(l.y-s)/A;e.push({x:u,y:c})}return e}function Fh(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 zv(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),A=.5+o*Math.sin(s);t.push({x:a,y:A})}return t}function Zv(i="isosceles",e={}){switch(i){case"equilateral":return ey();case"isosceles":return Ph(e.baseAngle??60);case"right":return ty(e.rightAnglePosition??"bottom-left");case"scalene":return iy(e.angles??[60,60,60])}}function ey(){return[{x:.5,y:0},{x:0,y:1},{x:1,y:1}]}function Ph(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 ty(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 iy(i){return Ph(i[0])}function ry(i={},e=1){const{type:t="rectangle",customPolygon:r,parallelogram:n,triangle:s,rhombus:o,arrow:a,star:A,regularPolygon:l}=i;switch(t){case"rectangle":return Mh(0,e);case"parallelogram":return Mh((n==null?void 0:n.angle)??30,e);case"triangle":return Zv((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 Fh((o==null?void 0:o.angle)??90);case"diamond":return Fh(90);case"pentagon":return to(5);case"hexagon":return to(6);case"octagon":return to(8);case"star":return zv((A==null?void 0:A.points)??5,(A==null?void 0:A.innerRadius)??.4);case"arrow":return qv((a==null?void 0:a.shaftRatio)??.4,(a==null?void 0:a.headRatio)??.4);case"heart":return Xv();case"circle":return Jv();case"ellipse":return jv(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 to((l==null?void 0:l.sides)??6)}}function ny(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,A=e[s].y,l=e[o].x,u=e[o].y;A>n!=u>n&&r<(l-a)*(n-A)/(u-A)+a&&(t=!t)}return t}function sy(i,e){let t=1,r=0;const n=200;for(let s=0;s<=n;s++){const o=s/n;ny({x:o,y:i},e)&&(t=Math.min(t,o),r=Math.max(r,o))}return r>=t?{left:t,right:r}:null}function oy(i){const e=Math.min(...i.map(A=>A.y)),t=Math.max(...i.map(A=>A.y));let r={x:0,y:0,width:0,height:0},n=0;const s=200,o=(t-e)/s,a=[];for(let A=0;A<=s;A++){const l=e+A*o;a.push({y:l,span:sy(l,i)})}for(let A=0;A<a.length-1;A++){const l=a[A].y;for(let u=A+1;u<a.length;u++){const h=a[u].y-l;let d=0,f=1,g=!0;const p=Math.min(5,u-A+1);for(let I=0;I<p;I++){const C=A+Math.floor(I/(p-1)*(u-A)),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:l,width:I,height:h})}}}return r}function ay(i,e=1){const t=ry(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=oy(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 ly(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 Ay(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 cy(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 uy(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 hy=dr(()=>mu.loadYoga());function Nh(i,e,{layout:t,scale:r=1}){const{position:n="relative",inset:s,width:o,height:a,minWidth:A,minHeight:l,maxWidth:u,maxHeight:c,flex:h,flexGrow:d,flexShrink:f,gap:g,margin:p,padding:I,direction:C="column",align:B="start",alignSelf:y,justify:Q="start"}=t??{},_={static:i.POSITION_TYPE_STATIC,relative:i.POSITION_TYPE_RELATIVE,absolute:i.POSITION_TYPE_ABSOLUTE};if(e.setPositionType(_[n]),typeof s<"u"){const{top:D,right:K,bottom:X,left:ie}=Ay(s,r);typeof D<"u"&&e.setPosition(i.EDGE_TOP,D),typeof K<"u"&&e.setPosition(i.EDGE_RIGHT,K),typeof X<"u"&&e.setPosition(i.EDGE_BOTTOM,X),typeof ie<"u"&&e.setPosition(i.EDGE_LEFT,ie)}const k={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(k[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 U={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(U[Q]),typeof p<"u"){const{top:D,right:K,bottom:X,left:ie}=cy(p,r);e.setMargin(i.EDGE_TOP,D),e.setMargin(i.EDGE_RIGHT,K),e.setMargin(i.EDGE_BOTTOM,X),e.setMargin(i.EDGE_LEFT,ie)}if(typeof I<"u"){const{top:D,right:K,bottom:X,left:ie}=uy(I,r);e.setPadding(i.EDGE_TOP,D),e.setPadding(i.EDGE_RIGHT,K),e.setPadding(i.EDGE_BOTTOM,X),e.setPadding(i.EDGE_LEFT,ie)}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 A<"u"&&e.setMinWidth(typeof A=="number"?A*r:A),typeof l<"u"&&e.setMinHeight(typeof l=="number"?l*r:l),typeof u<"u"&&e.setMaxWidth(typeof u=="number"?u*r:u),typeof c<"u"&&e.setMaxHeight(typeof c=="number"?c*r:c)}async function Oh({id:i,yoga:e,index:t,parent:r,element:n,resolvers:s}){var o,a,A;const{layout:l={},config:u={},options:c={},renderer:h}=n,d=e.Node.create();Nh(e,d,{layout:l}),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:c}))??null:f=await((a=s[h.type])==null?void 0:a.call(s,{id:i,config:u,options:c}))??null);const g=[];for await(const[p,I]of((A=n.children)==null?void 0:A.entries())??[])g.push(await Oh({id:i,yoga:e,index:p,parent:d,element:I,resolvers:s}));return{node:d,radius:ly(l.radius),element:n,renderer:h,config:u,options:c,dependencies:f,childNodes:g}}function Uh(i,e,t=0,r=0){const{top:n,left:s}=i.getComputedLayout(),{top:o,left:a,width:A,height:l}=e.node.getComputedLayout(),u=t+a,c=r+o,h=e.childNodes.map(d=>Uh(i,d,u,c));return{...e,x:s+u,y:n+c,width:A,height:l,childNodes:h}}async function hl({yoga:i,root:e,tree:t,measureCanvas:r}){for await(const{node:n,options:s,dependencies:o,renderer:a,childNodes:A}of t){if(a){const{width:l,height:u}=a;if(l&&r){e.calculateLayout();const c=await l({node:n,options:s,dependencies:o,measureCanvas:r});c&&n.setWidth(c)}if(u&&r){e.calculateLayout();const c=await u({node:n,options:s,dependencies:o,measureCanvas:r});c&&n.setHeight(c)}if((s==null?void 0:s.format)==="crop"&&(o!=null&&o.aspectRatio)&&(a.type==="video"||a.type==="image")){const c=s.crop;if(!c||c.x===0&&c.y===0&&c.width===1&&c.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 hl({yoga:i,root:e,tree:A,measureCanvas:r}),s!=null&&s.shape){const c=n.getComputedWidth(),h=n.getComputedHeight(),d=ay(s.shape,c/h);n.setPadding(i.EDGE_TOP,d.top*h),n.setPadding(i.EDGE_RIGHT,d.right*c),n.setPadding(i.EDGE_BOTTOM,d.bottom*h),n.setPadding(i.EDGE_LEFT,d.left*c)}}e.calculateLayout(),await hl({yoga:i,root:e,tree:A,measureCanvas:r})}}async function Gh({id:i,root:e,resolvers:t,measureCanvas:r}){const n=await hy(),s=n.Node.create();Nh(n,s,{layout:e.layout});const o=await Oh({id:i,yoga:n,index:0,parent:s,element:e.element,resolvers:t});await hl({yoga:n,root:s,tree:[o],measureCanvas:r});const{top:a,left:A,width:l,height:u}=s.getComputedLayout(),c={root:{x:A,y:a,width:l,height:u},node:Uh(s,o)};return s.freeRecursive(),c}const $h=/(?<value>\d+\.?\d*)(?=px)/;function dl({words:i,spaceMetrics:e,strokeWidth:t=0}){return i.reduce((r,n,s)=>{const o=n.metrics.width+t,a=s<i.length-1?e.width:0;return r+o+a},0)}Wc(({context:i,font:e,fontSizes:t,words:r,maxW:n=1/0,strokeWidth:s=0,letterSpacing:o=0})=>{try{i.save(),i.letterSpacing=`${o}px`,i.font=e.replace($h,t[0].toString());const a=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");if(r.length<=0)return[];const A=i.measureText(r[0].text);return r.slice(1).reduce((l,u)=>{const c=l[l.length-1],h=i.measureText(u.text),d={...u,metrics:h},f=[...c.words,d],g=dl({strokeWidth:s,words:f,spaceMetrics:c.spaceMetrics});if(g>n){const p=t[l.length%t.length];i.font=e.replace($h,p.toString());const I=i.measureText(" "),C=i.measureText(u.text),B=[{...u,metrics:C}],y=i.measureText("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");l=[...l,{allMetrics:y,spaceMetrics:I,lineWidth:dl({strokeWidth:s,spaceMetrics:I,words:B}),font:i.font,words:B,lineHeight:y.actualBoundingBoxAscent+y.actualBoundingBoxDescent+s}]}else l[l.length-1]={...c,lineWidth:g,words:f};return l},[{allMetrics:a,lineWidth:dl({strokeWidth:s,words:[{...r[0],metrics:A}],spaceMetrics:i.measureText(" ")}),lineHeight:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent+s,font:i.font,words:[{...r[0],metrics:A}],spaceMetrics:i.measureText(" ")}])}finally{i.restore()}},{cacheKey:([{font:i,fontSizes:e,words:t,maxW:r,strokeWidth:n,letterSpacing:s}])=>`${i}_${JSON.stringify(e)}_${JSON.stringify(t)}_${r}_${n}_${s}`});function dy(i){return i.slice(0,1).toUpperCase()+i.slice(1)}const Hh=[{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"}];function fy({text:i,font:e}){let t=e;return Hh.forEach(({family:r,regex:n})=>{n.exec(i)&&(t+=`, ${r}`)}),t}Object.keys(yh).map(i=>({label:dy(i),value:i,data:i}));function Yh(){return document.createElement("canvas")}function Yt(i){let e=0;for(const t of i)Array.isArray(t)?e+=Yt(t):e+=t;return e}function io(i){return i.map(({type:e,duration:t},r)=>{var n,s,o,a;if(e==="transition"){const A=((n=i[r-2])==null?void 0:n.type)==="transition"?i[r-2]:null,l=((s=i[r-1])==null?void 0:s.duration)??1/0,u=((o=i[r+1])==null?void 0:o.duration)??1/0,c=((a=i[r+2])==null?void 0:a.type)==="transition"?i[r+2]:null;return Math.min(A?l/2:l,t,c?u/2:u)*-1}return t})}function gy(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 py(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,'\\"')}Wm.filters.define("parse",i=>typeof i>"u"?null:typeof i=="string"?`"${py(i)}"`:gy(i)||Array.isArray(i)?JSON.stringify(i):i);function my(i){return i.some(({type:e})=>e==="text")}function Ey(i){return i.some(({type:e})=>e==="caption")}function Iy(i){return i.some(({type:e})=>e==="audio")}function vy(i){return i.some(({type:e})=>e==="video"||e==="image")}function fl(i){return i.type==="audio"}const yy="3";async function Cy({scene:i,start:e=0}){const{id:t,root:r,duration:n}=i,s=await Gh({id:t,root:r});return{type:i.type,start:e,duration:n,layout:s,id:i.id,config:i}}async function By({track:i}){const e=io(i),t=await Promise.all(i.reduce((s,o,a)=>{if(o.type!=="audio")return s;const A=Yt(e.slice(0,a));return s.push(Cy({scene:o,start:A})),s},[])),r=i.reduce((s,o,a)=>{if(o.type!=="gap")return s;const A=Yt(e.slice(0,a));return s.push({type:o.type,id:o.id,start:A,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 Vh({node:i,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:n=1,parentTransform:s,debug:o=!1,override:a}){var A,l,u,c,h;const d=e.sceneCanvas.getContext("2d");if(d){d.save(),d.setTransform(s);const f=(a==null?void 0:a.rotation)!=null&&((A=i.element.layout)!=null&&A.transform)?{...i.element.layout,transform:{...i.element.layout.transform,rotation:a.rotation}}:i.element.layout,g=kh({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:Q}=g,_=i.width*y.widthRatio,k=i.height*y.heightRatio;if(d.globalAlpha=p*n,(I.x||I.y)&&d.translate(I.x,I.y),(C!==1||Q!==0)&&(d.translate(i.x+_/2,i.y+k/2),d.scale(C,C),d.rotate(Q*Math.PI/180),d.translate(-(i.x+_/2),-(i.y+k/2))),B){d.beginPath();const D={x:i.x+B.x*_,y:i.y+B.y*k,width:B.width*_,height:B.height*k};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,_,k),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&&((l=i.options)!=null&&l.font)?{font:{...i.options.font,size:a.fontSize}}:{}}:i.options,U=(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=(c=i.renderer)==null?void 0:c.render)==null?void 0:h.call(c,{canvases:e,sceneTime:t,dx:i.x,dy:i.y,dw:_,dh:k,radius:i.radius,options:F,dependencies:U}));for await(const D of i.childNodes)await Vh({debug:o,node:D,canvases:e,sceneTime:t,sceneDuration:r,parentOpacity:d.globalAlpha,parentTransform:d.getTransform(),override:a});d.restore()}}async function Ty({layout:i,canvases:e,sceneTime:t,sceneDuration:r,debug:n=!1,override:s}){const{node:o}=i;await Vh({debug:n,node:o,canvases:e,sceneDuration:r,sceneTime:t,override:s})}async function ro({debug:i=!1,scene:e,start:t=0,resolvers:r,rootWidth:n,rootHeight:s,canvasFactory:o=Yh}){var a,A;const{id:l,x:u,y:c,width:h,height:d,root:f,duration:g}=e,p=o(),I=o(),C=o(),B=o(),y=o(),Q=await Gh({id:l,root:{...f,layout:{...f.layout,width:n,height:s},element:{...f.element,layout:{...f.element.layout,...typeof u=="number"&&typeof c=="number"?{position:"absolute",inset:{top:c,left:u}}:{},width:h??((a=f.element.layout)==null?void 0:a.width),height:d??((A=f.element.layout)==null?void 0:A.height)}}},resolvers:r,measureCanvas:y}),_=async(k,F)=>{const U=Math.max(0,k-t);p.width=p.height=0,p.width=n,p.height=s,await Ty({debug:i,layout:Q,sceneTime:U,sceneDuration:g,canvases:{sceneCanvas:p,cropCanvas:I,letterboxCanvas:C,posterCanvas:B},override:F})};return{id:l,type:e.type,start:t,duration:g,layout:Q,sceneCanvas:p,draw:_,config:e,childScenes:[]}}async function Sy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=io(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Yt(o.slice(0,d));return h.type==="caption"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Yt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Yt(o.slice(0,d))-f;return c.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)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"caption",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}function by({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 c=e[u];fl(c)||c.scenes.some(h=>s.sceneIds.includes(h.id))&&a.push(u)}let A,l=1/0;for(let u=0;u<i.length;u++){if(o===u)continue;const c=t[u];s.sceneIds.every(d=>c.has(d))&&c.size>t[o].size&&c.size<l&&(A=i[u].id,l=c.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:A,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 xy({group:i,currentTime:e,activeMembers:t,fallbackDimensions:r}){if(!i.animations||t.length===0)return null;const n=Math.min(...t.map(c=>c.start)),o=Math.max(...t.map(c=>c.end))-n,a=Math.max(0,e-n),A=i.bounds,l=(A==null?void 0:A.width)??r.width,u=(A==null?void 0:A.height)??r.height;return kh({sceneTime:a,animations:i.animations,elementDuration:o,elementDimensions:{width:l,height:u}})}function Kh({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,A=(n==null?void 0:n.height)??r.height,{opacity:l,translation:u,scale:c,clip:h,rotation:d}=e;if(t.globalAlpha*=l,(u.x||u.y)&&t.translate(u.x,u.y),c!==1||d!==0){const f=s+a/2,g=o+A/2;t.translate(f,g),t.scale(c,c),t.rotate(d*Math.PI/180),t.translate(-f,-g)}h&&(t.beginPath(),t.rect(s+h.x*a,o+h.y*A,h.width*a,h.height*A),t.clip())}async function Qy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=io(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Yt(o.slice(0,d));return h.type==="video"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),h.type==="image"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Yt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Yt(o.slice(0,d))-f;return c.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)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"picture",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(0,...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}async function wy({debug:i=!1,track:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}){const o=io(e),a=await Promise.all(e.reduce((c,h,d)=>{const f=Yt(o.slice(0,d));return h.type==="text"&&c.push(ro({debug:i,scene:h,start:f,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s})),c},[])),A=e.reduce((c,h,d)=>{if(h.type!=="gap")return c;const f=Yt(o.slice(0,d));return c.push({type:h.type,id:h.id,start:f,config:h,duration:h.duration}),c},[]),l=e.reduce((c,h,d)=>{if(h.type!=="transition")return c;const f=h.duration,g=Yt(o.slice(0,d))-f;return c.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)})}),c},[]),u=e.map(({id:c})=>a.find(({id:h})=>h===c)??A.find(({id:h})=>h===c)??l.find(({id:h})=>h===c)).filter(Boolean);return{type:"text",scenes:a,gapScenes:A,transitions:l,mergedScenes:u,duration:Math.max(...u.map(({start:c,duration:h})=>c+h)),trackCanvas:s()}}const _y=(((vh=Ih)==null?void 0:vh.default)??Ih).reduce((i,e)=>(i[e.name]=e,i),{});function Ry(i,e){return i.has(e)||i.set(e,{buffer:null,transitions:{},fromTexture:null,toTexture:null}),i.get(e)}function Dy({name:i,to:e,from:t,progress:r,width:n,height:s,glContext:o,contextResources:a,returnPixels:A=!0}){var l,u,c;const h=Ry(a,o);if(o.disable(o.DEPTH_TEST),h.buffer?o.bindBuffer(o.ARRAY_BUFFER,h.buffer):(h.buffer=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h.buffer),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,-1,4,4,-1]),o.STATIC_DRAW)),o.viewport(0,0,n,s),h.fromTexture?h.fromTexture.setPixels(t):(h.fromTexture=(((l=qs)==null?void 0:l.default)??qs)(o,t),h.fromTexture.minFilter=o.LINEAR,h.fromTexture.magFilter=o.LINEAR),h.toTexture?h.toTexture.setPixels(e):(h.toTexture=(((u=qs)==null?void 0:u.default)??qs)(o,e),h.toTexture.minFilter=o.LINEAR,h.toTexture.magFilter=o.LINEAR),h.transitions[i]||(h.transitions[i]=(((c=Eh)==null?void 0:c.default)??Eh)(o,_y[i])),h.transitions[i].draw(r,h.fromTexture,h.toTexture,n,s),!A)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 Ly(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 ky({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),Dy({name:i,to:e,from:t,progress:r,width:n.width,height:n.height,glContext:o,contextResources:s,returnPixels:!1}))}async function Wh({debug:i=!1,config:e,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s=Yh,drawTransition:o=ky}){var a;const A=new Map,l=await Promise.all(e.tracks.map(async I=>{if(vy(I))return{...await Qy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(my(I))return{...await wy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Ey(I))return{...await Sy({debug:i,track:I,resolvers:t,rootWidth:r,rootHeight:n,canvasFactory:s}),config:I};if(Iy(I))return{...await By({track:I}),config:I};throw new Error("Unknown track type")})),u=(a=e.groups)!=null&&a.length?by({groups:e.groups,tracks:l}):[],c=new Map,h=[...u].sort((I,C)=>I.depth-C.depth);for(const I of h)for(const C of I.sceneIds)c.set(C,I);const d=new Map(u.map(I=>[I.id,I]));function f(I){const C=[];let B=c.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 Q=I.getContext("2d");if(!Q)return;Q.globalAlpha=1,Q.globalCompositeOperation="source-over",Q.clearRect(0,0,I.width,I.height),Q.save(),Q.fillStyle="black",Q.fillRect(0,0,I.width,I.height),Q.restore();const _=new Map;for(const D of l)if(!fl(D))for(const K of D.scenes){if(C<K.start||C>=K.start+K.duration)continue;const X=K.layout,ie=X==null?void 0:X.node,re={start:K.start,end:K.start+K.duration,x:(ie==null?void 0:ie.x)??0,y:(ie==null?void 0:ie.y)??0,width:(ie==null?void 0:ie.width)??I.width,height:(ie==null?void 0:ie.height)??I.height};let L=c.get(K.id);for(;L;)L.animations&&(_.has(L.id)||_.set(L.id,[]),_.get(L.id).push(re)),L=L.parentGroupId?d.get(L.parentGroupId):void 0}const k=new Map;function F(D){if(k.has(D.id))return k.get(D.id);const K=xy({group:D,currentTime:C,activeMembers:_.get(D.id)??[],fallbackDimensions:{width:I.width,height:I.height}});return k.set(D.id,K),K}function U(D,K,X){const ie=f({id:X});if(ie.length===0){D.drawImage(K,0,0,K.width,K.height);return}D.save();for(let re=ie.length-1;re>=0;re--){const L=ie[re],O=F(L);O&&Kh({group:L,animationState:O,targetCtx:D,fallbackDimensions:{width:I.width,height:I.height}})}D.drawImage(K,0,0,K.width,K.height),D.restore()}for(let D=0;D<l.length;D++){if(y!=null&&y.aborted)return;const K=l[D];if(fl(K))continue;const{scenes:X,transitions:ie,trackCanvas:re}=K;re.width=re.height=0,re.width=I.width,re.height=I.height;const L=re.getContext("2d");if(!L)continue;const O=X.filter(({start:x,duration:M})=>C>=x&&C<x+M);if(O.length===0)continue;const W=ie.find(({start:x,duration:M})=>C>=x&&C<x+M),R=!!(W&&W.to&&W.from&&W.duration>0);for await(const x of O){if(y!=null&&y.aborted)return;const{sceneCanvas:M,draw:V,id:H}=x;if(await(V==null?void 0:V(C,B==null?void 0:B.get(H))),y!=null&&y.aborted)return;R&&(W.to.id===H||W.from.id===H)||U(L,M,H)}if(R){const{name:x,to:M,from:V,duration:H,transitionCanvas:te}=W;te.width=te.height=0,te.width=re.width,te.height=re.height;const ne=Math.min(1,Math.max(0,(C-M.start)/H));if(await o({name:x,progress:ne,contextResources:A,to:M.sceneCanvas,from:V.sceneCanvas,canvas:te}),y!=null&&y.aborted)return;const he=new Set(f({id:V.id})),ge=new Set(f({id:M.id})),Ce=[...he].filter(_e=>ge.has(_e)).sort((_e,fe)=>_e.depth-fe.depth);if(Ce.length===0)L.drawImage(te,0,0,te.width,te.height);else{L.save();for(const _e of Ce){const fe=F(_e);fe&&Kh({group:_e,animationState:fe,targetCtx:L,fallbackDimensions:{width:I.width,height:I.height}})}L.drawImage(te,0,0,te.width,te.height),L.restore()}}Q.drawImage(re,0,0,re.width,re.height)}},cleanup:()=>{Ly(A)},tracks:l,groups:u,aspectRatio:e.aspectRatio,transcriptions:e.transcriptions,duration:Math.max(...l.map(({duration:I})=>I))}}const My={version:"8.1.0"};function Fy(i){const{publicApiUrl:e}=bs(i),t=ur();return navigator.sendBeacon(`${e}/api/visitor`,JSON.stringify({visitorId:t})),t}function Py(i){var s,o,a,A,l,u,c,h,d,f,g,p;if(typeof window>"u")return{client:null,tab:null,request:ur()};let e=(o=(s=window.localStorage)==null?void 0:s.getItem)==null?void 0:o.call(s,"vouch-uid-visitor"),t=(A=(a=window.localStorage)==null?void 0:a.getItem)==null?void 0:A.call(a,"vouch-uid-client"),r=(u=(l=window.sessionStorage)==null?void 0:l.getItem)==null?void 0:u.call(l,"vouch-uid-tab");const n=ur();return e||(e=Fy(i),(h=(c=window.localStorage)==null?void 0:c.setItem)==null||h.call(c,"vouch-uid-visitor",e)),t||(t=ur(),(f=(d=window.localStorage)==null?void 0:d.setItem)==null||f.call(d,"vouch-uid-client",t)),r||(r=ur(),(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 Ny(i,e){return i&&"vouchId"in i?i.vouchId:(e==null?void 0:e.id)??null}function Oy(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 A=o.toLowerCase().replace(/[-_][a-z0-9]/g,l=>l.slice(-1).toUpperCase());r[A]=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:My.version,templateVersion:yy,...r}}const qh=1;class Uy{constructor(e){this._batchedEvents=[],this._hasPlayed=!1,this._hasLoaded={},this._answersViewed={},this._streamStartTime={},this._streamLatestTime={},this._currentlyPlayingVideo=null,this._createTrackingEvent=(t,r)=>{const n=Ny(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}=bs(this.host.env),{client:r,tab:n,request:s,visitor:o}=Py(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":Oy(this.host.trackingSource)}})),this._batchedEvents=[]},this._streamEnded=()=>{if(this._currentlyPlayingVideo){const{id:t,key:r}=this._currentlyPlayingVideo;this._streamLatestTime[r]>this._streamStartTime[r]+qh&&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]+qh&&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 gl={exports:{}};(function(i,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Gi<"u"&&Gi,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 Gi<"u"&&Gi||{},A={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(L){return L&&DataView.prototype.isPrototypeOf(L)}if(A.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(L){return L&&u.indexOf(Object.prototype.toString.call(L))>-1};function h(L){if(typeof L!="string"&&(L=String(L)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(L)||L==="")throw new TypeError('Invalid character in header field name: "'+L+'"');return L.toLowerCase()}function d(L){return typeof L!="string"&&(L=String(L)),L}function f(L){var O={next:function(){var W=L.shift();return{done:W===void 0,value:W}}};return A.iterable&&(O[Symbol.iterator]=function(){return O}),O}function g(L){this.map={},L instanceof g?L.forEach(function(O,W){this.append(W,O)},this):Array.isArray(L)?L.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):L&&Object.getOwnPropertyNames(L).forEach(function(O){this.append(O,L[O])},this)}g.prototype.append=function(L,O){L=h(L),O=d(O);var W=this.map[L];this.map[L]=W?W+", "+O:O},g.prototype.delete=function(L){delete this.map[h(L)]},g.prototype.get=function(L){return L=h(L),this.has(L)?this.map[L]:null},g.prototype.has=function(L){return this.map.hasOwnProperty(h(L))},g.prototype.set=function(L,O){this.map[h(L)]=d(O)},g.prototype.forEach=function(L,O){for(var W in this.map)this.map.hasOwnProperty(W)&&L.call(O,this.map[W],W,this)},g.prototype.keys=function(){var L=[];return this.forEach(function(O,W){L.push(W)}),f(L)},g.prototype.values=function(){var L=[];return this.forEach(function(O){L.push(O)}),f(L)},g.prototype.entries=function(){var L=[];return this.forEach(function(O,W){L.push([W,O])}),f(L)},A.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function p(L){if(!L._noBody){if(L.bodyUsed)return Promise.reject(new TypeError("Already read"));L.bodyUsed=!0}}function I(L){return new Promise(function(O,W){L.onload=function(){O(L.result)},L.onerror=function(){W(L.error)}})}function C(L){var O=new FileReader,W=I(O);return O.readAsArrayBuffer(L),W}function B(L){var O=new FileReader,W=I(O),R=/charset=([A-Za-z0-9_-]+)/.exec(L.type),x=R?R[1]:"utf-8";return O.readAsText(L,x),W}function y(L){for(var O=new Uint8Array(L),W=new Array(O.length),R=0;R<O.length;R++)W[R]=String.fromCharCode(O[R]);return W.join("")}function Q(L){if(L.slice)return L.slice(0);var O=new Uint8Array(L.byteLength);return O.set(new Uint8Array(L)),O.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(L){this.bodyUsed=this.bodyUsed,this._bodyInit=L,L?typeof L=="string"?this._bodyText=L:A.blob&&Blob.prototype.isPrototypeOf(L)?this._bodyBlob=L:A.formData&&FormData.prototype.isPrototypeOf(L)?this._bodyFormData=L:A.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)?this._bodyText=L.toString():A.arrayBuffer&&A.blob&&l(L)?(this._bodyArrayBuffer=Q(L.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):A.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(L)||c(L))?this._bodyArrayBuffer=Q(L):this._bodyText=L=Object.prototype.toString.call(L):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof L=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):A.searchParams&&URLSearchParams.prototype.isPrototypeOf(L)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},A.blob&&(this.blob=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var L=p(this);return L||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(A.blob)return this.blob().then(C);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var L=p(this);if(L)return L;if(this._bodyBlob)return B(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},A.formData&&(this.formData=function(){return this.text().then(D)}),this.json=function(){return this.text().then(JSON.parse)},this}var k=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(L){var O=L.toUpperCase();return k.indexOf(O)>-1?O:L}function U(L,O){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');O=O||{};var W=O.body;if(L instanceof U){if(L.bodyUsed)throw new TypeError("Already read");this.url=L.url,this.credentials=L.credentials,O.headers||(this.headers=new g(L.headers)),this.method=L.method,this.mode=L.mode,this.signal=L.signal,!W&&L._bodyInit!=null&&(W=L._bodyInit,L.bodyUsed=!0)}else this.url=String(L);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")&&W)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(W),(this.method==="GET"||this.method==="HEAD")&&(O.cache==="no-store"||O.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var x=/\?/;this.url+=(x.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function D(L){var O=new FormData;return L.trim().split("&").forEach(function(W){if(W){var R=W.split("="),x=R.shift().replace(/\+/g," "),M=R.join("=").replace(/\+/g," ");O.append(decodeURIComponent(x),decodeURIComponent(M))}}),O}function K(L){var O=new g,W=L.replace(/\r?\n[\t ]+/g," ");return W.split("\r").map(function(R){return R.indexOf(`
|
|
2476
2476
|
`)===0?R.substr(1,R.length):R}).forEach(function(R){var x=R.split(":"),M=x.shift().trim();if(M){var V=x.join(":").trim();try{O.append(M,V)}catch(H){console.warn("Response "+H.message)}}}),O}_.call(U.prototype);function X(L,O){if(!(this instanceof X))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(L)}_.call(X.prototype),X.prototype.clone=function(){return new X(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},X.error=function(){var L=new X(null,{status:200,statusText:""});return L.ok=!1,L.status=0,L.type="error",L};var ie=[301,302,303,307,308];X.redirect=function(L,O){if(ie.indexOf(O)===-1)throw new RangeError("Invalid status code");return new X(null,{status:O,headers:{location:L}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(O,W){this.message=O,this.name=W;var R=Error(O);this.stack=R.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function re(L,O){return new Promise(function(W,R){var x=new U(L,O);if(x.signal&&x.signal.aborted)return R(new o.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function V(){M.abort()}M.onload=function(){var ne={statusText:M.statusText,headers:K(M.getAllResponseHeaders()||"")};x.url.indexOf("file://")===0&&(M.status<200||M.status>599)?ne.status=200:ne.status=M.status,ne.url="responseURL"in M?M.responseURL:ne.headers.get("X-Request-URL");var he="response"in M?M.response:M.responseText;setTimeout(function(){W(new X(he,ne))},0)},M.onerror=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){R(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){R(new o.DOMException("Aborted","AbortError"))},0)};function H(ne){try{return ne===""&&a.location.href?a.location.href:ne}catch{return ne}}if(M.open(x.method,H(x.url),!0),x.credentials==="include"?M.withCredentials=!0:x.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(A.blob?M.responseType="blob":A.arrayBuffer&&(M.responseType="arraybuffer")),O&&typeof O.headers=="object"&&!(O.headers instanceof g||a.Headers&&O.headers instanceof a.Headers)){var te=[];Object.getOwnPropertyNames(O.headers).forEach(function(ne){te.push(h(ne)),M.setRequestHeader(ne,d(O.headers[ne]))}),x.headers.forEach(function(ne,he){te.indexOf(he)===-1&&M.setRequestHeader(he,ne)})}else x.headers.forEach(function(ne,he){M.setRequestHeader(he,ne)});x.signal&&(x.signal.addEventListener("abort",V),M.onreadystatechange=function(){M.readyState===4&&x.signal.removeEventListener("abort",V)}),M.send(typeof x._bodyInit>"u"?null:x._bodyInit)})}return re.polyfill=!0,a.fetch||(a.fetch=re,a.Headers=g,a.Request=U,a.Response=X),o.Headers=g,o.Request=U,o.Response=X,o.fetch=re,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})(gl,gl.exports);var Gy=gl.exports;const Jh=Da(Gy);async function $y(i){var e;try{if((e=await Jh(i,{method:"HEAD"}))!=null&&e.ok)return i}catch{return}}async function pl({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=>$y(a)),o=(await Promise.all(s)).find(Boolean);o&&(n=o)}return n}async function Hy(i){try{return(await Jh(i)).text()}catch{return null}}async function Yy(i){return i=i.trim(),i.startsWith("http")||i.startsWith("blob:")?Hy(i):i}function Vy(i){if(typeof i=="string"){const[e,t]=i.split(":");return parseFloat(e)/parseFloat(t)}return i}const Ky=dr(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},A=(n&&a[n])??i;return A?Yy(A):null},{cacheKey:([i,{language:e}])=>JSON.stringify({...i,language:e})});function Wy(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 qy=dr(async i=>{var e,t,r,n,s,o,a,A,l,u,c;const[h,d,f]=await Promise.all([pl({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]}),pl({sources:[(o=(s=i==null?void 0:i.answer)==null?void 0:s.media)==null?void 0:o.playlist]}),pl({sources:[((A=(a=i==null?void 0:i.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((c=(u=(l=i==null?void 0:i.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:c.xs)]})]);return{src:h,playlist:d,preview:f}},{cacheKey:([i])=>{var e,t,r,n,s,o,a,A,l,u,c;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:((A=(a=i==null?void 0:i.answer)==null?void 0:a.media)==null?void 0:A.reducedQuality)??((c=(u=(l=i==null?void 0:i.answer)==null?void 0:l.media)==null?void 0:u.videos)==null?void 0:c.xs)})}});function jh(i){var e,t,r,n,s,o,a,A,l,u,c,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=((A=(a=(o=i==null?void 0:i.answer)==null?void 0:o.contact)==null?void 0:a.client)==null?void 0:A.name)==="Not Supplied"?"":((h=(c=(u=(l=i==null?void 0:i.answer)==null?void 0:l.contact)==null?void 0:u.client)==null?void 0:c.name)==null?void 0:h.trim())??"",[g,p]=d.split(" ");return{name:d,firstName:g,lastName:p,companyName:f}}function Jy(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 jy(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((A,l)=>{var u;return((u=l==null?void 0:l.answer)==null?void 0:u.id)===o?(A??0)+1:A},0))<=1?o:`${o}-${t}`}async function ml({data:i,rootData:e,index:t},r){var n,s,o,a,A,l,u,c,h,d,f,g,p,I,C,B,y,Q,_,k,F,U,D,K,X;const ie=(n=e==null?void 0:e.answer)==null?void 0:n.metadata;(ie==null?void 0:ie.aspectRatio)!=null&&(ie.aspectRatio=Vy(ie.aspectRatio));const[re,L,O]=await Promise.all([jy(i,e,t),qy(e),Ky({original:((o=(s=e==null?void 0:e.answer)==null?void 0:s.media)==null?void 0:o.captions)??((A=(a=e==null?void 0:e.answer)==null?void 0:a.captions)==null?void 0:A.current),translation:((u=(l=e==null?void 0:e.answer)==null?void 0:l.media)==null?void 0:u.translation)??((h=(c=e==null?void 0:e.answer)==null?void 0:c.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)]),W=jh(e),R=Jy(e);return{...L,...W,...R,key:re,captions:O,wordTimings:Wy((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?((k=(_=(Q=(y=i==null?void 0:i.questions)==null?void 0:y.items)==null?void 0:Q[t-1])==null?void 0:_.answer)==null?void 0:k.label)??((D=(U=(F=i==null?void 0:i.questions)==null?void 0:F.items)==null?void 0:U[t-1])==null?void 0:D.title)??null:null,isFirstInstanceOfName:t?((X=(K=i==null?void 0:i.questions)==null?void 0:K.items)==null?void 0:X.findIndex(x=>jh(x).name===W.name))===t:!0}}const no={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 Xy({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,A,l,u,c;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=(c=(u=(l=(A=n==null?void 0:n.answer)==null?void 0:A.transcription)==null?void 0:l.translation)==null?void 0:u.language)==null?void 0:c.split("-")[0];return h&&no[h]&&!r.find(f=>f.value===h)&&r.push({value:h,label:no[h]}),d&&no[d]&&!r.find(f=>f.value===d)&&r.push({value:d,label:no[d]}),r},[]))??[]}/**
|
|
2477
2477
|
* @license
|
|
2478
2478
|
* Copyright 2018 Google LLC
|