UNPKG

@dotlottie/player-component

Version:

dotLottie animation player web component.

7 lines (6 loc) 1.92 MB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.DotLottiePlayer = {})); })(this, (function (exports) { 'use strict'; var ih=Object.defineProperty;var tp=Object.getOwnPropertyDescriptor;var ls=(t,e)=>()=>(t&&(e=t(t=0)),e);var fr=(t,e)=>{for(var i in e)ih(t,i,{get:e[i],enumerable:!0});};var Ri=(t,e,i,s)=>{for(var r=s>1?void 0:s?tp(e,i):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(r=(s?n(e,i,r):n(r))||r);return s&&r&&ih(e,i,r),r};function pp(t,e,i){return i||(i=e,e={}),typeof i!="function"&&ps(7),lp(t,e,[hp],function(s){return xh(lo(s.data[0],Ph(s.data[1])))},1,i)}function lo(t,e){return _h(t,{i:2},e&&e.out,e&&e.dictionary)}function fa(t,e){if(e){for(var i="",s=0;s<t.length;s+=16384)i+=String.fromCharCode.apply(null,t.subarray(s,s+16384));return i}else {if(eo)return eo.decode(t);var r=cp(t),a=r.s,i=r.r;return i.length&&ps(8),a}}function gp(t,e,i){i||(i=e,e={}),typeof i!="function"&&ps(7);var s=[],r=function(){for(var w=0;w<s.length;++w)s[w]();},a={},n=function(w,u){ah(function(){i(w,u);});};ah(function(){n=i;});for(var p=t.length-22;Gs(t,p)!=101010256;--p)if(!p||t.length-p>65558)return n(ps(13,0,1),null),r;var h=Qs(t,p+8);if(h){var y=h,P=Gs(t,p+16),c=P==4294967295||y==65535;if(c){var l=Gs(t,p-12);c=Gs(t,l)==101075792,c&&(y=h=Gs(t,l+32),P=Gs(t,l+48));}for(var E=e&&e.filter,b=function(w){var u=mp(t,P,c),f=u[0],g=u[1],_=u[2],k=u[3],z=u[4],q=u[5],W=up(t,q);P=z;var ot=function(gt,ut){gt?(r(),n(gt,null)):(ut&&(a[k]=ut),--h||n(null,a));};if(!E||E({name:k,size:g,originalSize:_,compression:f}))if(!f)ot(null,Pn(t,W,W+g));else if(f==8){var mt=t.subarray(W,W+g);if(g<32e4)try{ot(null,lo(mt,{out:new fs(_)}));}catch(gt){ot(gt,null);}else s.push(pp(mt,{size:_},ot));}else ot(ps(14,"unknown compression type "+f,1),null);else ot(null,null);},v=0;v<y;++v)b(v);}else n(null,{});return r}function yp(t){return (Array.isArray(t)?t:t.issues).reduce((e,i)=>{if(i.path){let s=i.path.map(({key:r})=>r).join(".");e.nested[s]=[...e.nested[s]||[],i.message];}else e.root=[...e.root||[],i.message];return e},{nested:{}})}function bp(t,e){return {reason:t==null?void 0:t.reason,validation:e.validation,origin:(t==null?void 0:t.origin)||"value",message:e.message,input:e.input,abortEarly:t==null?void 0:t.abortEarly,abortPipeEarly:t==null?void 0:t.abortPipeEarly}}function _p(t,e){return {reason:e,origin:t==null?void 0:t.origin,abortEarly:t==null?void 0:t.abortEarly,abortPipeEarly:t==null?void 0:t.abortPipeEarly}}function wr(t,e,i,s){if(!e||!e.length)return {output:t};let r,a,n=t;for(let p of e){let h=p(n);if(h.issue){r=r||_p(i,s);let y=bp(r,h.issue);if(a?a.push(y):a=[y],r.abortEarly||r.abortPipeEarly)break}else n=h.output;}return a?{issues:a}:{output:n}}function Hs(t,e){return !t||typeof t=="string"?[t,e]:[void 0,t]}function tr(t,e,i,s,r,a){return {issues:[{reason:e,validation:i,origin:(t==null?void 0:t.origin)||"value",message:s,input:r,issues:a,abortEarly:t==null?void 0:t.abortEarly,abortPipeEarly:t==null?void 0:t.abortPipeEarly}]}}function xp(t=[]){return {schema:"any",async:!1,_parse(e,i){return wr(e,t,i,"any")}}}function $a(t,e,i){let[s,r]=Hs(e,i);return {schema:"array",array:{item:t},async:!1,_parse(a,n){if(!Array.isArray(a))return tr(n,"type","array",s||"Invalid type",a);let p,h=[];for(let y=0;y<a.length;y++){let P=a[y],c=t._parse(P,n);if(c.issues){let l={schema:"array",input:a,key:y,value:P};for(let E of c.issues)E.path?E.path.unshift(l):E.path=[l],p==null||p.push(E);if(p||(p=c.issues),n!=null&&n.abortEarly)break}else h.push(c.output);}return p?{issues:p}:wr(h,r,n,"array")}}}function to(t,e){let[i,s]=Hs(t,e);return {schema:"boolean",async:!1,_parse(r,a){return typeof r!="boolean"?tr(a,"type","boolean",i||"Invalid type",r):wr(r,s,a,"boolean")}}}function nh(t,e){return {schema:"literal",literal:t,async:!1,_parse(i,s){return i!==t?tr(s,"type","literal",e||"Invalid type",i):{output:i}}}}function Pp(t,e){return {schema:"native_enum",nativeEnum:t,async:!1,_parse(i,s){return Object.values(t).includes(i)?{output:i}:tr(s,"type","native_enum",e||"Invalid type",i)}}}function js(t,e){let[i,s]=Hs(t,e);return {schema:"number",async:!1,_parse(r,a){return typeof r!="number"?tr(a,"type","number",i||"Invalid type",r):wr(r,s,a,"number")}}}function Ls(t,e,i){let[s,r]=Hs(e,i),a;return {schema:"object",object:t,async:!1,_parse(n,p){if(!n||typeof n!="object")return tr(p,"type","object",s||"Invalid type",n);a=a||Object.entries(t);let h,y={};for(let[P,c]of a){let l=n[P],E=c._parse(l,p);if(E.issues){let b={schema:"object",input:n,key:P,value:l};for(let v of E.issues)v.path?v.path.unshift(b):v.path=[b],h==null||h.push(v);if(h||(h=E.issues),p!=null&&p.abortEarly)break}else y[P]=E.output;}return h?{issues:h}:wr(y,r,p,"object")}}}function Ke(t){return {schema:"optional",wrapped:t,async:!1,_parse(e,i){return e===void 0?{output:e}:t._parse(e,i)}}}function Ji(t,e){let[i,s]=Hs(t,e);return {schema:"string",async:!1,_parse(r,a){return typeof r!="string"?tr(a,"type","string",i||"Invalid type",r):wr(r,s,a,"string")}}}function Sp(t,e,i,s){if(typeof e=="object"&&!Array.isArray(e)){let[n,p]=Hs(i,s);return [t,e,n,p]}let[r,a]=Hs(e,i);return [Ji(),t,r,a]}function Ap(t,e,i,s){let[r,a,n,p]=Sp(t,e,i,s);return {schema:"record",record:{key:r,value:a},async:!1,_parse(h,y){if(!h||typeof h!="object")return tr(y,"type","record",n||"Invalid type",h);let P,c={};for(let[l,E]of Object.entries(h))if(!Ep.includes(l)){let b,v=r._parse(l,{origin:"key",abortEarly:y==null?void 0:y.abortEarly,abortPipeEarly:y==null?void 0:y.abortPipeEarly});if(v.issues){b={schema:"record",input:h,key:l,value:E};for(let u of v.issues)u.path=[b],P==null||P.push(u);if(P||(P=v.issues),y!=null&&y.abortEarly)break}let w=a._parse(E,y);if(w.issues){b=b||{schema:"record",input:h,key:l,value:E};for(let u of w.issues)u.path?u.path.unshift(b):u.path=[b],P==null||P.push(u);if(P||(P=w.issues),y!=null&&y.abortEarly)break}!v.issues&&!w.issues&&(c[v.output]=w.output);}return P?{issues:P}:wr(c,p,y,"record")}}}function Cp(t,e,i){if(typeof t=="object"&&!Array.isArray(t)){let[a,n]=Hs(e,i);return [t,a,n]}let[s,r]=Hs(t,e);return [void 0,s,r]}function oh(t,e,i,s){let[r,a,n]=Cp(e,i,s);return {schema:"tuple",tuple:{items:t,rest:r},async:!1,_parse(p,h){if(!Array.isArray(p)||!r&&t.length!==p.length||r&&t.length>p.length)return tr(h,"type","tuple",a||"Invalid type",p);let y,P=[];for(let c=0;c<t.length;c++){let l=p[c],E=t[c]._parse(l,h);if(E.issues){let b={schema:"tuple",input:p,key:c,value:l};for(let v of E.issues)v.path?v.path.unshift(b):v.path=[b],y==null||y.push(v);if(y||(y=E.issues),h!=null&&h.abortEarly)break}else P[c]=E.output;}if(r)for(let c=t.length;c<p.length;c++){let l=p[c],E=r._parse(l,h);if(E.issues){let b={schema:"tuple",input:p,key:c,value:l};for(let v of E.issues)v.path?v.path.unshift(b):v.path=[b],y==null||y.push(v);if(y||(y=E.issues),h!=null&&h.abortEarly)break}else P[c]=E.output;}return y?{issues:y}:wr(P,n,h,"tuple")}}}function io(t,e){return {schema:"union",union:t,async:!1,_parse(i,s){let r,a;for(let n of t){let p=n._parse(i,s);if(p.issues)if(r)for(let h of p.issues)r.push(h);else r=p.issues;else {a=[p.output];break}}return a?{output:a[0]}:tr(s,"type","union",e||"Invalid type",i,r)}}}function Xa(t,e,i){let[s,r]=Hs(e,i);return Ls(t.reduce((a,n)=>({...a,...n.object}),{}),s,r)}function kp(t,e,i,s){let[r,a]=Hs(i,s);return Ls(Object.entries(t.object).reduce((n,[p,h])=>e.includes(p)?n:{...n,[p]:h},{}),r,a)}function Tp(t,e,i){let s=t._parse(e,i);return s.issues?{success:!1,error:new vp(s.issues),issues:s.issues}:{success:!0,data:s.output,output:s.output}}function so(t,e){return i=>i>t?{issue:{validation:"max_value",message:e||"Invalid value",input:i}}:{output:i}}function ro(t,e){return i=>i<t?{issue:{validation:"min_value",message:e||"Invalid value",input:i}}:{output:i}}function Ch(t){let e;if(typeof window>"u")e=Buffer.from(t).toString("base64");else {let i=Array.prototype.map.call(t,s=>String.fromCharCode(s)).join("");e=window.btoa(i);}return `data:${ef(e)};base64,${e}`}function lh(t){return "w"in t&&"h"in t&&!("xt"in t)&&"p"in t}function ao(t){return !("h"in t)&&!("w"in t)&&"p"in t&&"e"in t&&"u"in t&&"id"in t}async function Ja(t,e=()=>!0){if(!(t instanceof Uint8Array))throw new co("DotLottie not found","INVALID_DOTLOTTIE");return await new Promise((i,s)=>{gp(t,{filter:e},(r,a)=>{r&&s(r),i(a);});})}async function uo(t,e,i){if(!(t instanceof Uint8Array))throw new co("DotLottie not found","INVALID_DOTLOTTIE");return (await Ja(t,s=>s.name===e&&(!i||i(s))))[e]}async function Sn(t){let e="manifest.json",i=(await Ja(t,s=>s.name===e))[e];if(!(typeof i>"u"))return JSON.parse(fa(i,!1))}async function sf(t){if(!(t instanceof Uint8Array))return {success:!1,error:"DotLottie not found"};let e=await Sn(t);if(typeof e>"u")return {success:!1,error:"Invalid .lottie file, manifest.json is missing"};let i=Tp(qp,e);return i.success?{success:!0}:{success:!1,error:`Invalid .lottie file, manifest.json structure is invalid, ${JSON.stringify(yp(i.error).nested,null,2)}`}}async function mo(t){let e=new Uint8Array(t),i=await sf(e);if(i.error)throw new co(i.error,"INVALID_DOTLOTTIE");return e}async function rf(t,e){let i=await Ja(t,r=>{let a=r.name.replace("audio/","");return r.name.startsWith("audio/")&&(!e||e({...r,name:a}))}),s={};for(let r in i){let a=i[r];if(a instanceof Uint8Array){let n=r.replace("audio/","");s[n]=Ch(a);}}return s}async function af(t,e){var i;let s=new Map;for(let[a,n]of Object.entries(e))for(let p of n.assets||[])if(ao(p)){let h=p.p;s.has(h)||s.set(h,new Set),(i=s.get(h))==null||i.add(a);}let r=await rf(t,a=>s.has(a.name));for(let[a,n]of s){let p=r[a];if(p)for(let h of n){let y=e[h];for(let P of (y==null?void 0:y.assets)||[])ao(P)&&P.p===a&&(P.p=p,P.u="",P.e=1);}}}async function nf(t,e){let i=await Ja(t,r=>{let a=r.name.replace("images/","");return r.name.startsWith("images/")&&(!e||e({...r,name:a}))}),s={};for(let r in i){let a=i[r];if(a instanceof Uint8Array){let n=r.replace("images/","");s[n]=Ch(a);}}return s}async function of(t,e){var i;let s=new Map;for(let[a,n]of Object.entries(e))for(let p of n.assets||[])if(lh(p)){let h=p.p;s.has(h)||s.set(h,new Set),(i=s.get(h))==null||i.add(a);}let r=await nf(t,a=>s.has(a.name));for(let[a,n]of s){let p=r[a];if(p)for(let h of n){let y=e[h];for(let P of (y==null?void 0:y.assets)||[])lh(P)&&P.p===a&&(P.p=p,P.u="",P.e=1);}}}async function kh(t,e,{inlineAssets:i}={},s){let r=`animations/${e}.json`,a=await uo(t,r,s);if(typeof a>"u")return;let n=JSON.parse(fa(a,!1));if(!i)return n;let p={[e]:n};return await of(t,p),await af(t,p),n}async function Th(t,e,i){let s=`themes/${e}.json`,r=await uo(t,s,i);if(!(typeof r>"u"))return JSON.parse(fa(r,!1))}async function Mh(t,e){let i={},s=await Ja(t,r=>{let a=r.name.replace("states/","").replace(".json","");return r.name.startsWith("states/")&&(!e||e({...r,name:a}))});for(let r in s){let a=s[r];if(a instanceof Uint8Array){let n=r.replace("states/","").replace(".json","");i[n]=fa(a,!1);}}return i}async function wh(t,e,i){let s=`states/${e}.json`,r=await uo(t,s,i);return typeof r>"u"?void 0:JSON.parse(fa(r,!1))}function Ie(t,e="dotLottie-common"){return new Error(`[${e}]: ${t}`)}function er(t,e="dotLottie-common",...i){console.error(`[${e}]:`,t,...i);}function li(t,e="dotLottie-common",...i){console.warn(`[${e}]:`,t,...i);}function go(t=""){let e=t.trim(),i=e.lastIndexOf("/"),s=e.substring(i+1),r=s.indexOf(".");return r!==-1?s.substring(0,r):s}function Jr(t){return ["v","ip","op","layers","fr","w","h"].every(e=>Object.prototype.hasOwnProperty.call(t,e))}function yo(t){let e=t.assets;return e?e.some(i=>ao(i)):!1}function vo(t){try{let e=JSON.parse(t);return Jr(e)}catch{return !1}}function En(t,e){let i=Object.keys(t).find(s=>t[s]===e);if(i===void 0)throw new Error("Value not found in the object.");return i}function Ua(t){return JSON.parse(JSON.stringify(t))}var sh,ep,fs,Xr,ph,no,oo,fh,ch,uh,ho,ip,sp,mh,xn,cr,Xe,pa,Wa,Xe,Xe,Xe,Xe,dh,Xe,gh,yh,bn,Is,_n,vh,Pn,bh,ps,_h,rp,ap,rh,vn,np,op,hp,xh,Ph,lp,Qs,Gs,Qn,eo,fp,cp,up,mp,dp,ah,vp,Ep,Mp,po,wp,Sh,Dp,Fp,Ip,Ya,Lp,Vp,Rp,Bp,Op,zp,Np,Gp,Eh,jp,Ah,Hp,qp,fo,Yr,$p,Wp,Xp,Yp,Jp,Up,Zp,Kp,Qp,tf,hh,ef,co,ca=ls(()=>{sh={},ep=function(t,e,i,s,r){var a=new Worker(sh[e]||(sh[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(n){var p=n.data,h=p.$e$;if(h){var y=new Error(h[0]);y.code=h[1],y.stack=h[2],r(y,null);}else r(null,p);},a.postMessage(i,s),a},fs=Uint8Array,Xr=Uint16Array,ph=Int32Array,no=new fs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oo=new fs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),fh=new fs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ch=function(t,e){for(var i=new Xr(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];for(var r=new ph(i[30]),s=1;s<30;++s)for(var a=i[s];a<i[s+1];++a)r[a]=a-i[s]<<5|s;return {b:i,r}},uh=ch(no,2),ho=uh.b,ip=uh.r;ho[28]=258,ip[258]=28;sp=ch(oo,0),mh=sp.b,xn=new Xr(32768);for(Xe=0;Xe<32768;++Xe)cr=(Xe&43690)>>1|(Xe&21845)<<1,cr=(cr&52428)>>2|(cr&13107)<<2,cr=(cr&61680)>>4|(cr&3855)<<4,xn[Xe]=((cr&65280)>>8|(cr&255)<<8)>>1;pa=function(t,e,i){for(var s=t.length,r=0,a=new Xr(e);r<s;++r)t[r]&&++a[t[r]-1];var n=new Xr(e);for(r=1;r<e;++r)n[r]=n[r-1]+a[r-1]<<1;var p;if(i){p=new Xr(1<<e);var h=15-e;for(r=0;r<s;++r)if(t[r])for(var y=r<<4|t[r],P=e-t[r],c=n[t[r]-1]++<<P,l=c|(1<<P)-1;c<=l;++c)p[xn[c]>>h]=y;}else for(p=new Xr(s),r=0;r<s;++r)t[r]&&(p[r]=xn[n[t[r]-1]++]>>15-t[r]);return p},Wa=new fs(288);for(Xe=0;Xe<144;++Xe)Wa[Xe]=8;for(Xe=144;Xe<256;++Xe)Wa[Xe]=9;for(Xe=256;Xe<280;++Xe)Wa[Xe]=7;for(Xe=280;Xe<288;++Xe)Wa[Xe]=8;dh=new fs(32);for(Xe=0;Xe<32;++Xe)dh[Xe]=5;gh=pa(Wa,9,1),yh=pa(dh,5,1),bn=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},Is=function(t,e,i){var s=e/8|0;return (t[s]|t[s+1]<<8)>>(e&7)&i},_n=function(t,e){var i=e/8|0;return (t[i]|t[i+1]<<8|t[i+2]<<16)>>(e&7)},vh=function(t){return (t+7)/8|0},Pn=function(t,e,i){return (e==null||e<0)&&(e=0),(i==null||i>t.length)&&(i=t.length),new fs(t.subarray(e,i))},bh=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ps=function(t,e,i){var s=new Error(e||bh[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,ps),!i)throw s;return s},_h=function(t,e,i,s){var r=t.length,a=s?s.length:0;if(!r||e.f&&!e.l)return i||new fs(0);var n=!i,p=n||e.i!=2,h=e.i;n&&(i=new fs(r*3));var y=function(Wt){var fe=i.length;if(Wt>fe){var jt=new fs(Math.max(fe*2,Wt));jt.set(i),i=jt;}},P=e.f||0,c=e.p||0,l=e.b||0,E=e.l,b=e.d,v=e.m,w=e.n,u=r*8;do{if(!E){P=Is(t,c,1);var f=Is(t,c+1,3);if(c+=3,f)if(f==1)E=gh,b=yh,v=9,w=5;else if(f==2){var g=Is(t,c,31)+257,_=Is(t,c+10,15)+4,k=g+Is(t,c+5,31)+1;c+=14;for(var z=new fs(k),q=new fs(19),W=0;W<_;++W)q[fh[W]]=Is(t,c+W*3,7);c+=_*3;for(var ot=bn(q),mt=(1<<ot)-1,gt=pa(q,ot,1),W=0;W<k;){var ut=gt[Is(t,c,mt)];c+=ut&15;var Ct=ut>>4;if(Ct<16)z[W++]=Ct;else {var ht=0,yt=0;for(Ct==16?(yt=3+Is(t,c,3),c+=2,ht=z[W-1]):Ct==17?(yt=3+Is(t,c,7),c+=3):Ct==18&&(yt=11+Is(t,c,127),c+=7);yt--;)z[W++]=ht;}}var D=z.subarray(0,g),V=z.subarray(g);v=bn(D),w=bn(V),E=pa(D,v,1),b=pa(V,w,1);}else ps(1);else {var Ct=vh(c)+4,S=t[Ct-4]|t[Ct-3]<<8,R=Ct+S;if(R>r){h&&ps(0);break}p&&y(l+S),i.set(t.subarray(Ct,R),l),e.b=l+=S,e.p=c=R*8,e.f=P;continue}if(c>u){h&&ps(0);break}}p&&y(l+131072);for(var tt=(1<<v)-1,J=(1<<w)-1,Gt=c;;Gt=c){var ht=E[_n(t,c)&tt],Vt=ht>>4;if(c+=ht&15,c>u){h&&ps(0);break}if(ht||ps(2),Vt<256)i[l++]=Vt;else if(Vt==256){Gt=c,E=null;break}else {var Xt=Vt-254;if(Vt>264){var W=Vt-257,Ht=no[W];Xt=Is(t,c,(1<<Ht)-1)+ho[W],c+=Ht;}var Qt=b[_n(t,c)&J],Zt=Qt>>4;Qt||ps(3),c+=Qt&15;var V=mh[Zt];if(Zt>3){var Ht=oo[Zt];V+=_n(t,c)&(1<<Ht)-1,c+=Ht;}if(c>u){h&&ps(0);break}p&&y(l+131072);var ne=l+Xt;if(l<V){var ue=a-V,pe=Math.min(V,ne);for(ue+l<0&&ps(3);l<pe;++l)i[l]=s[ue+l];}for(;l<ne;++l)i[l]=i[l-V];}}e.l=E,e.p=Gt,e.b=l,e.f=P,E&&(P=1,e.m=v,e.d=b,e.n=w);}while(!P);return l!=i.length&&n?Pn(i,0,l):i.subarray(0,l)},rp=new fs(0),ap=function(t,e){var i={};for(var s in t)i[s]=t[s];for(var s in e)i[s]=e[s];return i},rh=function(t,e,i){for(var s=t(),r=t.toString(),a=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),n=0;n<s.length;++n){var p=s[n],h=a[n];if(typeof p=="function"){e+=";"+h+"=";var y=p.toString();if(p.prototype)if(y.indexOf("[native code]")!=-1){var P=y.indexOf(" ",8)+1;e+=y.slice(P,y.indexOf("(",P));}else {e+=y;for(var c in p.prototype)e+=";"+h+".prototype."+c+"="+p.prototype[c].toString();}else e+=y;}else i[h]=p;}return e},vn=[],np=function(t){var e=[];for(var i in t)t[i].buffer&&e.push((t[i]=new t[i].constructor(t[i])).buffer);return e},op=function(t,e,i,s){if(!vn[i]){for(var r="",a={},n=t.length-1,p=0;p<n;++p)r=rh(t[p],r,a);vn[i]={c:rh(t[n],r,a),e:a};}var h=ap({},vn[i].e);return ep(vn[i].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",i,h,np(h),s)},hp=function(){return [fs,Xr,ph,no,oo,fh,ho,mh,gh,yh,xn,bh,pa,bn,Is,_n,vh,Pn,ps,_h,lo,xh,Ph]},xh=function(t){return postMessage(t,[t.buffer])},Ph=function(t){return t&&{out:t.size&&new fs(t.size),dictionary:t.dictionary}},lp=function(t,e,i,s,r,a){var n=op(i,s,r,function(p,h){n.terminate(),a(p,h);});return n.postMessage([t,e],e.consume?[t.buffer]:[]),function(){n.terminate();}},Qs=function(t,e){return t[e]|t[e+1]<<8},Gs=function(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Qn=function(t,e){return Gs(t,e)+Gs(t,e+4)*4294967296};eo=typeof TextDecoder<"u"&&new TextDecoder,fp=0;try{eo.decode(rp,{stream:!0}),fp=1;}catch{}cp=function(t){for(var e="",i=0;;){var s=t[i++],r=(s>127)+(s>223)+(s>239);if(i+r>t.length)return {s:e,r:Pn(t,i-1)};r?r==3?(s=((s&15)<<18|(t[i++]&63)<<12|(t[i++]&63)<<6|t[i++]&63)-65536,e+=String.fromCharCode(55296|s>>10,56320|s&1023)):r&1?e+=String.fromCharCode((s&31)<<6|t[i++]&63):e+=String.fromCharCode((s&15)<<12|(t[i++]&63)<<6|t[i++]&63):e+=String.fromCharCode(s);}};up=function(t,e){return e+30+Qs(t,e+26)+Qs(t,e+28)},mp=function(t,e,i){var s=Qs(t,e+28),r=fa(t.subarray(e+46,e+46+s),!(Qs(t,e+8)&2048)),a=e+46+s,n=Gs(t,e+20),p=i&&n==4294967295?dp(t,a):[n,Gs(t,e+24),Gs(t,e+42)],h=p[0],y=p[1],P=p[2];return [Qs(t,e+10),h,y,r,a+Qs(t,e+30)+Qs(t,e+32),P]},dp=function(t,e){for(;Qs(t,e)!=1;e+=4+Qs(t,e+2));return [Qn(t,e+12),Qn(t,e+4),Qn(t,e+20)]},ah=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t();};vp=class extends Error{issues;constructor(t){super(t[0].message),this.name="ValiError",this.issues=t;}};Ep=["__proto__","prototype","constructor"];Mp=Object.create,po=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,Sh=Object.getOwnPropertyNames,Dp=Object.getPrototypeOf,Fp=Object.prototype.hasOwnProperty,Ip=(t,e,i)=>e in t?po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ya=(t,e)=>function(){return e||(0, t[Sh(t)[0]])((e={exports:{}}).exports,e),e.exports},Lp=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Sh(e))!Fp.call(t,r)&&r!==i&&po(t,r,{get:()=>e[r],enumerable:!(s=wp(e,r))||s.enumerable});return t},Vp=(t,e,i)=>(i=t!=null?Mp(Dp(t)):{},Lp(e||!t||!t.__esModule?po(i,"default",{value:t,enumerable:!0}):i,t)),Rp=(t,e,i)=>(Ip(t,typeof e!="symbol"?e+"":e,i),i),Bp=Ya({"../../node_modules/.pnpm/@rgba-image+copy@0.1.3/node_modules/@rgba-image/copy/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.copy=void 0;var e=(i,s,r=0,a=0,n=i.width-r,p=i.height-a,h=0,y=0)=>{if(r=r|0,a=a|0,n=n|0,p=p|0,h=h|0,y=y|0,n<=0||p<=0)return;let P=new Uint32Array(i.data.buffer),c=new Uint32Array(s.data.buffer);for(let l=0;l<p;l++){let E=a+l;if(E<0||E>=i.height)continue;let b=y+l;if(!(b<0||b>=s.height))for(let v=0;v<n;v++){let w=r+v;if(w<0||w>=i.width)continue;let u=h+v;if(u<0||u>=s.width)continue;let f=E*i.width+w,g=b*s.width+u;c[g]=P[f];}}};t.copy=e;}}),Op=Ya({"../../node_modules/.pnpm/@rgba-image+create-image@0.1.1/node_modules/@rgba-image/create-image/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CreateImageFactory=(e=[0,0,0,0],i=4)=>{if(i=Math.floor(i),isNaN(i)||i<1)throw TypeError("channels should be a positive non-zero number");if(!("length"in e)||e.length<i)throw TypeError(`fill should be iterable with at least ${i} members`);e=new Uint8ClampedArray(e).slice(0,i);let s=e.every(r=>r===0);return (r,a,n)=>{if(r===void 0||a===void 0)throw TypeError("Not enough arguments");if(r=Math.floor(r),a=Math.floor(a),isNaN(r)||r<1||isNaN(a)||a<1)throw TypeError("Index or size is negative or greater than the allowed amount");let p=r*a*i;if(n===void 0&&(n=new Uint8ClampedArray(p)),n instanceof Uint8ClampedArray){if(n.length!==p)throw TypeError("Index or size is negative or greater than the allowed amount");if(!s)for(let h=0;h<a;h++)for(let y=0;y<r;y++){let P=(h*r+y)*i;for(let c=0;c<i;c++)n[P+c]=e[c];}return {get width(){return r},get height(){return a},get data(){return n}}}throw TypeError("Expected data to be Uint8ClampedArray or undefined")}},t.createImage=t.CreateImageFactory();}}),zp=Ya({"../../node_modules/.pnpm/@rgba-image+lanczos@0.1.1/node_modules/@rgba-image/lanczos/dist/filters.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.filters=void 0;var e=14,i=(a,n)=>{if(a<=-n||a>=n||a==0)return 0;let p=a*Math.PI;return Math.sin(p)/p*Math.sin(p/n)/(p/n)},s=a=>Math.round(a*((1<<e)-1)),r=(a,n,p,h,y)=>{let P=y?2:3,c=1/p,l=Math.min(1,p),E=P/l,b=Math.floor((E+1)*2),v=new Int16Array((b+2)*n),w=0;for(let u=0;u<n;u++){let f=(u+.5)*c+h,g=Math.max(0,Math.floor(f-E)),_=Math.min(a-1,Math.ceil(f+E)),k=_-g+1,z=new Float32Array(k),q=new Int16Array(k),W=0,ot=0;for(let yt=g;yt<=_;yt++){let D=i((yt+.5-f)*l,P);W+=D,z[ot]=D,ot++;}let mt=0;for(let yt=0;yt<z.length;yt++){let D=z[yt]/W;mt+=D,q[yt]=s(D);}q[n>>1]+=s(1-mt);let gt=0;for(;gt<q.length&&q[gt]===0;)gt++;let ut=q.length-1;for(;ut>0&&q[ut]===0;)ut--;let Ct=g+gt,ht=ut-gt+1;v[w++]=Ct,v[w++]=ht,v.set(q.subarray(gt,ut+1),w),w+=ht;}return v};t.filters=r;}}),Np=Ya({"../../node_modules/.pnpm/@rgba-image+lanczos@0.1.1/node_modules/@rgba-image/lanczos/dist/convolve.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convolve=void 0;var e=14,i=(s,r,a,n,p,h)=>{let y=0,P=0;for(let c=0;c<n;c++){let l=0;for(let E=0;E<p;E++){let b=h[l++],v=y+b*4|0,w=0,u=0,f=0,g=0;for(let _=h[l++];_>0;_--){let k=h[l++];w=w+k*s[v]|0,u=u+k*s[v+1]|0,f=f+k*s[v+2]|0,g=g+k*s[v+3]|0,v=v+4|0;}r[P]=w+8192>>e,r[P+1]=u+8192>>e,r[P+2]=f+8192>>e,r[P+3]=g+8192>>e,P=P+n*4|0;}P=(c+1)*4|0,y=(c+1)*a*4|0;}};t.convolve=i;}}),Gp=Ya({"../../node_modules/.pnpm/@rgba-image+lanczos@0.1.1/node_modules/@rgba-image/lanczos/dist/index.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.lanczos2=t.lanczos=void 0;var e=Bp(),i=Op(),s=zp(),r=Np(),a=(h,y,P=!1)=>{let c=y.width/h.width,l=y.height/h.height,E=s.filters(h.width,y.width,c,0,P),b=s.filters(h.height,y.height,l,0,P),v=new Uint8ClampedArray(y.width*h.height*4);r.convolve(h.data,v,h.width,h.height,y.width,E),r.convolve(v,y.data,h.height,y.width,y.height,b);},n=(h,y,P=0,c=0,l=h.width-P,E=h.height-c,b=0,v=0,w=y.width-b,u=y.height-v)=>{if(P=P|0,c=c|0,l=l|0,E=E|0,b=b|0,v=v|0,w=w|0,u=u|0,l<=0||E<=0||w<=0||u<=0)return;if(P===0&&c===0&&l===h.width&&E===h.height&&b===0&&v===0&&w===y.width&&u===y.height){a(h,y);return}let f=i.createImage(l,E),g=i.createImage(w,u);e.copy(h,f,P,c),a(f,g),e.copy(g,y,0,0,g.width,g.height,b,v);};t.lanczos=n;var p=(h,y,P=0,c=0,l=h.width-P,E=h.height-c,b=0,v=0,w=y.width-b,u=y.height-v)=>{if(P=P|0,c=c|0,l=l|0,E=E|0,b=b|0,v=v|0,w=w|0,u=u|0,l<=0||E<=0||w<=0||u<=0)return;if(P===0&&c===0&&l===h.width&&E===h.height&&b===0&&v===0&&w===y.width&&u===y.height){a(h,y,!0);return}let f=i.createImage(l,E),g=i.createImage(w,u);e.copy(h,f,P,c),a(f,g,!0),e.copy(g,y,0,0,g.width,g.height,b,v);};t.lanczos2=p;}}),Eh=(t=>(t.Bounce="bounce",t.Normal="normal",t))(Eh||{}),jp=Pp(Eh),Ah=Ls({autoplay:Ke(to()),defaultTheme:Ke(Ji()),direction:Ke(io([nh(1),nh(-1)])),hover:Ke(to()),id:Ji(),intermission:Ke(js()),loop:Ke(io([to(),js()])),playMode:Ke(jp),speed:Ke(js()),themeColor:Ke(Ji())}),Hp=Ls({animations:$a(Ji()),id:Ji()}),qp=Ls({activeAnimationId:Ke(Ji()),animations:$a(Ah),author:Ke(Ji()),custom:Ke(Ap(Ji(),xp())),description:Ke(Ji()),generator:Ke(Ji()),keywords:Ke(Ji()),revision:Ke(js()),themes:Ke($a(Hp)),states:Ke($a(Ji())),version:Ke(Ji())}),fo=kp(Ah,["id"]),Yr=Ls({state:Ji()}),$p=Yr,Wp=Xa([Yr,Ls({ms:js()})]),Xp=Xa([Yr,Ls({count:js()})]),Yp=Yr,Jp=Yr,Up=Yr,Zp=Xa([Yr,Ls({threshold:Ke($a(js([ro(0),so(1)])))})]),Kp=Ls({onAfter:Ke(Wp),onClick:Ke($p),onComplete:Ke(Up),onEnter:Ke(Xp),onMouseEnter:Ke(Yp),onMouseLeave:Ke(Jp),onShow:Ke(Zp)}),Qp=Xa([fo,Ls({playOnScroll:Ke(oh([js([ro(0),so(1)]),js([ro(0),so(1)])])),segments:Ke(io([oh([js(),js()]),Ji()]))})]);Xa([Kp,Ls({animationId:Ke(Ji()),playbackSettings:Qp})]);tf={jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",svg:"image/svg+xml",webp:"image/webp",mpeg:"audio/mpeg",mp3:"audio/mp3"},hh={jpeg:[255,216,255],png:[137,80,78,71,13,10,26,10],gif:[71,73,70],bmp:[66,77],webp:[82,73,70,70,87,69,66,80],svg:[60,63,120],mp3:[73,68,51,3,0,0,0,0],mpeg:[73,68,51,3,0,0,0,0]},ef=t=>{let e=null,i=[];if(!t)return null;let s=t.substring(t.indexOf(",")+1);typeof window>"u"?e=Buffer.from(s,"base64").toString("binary"):e=atob(s);let r=new Uint8Array(e.length);for(let a=0;a<e.length;a+=1)r[a]=e.charCodeAt(a);i=Array.from(r.subarray(0,8));for(let a in hh){let n=hh[a];if(n&&i.every((p,h)=>p===n[h]))return tf[a]}return null},co=class extends Error{constructor(t,e){super(t),Rp(this,"code"),this.name="[dotlottie-js]",this.code=e;}};Vp(Gp());});var Dh,An=ls(()=>{ca();Dh=class{_dotLottie;_animationsMap=new Map;_themeMap=new Map;_stateMachinesMap=new Map;_manifest;get dotLottie(){return this._dotLottie}get animationsMap(){return this._animationsMap}get themeMap(){return this._themeMap}get stateMachinesMap(){return this._stateMachinesMap}get manifest(){return this._manifest}async loadFromUrl(t){let e=await fetch(t,{method:"GET",mode:"cors"});if(!e.ok)throw new Error(`Failed to load dotLottie from ${t} with status ${e.status}`);let i=e.headers.get("content-type");if(i!=null&&i.includes("application/json")){let s=await e.json();if(!Jr(s))throw new Error(`Invalid lottie JSON at ${t}`);let r=go(t);this._animationsMap.set(r,s);let a={activeAnimationId:r,animations:[{id:r}]};this._manifest=a;}else {this._dotLottie=await mo(await e.arrayBuffer());let s=await Sn(this._dotLottie);if(!s)throw new Error("Manifest not found");this._manifest=s;}}loadFromLottieJSON(t){if(!Jr(t))throw new Error("Invalid lottie JSON");let e="my-animation";this._animationsMap.set(e,t);let i={activeAnimationId:e,animations:[{id:e}]};this._manifest=i;}async loadFromArrayBuffer(t){this._dotLottie=await mo(t);let e=await Sn(this._dotLottie);if(!e)throw new Error("Manifest not found");this._manifest=e;}async getAnimation(t){if(this._animationsMap.get(t))return this._animationsMap.get(t);if(!this._dotLottie)return;let e=await kh(this._dotLottie,t,{inlineAssets:!0});return e&&this._animationsMap.set(t,e),e}async getTheme(t){if(this._themeMap.get(t))return this._themeMap.get(t);if(!this._dotLottie)return;let e=await Th(this._dotLottie,t);return e&&this._themeMap.set(t,e),e}async getStateMachines(){if(!this._dotLottie)return;let t=await Mh(this._dotLottie);for(let e in t)if(e){let i=t[e];if(i){let s=JSON.parse(i);if(s){let r=s.descriptor.id;this._stateMachinesMap.get(r)||this._stateMachinesMap.set(r,s);}}}return Array.from(this._stateMachinesMap.values())}async getStateMachine(t){if(this._stateMachinesMap.get(t))return this._stateMachinesMap.get(t);if(!this._dotLottie)return;let e=await wh(this._dotLottie,t);return e&&this._stateMachinesMap.set(e.descriptor.id,e),e}};});function kn(){throw new Error("Cycle detected")}function _o(){if(ua>1)ua--;else {for(var t,e=!1;Za!==void 0;){var i=Za;for(Za=void 0,bo++;i!==void 0;){var s=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&Ih(i))try{i.c();}catch(r){e||(t=r,e=!0);}i=s;}}if(bo=0,ua--,e)throw t}}function Fh(t){if(Ei!==void 0){var e=t.n;if(e===void 0||e.t!==Ei)return e={i:0,S:t,p:Ei.s,n:void 0,t:Ei,e:void 0,x:void 0,r:e},Ei.s!==void 0&&(Ei.s.n=e),Ei.s=e,t.n=e,32&Ei.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ei.s,e.n=void 0,Ei.s.n=e,Ei.s=e),e}}function vs(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0;}function hf(t){return new vs(t)}function Ih(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return !0;return !1}function Lh(t){for(var e=t.s;e!==void 0;e=e.n){var i=e.S.n;if(i!==void 0&&(e.r=i),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Vh(t){for(var e=t.s,i=void 0;e!==void 0;){var s=e.p;e.i===-1?(e.S.U(e),s!==void 0&&(s.n=e.n),e.n!==void 0&&(e.n.p=s)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=s;}t.s=i;}function Ur(t){vs.call(this,void 0),this.x=t,this.s=void 0,this.g=Cn-1,this.f=4;}function Rh(t){var e=t.u;if(t.u=void 0,typeof e=="function"){ua++;var i=Ei;Ei=void 0;try{e();}catch(s){throw t.f&=-2,t.f|=8,xo(t),s}finally{Ei=i,_o();}}}function xo(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Rh(t);}function lf(t){if(Ei!==this)throw new Error("Out-of-order effect");Vh(this),Ei=t,this.f&=-2,8&this.f&&xo(this),_o();}function Ka(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32;}function pf(t){var e=new Ka(t);try{e.c();}catch(i){throw e.d(),i}return e.d.bind(e)}var Ei,Za,ua,bo,Cn,Bh,Tn=ls(()=>{Ei=void 0,Za=void 0,ua=0,bo=0,Cn=0;vs.prototype.h=function(){return !0};vs.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t);};vs.prototype.U=function(t){if(this.t!==void 0){var e=t.e,i=t.x;e!==void 0&&(e.x=i,t.e=void 0),i!==void 0&&(i.e=e,t.x=void 0),t===this.t&&(this.t=i);}};vs.prototype.subscribe=function(t){var e=this;return pf(function(){var i=e.value,s=32&this.f;this.f&=-33;try{t(i);}finally{this.f|=s;}})};vs.prototype.valueOf=function(){return this.value};vs.prototype.toString=function(){return this.value+""};vs.prototype.toJSON=function(){return this.value};vs.prototype.peek=function(){return this.v};Object.defineProperty(vs.prototype,"value",{get:function(){var t=Fh(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(Ei instanceof Ur&&function(){throw new Error("Computed cannot have side-effects")}(),t!==this.v){bo>100&&kn(),this.v=t,this.i++,Cn++,ua++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N();}finally{_o();}}}});(Ur.prototype=new vs).h=function(){if(this.f&=-3,1&this.f)return !1;if((36&this.f)==32||(this.f&=-5,this.g===Cn))return !0;if(this.g=Cn,this.f|=1,this.i>0&&!Ih(this))return this.f&=-2,!0;var t=Ei;try{Lh(this),Ei=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++);}catch(i){this.v=i,this.f|=16,this.i++;}return Ei=t,Vh(this),this.f&=-2,!0};Ur.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e);}vs.prototype.S.call(this,t);};Ur.prototype.U=function(t){if(this.t!==void 0&&(vs.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e);}};Ur.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N();}};Ur.prototype.peek=function(){if(this.h()||kn(),16&this.f)throw this.v;return this.v};Object.defineProperty(Ur.prototype,"value",{get:function(){1&this.f&&kn();var t=Fh(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});Ka.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e);}finally{t();}};Ka.prototype.S=function(){1&this.f&&kn(),this.f|=1,this.f&=-9,Rh(this),Lh(this),ua++;var t=Ei;return Ei=this,lf.bind(this,t)};Ka.prototype.N=function(){2&this.f||(this.f|=2,this.o=Za,Za=this);};Ka.prototype.d=function(){this.f|=8,1&this.f||xo(this);};Bh=class{_state;_prevState;constructor(t){this._prevState=t,this._state=hf(t);}setState(t){this._prevState=this._state.value,this._state.value=t;}subscribe(t){return this._state.subscribe(e=>t(e,this._prevState))}};});var ff,Oh,cf,uf,mf,df,is,gf,zh,qs=ls(()=>{ff=Object.create,Oh=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,uf=Object.getOwnPropertyNames,mf=Object.getPrototypeOf,df=Object.prototype.hasOwnProperty,is=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gf=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of uf(e))!df.call(t,r)&&r!==i&&Oh(t,r,{get:()=>e[r],enumerable:!(s=cf(e,r))||s.enumerable});return t},zh=(t,e,i)=>(i=t!=null?ff(mf(t)):{},gf(e||!t||!t.__esModule?Oh(i,"default",{value:t,enumerable:!0}):i,t));});var fl={};fr(fl,{DotLottieStateMachineManager:()=>cc});function Fo(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]]);return i}function ze(t){var e=typeof Symbol=="function"&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&typeof t.length=="number")return {next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qe(t,e){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var s=i.call(t),r,a=[],n;try{for(;(e===void 0||e-- >0)&&!(r=s.next()).done;)a.push(r.value);}catch(p){n={error:p};}finally{try{r&&!r.done&&(i=s.return)&&i.call(s);}finally{if(n)throw n.error}}return a}function ui(t,e,i){if(i||arguments.length===2)for(var s=0,r=e.length,a;s<r;s++)(a||!(s in e))&&(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))}function Lo(t,e,i){i===void 0&&(i=Zh);var s=an(t,i),r=an(e,i);return Qe(r)?Qe(s)?r===s:!1:Qe(s)?s in r:Object.keys(s).every(function(a){return a in r?Lo(s[a],r[a]):!1})}function Kh(t){try{return Qe(t)||typeof t=="number"?"".concat(t):t.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function ko(t,e){try{return Pa(t)?t:t.toString().split(e)}catch{throw new Error("'".concat(t,"' is not a valid state path."))}}function Sf(t){return typeof t=="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function an(t,e){if(Sf(t))return t.value;if(Pa(t))return On(t);if(typeof t!="string")return t;var i=ko(t,e);return On(i)}function On(t){if(t.length===1)return t[0];for(var e={},i=e,s=0;s<t.length-1;s++)s===t.length-2?i[t[s]]=t[s+1]:(i[t[s]]={},i=i[t[s]]);return e}function tn(t,e){for(var i={},s=Object.keys(t),r=0;r<s.length;r++){var a=s[r];i[a]=e(t[a],a,t,r);}return i}function jh(t,e,i){var s,r,a={};try{for(var n=ze(Object.keys(t)),p=n.next();!p.done;p=n.next()){var h=p.value,y=t[h];i(y)&&(a[h]=e(y,h,t));}}catch(P){s={error:P};}finally{try{p&&!p.done&&(r=n.return)&&r.call(n);}finally{if(s)throw s.error}}return a}function Af(t,e){return function(i){var s,r,a=i;try{for(var n=ze(t),p=n.next();!p.done;p=n.next()){var h=p.value;a=a[e][h];}}catch(y){s={error:y};}finally{try{p&&!p.done&&(r=n.return)&&r.call(n);}finally{if(s)throw s.error}}return a}}function Ln(t){if(!t)return [[]];if(Qe(t))return [[t]];var e=bi(Object.keys(t).map(function(i){var s=t[i];return typeof s!="string"&&(!s||!Object.keys(s).length)?[[i]]:Ln(t[i]).map(function(r){return [i].concat(r)})}));return e}function bi(t){var e;return (e=[]).concat.apply(e,ui([],qe(t),!1))}function Qh(t){return Pa(t)?t:[t]}function $s(t){return t===void 0?[]:Qh(t)}function zn(t,e,i){var s,r;if(Ye(t))return t(e,i.data);var a={};try{for(var n=ze(Object.keys(t)),p=n.next();!p.done;p=n.next()){var h=p.value,y=t[h];Ye(y)?a[h]=y(e,i.data):a[h]=y;}}catch(P){s={error:P};}finally{try{p&&!p.done&&(r=n.return)&&r.call(n);}finally{if(s)throw s.error}}return a}function Cf(t){return /^(done|error)\./.test(t)}function Hh(t){return !!(t instanceof Promise||t!==null&&(Ye(t)||typeof t=="object")&&Ye(t.then))}function kf(t){return t!==null&&typeof t=="object"&&"transition"in t&&typeof t.transition=="function"}function Tf(t,e){var i,s,r=qe([[],[]],2),a=r[0],n=r[1];try{for(var p=ze(t),h=p.next();!h.done;h=p.next()){var y=h.value;e(y)?a.push(y):n.push(y);}}catch(P){i={error:P};}finally{try{h&&!h.done&&(s=p.return)&&s.call(p);}finally{if(i)throw i.error}}return [a,n]}function tl(t,e){return tn(t.states,function(i,s){if(i){var r=(Qe(e)?void 0:e[s])||(i?i.current:void 0);if(r)return {current:r,states:tl(i,r)}}})}function Mf(t,e){return {current:e,states:tl(t,e)}}function qh(t,e,i,s){var r=t&&i.reduce(function(a,n){var p,h,y=n.assignment,P={state:s,action:n,_event:e},c={};if(Ye(y))c=y(a,e.data,P);else try{for(var l=ze(Object.keys(y)),E=l.next();!E.done;E=l.next()){var b=E.value,v=y[b];c[b]=Ye(v)?v(a,e.data,P):v;}}catch(w){p={error:w};}finally{try{E&&!E.done&&(h=l.return)&&h.call(l);}finally{if(p)throw p.error}}return Object.assign({},a,c)},t);return r}function Pa(t){return Array.isArray(t)}function Ye(t){return typeof t=="function"}function Qe(t){return typeof t=="string"}function el(t,e){if(t)return Qe(t)?{type:Co,name:t,predicate:e?e[t]:void 0}:Ye(t)?{type:Co,name:t.name,predicate:t}:t}function Df(t){try{return "subscribe"in t&&Ye(t.subscribe)}catch{return !1}}function xa(t){return !!t&&"__xstatenode"in t}function Ff(t){return !!t&&typeof t.send=="function"}function Hn(t,e){return Qe(t)||typeof t=="number"?ae({type:t},e):t}function Ui(t,e){if(!Qe(t)&&"$$type"in t&&t.$$type==="scxml")return t;var i=Hn(t);return ae({name:i.type,data:i,$$type:"scxml",type:"external"},e)}function ma(t,e){var i=Qh(e).map(function(s){return typeof s>"u"||typeof s=="string"||xa(s)?{target:s,event:t}:ae(ae({},s),{event:t})});return i}function If(t){if(!(t===void 0||t===Pf))return $s(t)}function il(t,e,i,s,r){var a=t.options.guards,n={state:r,cond:e,_event:s};if(e.type===Co)return ((a==null?void 0:a[e.name])||e.predicate)(i,s.data,n);var p=a==null?void 0:a[e.type];if(!p)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return p(i,s.data,n)}function sl(t){return typeof t=="string"?{type:t}:t}function Vn(t,e,i){var s=function(){},r=typeof t=="object",a=r?t:null;return {next:((r?t.next:t)||s).bind(a),error:((r?t.error:e)||s).bind(a),complete:((r?t.complete:i)||s).bind(a)}}function wn(t,e){return "".concat(t,":invocation[").concat(e,"]")}function To(t){return (t.type===hn||t.type===jn&&t.to===_a.Internal)&&typeof t.delay!="number"}function Mo(t,e){return e&&e[t]||void 0}function nn(t,e){var i;if(Qe(t)||typeof t=="number"){var s=Mo(t,e);Ye(s)?i={type:t,exec:s}:s?i=s:i={type:t,exec:void 0};}else if(Ye(t))i={type:t.name||t.toString(),exec:t};else {var s=Mo(t.type,e);if(Ye(s))i=ae(ae({},t),{exec:s});else if(s){var r=s.type||t.type;i=ae(ae(ae({},s),t),{type:r});}else i=t;}return i}function Vo(t){var e=nn(t);return ae(ae({id:Qe(t)?t:e.id},e),{type:e.type})}function Lf(t,e){return {type:hn,event:typeof t=="function"?t:Hn(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function Vf(t,e,i,s){var r={_event:i},a=Ui(Ye(t.event)?t.event(e,i.data,r):t.event),n;if(Qe(t.delay)){var p=s&&s[t.delay];n=Ye(p)?p(e,i.data,r):p;}else n=Ye(t.delay)?t.delay(e,i.data,r):t.delay;return ae(ae({},t),{type:hn,_event:a,delay:n})}function Rf(t,e){return {to:e?e.to:void 0,type:jn,event:Ye(t)?t:Hn(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:Ye(t)?t.name:Kh(t)}}function Bf(t,e,i,s){var r={_event:i},a=Ui(Ye(t.event)?t.event(e,i.data,r):t.event),n;if(Qe(t.delay)){var p=s&&s[t.delay];n=Ye(p)?p(e,i.data,r):p;}else n=Ye(t.delay)?t.delay(e,i.data,r):t.delay;var h=Ye(t.to)?t.to(e,i.data,r):t.to;return ae(ae({},t),{to:h,_event:a,event:a.data,delay:n})}function Nf(t){var e=Vo(t);return {type:ai.Start,activity:e,exec:void 0}}function Gf(t){var e=Ye(t)?t:Vo(t);return {type:ai.Stop,activity:e,exec:void 0}}function jf(t,e,i){var s=Ye(t.activity)?t.activity(e,i.data):t.activity,r=typeof s=="string"?{id:s}:s,a={type:ai.Stop,activity:r};return a}function Hf(t,e){var i=e?"#".concat(e):"";return "".concat(ai.After,"(").concat(t,")").concat(i)}function Dn(t,e){var i="".concat(ai.DoneState,".").concat(t),s={type:i,data:e};return s.toString=function(){return i},s}function Rn(t,e){var i="".concat(ai.DoneInvoke,".").concat(t),s={type:i,data:e};return s.toString=function(){return i},s}function en(t,e){var i="".concat(ai.ErrorPlatform,".").concat(t),s={type:i,data:e};return s.toString=function(){return i},s}function Nn(t,e,i,s,r,a,n){n===void 0&&(n=!1);var p=n?[]:qf(r),h=p.length?qh(i,s,p,e):i,y=n?[i]:void 0,P=[];function c(b,v){var w;switch(v.type){case hn:{var u=Vf(v,h,s,t.options.delays);return a&&typeof u.delay=="number"&&a(u,h,s),u}case jn:var f=Bf(v,h,s,t.options.delays);return a&&f.to!==_a.Internal&&(b==="entry"?P.push(f):a(f,h,s)),f;case Jh:{var g=Of(v,h,s);return a==null||a(g,h,s),g}case _f:{var _=v,k=(w=_.conds.find(function(D){var V=el(D.cond,t.options.guards);return !V||il(t,V,h,s,a?void 0:e)}))===null||w===void 0?void 0:w.actions;if(!k)return [];var z=qe(Nn(t,e,h,s,[{type:b,actions:Fr($s(k),t.options.actions)}],a,n),2),q=z[0],W=z[1];return h=W,y==null||y.push(h),q}case xf:{var k=v.get(h,s.data);if(!k)return [];var ot=qe(Nn(t,e,h,s,[{type:b,actions:Fr($s(k),t.options.actions)}],a,n),2),mt=ot[0],gt=ot[1];return h=gt,y==null||y.push(h),mt}case Io:{var g=jf(v,h,s);return a==null||a(g,i,s),g}case Yh:{h=qh(h,s,[v],a?void 0:e),y==null||y.push(h);break}default:var ut=nn(v,t.options.actions),Ct=ut.exec;if(a)a(ut,h,s);else if(Ct&&y){var ht=y.length-1,yt=ae(ae({},ut),{exec:function(D){for(var V=[],S=1;S<arguments.length;S++)V[S-1]=arguments[S];Ct.apply(void 0,ui([y[ht]],qe(V),!1));}});ut=yt;}return ut}}function l(b){var v,w,u=[];try{for(var f=ze(b.actions),g=f.next();!g.done;g=f.next()){var _=g.value,k=c(b.type,_);k&&(u=u.concat(k));}}catch(z){v={error:z};}finally{try{g&&!g.done&&(w=f.return)&&w.call(f);}finally{if(v)throw v.error}}return P.forEach(function(z){a(z,h,s);}),P.length=0,u}var E=bi(r.map(l));return [E,h]}function rl(t){var e;return e={id:t,send:function(){},subscribe:function(){return {unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return {id:t}}},e[Dr]=function(){return this},e}function $f(t,e,i,s){var r,a=sl(t.src),n=(r=e==null?void 0:e.options.services)===null||r===void 0?void 0:r[a.type],p=t.data?zn(t.data,i,s):void 0,h=n?al(n,t.id,p):rl(t.id);return h.meta=t,h}function al(t,e,i){var s=rl(e);if(s.deferred=!0,xa(t)){var r=s.state=ya(void 0,function(){return (i?t.withContext(i):t).initialState});s.getSnapshot=function(){return r};}return s}function Wf(t){try{return typeof t.send=="function"}catch{return !1}}function Xf(t){return Wf(t)&&"id"in t}function Yf(t){var e;return ae((e={subscribe:function(){return {unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},e[Dr]=function(){return this},e),t)}function nl(t){return Object.keys(t.states).map(function(e){return t.states[e]})}function on(t){return nl(t).filter(function(e){return e.type!=="history"})}function ol(t){var e=[t];return Gn(t)?e:e.concat(bi(on(t).map(ol)))}function sn(t,e){var i,s,r,a,n,p,h,y,P=new Set(t),c=wo(P),l=new Set(e);try{for(var E=ze(l),b=E.next();!b.done;b=E.next())for(var v=b.value,w=v.parent;w&&!l.has(w);)l.add(w),w=w.parent;}catch(ot){i={error:ot};}finally{try{b&&!b.done&&(s=E.return)&&s.call(E);}finally{if(i)throw i.error}}var u=wo(l);try{for(var f=ze(l),g=f.next();!g.done;g=f.next()){var v=g.value;if(v.type==="compound"&&(!u.get(v)||!u.get(v).length))c.get(v)?c.get(v).forEach(function(mt){return l.add(mt)}):v.initialStateNodes.forEach(function(mt){return l.add(mt)});else if(v.type==="parallel")try{for(var _=(n=void 0,ze(on(v))),k=_.next();!k.done;k=_.next()){var z=k.value;l.has(z)||(l.add(z),c.get(z)?c.get(z).forEach(function(mt){return l.add(mt)}):z.initialStateNodes.forEach(function(mt){return l.add(mt)}));}}catch(mt){n={error:mt};}finally{try{k&&!k.done&&(p=_.return)&&p.call(_);}finally{if(n)throw n.error}}}}catch(ot){r={error:ot};}finally{try{g&&!g.done&&(a=f.return)&&a.call(f);}finally{if(r)throw r.error}}try{for(var q=ze(l),W=q.next();!W.done;W=q.next())for(var v=W.value,w=v.parent;w&&!l.has(w);)l.add(w),w=w.parent;}catch(ot){h={error:ot};}finally{try{W&&!W.done&&(y=q.return)&&y.call(q);}finally{if(h)throw h.error}}return l}function hl(t,e){var i=e.get(t);if(!i)return {};if(t.type==="compound"){var s=i[0];if(s){if(Gn(s))return s.key}else return {}}var r={};return i.forEach(function(a){r[a.key]=hl(a,e);}),r}function wo(t){var e,i,s=new Map;try{for(var r=ze(t),a=r.next();!a.done;a=r.next()){var n=a.value;s.has(n)||s.set(n,[]),n.parent&&(s.has(n.parent)||s.set(n.parent,[]),s.get(n.parent).push(n));}}catch(p){e={error:p};}finally{try{a&&!a.done&&(i=r.return)&&i.call(r);}finally{if(e)throw e.error}}return s}function Jf(t,e){var i=sn([t],e);return hl(t,wo(i))}function rn(t,e){return Array.isArray(t)?t.some(function(i){return i===e}):t instanceof Set?t.has(e):!1}function Uf(t){return ui([],qe(new Set(bi(ui([],qe(t.map(function(e){return e.ownEvents})),!1)))),!1)}function Bn(t,e){return e.type==="compound"?on(e).some(function(i){return i.type==="final"&&rn(t,i)}):e.type==="parallel"?on(e).every(function(i){return Bn(t,i)}):!1}function Zf(t){return t===void 0&&(t=[]),t.reduce(function(e,i){return i.meta!==void 0&&(e[i.id]=i.meta),e},{})}function $h(t){return new Set(bi(t.map(function(e){return e.tags})))}function ll(t,e){if(t===e)return !0;if(t===void 0||e===void 0)return !1;if(Qe(t)||Qe(e))return t===e;var i=Object.keys(t),s=Object.keys(e);return i.length===s.length&&i.every(function(r){return ll(t[r],e[r])})}function Kf(t){return typeof t!="object"||t===null?!1:"value"in t&&"_event"in t}function Qf(t,e){var i=t.exec,s=ae(ae({},t),{exec:i!==void 0?function(){return i(e.context,e.event,{action:t,state:e,_event:e._event})}:void 0});return s}function Ro(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function ic(){var t=Ro();if(t&&"__xstate__"in t)return t.__xstate__}function sc(t){if(Ro()){var e=ic();e&&e.register(t);}}function rc(t,e){e===void 0&&(e={});var i=t.initialState,s=new Set,r=[],a=!1,n=function(){if(!a){for(a=!0;r.length>0;){var y=r.shift();i=t.transition(i,y,h),s.forEach(function(P){return P.next(i)});}a=!1;}},p=Yf({id:e.id,send:function(y){r.push(y),n();},getSnapshot:function(){return i},subscribe:function(y,P,c){var l=Vn(y,P,c);return s.add(l),l.next(i),{unsubscribe:function(){s.delete(l);}}}}),h={parent:e.parent,self:p,id:e.id||"anonymous",observers:s};return i=t.start?t.start(h):i,p}function pl(t,e){var i=new nc(t,e);return i}function oc(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function Fn(t){return ae(ae({type:Ao},t),{toJSON:function(){t.onDone,t.onError;var e=Fo(t,["onDone","onError"]);return ae(ae({},e),{type:Ao,src:oc(t.src)})}})}function pc(t,e){return new lc(t,e)}var ae,ai,_a,Eo,Io,hn,jn,Xh,yf,Yh,Jh,vf,Ao,Nh,bf,Uh,_f,xf,Zh,Gh,Co,Pf,Mn,Ef,wf,Dr,ba,Fr,Of,zf,qf,ya,Gn,ir,tc,Wh,Po,ec,Qa,ac,ji,nc,In,Do,So,da,ga,hc,lc,va,fc,cc,cl=ls(()=>{Bo();An();qn();Tn();ca();qs();ae=function(){return ae=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++){e=arguments[i];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);}return t},ae.apply(this,arguments)};(function(t){t.Start="xstate.start",t.Stop="xstate.stop",t.Raise="xstate.raise",t.Send="xstate.send",t.Cancel="xstate.cancel",t.NullEvent="",t.Assign="xstate.assign",t.After="xstate.after",t.DoneState="done.state",t.DoneInvoke="done.invoke",t.Log="xstate.log",t.Init="xstate.init",t.Invoke="xstate.invoke",t.ErrorExecution="error.execution",t.ErrorCommunication="error.communication",t.ErrorPlatform="error.platform",t.ErrorCustom="xstate.error",t.Update="xstate.update",t.Pure="xstate.pure",t.Choose="xstate.choose";})(ai||(ai={}));(function(t){t.Parent="#_parent",t.Internal="#_internal";})(_a||(_a={}));Eo=ai.Start,Io=ai.Stop,hn=ai.Raise,jn=ai.Send,Xh=ai.Cancel,yf=ai.NullEvent,Yh=ai.Assign;ai.After;ai.DoneState;Jh=ai.Log,vf=ai.Init,Ao=ai.Invoke;ai.ErrorExecution;Nh=ai.ErrorPlatform,bf=ai.ErrorCustom,Uh=ai.Update,_f=ai.Choose,xf=ai.Pure,Zh=".",Gh={},Co="xstate.guard",Pf="";Ef=function(t){return function(e){var i,s,r=e;try{for(var a=ze(t),n=a.next();!n.done;n=a.next()){var p=n.value;r=r[p];}}catch(h){i={error:h};}finally{try{n&&!n.done&&(s=a.return)&&s.call(a);}finally{if(i)throw i.error}}return r}};wf=function(){};Dr=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Mn={},Mn[Dr]=function(){return this},Mn[Symbol.observable]=function(){return this};ba=Ui({type:vf});Fr=function(t,e){if(!t)return [];var i=Pa(t)?t:[t];return i.map(function(s){return nn(s,e)})};Of=function(t,e,i){return ae(ae({},t),{value:Qe(t.expr)?t.expr:t.expr(e,i.data,{_event:i})})},zf=function(t){return {type:Xh,sendId:t}};qf=function(t){var e,i,s=[];try{for(var r=ze(t),a=r.next();!a.done;a=r.next())for(var n=a.value,p=0;p<n.actions.length;){if(n.actions[p].type===Yh){s.push(n.actions[p]),n.actions.splice(p,1);continue}p++;}}catch(h){e={error:h};}finally{try{a&&!a.done&&(i=r.return)&&i.call(r);}finally{if(e)throw e.error}}return s};ya=function(t,e){var i=e(t);return i};Gn=function(t){return t.type==="atomic"||t.type==="final"};ir=function(){function t(e){var i=this,s;this.actions=[],this.activities=Gh,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||Gh,this.meta=Zf(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configura