diff --git a/assets/AnimatedWave-BifePjRS.js b/assets/AnimatedWave-wua8MzWE.js similarity index 60% rename from assets/AnimatedWave-BifePjRS.js rename to assets/AnimatedWave-wua8MzWE.js index 2e1f7c6e4eed23b87b859aa3afb49790bb55d463..206d519ef0146793270292fc12dac192cd2b6dd9 100644 --- a/assets/AnimatedWave-BifePjRS.js +++ b/assets/AnimatedWave-wua8MzWE.js @@ -1,3 +1,3 @@ -import{b as e}from"./Basic-DOfBA0ws.js";import{A as t,bT as n,c6 as r,c7 as i,c9 as a,cJ as o,cO as s,cc as c,ce as l,cj as u,d3 as d,d8 as f,dL as p,dR as m,dS as h,dT as g,dU as _,dV as v,dW as y,dX as b,dY as x,dZ as S,d_ as C,dc as w,dk as T,dl as E,e1 as D,e3 as O,e4 as k,e6 as A,e7 as j,e8 as M,ea as N,eb as P,ec as F,ed as I,ee as L,ef as R,eh as z,el as B,em as V,eo as ee,ep as H,n as U,o as W,p as G,q as K,s as q,x as J,y as Y}from"./index-DEpwtsc8.js";import{b as X,c as Z,d as Q}from"./HeaderLink-Cg3P1d5b.js";import{d as $,e as te,f as ne}from"./Scenes-C-Sbq7ai.js";function re(e,t){let n=ne(e,t?.in);if(!te(n))throw RangeError(`Invalid time value`);let r=t?.format??`extended`,i=t?.representation??`complete`,a=``,o=r===`extended`?`-`:``,s=r===`extended`?`:`:``;if(i!==`time`){let e=$(n.getDate(),2),t=$(n.getMonth()+1,2),r=$(n.getFullYear(),4);a=`${r}${o}${t}${o}${e}`}if(i!==`date`){let e=$(n.getHours(),2),t=$(n.getMinutes(),2),r=$(n.getSeconds(),2),i=a===``?``:` `;a=`${a}${i}${e}${s}${t}${s}${r}`}return a}const ie={},ae={class:`cross-background-container`};function oe(e,t){return A(),b(`div`,ae,[M(e.$slots,`default`,{},void 0,!0)])}var se=s(ie,[[`render`,oe],[`__scopeId`,`data-v-455eb62c`]]);const ce={"mb-1":``,"w-full":``,"gap-2":``},le={"w-full":``};var ue=C({__name:`Header`,setup(e){return(e,t)=>(A(),b(`header`,ce,[_(`div`,le,[S(X)]),S(B(d),{class:`m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400`,to:`/settings`},{default:L(()=>t[0]||=[_(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),de=ue,fe=`/assets/worker-_4r9VDQB.js`;const pe={relative:``,px:`{O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),l(async()=>{O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),(e,t)=>{let i=N(`auto-animate`);return A(),b(`div`,pe,[t[3]||=_(`div`,{"flex-1":``},null,-1),R((A(),b(`div`,{ref_key:`chatHistoryRef`,ref:n,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[t[2]||=_(`div`,{"flex-1":``},null,-1),(A(!0),b(m,null,j(B(a),(e,n)=>(A(),b(`div`,{key:n,"mb-2":``},[e.role===`error`?(A(),b(`div`,me,[_(`div`,he,[_(`div`,ge,[_(`div`,_e,[_(`span`,ve,H(B(r)(`stage.chat.message.character-name.core-system`)),1)]),t[0]||=_(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),B(o)&&n===B(a).length-1?(A(),b(`div`,ye)):(A(),b(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base (A(),b(`div`,{key:n},[e.type===`tool-call`?(A(),b(`div`,Te,[_(`div`,Ee,[t[1]||=x(` Called: `,-1),_(`code`,null,H(e.toolCall.toolName),1)])])):e.type===`tool-call-result`?(A(),b(`div`,De)):(A(),b(`div`,{key:2,innerHTML:B(s)(e.text)},null,8,Oe))]))),128))])):n===B(a).length-1&&!e.content?(A(),b(`div`,ke)):y(``,!0)])])):e.role===`user`?(A(),b(`div`,Ae,[_(`div`,je,[_(`div`,null,[_(`span`,Me,H(B(r)(`stage.chat.message.character-name.you`)),1)]),e.content?(A(),b(`div`,{key:0,class:`markdown-content break-words`,text:`base {if(!e||!e.trim())return;let t=d.getProviderConfig(p.value);await x(e,{chatProvider:await d.getProviderInstance(p.value),model:m.value,providerConfig:t})}});async function M(){if(!(!o.value.trim()||u.value))try{let e=d.getProviderConfig(p.value);await x(o.value,{chatProvider:await d.getProviderInstance(p.value),model:m.value,providerConfig:e})}catch(e){T.value.pop(),T.value.push({role:`error`,content:e.message})}}let{destroy:N,start:P}=r(y,{onSpeechStart:()=>{s.value=!0},onVADMisfire:()=>{s.value=!1},onSpeechEnd:e=>{s.value=!1,F(e.buffer)},auto:!1});async function F(e){await E.resume();let t=await a(e,E.sampleRate);O({type:`generate`,data:{audio:t,language:`en`}})}return I(v,async e=>{e===!1&&(N(),j())}),I(l,async e=>{e&&await g()}),I([p,m],async()=>{p.value&&m.value&&await w(m.value,await d.getProviderInstance(p.value),[])}),k(()=>{P()}),C(async()=>{o.value=``}),(t,n)=>(A(),b(`div`,Le,[_(`div`,Re,[_(`div`,ze,[S(Ie,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`o.value=e,placeholder:B(D)(`stage.message`),text:`primary-500 hover:primary-600 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-400 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500`,bg:`primary-200/20 dark:primary-400/20`,"min-h":`[100px]`,"max-h":`[300px]`,"w-full":``,"rounded-t-xl":``,"p-4":``,"font-medium":``,"outline-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:V({"transition-colors-none placeholder:transition-colors-none":B(h)}),onSubmit:M,onCompositionstart:n[1]||=e=>u.value=!0,onCompositionend:n[2]||=e=>u.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])])]))}}),He=Ve;const Ue=[`src`],We=[`src`];var Ge=C({__name:`MobileHeaderLink`,setup(e){let t=w();return(e,n)=>(A(),v(B(d),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:L(()=>[B(t)?(A(),b(`img`,{key:0,src:B(Q),"h-8":``,"w-8":``,class:`theme-colored`},null,8,Ue)):(A(),b(`img`,{key:1,src:B(Z),"h-8":``,"w-8":``,class:`theme-colored`},null,8,We))]),_:1}))}}),Ke=s(Ge,[[`__scopeId`,`data-v-9c3d67a4`]]);const qe={"mb-1":``,"w-full":``,"gap-2":``},Je={"w-full":``,flex:``,"justify-center":``};var Ye=C({__name:`MobileHeader`,setup(e){return(e,t)=>(A(),b(`header`,qe,[_(`div`,Je,[S(Ke)])]))}}),Xe=Ye;const Ze={flex:`~ col`,rounded:`lg`,"overflow-hidden":``},Qe={key:0,flex:``,mr:`12`},$e={flex:`~ col`,shadow:`md violet-200/20 dark:none`,"min-w-20":``,"rounded-lg":``,"px-3":``,"py-2":``,h:`unset {O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),c(async()=>{O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),(e,t)=>{let i=N(`auto-animate`);return A(),b(`div`,Ze,[R((A(),b(`div`,{ref_key:`chatHistoryRef`,ref:n,"max-h":`35dvh`,"z-5":``,flex:`~ col`,"h-full":``,"w-full":``,"overflow-scroll":``,class:`chat-history`},[(A(!0),b(m,null,j(B(a),(e,n)=>(A(),b(`div`,{key:n,"mb-2":``},[e.role===`error`?(A(),b(`div`,Qe,[_(`div`,$e,[_(`div`,et,[_(`div`,null,[_(`span`,tt,H(B(r)(`stage.chat.message.character-name.core-system`)),1)]),t[0]||=_(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),e.content?(A(),b(`div`,{key:0,class:`markdown-content break-words`,text:`base {if(_t.test(e)){let t=Date.prototype[e.replace(_t,`$1UTC`)];t&&(gt.prototype[e]=t)}});var vt=class extends gt{toString(){let e=this.toDateString(),t=this.toTimeString();return`${e} ${t}`}toDateString(){let e=yt.format(this),t=bt.format(this),n=this.getFullYear();return`${e} ${t} ${n}`}toTimeString(){let e=xt.format(this);return`${e} GMT+0000 (Coordinated Universal Time)`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{timeZone:`UTC`,...t})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{timeZone:`UTC`,...t})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{timeZone:`UTC`,...t})}},yt=new Intl.DateTimeFormat(`en-US`,{weekday:`short`,timeZone:`UTC`}),bt=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,timeZone:`UTC`}),xt=new Intl.DateTimeFormat(`en-GB`,{hour12:!1,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZone:`UTC`});const St=`acda49dc66`,Ct=`main`,wt=`Thu Aug 7 00:00:35 2025 +0800`,Tt={"max-w":`calc[100%-2rem]`,"mx-auto":``,"h-full":``,flex:``,"flex-col":``,"pt-14":``},Et={"flex-1":``},Dt={grid:`~ cols-[70px_1fr]`,"mt-4":``,"gap-2":``,"text-sm":``},Ot={"font-mono":``},kt={"font-mono":``},At={"font-mono":``};var jt=C({__name:`About`,setup(e){let t=z(!1),n=re(new vt(wt));return(e,r)=>(A(),b(m,null,[_(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`About`,onClick:r[0]||=e=>t.value=!t.value},r[2]||=[_(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),S(B(l),{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e},{default:L(()=>[_(`div`,Tt,[r[7]||=_(`div`,{"mb-14":``,"text-center":``,"text-5xl":``,"font-sans-rounded":``},[_(`span`,{text:`neutral-400 dark:neutral-100/65`},`Project`),x(),_(`span`,{text:`pink-400 dark:pink-300/90`},`AIRI`),_(`div`,{"mt-2":``,"text-base":``},` Web ver. `)],-1),_(`div`,Et,[r[6]||=_(`div`,{text:`neutral-500 dark:neutral-400`},` Application build information `,-1),_(`div`,Dt,[r[3]||=_(`div`,{text:`neutral-500 dark:neutral-400`},` Branch `,-1),_(`div`,Ot,H(B(Ct)),1),r[4]||=_(`div`,{text:`neutral-500 dark:neutral-400`},` Commit `,-1),_(`div`,kt,H(B(St).substring(0,7)),1),r[5]||=_(`div`,{text:`neutral-500 dark:neutral-400`},` Built on `,-1),_(`div`,At,H(B(n)),1)])]),r[8]||=_(`div`,{"my-10":``},[_(`div`,{text:`neutral-500 dark:neutral-400`},` About `),_(`div`,{"mt-4":``,flex:``,"flex-col":``,"gap-2":``},[_(`a`,{class:V([`block`,`flex items-center gap-2`,`rounded-xl px-3 py-2 lg:px-5 lg:py-3 outline-none backdrop-blur-md active:scale-95 focus:outline-none text-nowrap text-sm md:text-base`,`text-slate-700 dark:text-slate-100`]),bg:`black/4 dark:black/10 dark:hover:white/30`,transition:`colors,transform duration-200 ease-in-out`,href:`https://airi.moeru.ai/docs/`,target:`_blank`},[_(`div`,{"i-solar:home-smile-outline":``}),_(`div`,null,`Home`)]),_(`a`,{href:`https://airi.moeru.ai/docs/en/docs/overview/`,class:V([`block`,`flex items-center gap-2`,`rounded-xl px-3 py-2 lg:px-5 lg:py-3 outline-none backdrop-blur-md active:scale-95 focus:outline-none text-nowrap text-sm md:text-base`,`text-slate-700 dark:text-slate-100`]),bg:`black/4 dark:black/10 dark:hover:white/30`,transition:`colors,transform duration-200 ease-in-out`,target:`_blank`},[_(`div`,{"i-solar:document-add-outline":``}),_(`div`,null,`Documentations`)]),_(`a`,{href:`https://github.com/moeru-ai/airi`,class:V([`block`,`flex items-center gap-2`,`rounded-xl px-3 py-2 lg:px-5 lg:py-3 outline-none backdrop-blur-md active:scale-95 focus:outline-none text-nowrap text-sm md:text-base`,`text-slate-700 dark:text-slate-100`]),bg:`black/4 dark:black/10 dark:hover:white/30`,transition:`colors,transform duration-200 ease-in-out`,target:`_blank`},[_(`div`,{"i-simple-icons:github":``}),_(`div`,null,`GitHub`)])])],-1)])]),_:1},8,[`modelValue`])],64))}}),Mt=jt;const Nt={"w-full":``,flex:``,"flex-1":``,"items-center":``,"self-end":``,"justify-end":``,"gap-2":``},Pt={key:0,"w-full":``,flex:``,"justify-between":``,"gap-2":``},Ft={key:0,"i-solar:tuning-outline":``,"size-5":``},It={key:1,"i-solar:alt-arrow-right-outline":``,"size-5":``};var Lt=C({__name:`ViewControls`,props:{modelValue:{required:!0},modelModifiers:{}},emits:D([`reset`],[`update:modelValue`]),setup(e,{emit:t}){let n=t,{stageView:r,stageViewControlsEnabled:i}=f(W()),a=P(e,`modelValue`);function o(e){if(a.value===e){n(`reset`);return}a.value=e}return(e,t)=>(A(),b(`div`,Nt,[S(p,{name:`fade`},{default:L(()=>[B(i)?(A(),b(`div`,Pt,[S(B(u),{variant:`secondary-muted`,toggled:a.value===`x`,"w-full":``,onClick:t[0]||=e=>o(`x`)},{default:L(()=>t[5]||=[x(` X `,-1)]),_:1,__:[5]},8,[`toggled`]),S(B(u),{variant:`secondary-muted`,toggled:a.value===`y`,"w-full":``,onClick:t[1]||=e=>o(`y`)},{default:L(()=>t[6]||=[x(` Y `,-1)]),_:1,__:[6]},8,[`toggled`]),B(r)===`3d`?(A(),v(B(u),{key:0,variant:`secondary-muted`,toggled:a.value===`z`,"w-full":``,onClick:t[2]||=e=>o(`z`)},{default:L(()=>t[7]||=[x(` Z `,-1)]),_:1,__:[7]},8,[`toggled`])):y(``,!0),S(B(u),{variant:`secondary-muted`,toggled:a.value===`scale`,"w-full":``,onClick:t[3]||=e=>o(`scale`)},{default:L(()=>t[8]||=[x(` Scale `,-1)]),_:1,__:[8]},8,[`toggled`])])):y(``,!0)]),_:1}),_(`button`,{"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"justify-self-end":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,title:`View`,text:`neutral-500 dark:neutral-400`,onClick:t[4]||=e=>i.value=!B(i)},[S(p,{name:`fade`,mode:`out-in`},{default:L(()=>[B(i)?(A(),b(`div`,It)):(A(),b(`div`,Ft))]),_:1})])]))}}),Rt=s(Lt,[[`__scopeId`,`data-v-35df7db7`]]);const zt={key:0},Bt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Vt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Ht={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Ut={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Wt={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Gt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Kt={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},qt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`};var Jt=C({__name:`Inputs`,props:{mode:{}},setup(e,{expose:t}){let n=e,{stageView:r,stageViewControlsEnabled:i}=f(W()),{scale:a,modelOffset:s,modelSize:c}=f(U()),{scale:l,position:u}=f(K()),d=g({get:()=>{switch(r.value){case`2d`:return u.value.x;case`3d`:return s.value.x;default:return 0}},set:e=>{switch(r.value){case`2d`:u.value.x=e;break;case`3d`:s.value.x=e;break;default:break}}}),m=g(()=>r.value===`2d`?-500:-c.value.x-10),h=g(()=>r.value===`2d`?500:c.value.x+10),x=g({get:()=>{switch(r.value){case`2d`:return u.value.y;case`3d`:return s.value.y;default:return 0}},set:e=>{switch(r.value){case`2d`:u.value.y=e;break;case`3d`:s.value.y=e;break;default:break}}}),C=g(()=>r.value===`2d`?-500:-c.value.y-10),w=g(()=>r.value===`2d`?500:c.value.y+10),T=g({get:()=>{switch(r.value){case`2d`:return 0;case`3d`:return s.value.z;default:return 0}},set:e=>{switch(r.value){case`2d`:break;case`3d`:s.value.z=e;break;default:break}}}),E=g(()=>r.value===`2d`?-500:-c.value.z-10),D=g(()=>r.value===`2d`?500:c.value.z+10),O=g({get:()=>r.value===`2d`?l.value:a.value,set:e=>{r.value===`2d`?l.value=e:a.value=e}});function k(){switch(n.mode){case`x`:d.value=0;break;case`y`:x.value=0;break;case`z`:T.value=0;break;case`scale`:O.value=1;break}}return t({resetOnMode:k}),(e,t)=>(A(),v(p,{name:`fade-side-pops-in`},{default:L(()=>[B(i)?(A(),b(`div`,zt,[S(p,{name:`fade-side-pops-in`,mode:`out-in`},{default:L(()=>[n.mode===`x`?(A(),b(`div`,Bt,[S(B(o),{modelValue:d.value,"onUpdate:modelValue":t[0]||=e=>d.value=e,min:m.value,max:h.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),_(`div`,Vt,H(d.value.toFixed(2)),1)])):n.mode===`y`?(A(),b(`div`,Ht,[S(B(o),{modelValue:x.value,"onUpdate:modelValue":t[1]||=e=>x.value=e,min:C.value,max:w.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),_(`div`,Ut,H(x.value.toFixed(2)),1)])):B(r)===`3d`&&n.mode===`z`?(A(),b(`div`,Wt,[S(B(o),{modelValue:T.value,"onUpdate:modelValue":t[2]||=e=>T.value=e,min:E.value,max:D.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),_(`div`,Gt,H(T.value.toFixed(2)),1)])):n.mode===`scale`?(A(),b(`div`,Kt,[S(B(o),{modelValue:O.value,"onUpdate:modelValue":t[3]||=e=>O.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),_(`div`,qt,H(O.value.toFixed(2)),1)])):y(``,!0)]),_:1})])):y(``,!0)]),_:1}))}}),Yt=s(Jt,[[`__scopeId`,`data-v-225b2747`]]);const Xt={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},Zt={relative:``,"w-full":``,"self-end":``},Qt={top:`50%`,"translate-y":`[-50%]`,fixed:``,"z-15":``,"px-3":``},$t={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-3":``,"pb-3":``,"font-sans":``},en={flex:`~ col`,"w-full":``,"gap-1":``},tn={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},nn={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},rn={key:0,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},an={key:1,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``};var on=C({__name:`MobileInteractiveArea`,setup(n){let i=w({disableTransition:!1}),a=z(`scale`),o=F(`viewControlsInputs`),s=z(``),c=z(!1),l=z(!1),u=E(),m=Y(),{activeProvider:g,activeModel:x}=f(J());T(document.documentElement,()=>u.update());let{themeColorsHueDynamic:C,stageView:D,stageViewControlsEnabled:O}=f(W()),{enabled:j,selectedAudioInput:M}=f(G()),{send:N,onAfterMessageComposed:P,discoverToolsCompatibility:R}=q(),{messages:H}=f(q()),{t:U}=t();async function K(){if(!(!s.value.trim()||l.value))try{let e=m.getProviderConfig(g.value);await N(s.value,{chatProvider:await m.getProviderInstance(g.value),model:x.value,providerConfig:e})}catch(e){H.value.pop(),H.value.push({role:`error`,content:e.message})}}let{destroy:X,start:Z}=r(M,{onSpeechStart:()=>{c.value=!0},onVADMisfire:()=>{c.value=!1},onSpeechEnd:e=>{c.value=!1,Q(e)},auto:!1});function Q(e){alert(`Transcription is not implemented yet`)}return I(j,async e=>{e===!1&&X()}),P(async()=>{s.value=``}),I([g,x],async()=>{g.value&&x.value&&await R(x.value,await m.getProviderInstance(g.value),[])}),k(()=>{Z(),u.update()}),(t,n)=>(A(),b(`div`,Xt,[(A(),v(h,null,[S(p,{name:`fade`},{default:L(()=>[B(O)?y(``,!0):(A(),v(ht,{key:0,"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-3":``}))]),_:1})],1024)),_(`div`,Zt,[_(`div`,Qt,[S(Yt,{ref:`viewControlsInputs`,mode:a.value},null,8,[`mode`])]),_(`div`,$t,[_(`div`,en,[S(Mt),_(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Theme`,onClick:n[0]||=e=>i.value=!B(i)},[S(p,{name:`fade`,mode:`out-in`},{default:L(()=>[B(i)?(A(),b(`div`,tn)):(A(),b(`div`,nn))]),_:1})]),S(B(d),{to:`/settings`,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Settings`},{default:L(()=>n[7]||=[_(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),_:1,__:[7]}),_(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Stage View`,onClick:n[1]||=e=>D.value=B(D)===`2d`?`3d`:`2d`},[B(D)===`2d`?(A(),b(`div`,rn,n[8]||=[_(`span`,null,`2D`,-1)])):y(``,!0),B(D)===`3d`?(A(),b(`div`,an,n[9]||=[_(`span`,null,`3D`,-1)])):y(``,!0)]),S(Rt,{modelValue:a.value,"onUpdate:modelValue":n[2]||=e=>a.value=e,onReset:n[3]||=()=>o.value?.resetOnMode()},null,8,[`modelValue`])])]),_(`div`,{bg:`white dark:neutral-800`,"max-h-100dvh":``,"max-w-100dvw":``,"w-full":``,flex:``,"gap-1":``,"overflow-auto":``,"px-3":``,"pt-2":``,style:ee({paddingBottom:`${Math.max(Number.parseFloat(B(u).bottom.value.replace(`px`,``)),12)}px`})},[S(B(e),{modelValue:s.value,"onUpdate:modelValue":n[4]||=e=>s.value=e,placeholder:B(U)(`stage.message`),border:`solid 2 neutral-200/60 dark:neutral-700/60`,text:`neutral-500 hover:neutral-600 dark:neutral-100 dark:hover:neutral-200 placeholder:neutral-400 placeholder:hover:neutral-500 placeholder:dark:neutral-300 placeholder:dark:hover:neutral-400`,bg:`neutral-100/80 dark:neutral-950/80`,"max-h":`[10lh]`,"min-h":`[calc(1lh+4px+4px)]`,"w-full":``,"resize-none":``,"overflow-y-scroll":``,rounded:`[1lh]`,"px-4":``,"py-0.5":``,"outline-none":``,"backdrop-blur-md":``,"scrollbar-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:V([B(C)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:()=>{},onCompositionstart:n[5]||=e=>l.value=!0,onCompositionend:n[6]||=e=>l.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),s.value.trim()||l.value?(A(),b(`button`,{key:0,w:`[calc(1lh+4px+4px)]`,h:`[calc(1lh+4px+4px)]`,"aspect-square":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-full":``,"outline-none":``,"backdrop-blur-md":``,text:`neutral-500 hover:neutral-600 dark:neutral-900 dark:hover:neutral-800`,bg:`primary-50/80 dark:neutral-100/80 hover:neutral-50`,transition:`all duration-250 ease-in-out`,onClick:K},n[10]||=[_(`div`,{"i-solar:arrow-up-outline":``},null,-1)])):y(``,!0)],4)])]))}}),sn=on;const cn={class:`relative`},ln={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var un=C({__name:`AnimatedWave`,props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:`oklch(95% 0.10 var(--chromatic-hue))`},direction:{default:`down`},movementDirection:{default:`left`},animationSpeed:{default:50}},setup(e){let t=e,n=z(t.height),r=z(t.amplitude),i=z(t.waveLength),a=z(t.fillColor),o=z(t.direction),s=z(t.movementDirection);function c(e,t,n,r,i){let a=[],o=Math.ceil(e/r),s=o*r,c=1,l=i===`up`?n:t-n;a.push(`M 0 ${l}`);let u=Math.PI*2/r;for(let e=0;e<=s;e+=c){let t=n*Math.sin(u*e),r=i===`up`?l-t:l+t;a.push(`L ${e} ${r}`)}let d=i===`up`?t:0;return a.push(`L ${s} ${d}`),a.push(`L 0 ${d} Z`),a.join(` `)}let l=g(()=>n.value+r.value*2),u=g(()=>{let e=` +import{b as e}from"./Basic-kTOabOY_.js";import{A as t,bT as n,c6 as r,c7 as i,c9 as a,cJ as o,cO as s,cc as c,ce as l,cj as u,d$ as d,d3 as f,d8 as p,dM as m,dS as h,dT as g,dU as _,dV as v,dW as y,dX as b,dY as x,dZ as S,d_ as C,dc as w,dk as T,dl as E,e2 as D,e4 as O,e5 as k,e7 as A,e8 as j,e9 as M,eb as N,ec as P,ed as F,ee as I,ef as L,eg as R,ei as z,em as B,en as V,ep as ee,eq as H,n as U,o as W,p as G,q as K,s as q,x as J,y as Y}from"./index-BF1-WNuF.js";import{b as X,c as Z,d as Q}from"./HeaderLink-DVkQgheP.js";import{d as $,e as te,f as ne}from"./Scenes-CogR6jTf.js";function re(e,t){let n=ne(e,t?.in);if(!te(n))throw RangeError(`Invalid time value`);let r=t?.format??`extended`,i=t?.representation??`complete`,a=``,o=r===`extended`?`-`:``,s=r===`extended`?`:`:``;if(i!==`time`){let e=$(n.getDate(),2),t=$(n.getMonth()+1,2),r=$(n.getFullYear(),4);a=`${r}${o}${t}${o}${e}`}if(i!==`date`){let e=$(n.getHours(),2),t=$(n.getMinutes(),2),r=$(n.getSeconds(),2),i=a===``?``:` `;a=`${a}${i}${e}${s}${t}${s}${r}`}return a}const ie={},ae={class:`cross-background-container`};function oe(e,t){return A(),x(`div`,ae,[M(e.$slots,`default`,{},void 0,!0)])}var se=s(ie,[[`render`,oe],[`__scopeId`,`data-v-455eb62c`]]);const ce={"mb-1":``,"w-full":``,"gap-2":``},le={"w-full":``};var ue=d({__name:`Header`,setup(e){return(e,t)=>(A(),x(`header`,ce,[v(`div`,le,[C(X)]),C(B(f),{class:`m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400`,to:`/settings`},{default:L(()=>t[0]||=[v(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),de=ue,fe=`/assets/worker-_4r9VDQB.js`;const pe={relative:``,px:`{O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),l(async()=>{O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),(e,t)=>{let i=N(`auto-animate`);return A(),x(`div`,pe,[t[3]||=v(`div`,{"flex-1":``},null,-1),R((A(),x(`div`,{ref_key:`chatHistoryRef`,ref:n,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[t[2]||=v(`div`,{"flex-1":``},null,-1),(A(!0),x(h,null,j(B(a),(e,n)=>(A(),x(`div`,{key:n,"mb-2":``},[e.role===`error`?(A(),x(`div`,me,[v(`div`,he,[v(`div`,ge,[v(`div`,_e,[v(`span`,ve,H(B(r)(`stage.chat.message.character-name.core-system`)),1)]),t[0]||=v(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),B(o)&&n===B(a).length-1?(A(),x(`div`,ye)):(A(),x(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base (A(),x(`div`,{key:n},[e.type===`tool-call`?(A(),x(`div`,Te,[v(`div`,Ee,[t[1]||=S(` Called: `,-1),v(`code`,null,H(e.toolCall.toolName),1)])])):e.type===`tool-call-result`?(A(),x(`div`,De)):(A(),x(`div`,{key:2,innerHTML:B(s)(e.text)},null,8,Oe))]))),128))])):n===B(a).length-1&&!e.content?(A(),x(`div`,ke)):b(``,!0)])])):e.role===`user`?(A(),x(`div`,Ae,[v(`div`,je,[v(`div`,null,[v(`span`,Me,H(B(r)(`stage.chat.message.character-name.you`)),1)]),e.content?(A(),x(`div`,{key:0,class:`markdown-content break-words`,text:`base {if(!e||!e.trim())return;let t=d.getProviderConfig(f.value);await b(e,{chatProvider:await d.getProviderInstance(f.value),model:m.value,providerConfig:t})}});async function M(){if(!(!o.value.trim()||u.value))try{let e=d.getProviderConfig(f.value);await b(o.value,{chatProvider:await d.getProviderInstance(f.value),model:m.value,providerConfig:e})}catch(e){T.value.pop(),T.value.push({role:`error`,content:e.message})}}let{destroy:N,start:P}=r(y,{onSpeechStart:()=>{s.value=!0},onVADMisfire:()=>{s.value=!1},onSpeechEnd:e=>{s.value=!1,F(e.buffer)},auto:!1});async function F(e){await E.resume();let t=await a(e,E.sampleRate);O({type:`generate`,data:{audio:t,language:`en`}})}return I(_,async e=>{e===!1&&(N(),j())}),I(l,async e=>{e&&await g()}),I([f,m],async()=>{f.value&&m.value&&await w(m.value,await d.getProviderInstance(f.value),[])}),k(()=>{P()}),S(async()=>{o.value=``}),(t,n)=>(A(),x(`div`,Le,[v(`div`,Re,[v(`div`,ze,[C(Ie,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`o.value=e,placeholder:B(D)(`stage.message`),text:`primary-500 hover:primary-600 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-400 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500`,bg:`primary-200/20 dark:primary-400/20`,"min-h":`[100px]`,"max-h":`[300px]`,"w-full":``,"rounded-t-xl":``,"p-4":``,"font-medium":``,"outline-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:V({"transition-colors-none placeholder:transition-colors-none":B(h)}),onSubmit:M,onCompositionstart:n[1]||=e=>u.value=!0,onCompositionend:n[2]||=e=>u.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])])]))}}),He=Ve;const Ue=[`src`],We=[`src`];var Ge=d({__name:`MobileHeaderLink`,setup(e){let t=w();return(e,n)=>(A(),y(B(f),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:L(()=>[B(t)?(A(),x(`img`,{key:0,src:B(Q),"h-8":``,"w-8":``,class:`theme-colored`},null,8,Ue)):(A(),x(`img`,{key:1,src:B(Z),"h-8":``,"w-8":``,class:`theme-colored`},null,8,We))]),_:1}))}}),Ke=s(Ge,[[`__scopeId`,`data-v-9c3d67a4`]]);const qe={"mb-1":``,"w-full":``,"gap-2":``},Je={"w-full":``,flex:``,"justify-center":``};var Ye=d({__name:`MobileHeader`,setup(e){return(e,t)=>(A(),x(`header`,qe,[v(`div`,Je,[C(Ke)])]))}}),Xe=Ye;const Ze={flex:`~ col`,rounded:`lg`,"overflow-hidden":``},Qe={key:0,flex:``,mr:`12`},$e={flex:`~ col`,shadow:`md violet-200/20 dark:none`,"min-w-20":``,"rounded-lg":``,"px-3":``,"py-2":``,h:`unset {O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),c(async()=>{O().then(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}),(e,t)=>{let i=N(`auto-animate`);return A(),x(`div`,Ze,[R((A(),x(`div`,{ref_key:`chatHistoryRef`,ref:n,"max-h":`35dvh`,"z-5":``,flex:`~ col`,"h-full":``,"w-full":``,"overflow-scroll":``,class:`chat-history`},[(A(!0),x(h,null,j(B(a),(e,n)=>(A(),x(`div`,{key:n,"mb-2":``},[e.role===`error`?(A(),x(`div`,Qe,[v(`div`,$e,[v(`div`,et,[v(`div`,null,[v(`span`,tt,H(B(r)(`stage.chat.message.character-name.core-system`)),1)]),t[0]||=v(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),e.content?(A(),x(`div`,{key:0,class:`markdown-content break-words`,text:`base {if(_t.test(e)){let t=Date.prototype[e.replace(_t,`$1UTC`)];t&&(gt.prototype[e]=t)}});var vt=class extends gt{toString(){let e=this.toDateString(),t=this.toTimeString();return`${e} ${t}`}toDateString(){let e=yt.format(this),t=bt.format(this),n=this.getFullYear();return`${e} ${t} ${n}`}toTimeString(){let e=xt.format(this);return`${e} GMT+0000 (Coordinated Universal Time)`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{timeZone:`UTC`,...t})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{timeZone:`UTC`,...t})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{timeZone:`UTC`,...t})}},yt=new Intl.DateTimeFormat(`en-US`,{weekday:`short`,timeZone:`UTC`}),bt=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,timeZone:`UTC`}),xt=new Intl.DateTimeFormat(`en-GB`,{hour12:!1,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZone:`UTC`});const St=`18d48e4638`,Ct=`main`,wt=`Thu Aug 7 01:34:28 2025 +0800`,Tt={"max-w":`calc[100%-2rem]`,"mx-auto":``,"h-full":``,flex:``,"flex-col":``,"pt-14":``},Et={"flex-1":``},Dt={grid:`~ cols-[70px_1fr]`,"mt-4":``,"gap-2":``,"text-sm":``},Ot={"font-mono":``},kt={"font-mono":``},At={"font-mono":``};var jt=d({__name:`About`,setup(e){let t=z(!1),n=re(new vt(wt));return(e,r)=>(A(),x(h,null,[v(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`About`,onClick:r[0]||=e=>t.value=!t.value},r[2]||=[v(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),C(B(l),{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e},{default:L(()=>[v(`div`,Tt,[r[7]||=v(`div`,{"mb-14":``,"text-center":``,"text-5xl":``,"font-sans-rounded":``},[v(`span`,{text:`neutral-400 dark:neutral-100/65`},`Project`),S(),v(`span`,{text:`pink-400 dark:pink-300/90`},`AIRI`),v(`div`,{"mt-2":``,"text-base":``},` Web ver. `)],-1),v(`div`,Et,[r[6]||=v(`div`,{text:`neutral-500 dark:neutral-400`},` Application build information `,-1),v(`div`,Dt,[r[3]||=v(`div`,{text:`neutral-500 dark:neutral-400`},` Branch `,-1),v(`div`,Ot,H(B(Ct)),1),r[4]||=v(`div`,{text:`neutral-500 dark:neutral-400`},` Commit `,-1),v(`div`,kt,H(B(St).substring(0,7)),1),r[5]||=v(`div`,{text:`neutral-500 dark:neutral-400`},` Built on `,-1),v(`div`,At,H(B(n)),1)])]),r[8]||=v(`div`,{"my-10":``},[v(`div`,{text:`neutral-500 dark:neutral-400`},` About `),v(`div`,{"mt-4":``,flex:``,"flex-col":``,"gap-2":``},[v(`a`,{class:V([`block`,`flex items-center gap-2`,`rounded-xl px-3 py-2 lg:px-5 lg:py-3 outline-none backdrop-blur-md active:scale-95 focus:outline-none text-nowrap text-sm md:text-base`,`text-slate-700 dark:text-slate-100`]),bg:`black/4 dark:black/10 dark:hover:white/30`,transition:`colors,transform duration-200 ease-in-out`,href:`https://airi.moeru.ai/docs/`,target:`_blank`},[v(`div`,{"i-solar:home-smile-outline":``}),v(`div`,null,`Home`)]),v(`a`,{href:`https://airi.moeru.ai/docs/en/docs/overview/`,class:V([`block`,`flex items-center gap-2`,`rounded-xl px-3 py-2 lg:px-5 lg:py-3 outline-none backdrop-blur-md active:scale-95 focus:outline-none text-nowrap text-sm md:text-base`,`text-slate-700 dark:text-slate-100`]),bg:`black/4 dark:black/10 dark:hover:white/30`,transition:`colors,transform duration-200 ease-in-out`,target:`_blank`},[v(`div`,{"i-solar:document-add-outline":``}),v(`div`,null,`Documentations`)]),v(`a`,{href:`https://github.com/moeru-ai/airi`,class:V([`block`,`flex items-center gap-2`,`rounded-xl px-3 py-2 lg:px-5 lg:py-3 outline-none backdrop-blur-md active:scale-95 focus:outline-none text-nowrap text-sm md:text-base`,`text-slate-700 dark:text-slate-100`]),bg:`black/4 dark:black/10 dark:hover:white/30`,transition:`colors,transform duration-200 ease-in-out`,target:`_blank`},[v(`div`,{"i-simple-icons:github":``}),v(`div`,null,`GitHub`)])])],-1)])]),_:1},8,[`modelValue`])],64))}}),Mt=jt;const Nt={"w-full":``,flex:``,"flex-1":``,"items-center":``,"self-end":``,"justify-end":``,"gap-2":``},Pt={key:0,"w-full":``,flex:``,"justify-between":``,"gap-2":``},Ft={key:0,"i-solar:tuning-outline":``,"size-5":``},It={key:1,"i-solar:alt-arrow-right-outline":``,"size-5":``};var Lt=d({__name:`ViewControls`,props:{modelValue:{required:!0},modelModifiers:{}},emits:D([`reset`],[`update:modelValue`]),setup(e,{emit:t}){let n=t,{stageView:r,stageViewControlsEnabled:i}=p(W()),a=P(e,`modelValue`);function o(e){if(a.value===e){n(`reset`);return}a.value=e}return(e,t)=>(A(),x(`div`,Nt,[C(m,{name:`fade`},{default:L(()=>[B(i)?(A(),x(`div`,Pt,[C(B(u),{variant:`secondary-muted`,toggled:a.value===`x`,"w-full":``,onClick:t[0]||=e=>o(`x`)},{default:L(()=>t[5]||=[S(` X `,-1)]),_:1,__:[5]},8,[`toggled`]),C(B(u),{variant:`secondary-muted`,toggled:a.value===`y`,"w-full":``,onClick:t[1]||=e=>o(`y`)},{default:L(()=>t[6]||=[S(` Y `,-1)]),_:1,__:[6]},8,[`toggled`]),B(r)===`3d`?(A(),y(B(u),{key:0,variant:`secondary-muted`,toggled:a.value===`z`,"w-full":``,onClick:t[2]||=e=>o(`z`)},{default:L(()=>t[7]||=[S(` Z `,-1)]),_:1,__:[7]},8,[`toggled`])):b(``,!0),C(B(u),{variant:`secondary-muted`,toggled:a.value===`scale`,"w-full":``,onClick:t[3]||=e=>o(`scale`)},{default:L(()=>t[8]||=[S(` Scale `,-1)]),_:1,__:[8]},8,[`toggled`])])):b(``,!0)]),_:1}),v(`button`,{"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"justify-self-end":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,title:`View`,text:`neutral-500 dark:neutral-400`,onClick:t[4]||=e=>i.value=!B(i)},[C(m,{name:`fade`,mode:`out-in`},{default:L(()=>[B(i)?(A(),x(`div`,It)):(A(),x(`div`,Ft))]),_:1})])]))}}),Rt=s(Lt,[[`__scopeId`,`data-v-35df7db7`]]);const zt={key:0},Bt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Vt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Ht={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Ut={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Wt={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Gt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Kt={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},qt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`};var Jt=d({__name:`Inputs`,props:{mode:{}},setup(e,{expose:t}){let n=e,{stageView:r,stageViewControlsEnabled:i}=p(W()),{scale:a,modelOffset:s,modelSize:c}=p(U()),{scale:l,position:u}=p(K()),d=_({get:()=>{switch(r.value){case`2d`:return u.value.x;case`3d`:return s.value.x;default:return 0}},set:e=>{switch(r.value){case`2d`:u.value.x=e;break;case`3d`:s.value.x=e;break;default:break}}}),f=_(()=>r.value===`2d`?-500:-c.value.x-10),h=_(()=>r.value===`2d`?500:c.value.x+10),g=_({get:()=>{switch(r.value){case`2d`:return u.value.y;case`3d`:return s.value.y;default:return 0}},set:e=>{switch(r.value){case`2d`:u.value.y=e;break;case`3d`:s.value.y=e;break;default:break}}}),S=_(()=>r.value===`2d`?-500:-c.value.y-10),w=_(()=>r.value===`2d`?500:c.value.y+10),T=_({get:()=>{switch(r.value){case`2d`:return 0;case`3d`:return s.value.z;default:return 0}},set:e=>{switch(r.value){case`2d`:break;case`3d`:s.value.z=e;break;default:break}}}),E=_(()=>r.value===`2d`?-500:-c.value.z-10),D=_(()=>r.value===`2d`?500:c.value.z+10),O=_({get:()=>r.value===`2d`?l.value:a.value,set:e=>{r.value===`2d`?l.value=e:a.value=e}});function k(){switch(n.mode){case`x`:d.value=0;break;case`y`:g.value=0;break;case`z`:T.value=0;break;case`scale`:O.value=1;break}}return t({resetOnMode:k}),(e,t)=>(A(),y(m,{name:`fade-side-pops-in`},{default:L(()=>[B(i)?(A(),x(`div`,zt,[C(m,{name:`fade-side-pops-in`,mode:`out-in`},{default:L(()=>[n.mode===`x`?(A(),x(`div`,Bt,[C(B(o),{modelValue:d.value,"onUpdate:modelValue":t[0]||=e=>d.value=e,min:f.value,max:h.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),v(`div`,Vt,H(d.value.toFixed(2)),1)])):n.mode===`y`?(A(),x(`div`,Ht,[C(B(o),{modelValue:g.value,"onUpdate:modelValue":t[1]||=e=>g.value=e,min:S.value,max:w.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),v(`div`,Ut,H(g.value.toFixed(2)),1)])):B(r)===`3d`&&n.mode===`z`?(A(),x(`div`,Wt,[C(B(o),{modelValue:T.value,"onUpdate:modelValue":t[2]||=e=>T.value=e,min:E.value,max:D.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),v(`div`,Gt,H(T.value.toFixed(2)),1)])):n.mode===`scale`?(A(),x(`div`,Kt,[C(B(o),{modelValue:O.value,"onUpdate:modelValue":t[3]||=e=>O.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),v(`div`,qt,H(O.value.toFixed(2)),1)])):b(``,!0)]),_:1})])):b(``,!0)]),_:1}))}}),Yt=s(Jt,[[`__scopeId`,`data-v-225b2747`]]);const Xt={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},Zt={relative:``,"w-full":``,"self-end":``},Qt={top:`50%`,"translate-y":`[-50%]`,fixed:``,"z-15":``,"px-3":``},$t={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-3":``,"pb-3":``,"font-sans":``},en={flex:`~ col`,"w-full":``,"gap-1":``},tn={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},nn={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},rn={key:0,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},an={key:1,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``};var on=d({__name:`MobileInteractiveArea`,setup(n){let i=w({disableTransition:!1}),a=z(`scale`),o=F(`viewControlsInputs`),s=z(``),c=z(!1),l=z(!1),u=E(),d=Y(),{activeProvider:h,activeModel:_}=p(J());T(document.documentElement,()=>u.update());let{themeColorsHueDynamic:S,stageView:D,stageViewControlsEnabled:O}=p(W()),{enabled:j,selectedAudioInput:M}=p(G()),{send:N,onAfterMessageComposed:P,discoverToolsCompatibility:R}=q(),{messages:H}=p(q()),{t:U}=t();async function K(){if(!(!s.value.trim()||l.value))try{let e=d.getProviderConfig(h.value);await N(s.value,{chatProvider:await d.getProviderInstance(h.value),model:_.value,providerConfig:e})}catch(e){H.value.pop(),H.value.push({role:`error`,content:e.message})}}let{destroy:X,start:Z}=r(M,{onSpeechStart:()=>{c.value=!0},onVADMisfire:()=>{c.value=!1},onSpeechEnd:e=>{c.value=!1,Q(e)},auto:!1});function Q(e){alert(`Transcription is not implemented yet`)}return I(j,async e=>{e===!1&&X()}),P(async()=>{s.value=``}),I([h,_],async()=>{h.value&&_.value&&await R(_.value,await d.getProviderInstance(h.value),[])}),k(()=>{Z(),u.update()}),(t,n)=>(A(),x(`div`,Xt,[(A(),y(g,null,[C(m,{name:`fade`},{default:L(()=>[B(O)?b(``,!0):(A(),y(ht,{key:0,"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-3":``}))]),_:1})],1024)),v(`div`,Zt,[v(`div`,Qt,[C(Yt,{ref:`viewControlsInputs`,mode:a.value},null,8,[`mode`])]),v(`div`,$t,[v(`div`,en,[C(Mt),v(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Theme`,onClick:n[0]||=e=>i.value=!B(i)},[C(m,{name:`fade`,mode:`out-in`},{default:L(()=>[B(i)?(A(),x(`div`,tn)):(A(),x(`div`,nn))]),_:1})]),C(B(f),{to:`/settings`,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Settings`},{default:L(()=>n[7]||=[v(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),_:1,__:[7]}),v(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Stage View`,onClick:n[1]||=e=>D.value=B(D)===`2d`?`3d`:`2d`},[B(D)===`2d`?(A(),x(`div`,rn,n[8]||=[v(`span`,null,`2D`,-1)])):b(``,!0),B(D)===`3d`?(A(),x(`div`,an,n[9]||=[v(`span`,null,`3D`,-1)])):b(``,!0)]),C(Rt,{modelValue:a.value,"onUpdate:modelValue":n[2]||=e=>a.value=e,onReset:n[3]||=()=>o.value?.resetOnMode()},null,8,[`modelValue`])])]),v(`div`,{bg:`white dark:neutral-800`,"max-h-100dvh":``,"max-w-100dvw":``,"w-full":``,flex:``,"gap-1":``,"overflow-auto":``,"px-3":``,"pt-2":``,style:ee({paddingBottom:`${Math.max(Number.parseFloat(B(u).bottom.value.replace(`px`,``)),12)}px`})},[C(B(e),{modelValue:s.value,"onUpdate:modelValue":n[4]||=e=>s.value=e,placeholder:B(U)(`stage.message`),border:`solid 2 neutral-200/60 dark:neutral-700/60`,text:`neutral-500 hover:neutral-600 dark:neutral-100 dark:hover:neutral-200 placeholder:neutral-400 placeholder:hover:neutral-500 placeholder:dark:neutral-300 placeholder:dark:hover:neutral-400`,bg:`neutral-100/80 dark:neutral-950/80`,"max-h":`[10lh]`,"min-h":`[calc(1lh+4px+4px)]`,"w-full":``,"resize-none":``,"overflow-y-scroll":``,rounded:`[1lh]`,"px-4":``,"py-0.5":``,"outline-none":``,"backdrop-blur-md":``,"scrollbar-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:V([B(S)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:()=>{},onCompositionstart:n[5]||=e=>l.value=!0,onCompositionend:n[6]||=e=>l.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),s.value.trim()||l.value?(A(),x(`button`,{key:0,w:`[calc(1lh+4px+4px)]`,h:`[calc(1lh+4px+4px)]`,"aspect-square":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-full":``,"outline-none":``,"backdrop-blur-md":``,text:`neutral-500 hover:neutral-600 dark:neutral-900 dark:hover:neutral-800`,bg:`primary-50/80 dark:neutral-100/80 hover:neutral-50`,transition:`all duration-250 ease-in-out`,onClick:K},n[10]||=[v(`div`,{"i-solar:arrow-up-outline":``},null,-1)])):b(``,!0)],4)])]))}}),sn=on;const cn={class:`relative`},ln={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var un=d({__name:`AnimatedWave`,props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:`oklch(95% 0.10 var(--chromatic-hue))`},direction:{default:`down`},movementDirection:{default:`left`},animationSpeed:{default:50}},setup(e){let t=e,n=z(t.height),r=z(t.amplitude),i=z(t.waveLength),a=z(t.fillColor),o=z(t.direction),s=z(t.movementDirection);function c(e,t,n,r,i){let a=[],o=Math.ceil(e/r),s=o*r,c=1,l=i===`up`?n:t-n;a.push(`M 0 ${l}`);let u=Math.PI*2/r;for(let e=0;e<=s;e+=c){let t=n*Math.sin(u*e),r=i===`up`?l-t:l+t;a.push(`L ${e} ${r}`)}let d=i===`up`?t:0;return a.push(`L ${s} ${d}`),a.push(`L 0 ${d} Z`),a.join(` `)}let l=_(()=>n.value+r.value*2),u=_(()=>{let e=` - `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return I(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,r.value=t.amplitude,i.value=t.waveLength,a.value=t.fillColor,o.value=t.direction,s.value=t.movementDirection},{immediate:!0}),(e,t)=>(A(),b(`div`,cn,[M(e.$slots,`default`,{},void 0,!0),_(`div`,ln,[_(`div`,{class:`colored-area wave`,style:ee({background:a.value,height:`${l.value}px`,maskImage:u.value,WebkitMaskImage:u.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/e.animationSpeed}s`,"animation-direction":s.value===`left`?`normal`:`reverse`})},null,4)])]))}}),dn=s(un,[[`__scopeId`,`data-v-33a54ad1`]]);export{dn as b,sn as c,Xe as d,He as e,de as f,se as g}; \ No newline at end of file + `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return I(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,r.value=t.amplitude,i.value=t.waveLength,a.value=t.fillColor,o.value=t.direction,s.value=t.movementDirection},{immediate:!0}),(e,t)=>(A(),x(`div`,cn,[M(e.$slots,`default`,{},void 0,!0),v(`div`,ln,[v(`div`,{class:`colored-area wave`,style:ee({background:a.value,height:`${l.value}px`,maskImage:u.value,WebkitMaskImage:u.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/e.animationSpeed}s`,"animation-direction":s.value===`left`?`normal`:`reverse`})},null,4)])]))}}),dn=s(un,[[`__scopeId`,`data-v-33a54ad1`]]);export{dn as b,sn as c,Xe as d,He as e,de as f,se as g}; \ No newline at end of file diff --git a/assets/Basic-DOfBA0ws.js b/assets/Basic-kTOabOY_.js similarity index 58% rename from assets/Basic-DOfBA0ws.js rename to assets/Basic-kTOabOY_.js index bddc14100ea53966d7682b22fd63efed957392c4..b44240cb73d0e2fb5d11dbe6522dcad415136298 100644 --- a/assets/Basic-DOfBA0ws.js +++ b/assets/Basic-kTOabOY_.js @@ -1 +1 @@ -import{dO as e,dX as t,d_ as n,e1 as r,e6 as i,eb as a,ed as o,ef as s,eh as c,eo as l}from"./index-DEpwtsc8.js";var u=n({__name:`Basic`,props:r({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:r([`submit`],[`update:modelValue`]),setup(n,{emit:r}){let u=n,d=r,f=a(n,`modelValue`),p=c(),m=c(`auto`);function h(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),d(`submit`,f.value))}return o(f,()=>{m.value=`auto`,requestAnimationFrame(()=>{if(p.value){if(f.value===``){m.value=u.defaultHeight||`fit-content`;return}m.value=`${p.value.scrollHeight}px`}})},{immediate:!0}),(n,r)=>s((i(),t(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":r[0]||=e=>f.value=e,style:l({height:m.value}),onKeydown:h},null,36)),[[e,f.value]])}}),d=u;export{d as b}; \ No newline at end of file +import{d$ as e,dP as t,dY as n,e2 as r,e7 as i,ec as a,ee as o,eg as s,ei as c,ep as l}from"./index-BF1-WNuF.js";var u=e({__name:`Basic`,props:r({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:r([`submit`],[`update:modelValue`]),setup(e,{emit:r}){let u=e,d=r,f=a(e,`modelValue`),p=c(),m=c(`auto`);function h(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),d(`submit`,f.value))}return o(f,()=>{m.value=`auto`,requestAnimationFrame(()=>{if(p.value){if(f.value===``){m.value=u.defaultHeight||`fit-content`;return}m.value=`${p.value.scrollHeight}px`}})},{immediate:!0}),(e,r)=>s((i(),n(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":r[0]||=e=>f.value=e,style:l({height:m.value}),onKeydown:h},null,36)),[[t,f.value]])}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/CardCreate-DO-bH_p3.js b/assets/CardCreate-CVfo1sY1.js similarity index 54% rename from assets/CardCreate-DO-bH_p3.js rename to assets/CardCreate-CVfo1sY1.js index 40bd3c1a16a98f05b35579321296432596c09c10..be3f49380325801abb108b8375e096fc2baf34e2 100644 --- a/assets/CardCreate-DO-bH_p3.js +++ b/assets/CardCreate-CVfo1sY1.js @@ -1 +1 @@ -import{A as e,dU as t,dX as n,d_ as r,e6 as i,el as a,ep as o}from"./index-DEpwtsc8.js";const s={relative:``,class:`min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-neutral-200 rounded-xl bg-white/60 p-6 dark:border-neutral-700 hover:border-primary-300 dark:bg-black/30 hover:bg-white/80 dark:hover:border-primary-700 dark:hover:bg-black/40`,border:`solid 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`},c={"font-medium":``,text:`neutral-600 dark:neutral-300`};var l=r({__name:`CardCreate`,setup(r){let{t:l}=e();return(e,r)=>(i(),n(`div`,s,[r[0]||=t(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),t(`p`,c,o(a(l)(`settings.pages.card.create_card`)),1)]))}}),u=l;export{u as b}; \ No newline at end of file +import{A as e,d$ as t,dV as n,dY as r,e7 as i,em as a,eq as o}from"./index-BF1-WNuF.js";const s={relative:``,class:`min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-neutral-200 rounded-xl bg-white/60 p-6 dark:border-neutral-700 hover:border-primary-300 dark:bg-black/30 hover:bg-white/80 dark:hover:border-primary-700 dark:hover:bg-black/40`,border:`solid 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`},c={"font-medium":``,text:`neutral-600 dark:neutral-300`};var l=t({__name:`CardCreate`,setup(t){let{t:l}=e();return(e,t)=>(i(),r(`div`,s,[t[0]||=n(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),n(`p`,c,o(a(l)(`settings.pages.card.create_card`)),1)]))}}),u=l;export{u as b}; \ No newline at end of file diff --git a/assets/CardCreate-D1L2CNWh.js b/assets/CardCreate-D1L2CNWh.js new file mode 100644 index 0000000000000000000000000000000000000000..67e48cc833478aab36c8f506b6b13cd19fbb1468 --- /dev/null +++ b/assets/CardCreate-D1L2CNWh.js @@ -0,0 +1 @@ +import{b as e}from"./CardCreate-CVfo1sY1.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreate-DNezsN8h.js b/assets/CardCreate-DNezsN8h.js deleted file mode 100644 index fc6152fef733c7503a3123be758dbf312b401da2..0000000000000000000000000000000000000000 --- a/assets/CardCreate-DNezsN8h.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardCreate-DO-bH_p3.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-Ccy00rjA.js b/assets/CardCreationDialog-Ccy00rjA.js new file mode 100644 index 0000000000000000000000000000000000000000..cc77ca28cb085bf184365e93649da8d008392bb9 --- /dev/null +++ b/assets/CardCreationDialog-Ccy00rjA.js @@ -0,0 +1,3 @@ +import{b as e}from"./DialogTitle-DeExZXr0.js";import{A as t,cL as n,cO as r,cQ as i,cU as a,cW as o,cX as s,cY as c,cj as l,d$ as u,dS as ee,dU as d,dV as f,dW as p,dX as m,dY as h,dZ as g,d_ as _,e2 as v,e7 as y,e8 as te,ec as ne,ef as b,eh as x,ei as S,ek as C,em as w,en as T,eq as E,er as D,ev as O,u as re}from"./index-BF1-WNuF.js";var k=D(((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n})),A=D(((exports,t)=>{var n=k();t.exports=n})),j=D(((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n})),M=D(((exports,t)=>{var n=j();t.exports=n})),N=D(((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n})),P=D(((exports,t)=>{var n=String.prototype.trim;t.exports=n})),F=D(((exports,t)=>{var n=P(),r=` + \r +\f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a})),I=D(((exports,t)=>{var n=M(),r=/^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;function i(e){return n(e,r,`$1`)}t.exports=i})),L=D(((exports,t)=>{var n=P();function r(e){return n.call(e)}t.exports=r})),R=D(((exports,t)=>{var n=N(),r=F(),i=I(),a=L(),o;o=n&&r()?a:i,t.exports=o})),z=D(((exports,t)=>{var n=A(),r=M(),i=R(),a=/\s+/g,o=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,s=/([a-z0-9])([A-Z])/g;function c(e){return e=r(e,o,` `),e=r(e,s,`$1 $2`),e=i(e),e=r(e,a,`-`),n(e)}t.exports=c})),B=D(((exports,t)=>{var n=z();t.exports=n})),V=O(B());const H={class:`w-full flex flex-col gap-5`},U={class:`mt-4`},W={class:`border-b border-neutral-200 dark:border-neutral-700`},G={class:`flex justify-center -mb-px sm:justify-start space-x-1`},K=[`onClick`],ie={class:`flex items-center gap-1`},ae={key:0,class:`w-full rounded-xl bg-red900`},oe={class:`w-full p-4`},se={key:1,class:`tab-content ml-auto mr-auto w-95%`},ce={class:`mb-3`},le={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},ue={key:2,class:`tab-content ml-auto mr-auto w-95%`},de={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},fe={key:3,class:`tab-content ml-auto mr-auto w-95%`},pe={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},me={class:`ml-auto mr-1 flex flex-row gap-2`};var q=u({__name:`CardCreationDialog`,props:v({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:v([`update:modelValue`],[`update:modelValue`]),setup(r,{emit:u}){let v=u,D=ne(r,`modelValue`),{t:O}=t(),k=re(),A=S(``),j=[{id:`identity`,label:O(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:O(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:O(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],M=d({get:()=>j.find(e=>e.id===A.value)?A.value:j[0]?.id||``,set:e=>{A.value=e}}),N=S(!1),P=S(``);function F(e){let t=C(e);if(t.name.length>0)if(/^(?:\d+\.)+\d+$/.test(t.version))if(t.description.length>0)if(t.personality.length>0)if(t.scenario.length>0)if(t.systemPrompt.length>0){if(!(t.postHistoryInstructions.length>0))return N.value=!0,P.value=O(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return N.value=!0,P.value=O(`settings.pages.card.creation.errors.systemprompt`),!1;else return N.value=!0,P.value=O(`settings.pages.card.creation.errors.scenario`),!1;else return N.value=!0,P.value=O(`settings.pages.card.creation.errors.personality`),!1;else return N.value=!0,P.value=O(`settings.pages.card.creation.errors.description`),!1;else return N.value=!0,P.value=O(`settings.pages.card.creation.errors.version`),!1;else return N.value=!0,P.value=O(`settings.pages.card.creation.errors.name`),!1;return N.value=!1,k.addCard(t),D.value=!1,!0}let I=S({name:O(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:O(`settings.pages.card.creation.defaults.personality`),scenario:O(`settings.pages.card.creation.defaults.scenario`),systemPrompt:O(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:O(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function L(e,t){return d({get:()=>I.value[e]??``,set:n=>{let r=n.trim();I.value[e]=r.length>0?t?t(r):r:``}})}let R=L(`name`,e=>(0,V.default)(e)),z=L(`nickname`),B=L(`description`),q=L(`notes`),J=L(`personality`),Y=L(`scenario`),X=d({get:()=>I.value.greetings??[],set:e=>{I.value.greetings=e||[]}}),Z=L(`version`),Q=L(`systemPrompt`),$=L(`postHistoryInstructions`);return(t,r)=>(y(),p(w(c),{open:D.value,"onUpdate:open":r[12]||=e=>v(`update:modelValue`,e)},{default:b(()=>[_(w(a),null,{default:b(()=>[_(w(o),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),_(w(s),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:b(()=>[f(`div`,H,[_(w(e),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:b(()=>[g(E(w(O)(`settings.pages.card.create_card`)),1)]),_:1}),f(`div`,U,[f(`div`,W,[f(`div`,G,[(y(),h(ee,null,te(j,e=>f(`button`,{key:e.id,class:T([`px-4 py-2 text-sm font-medium`,[M.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>M.value=e.id},[f(`div`,ie,[f(`div`,{class:T(e.icon)},null,2),g(` `+E(e.label),1)])],10,K)),64))])])]),N.value?(y(),h(`div`,ae,[f(`p`,oe,E(P.value),1)])):m(``,!0),M.value===`identity`?(y(),h(`div`,se,[f(`p`,ce,E(w(O)(`settings.pages.card.creation.fields_info.subtitle`)),1),f(`div`,le,[_(w(i),{modelValue:w(R),"onUpdate:modelValue":r[0]||=e=>x(R)?R.value=e:null,label:w(O)(`settings.pages.card.creation.name`),description:w(O)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),_(w(i),{modelValue:w(z),"onUpdate:modelValue":r[1]||=e=>x(z)?z.value=e:null,label:w(O)(`settings.pages.card.creation.nickname`),description:w(O)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),_(w(i),{modelValue:w(B),"onUpdate:modelValue":r[2]||=e=>x(B)?B.value=e:null,label:w(O)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:w(O)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),_(w(i),{modelValue:w(q),"onUpdate:modelValue":r[3]||=e=>x(q)?q.value=e:null,label:w(O)(`settings.pages.card.creator_notes`),"single-line":!1,description:w(O)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):M.value===`behavior`?(y(),h(`div`,ue,[f(`div`,de,[_(w(i),{modelValue:w(J),"onUpdate:modelValue":r[4]||=e=>x(J)?J.value=e:null,label:w(O)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:w(O)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),_(w(i),{modelValue:w(Y),"onUpdate:modelValue":r[5]||=e=>x(Y)?Y.value=e:null,label:w(O)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:w(O)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),_(w(n),{modelValue:X.value,"onUpdate:modelValue":r[6]||=e=>X.value=e,label:w(O)(`settings.pages.card.creation.greetings`),description:w(O)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):M.value===`settings`?(y(),h(`div`,fe,[f(`div`,pe,[_(w(i),{modelValue:w(Q),"onUpdate:modelValue":r[7]||=e=>x(Q)?Q.value=e:null,label:w(O)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:w(O)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),_(w(i),{modelValue:w($),"onUpdate:modelValue":r[8]||=e=>x($)?$.value=e:null,label:w(O)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:w(O)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),_(w(i),{modelValue:w(Z),"onUpdate:modelValue":r[9]||=e=>x(Z)?Z.value=e:null,label:w(O)(`settings.pages.card.creation.version`),required:!0,description:w(O)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):m(``,!0),f(`div`,me,[_(w(l),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:w(O)(`settings.pages.card.cancel`),disabled:!1,onClick:r[10]||=e=>D.value=!1},null,8,[`label`]),_(w(l),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:w(O)(`settings.pages.card.creation.create`),disabled:!1,onClick:r[11]||=e=>F(I.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=r(q,[[`__scopeId`,`data-v-71e6e2f1`]]);export{J as b}; \ No newline at end of file diff --git a/assets/CardCreationDialog-CxSxad_k.js b/assets/CardCreationDialog-CxSxad_k.js deleted file mode 100644 index f4a7506f01fa332d627f67267cbf4e40215ffb3c..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-CxSxad_k.js +++ /dev/null @@ -1,3 +0,0 @@ -import{b as e}from"./DialogTitle-D3E9wBQi.js";import{A as t,cL as n,cO as r,cQ as i,cU as a,cW as o,cX as s,cY as c,cj as l,dR as u,dT as d,dU as f,dV as p,dW as m,dX as h,dY as g,dZ as _,d_ as v,e1 as y,e6 as b,e7 as ee,eb as te,ee as x,eg as S,eh as C,ej as w,el as T,em as E,ep as D,eq as O,eu as k,u as ne}from"./index-DEpwtsc8.js";var A=O(((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n})),j=O(((exports,t)=>{var n=A();t.exports=n})),M=O(((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n})),N=O(((exports,t)=>{var n=M();t.exports=n})),P=O(((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n})),F=O(((exports,t)=>{var n=String.prototype.trim;t.exports=n})),I=O(((exports,t)=>{var n=F(),r=` - \r -\f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a})),L=O(((exports,t)=>{var n=N(),r=/^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;function i(e){return n(e,r,`$1`)}t.exports=i})),R=O(((exports,t)=>{var n=F();function r(e){return n.call(e)}t.exports=r})),z=O(((exports,t)=>{var n=P(),r=I(),i=L(),a=R(),o;o=n&&r()?a:i,t.exports=o})),B=O(((exports,t)=>{var n=j(),r=N(),i=z(),a=/\s+/g,o=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,s=/([a-z0-9])([A-Z])/g;function c(e){return e=r(e,o,` `),e=r(e,s,`$1 $2`),e=i(e),e=r(e,a,`-`),n(e)}t.exports=c})),V=O(((exports,t)=>{var n=B();t.exports=n})),H=k(V());const U={class:`w-full flex flex-col gap-5`},W={class:`mt-4`},G={class:`border-b border-neutral-200 dark:border-neutral-700`},K={class:`flex justify-center -mb-px sm:justify-start space-x-1`},re=[`onClick`],ie={class:`flex items-center gap-1`},ae={key:0,class:`w-full rounded-xl bg-red900`},oe={class:`w-full p-4`},se={key:1,class:`tab-content ml-auto mr-auto w-95%`},ce={class:`mb-3`},le={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},ue={key:2,class:`tab-content ml-auto mr-auto w-95%`},de={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},fe={key:3,class:`tab-content ml-auto mr-auto w-95%`},pe={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},me={class:`ml-auto mr-1 flex flex-row gap-2`};var q=v({__name:`CardCreationDialog`,props:y({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:y([`update:modelValue`],[`update:modelValue`]),setup(r,{emit:v}){let y=v,O=te(r,`modelValue`),{t:k}=t(),A=ne(),j=C(``),M=[{id:`identity`,label:k(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:k(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:k(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],N=d({get:()=>M.find(e=>e.id===j.value)?j.value:M[0]?.id||``,set:e=>{j.value=e}}),P=C(!1),F=C(``);function I(e){let t=w(e);if(t.name.length>0)if(/^(?:\d+\.)+\d+$/.test(t.version))if(t.description.length>0)if(t.personality.length>0)if(t.scenario.length>0)if(t.systemPrompt.length>0){if(!(t.postHistoryInstructions.length>0))return P.value=!0,F.value=k(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return P.value=!0,F.value=k(`settings.pages.card.creation.errors.systemprompt`),!1;else return P.value=!0,F.value=k(`settings.pages.card.creation.errors.scenario`),!1;else return P.value=!0,F.value=k(`settings.pages.card.creation.errors.personality`),!1;else return P.value=!0,F.value=k(`settings.pages.card.creation.errors.description`),!1;else return P.value=!0,F.value=k(`settings.pages.card.creation.errors.version`),!1;else return P.value=!0,F.value=k(`settings.pages.card.creation.errors.name`),!1;return P.value=!1,A.addCard(t),O.value=!1,!0}let L=C({name:k(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:k(`settings.pages.card.creation.defaults.personality`),scenario:k(`settings.pages.card.creation.defaults.scenario`),systemPrompt:k(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:k(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function R(e,t){return d({get:()=>L.value[e]??``,set:n=>{let r=n.trim();L.value[e]=r.length>0?t?t(r):r:``}})}let z=R(`name`,e=>(0,H.default)(e)),B=R(`nickname`),V=R(`description`),q=R(`notes`),J=R(`personality`),Y=R(`scenario`),X=d({get:()=>L.value.greetings??[],set:e=>{L.value.greetings=e||[]}}),Z=R(`version`),Q=R(`systemPrompt`),$=R(`postHistoryInstructions`);return(t,r)=>(b(),p(T(c),{open:O.value,"onUpdate:open":r[12]||=e=>y(`update:modelValue`,e)},{default:x(()=>[_(T(a),null,{default:x(()=>[_(T(o),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),_(T(s),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:x(()=>[f(`div`,U,[_(T(e),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:x(()=>[g(D(T(k)(`settings.pages.card.create_card`)),1)]),_:1}),f(`div`,W,[f(`div`,G,[f(`div`,K,[(b(),h(u,null,ee(M,e=>f(`button`,{key:e.id,class:E([`px-4 py-2 text-sm font-medium`,[N.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>N.value=e.id},[f(`div`,ie,[f(`div`,{class:E(e.icon)},null,2),g(` `+D(e.label),1)])],10,re)),64))])])]),P.value?(b(),h(`div`,ae,[f(`p`,oe,D(F.value),1)])):m(``,!0),N.value===`identity`?(b(),h(`div`,se,[f(`p`,ce,D(T(k)(`settings.pages.card.creation.fields_info.subtitle`)),1),f(`div`,le,[_(T(i),{modelValue:T(z),"onUpdate:modelValue":r[0]||=e=>S(z)?z.value=e:null,label:T(k)(`settings.pages.card.creation.name`),description:T(k)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),_(T(i),{modelValue:T(B),"onUpdate:modelValue":r[1]||=e=>S(B)?B.value=e:null,label:T(k)(`settings.pages.card.creation.nickname`),description:T(k)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),_(T(i),{modelValue:T(V),"onUpdate:modelValue":r[2]||=e=>S(V)?V.value=e:null,label:T(k)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:T(k)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),_(T(i),{modelValue:T(q),"onUpdate:modelValue":r[3]||=e=>S(q)?q.value=e:null,label:T(k)(`settings.pages.card.creator_notes`),"single-line":!1,description:T(k)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):N.value===`behavior`?(b(),h(`div`,ue,[f(`div`,de,[_(T(i),{modelValue:T(J),"onUpdate:modelValue":r[4]||=e=>S(J)?J.value=e:null,label:T(k)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:T(k)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),_(T(i),{modelValue:T(Y),"onUpdate:modelValue":r[5]||=e=>S(Y)?Y.value=e:null,label:T(k)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:T(k)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),_(T(n),{modelValue:X.value,"onUpdate:modelValue":r[6]||=e=>X.value=e,label:T(k)(`settings.pages.card.creation.greetings`),description:T(k)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):N.value===`settings`?(b(),h(`div`,fe,[f(`div`,pe,[_(T(i),{modelValue:T(Q),"onUpdate:modelValue":r[7]||=e=>S(Q)?Q.value=e:null,label:T(k)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:T(k)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),_(T(i),{modelValue:T($),"onUpdate:modelValue":r[8]||=e=>S($)?$.value=e:null,label:T(k)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:T(k)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),_(T(i),{modelValue:T(Z),"onUpdate:modelValue":r[9]||=e=>S(Z)?Z.value=e:null,label:T(k)(`settings.pages.card.creation.version`),required:!0,description:T(k)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):m(``,!0),f(`div`,me,[_(T(l),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:T(k)(`settings.pages.card.cancel`),disabled:!1,onClick:r[10]||=e=>O.value=!1},null,8,[`label`]),_(T(l),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:T(k)(`settings.pages.card.creation.create`),disabled:!1,onClick:r[11]||=e=>I(L.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=r(q,[[`__scopeId`,`data-v-71e6e2f1`]]);export{J as b}; \ No newline at end of file diff --git a/assets/CardCreationDialog-DVYMLoWa.js b/assets/CardCreationDialog-DVYMLoWa.js new file mode 100644 index 0000000000000000000000000000000000000000..9b1f943d2207c233d9ff752c089c8a924aa70de7 --- /dev/null +++ b/assets/CardCreationDialog-DVYMLoWa.js @@ -0,0 +1 @@ +import"./DialogTitle-DeExZXr0.js";import{b as e}from"./CardCreationDialog-Ccy00rjA.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-zZ6xk9W3.js b/assets/CardCreationDialog-zZ6xk9W3.js deleted file mode 100644 index 561ba953fc8d37cf762eac0983f31c62a800ce74..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-zZ6xk9W3.js +++ /dev/null @@ -1 +0,0 @@ -import"./DialogTitle-D3E9wBQi.js";import{b as e}from"./CardCreationDialog-CxSxad_k.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-CTDWU09J.js b/assets/CardDetailDialog-CTDWU09J.js new file mode 100644 index 0000000000000000000000000000000000000000..4149fa1c0761f7793479f887b8c184f4b53ad569 --- /dev/null +++ b/assets/CardDetailDialog-CTDWU09J.js @@ -0,0 +1 @@ +import"./DeleteCardDialog-CAFkJEuJ.js";import"./DialogTitle-DeExZXr0.js";import{b as e}from"./CardDetailDialog-Cz1N4FQk.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-CTtvzxCu.js b/assets/CardDetailDialog-CTtvzxCu.js deleted file mode 100644 index 65607b804b94eb8ddea222685ae12decc7423f01..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-CTtvzxCu.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./DeleteCardDialog-D4etY9xD.js";import{b as t}from"./DialogTitle-D3E9wBQi.js";import{A as n,cU as ee,cW as r,cX as te,cY as ne,cj as re,d8 as i,dR as a,dT as o,dU as s,dW as c,dX as l,dY as u,dZ as d,d_ as f,e6 as p,e7 as m,ee as h,eh as g,el as _,em as v,ep as y,u as ie}from"./index-DEpwtsc8.js";const ae={key:0,class:`w-full flex flex-col gap-5`},oe={flex:`~ col`,"gap-3":``},se={flex:`~ row`,"items-center":``,"justify-between":``},ce={flex:`~ row`,"items-center":``,"gap-2":``},le={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},ue={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},de={"font-medium":``},fe={flex:`~ row`,"gap-2":``},pe={class:`mt-4`},me={class:`border-b border-neutral-200 dark:border-neutral-700`},he={class:`flex justify-center -mb-px sm:justify-start space-x-1`},ge=[`onClick`],b={class:`flex items-center gap-1`},x={key:0},S=[`innerHTML`],C={key:1},w=[`innerHTML`],T={key:2},E={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},D={key:0,flex:`~ col`,"gap-2":``},O={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},k=[`innerHTML`],A={key:3},j={grid:`~ cols-1 sm:cols-3`,"gap-4":``},M={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},N={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},P={truncate:``,"font-medium":``},F={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},I={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},L={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=f({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:{}},emits:[`update:modelValue`],setup(f,{emit:R}){let z=f,B=R,{t:V}=n(),H=ie(),{removeCard:xe}=H,{activeCardId:U}=i(H),W=o(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=o(()=>{if(!W.value||!W.value.extensions?.airi?.modules)return{consciousness:``,speech:``,voice:``};let e=W.value.extensions.airi.modules;return{consciousness:e.consciousness?.model||``,speech:e.speech?.model||``,voice:e.speech?.voice_id||``}}),K=o(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=o(()=>z.cardId===U.value),J=g(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`{{ $1 }}`).trim()}let X=g(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=g(``),Q=o(()=>{let e=[];return W.value?.description&&e.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),W.value?.notes&&e.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&e.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),e.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),e}),$=o({get:()=>Q.value.find(e=>e.id===Z.value)?Z.value:Q.value[0]?.id||``,set:e=>{Z.value=e}});return(n,i)=>(p(),l(a,null,[d(_(ne),{open:n.modelValue,"onUpdate:open":i[0]||=e=>B(`update:modelValue`,e)},{default:h(()=>[d(_(ee),null,{default:h(()=>[d(_(r),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),d(_(te),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:h(()=>[W.value?(p(),l(`div`,ae,[s(`div`,oe,[s(`div`,se,[s(`div`,null,[s(`div`,ce,[d(_(t),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:h(()=>[u(y(W.value.name),1)]),_:1}),q.value?(p(),l(`div`,le,[i[3]||=s(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),u(` `+y(_(V)(`settings.pages.card.active_badge`)),1)])):c(``,!0)]),s(`div`,ue,[u(` v`+y(W.value.version)+` `,1),W.value.creator?(p(),l(a,{key:0},[u(` · `+y(_(V)(`settings.pages.card.created_by`))+` `,1),s(`span`,de,y(W.value.creator),1)],64)):c(``,!0)])]),s(`div`,fe,[d(_(re),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?_(V)(`settings.pages.card.active`):_(V)(`settings.pages.card.activate`),disabled:q.value,class:v({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),s(`div`,pe,[s(`div`,me,[s(`div`,he,[(p(!0),l(a,null,m(Q.value,e=>(p(),l(`button`,{key:e.id,class:v([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[s(`div`,b,[s(`div`,{class:v(e.icon)},null,2),u(` `+y(e.label),1)])],10,ge))),128))])])]),$.value===`notes`&&W.value.notes?(p(),l(`div`,x,[s(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,S)])):c(``,!0),$.value===`description`&&W.value.description?(p(),l(`div`,C,[s(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,w)])):c(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(p(),l(`div`,T,[s(`div`,E,[(p(!0),l(a,null,m(K.value,(e,t)=>(p(),l(a,{key:t},[e?(p(),l(`div`,D,[s(`h2`,O,y(_(V)(`settings.pages.card.${t.toLowerCase()}`)),1),s(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(e)},null,8,k)])):c(``,!0)],64))),128))])])):c(``,!0),$.value===`modules`?(p(),l(`div`,A,[s(`div`,j,[s(`div`,M,[s(`span`,N,[i[4]||=s(`div`,{"i-lucide:ghost":``},null,-1),u(` `+y(_(V)(`settings.pages.card.consciousness.model`)),1)]),s(`div`,P,y(G.value.consciousness??`default`),1)]),s(`div`,F,[s(`span`,I,[i[5]||=s(`div`,{"i-lucide:mic":``},null,-1),u(` `+y(_(V)(`settings.pages.card.speech.model`)),1)]),s(`div`,L,y(G.value.speech??`default`),1)]),s(`div`,_e,[s(`span`,ve,[i[6]||=s(`div`,{"i-lucide:music":``},null,-1),u(` `+y(_(V)(`settings.pages.card.speech.voice`)),1)]),s(`div`,ye,y(G.value.voice??`default`),1)])])])):c(``,!0)])])):(p(),l(`div`,be,[i[7]||=s(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),u(` `+y(_(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),d(e,{modelValue:X.value,"onUpdate:modelValue":i[1]||=e=>X.value=e,"card-name":W.value?.name,onConfirm:Ce,onCancel:i[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64))}}),z=R;export{z as b}; \ No newline at end of file diff --git a/assets/CardDetailDialog-Cz1N4FQk.js b/assets/CardDetailDialog-Cz1N4FQk.js new file mode 100644 index 0000000000000000000000000000000000000000..ef7ab90d614e19b192a5893ec5ff63693dd23a18 --- /dev/null +++ b/assets/CardDetailDialog-Cz1N4FQk.js @@ -0,0 +1 @@ +import{b as e}from"./DeleteCardDialog-CAFkJEuJ.js";import{b as t}from"./DialogTitle-DeExZXr0.js";import{A as n,cU as ee,cW as te,cX as ne,cY as r,cj as re,d$ as i,d8 as ie,dS as a,dU as o,dV as s,dX as c,dY as l,dZ as u,d_ as d,e7 as f,e8 as p,ef as m,ei as h,em as g,en as _,eq as v,u as ae}from"./index-BF1-WNuF.js";const oe={key:0,class:`w-full flex flex-col gap-5`},se={flex:`~ col`,"gap-3":``},ce={flex:`~ row`,"items-center":``,"justify-between":``},le={flex:`~ row`,"items-center":``,"gap-2":``},ue={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},de={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},fe={"font-medium":``},pe={flex:`~ row`,"gap-2":``},me={class:`mt-4`},he={class:`border-b border-neutral-200 dark:border-neutral-700`},ge={class:`flex justify-center -mb-px sm:justify-start space-x-1`},y=[`onClick`],b={class:`flex items-center gap-1`},x={key:0},S=[`innerHTML`],C={key:1},w=[`innerHTML`],T={key:2},E={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},D={key:0,flex:`~ col`,"gap-2":``},O={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},k=[`innerHTML`],A={key:3},j={grid:`~ cols-1 sm:cols-3`,"gap-4":``},M={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},N={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},P={truncate:``,"font-medium":``},F={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},I={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},L={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=i({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:{}},emits:[`update:modelValue`],setup(i,{emit:R}){let z=i,B=R,{t:V}=n(),H=ae(),{removeCard:xe}=H,{activeCardId:U}=ie(H),W=o(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=o(()=>{if(!W.value||!W.value.extensions?.airi?.modules)return{consciousness:``,speech:``,voice:``};let e=W.value.extensions.airi.modules;return{consciousness:e.consciousness?.model||``,speech:e.speech?.model||``,voice:e.speech?.voice_id||``}}),K=o(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=o(()=>z.cardId===U.value),J=h(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`{{ $1 }}`).trim()}let X=h(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=h(``),Q=o(()=>{let e=[];return W.value?.description&&e.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),W.value?.notes&&e.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&e.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),e.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),e}),$=o({get:()=>Q.value.find(e=>e.id===Z.value)?Z.value:Q.value[0]?.id||``,set:e=>{Z.value=e}});return(n,i)=>(f(),l(a,null,[d(g(r),{open:n.modelValue,"onUpdate:open":i[0]||=e=>B(`update:modelValue`,e)},{default:m(()=>[d(g(ee),null,{default:m(()=>[d(g(te),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),d(g(ne),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:m(()=>[W.value?(f(),l(`div`,oe,[s(`div`,se,[s(`div`,ce,[s(`div`,null,[s(`div`,le,[d(g(t),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:m(()=>[u(v(W.value.name),1)]),_:1}),q.value?(f(),l(`div`,ue,[i[3]||=s(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),u(` `+v(g(V)(`settings.pages.card.active_badge`)),1)])):c(``,!0)]),s(`div`,de,[u(` v`+v(W.value.version)+` `,1),W.value.creator?(f(),l(a,{key:0},[u(` · `+v(g(V)(`settings.pages.card.created_by`))+` `,1),s(`span`,fe,v(W.value.creator),1)],64)):c(``,!0)])]),s(`div`,pe,[d(g(re),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?g(V)(`settings.pages.card.active`):g(V)(`settings.pages.card.activate`),disabled:q.value,class:_({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),s(`div`,me,[s(`div`,he,[s(`div`,ge,[(f(!0),l(a,null,p(Q.value,e=>(f(),l(`button`,{key:e.id,class:_([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[s(`div`,b,[s(`div`,{class:_(e.icon)},null,2),u(` `+v(e.label),1)])],10,y))),128))])])]),$.value===`notes`&&W.value.notes?(f(),l(`div`,x,[s(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,S)])):c(``,!0),$.value===`description`&&W.value.description?(f(),l(`div`,C,[s(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,w)])):c(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(f(),l(`div`,T,[s(`div`,E,[(f(!0),l(a,null,p(K.value,(e,t)=>(f(),l(a,{key:t},[e?(f(),l(`div`,D,[s(`h2`,O,v(g(V)(`settings.pages.card.${t.toLowerCase()}`)),1),s(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(e)},null,8,k)])):c(``,!0)],64))),128))])])):c(``,!0),$.value===`modules`?(f(),l(`div`,A,[s(`div`,j,[s(`div`,M,[s(`span`,N,[i[4]||=s(`div`,{"i-lucide:ghost":``},null,-1),u(` `+v(g(V)(`settings.pages.card.consciousness.model`)),1)]),s(`div`,P,v(G.value.consciousness??`default`),1)]),s(`div`,F,[s(`span`,I,[i[5]||=s(`div`,{"i-lucide:mic":``},null,-1),u(` `+v(g(V)(`settings.pages.card.speech.model`)),1)]),s(`div`,L,v(G.value.speech??`default`),1)]),s(`div`,_e,[s(`span`,ve,[i[6]||=s(`div`,{"i-lucide:music":``},null,-1),u(` `+v(g(V)(`settings.pages.card.speech.voice`)),1)]),s(`div`,ye,v(G.value.voice??`default`),1)])])])):c(``,!0)])])):(f(),l(`div`,be,[i[7]||=s(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),u(` `+v(g(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),d(e,{modelValue:X.value,"onUpdate:modelValue":i[1]||=e=>X.value=e,"card-name":W.value?.name,onConfirm:Ce,onCancel:i[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64))}}),z=R;export{z as b}; \ No newline at end of file diff --git a/assets/CardDetailDialog-h5b58PK2.js b/assets/CardDetailDialog-h5b58PK2.js deleted file mode 100644 index bf13dbd4b99cad6641a499cc8bf24518571e610d..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-h5b58PK2.js +++ /dev/null @@ -1 +0,0 @@ -import"./DeleteCardDialog-D4etY9xD.js";import"./DialogTitle-D3E9wBQi.js";import{b as e}from"./CardDetailDialog-CTtvzxCu.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-CK8o7jg4.js b/assets/CardListItem-CK8o7jg4.js new file mode 100644 index 0000000000000000000000000000000000000000..e0476c912999ce8a36364c3ddaf78b48096fdad1 --- /dev/null +++ b/assets/CardListItem-CK8o7jg4.js @@ -0,0 +1 @@ +import{b as e}from"./CardListItem-oFjJO8yD.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-DcGJophG.js b/assets/CardListItem-DcGJophG.js deleted file mode 100644 index db677d9de02b85615b259201edf96c27da3003c8..0000000000000000000000000000000000000000 --- a/assets/CardListItem-DcGJophG.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardListItem-Dl6W0_Rh.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-Dl6W0_Rh.js b/assets/CardListItem-oFjJO8yD.js similarity index 65% rename from assets/CardListItem-Dl6W0_Rh.js rename to assets/CardListItem-oFjJO8yD.js index 3162a71727138a420f5f11b818039f6031ccaa10..afec195ee4d3bc7c31b76e61ef3f4f628870564a 100644 --- a/assets/CardListItem-Dl6W0_Rh.js +++ b/assets/CardListItem-oFjJO8yD.js @@ -1 +1 @@ -import{cf as e,dQ as t,dU as n,dV as r,dW as i,dX as a,d_ as o,e6 as s,ee as c,el as l,em as u,ep as d}from"./index-DEpwtsc8.js";const f={relative:``,flex:`~ col 1`,"justify-between":``,"gap-3":``,"overflow-hidden":``,"rounded-lg":``,bg:`white dark:neutral-900`,"p-5":``,transition:`all ease-in-out duration-400`,after:`content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out`,hover:`after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80`},p={"z-1":``,flex:``,"items-start":``,"justify-between":``,"gap-2":``},m={"flex-1":``,truncate:``,"text-lg":``,"font-normal":``},h={key:0,"shrink-0":``,"rounded-md":``,"p-1":``,bg:`primary-100 dark:primary-900/40`,text:`primary-600 dark:primary-400`},g={key:0,"line-clamp-3":``,"min-h-40px":``,"flex-1":``,"text-sm":``,text:`neutral-500 dark:neutral-400`},_={"z-1":``,flex:``,"items-center":``,"justify-between":``,"text-xs":``,text:`neutral-500 dark:neutral-400`},v={flex:``,"items-center":``,"gap-1.5":``},y={flex:``,"items-center":``,"gap-0.5":``},b={flex:``,"items-center":``,"gap-0.5":``},x={flex:``,"items-center":``,"justify-end":``,"px-2":``,"py-1.5":``},S=[`disabled`];var C=o({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(o,{emit:C}){let w=C;return(o,C)=>(s(),r(l(e),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:u([o.isSelected?`border-2 border-primary-400 dark:border-primary-600`:`border-2 border-neutral-100 dark:border-neutral-800/25`]),bg:`neutral-200/50 dark:neutral-800/50`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,transition:`all ease-in-out duration-400`,before:`content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0`,hover:`before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent`,onClick:C[2]||=e=>w(`select`)},{default:c(()=>[n(`div`,f,[n(`div`,p,[n(`h3`,m,d(o.name),1),o.isActive?(s(),a(`div`,h,C[3]||=[n(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):i(``,!0)]),o.description?(s(),a(`p`,g,d(o.description),1)):i(``,!0),n(`div`,_,[n(`div`,null,`v`+d(o.version),1),n(`div`,v,[n(`div`,y,[C[4]||=n(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),n(`span`,null,d(o.consciousnessModel),1)]),n(`div`,b,[C[5]||=n(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),n(`span`,null,d(o.voiceModel),1)])])])]),n(`div`,x,[n(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:o.isActive,onClick:C[0]||=t(e=>w(`activate`),[`stop`])},[n(`div`,{class:u([o.isActive?`i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400`:`i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400`])},null,2)],8,S),o.id===`default`?i(``,!0):(s(),a(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:C[1]||=t(e=>w(`delete`),[`stop`])},C[6]||=[n(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]))])]),_:1},8,[`class`]))}}),w=C;export{w as b}; \ No newline at end of file +import{cf as e,d$ as t,dR as n,dV as r,dW as i,dX as a,dY as o,e7 as s,ef as c,em as l,en as u,eq as d}from"./index-BF1-WNuF.js";const f={relative:``,flex:`~ col 1`,"justify-between":``,"gap-3":``,"overflow-hidden":``,"rounded-lg":``,bg:`white dark:neutral-900`,"p-5":``,transition:`all ease-in-out duration-400`,after:`content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out`,hover:`after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80`},p={"z-1":``,flex:``,"items-start":``,"justify-between":``,"gap-2":``},m={"flex-1":``,truncate:``,"text-lg":``,"font-normal":``},h={key:0,"shrink-0":``,"rounded-md":``,"p-1":``,bg:`primary-100 dark:primary-900/40`,text:`primary-600 dark:primary-400`},g={key:0,"line-clamp-3":``,"min-h-40px":``,"flex-1":``,"text-sm":``,text:`neutral-500 dark:neutral-400`},_={"z-1":``,flex:``,"items-center":``,"justify-between":``,"text-xs":``,text:`neutral-500 dark:neutral-400`},v={flex:``,"items-center":``,"gap-1.5":``},y={flex:``,"items-center":``,"gap-0.5":``},b={flex:``,"items-center":``,"gap-0.5":``},x={flex:``,"items-center":``,"justify-end":``,"px-2":``,"py-1.5":``},S=[`disabled`];var C=t({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(t,{emit:C}){let w=C;return(t,C)=>(s(),i(l(e),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:u([t.isSelected?`border-2 border-primary-400 dark:border-primary-600`:`border-2 border-neutral-100 dark:border-neutral-800/25`]),bg:`neutral-200/50 dark:neutral-800/50`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,transition:`all ease-in-out duration-400`,before:`content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0`,hover:`before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent`,onClick:C[2]||=e=>w(`select`)},{default:c(()=>[r(`div`,f,[r(`div`,p,[r(`h3`,m,d(t.name),1),t.isActive?(s(),o(`div`,h,C[3]||=[r(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):a(``,!0)]),t.description?(s(),o(`p`,g,d(t.description),1)):a(``,!0),r(`div`,_,[r(`div`,null,`v`+d(t.version),1),r(`div`,v,[r(`div`,y,[C[4]||=r(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),r(`span`,null,d(t.consciousnessModel),1)]),r(`div`,b,[C[5]||=r(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),r(`span`,null,d(t.voiceModel),1)])])])]),r(`div`,x,[r(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:t.isActive,onClick:C[0]||=n(e=>w(`activate`),[`stop`])},[r(`div`,{class:u([t.isActive?`i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400`:`i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400`])},null,2)],8,S),t.id===`default`?a(``,!0):(s(),o(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:C[1]||=n(e=>w(`delete`),[`stop`])},C[6]||=[r(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]))])]),_:1},8,[`class`]))}}),w=C;export{w as b}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-BMk3CSBA.js b/assets/DeleteCardDialog-BMk3CSBA.js new file mode 100644 index 0000000000000000000000000000000000000000..3de98d3d0d428513b6beb1ec90c1133dd3a68a98 --- /dev/null +++ b/assets/DeleteCardDialog-BMk3CSBA.js @@ -0,0 +1 @@ +import{b as e}from"./DeleteCardDialog-CAFkJEuJ.js";import"./DialogTitle-DeExZXr0.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-D4etY9xD.js b/assets/DeleteCardDialog-CAFkJEuJ.js similarity index 74% rename from assets/DeleteCardDialog-D4etY9xD.js rename to assets/DeleteCardDialog-CAFkJEuJ.js index 2d6b4d5edb1c2a21c208785acbd50b7d47bda45a..540f11c41f4bc63a59eba5cd0f4feaf41a5cb4b7 100644 --- a/assets/DeleteCardDialog-D4etY9xD.js +++ b/assets/DeleteCardDialog-CAFkJEuJ.js @@ -1 +1 @@ -import{b as e}from"./DialogTitle-D3E9wBQi.js";import{A as t,c$ as n,cV as r,cW as i,cX as a,cY as o,cZ as s,c_ as c,cj as l,d$ as u,d0 as d,d1 as f,d2 as p,dQ as m,dU as h,dV as g,dY as _,dZ as v,d_ as y,e2 as b,e3 as x,e4 as S,e6 as C,e8 as w,ee as T,eh as E,el as D,en as O,ep as k}from"./index-DEpwtsc8.js";var A=y({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;d();let n=s();return(e,r)=>(C(),g(D(c),b(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>D(n).onOpenChange(!1)}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16,[`type`]))}}),j=A,M=y({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;d();let n=s();return(e,r)=>(C(),g(D(c),b(t,{id:D(n).descriptionId}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16,[`id`]))}}),N=M,P=y({__name:`AlertDialogAction`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;return d(),(e,n)=>(C(),g(D(j),O(u(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),F=P;const[I,L]=p(`AlertDialogContent`);var R=y({__name:`AlertDialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=f(r);d();let o=E();return L({onCancelElementChange:e=>{o.value=e}}),(e,t)=>(C(),g(D(a),b({...n,...D(i)},{role:`alertdialog`,onPointerDownOutside:t[0]||=m(()=>{},[`prevent`]),onInteractOutside:t[1]||=m(()=>{},[`prevent`]),onOpenAutoFocus:t[2]||=()=>{x(()=>{o.value?.focus({preventScroll:!0})})}}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),z=R,B=y({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=I(),{forwardRef:r,currentElement:i}=d();return S(()=>{n.onCancelElementChange(i.value)}),(e,n)=>(C(),g(D(j),b(t,{ref:D(r)}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),V=B,H=y({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;return d(),(e,n)=>(C(),g(D(N),O(u(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),U=H,W=y({__name:`AlertDialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return d(),(e,n)=>(C(),g(D(i),O(u(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),G=W,K=y({__name:`AlertDialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(C(),g(D(r),O(u(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),q=K,J=y({__name:`AlertDialogRoot`,props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:t}){let r=e,i=t,a=n(r,i);return d(),(e,t)=>(C(),g(D(o),b(D(a),{modal:!0}),{default:T(t=>[w(e.$slots,`default`,O(u(t)))]),_:3},16))}}),Y=J,X=y({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(t){let n=t;return d(),(t,r)=>(C(),g(D(e),O(u(n)),{default:T(()=>[w(t.$slots,`default`)]),_:3},16))}}),Z=X;const Q={class:`flex flex-row justify-end gap-3`};var $=y({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:{}},emits:[`update:modelValue`,`confirm`,`cancel`],setup(e,{emit:n}){let r=n,{t:i}=t();function a(){r(`update:modelValue`,!1),r(`cancel`)}function o(){r(`update:modelValue`,!1),r(`confirm`)}return(e,t)=>(C(),g(D(Y),{open:e.modelValue,"onUpdate:open":t[0]||=e=>r(`update:modelValue`,e)},{default:T(()=>[v(D(q),null,{default:T(()=>[v(D(G),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),v(D(z),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800`},{default:T(()=>[v(D(Z),{class:`mb-4 text-xl font-normal`},{default:T(()=>[_(k(D(i)(`settings.pages.card.delete_card`)),1)]),_:1}),v(D(U),{class:`mb-6`},{default:T(()=>[_(k(D(i)(`settings.pages.card.delete_confirmation`))+` `,1),h(`b`,null,`"`+k(e.cardName||``)+`"`,1)]),_:1}),h(`div`,Q,[v(D(V),{"as-child":``},{default:T(()=>[v(D(l),{variant:`secondary`,label:D(i)(`settings.pages.card.cancel`),onClick:a},null,8,[`label`])]),_:1}),v(D(F),{"as-child":``},{default:T(()=>[v(D(l),{variant:`danger`,label:D(i)(`settings.pages.card.delete`),onClick:o},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),ee=$;export{ee as b}; \ No newline at end of file +import{b as e}from"./DialogTitle-DeExZXr0.js";import{A as t,c$ as n,cV as r,cW as i,cX as a,cY as o,cZ as s,c_ as c,cj as l,d$ as u,d0 as d,d1 as f,d2 as p,dR as m,dV as h,dW as g,dZ as _,d_ as v,e0 as y,e3 as b,e4 as x,e5 as S,e7 as C,e9 as w,ef as T,ei as E,em as D,eo as O,eq as k}from"./index-BF1-WNuF.js";var A=u({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;d();let n=s();return(e,r)=>(C(),g(D(c),b(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>D(n).onOpenChange(!1)}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16,[`type`]))}}),j=A,M=u({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;d();let n=s();return(e,r)=>(C(),g(D(c),b(t,{id:D(n).descriptionId}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16,[`id`]))}}),N=M,P=u({__name:`AlertDialogAction`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;return d(),(e,n)=>(C(),g(D(j),O(y(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),F=P;const[I,L]=p(`AlertDialogContent`);var R=u({__name:`AlertDialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=f(r);d();let o=E();return L({onCancelElementChange:e=>{o.value=e}}),(e,t)=>(C(),g(D(a),b({...n,...D(i)},{role:`alertdialog`,onPointerDownOutside:t[0]||=m(()=>{},[`prevent`]),onInteractOutside:t[1]||=m(()=>{},[`prevent`]),onOpenAutoFocus:t[2]||=()=>{x(()=>{o.value?.focus({preventScroll:!0})})}}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),z=R,B=u({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=I(),{forwardRef:r,currentElement:i}=d();return S(()=>{n.onCancelElementChange(i.value)}),(e,n)=>(C(),g(D(j),b(t,{ref:D(r)}),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),V=B,H=u({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;return d(),(e,n)=>(C(),g(D(N),O(y(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),U=H,W=u({__name:`AlertDialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return d(),(e,n)=>(C(),g(D(i),O(y(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),G=W,K=u({__name:`AlertDialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(C(),g(D(r),O(y(t)),{default:T(()=>[w(e.$slots,`default`)]),_:3},16))}}),q=K,J=u({__name:`AlertDialogRoot`,props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:t}){let r=e,i=t,a=n(r,i);return d(),(e,t)=>(C(),g(D(o),b(D(a),{modal:!0}),{default:T(t=>[w(e.$slots,`default`,O(y(t)))]),_:3},16))}}),Y=J,X=u({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(t){let n=t;return d(),(t,r)=>(C(),g(D(e),O(y(n)),{default:T(()=>[w(t.$slots,`default`)]),_:3},16))}}),Z=X;const Q={class:`flex flex-row justify-end gap-3`};var $=u({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:{}},emits:[`update:modelValue`,`confirm`,`cancel`],setup(e,{emit:n}){let r=n,{t:i}=t();function a(){r(`update:modelValue`,!1),r(`cancel`)}function o(){r(`update:modelValue`,!1),r(`confirm`)}return(e,t)=>(C(),g(D(Y),{open:e.modelValue,"onUpdate:open":t[0]||=e=>r(`update:modelValue`,e)},{default:T(()=>[v(D(q),null,{default:T(()=>[v(D(G),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),v(D(z),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800`},{default:T(()=>[v(D(Z),{class:`mb-4 text-xl font-normal`},{default:T(()=>[_(k(D(i)(`settings.pages.card.delete_card`)),1)]),_:1}),v(D(U),{class:`mb-6`},{default:T(()=>[_(k(D(i)(`settings.pages.card.delete_confirmation`))+` `,1),h(`b`,null,`"`+k(e.cardName||``)+`"`,1)]),_:1}),h(`div`,Q,[v(D(V),{"as-child":``},{default:T(()=>[v(D(l),{variant:`secondary`,label:D(i)(`settings.pages.card.cancel`),onClick:a},null,8,[`label`])]),_:1}),v(D(F),{"as-child":``},{default:T(()=>[v(D(l),{variant:`danger`,label:D(i)(`settings.pages.card.delete`),onClick:o},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),ee=$;export{ee as b}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-emOJOrss.js b/assets/DeleteCardDialog-emOJOrss.js deleted file mode 100644 index a15fca5d4accbf307b113caefdabe0cc81b1571e..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-emOJOrss.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./DeleteCardDialog-D4etY9xD.js";import"./DialogTitle-D3E9wBQi.js";export{e as default}; \ No newline at end of file diff --git a/assets/DialogTitle-D3E9wBQi.js b/assets/DialogTitle-D3E9wBQi.js deleted file mode 100644 index 20ce5d0faa0f01b87e75932ecf3bcce03a1eeffb..0000000000000000000000000000000000000000 --- a/assets/DialogTitle-D3E9wBQi.js +++ /dev/null @@ -1 +0,0 @@ -import{cZ as e,c_ as t,d0 as n,dV as r,d_ as i,e2 as a,e6 as o,e8 as s,ee as c,el as l}from"./index-DEpwtsc8.js";var u=i({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(i){let u=i,d=e();return n(),(e,n)=>(o(),r(l(t),a(u,{id:l(d).titleId}),{default:c(()=>[s(e.$slots,`default`)]),_:3},16,[`id`]))}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/DialogTitle-DeExZXr0.js b/assets/DialogTitle-DeExZXr0.js new file mode 100644 index 0000000000000000000000000000000000000000..171a4d38a892775e93394eba0b73e940d26ed3df --- /dev/null +++ b/assets/DialogTitle-DeExZXr0.js @@ -0,0 +1 @@ +import{cZ as e,c_ as t,d$ as n,d0 as r,dW as i,e3 as a,e7 as o,e9 as s,ef as c,em as l}from"./index-BF1-WNuF.js";var u=n({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(n){let u=n,d=e();return r(),(e,n)=>(o(),i(l(t),a(u,{id:l(d).titleId}),{default:c(()=>[s(e.$slots,`default`)]),_:3},16,[`id`]))}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/HeaderLink-Cg3P1d5b.js b/assets/HeaderLink-Cg3P1d5b.js deleted file mode 100644 index 397ad86280992486f9c76d46d31887b1d53c9736..0000000000000000000000000000000000000000 --- a/assets/HeaderLink-Cg3P1d5b.js +++ /dev/null @@ -1 +0,0 @@ -import{cO as e,d3 as t,dU as n,dV as r,dX as i,d_ as a,dc as o,e6 as s,ee as c,el as l}from"./index-DEpwtsc8.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=a({__name:`HeaderLink`,setup(e){let a=o();return(e,o)=>(s(),r(l(t),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:c(()=>[l(a)?(s(),i(`img`,{key:0,src:l(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(s(),i(`img`,{key:1,src:l(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),o[0]||=n(`div`,{"translate-y":`[2px]`,"font-quicksand":``,"font-semibold":``},[n(`span`,null,`AIRI`)],-1)]),_:1,__:[0]}))}}),h=e(m,[[`__scopeId`,`data-v-242dcb19`]]);export{h as b,d as c,u as d}; \ No newline at end of file diff --git a/assets/HeaderLink-DVkQgheP.js b/assets/HeaderLink-DVkQgheP.js new file mode 100644 index 0000000000000000000000000000000000000000..d182920fd4b7f7f64e374e3b2de4dd135d6f04b9 --- /dev/null +++ b/assets/HeaderLink-DVkQgheP.js @@ -0,0 +1 @@ +import{cO as e,d$ as t,d3 as n,dV as r,dW as i,dY as a,dc as o,e7 as s,ef as c,em as l}from"./index-BF1-WNuF.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=t({__name:`HeaderLink`,setup(e){let t=o();return(e,o)=>(s(),i(l(n),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:c(()=>[l(t)?(s(),a(`img`,{key:0,src:l(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(s(),a(`img`,{key:1,src:l(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),o[0]||=r(`div`,{"translate-y":`[2px]`,"font-quicksand":``,"font-semibold":``},[r(`span`,null,`AIRI`)],-1)]),_:1,__:[0]}))}}),h=e(m,[[`__scopeId`,`data-v-242dcb19`]]);export{h as b,d as c,u as d}; \ No newline at end of file diff --git a/assets/IconAnimation-DufoONwd.js b/assets/IconAnimation-PgvikmZb.js similarity index 68% rename from assets/IconAnimation-DufoONwd.js rename to assets/IconAnimation-PgvikmZb.js index dfa6fe438e8fc55f073fe4bd635cb3a9c8d4dc75..c79b7dc4727a215fe5aac1decc5dfe9eebe88d8f 100644 --- a/assets/IconAnimation-DufoONwd.js +++ b/assets/IconAnimation-PgvikmZb.js @@ -1 +1 @@ -import{dT as e,dU as t,dX as n,d_ as r,e6 as i,ed as a,eh as o,em as s,eo as c}from"./index-DEpwtsc8.js";var l=r({__name:`IconAnimation`,props:{icon:{},iconSize:{},position:{},duration:{},started:{type:Boolean},textColor:{},isReverse:{type:Boolean},zIndex:{}},emits:[`animationEnded`],setup(r,{emit:l}){let u=r,d=l,f=o(!1);a(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=e(()=>({opacity:f.value===u.isReverse?0:1,size:f.value===u.isReverse?u.iconSize:25,position:f.value===u.isReverse?u.position:`calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)`,textColor:f.value===u.isReverse?u.textColor:`text-white`})),m=o([]),h=o(!1);function g(e){m.value.push(e.propertyName),m.value.includes(`color`)&&m.value.includes(`width`)&&m.value.includes(`height`)&&m.value.includes(`transform`)&&(h.value=!0,d(`animationEnded`))}return(e,r)=>(i(),n(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:c({zIndex:h.value?e.zIndex:void 0})},[t(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:c({opacity:p.value.opacity,transitionDuration:`${e.duration}ms`})},null,4),t(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:c({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${e.duration}ms`}),class:s([p.value.textColor,u.icon,{"transition-all":f.value}]),onTransitionend:g},null,38)],4))}}),u=l;export{u as b}; \ No newline at end of file +import{d$ as e,dU as t,dV as n,dY as r,e7 as i,ee as a,ei as o,en as s,ep as c}from"./index-BF1-WNuF.js";var l=e({__name:`IconAnimation`,props:{icon:{},iconSize:{},position:{},duration:{},started:{type:Boolean},textColor:{},isReverse:{type:Boolean},zIndex:{}},emits:[`animationEnded`],setup(e,{emit:l}){let u=e,d=l,f=o(!1);a(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=t(()=>({opacity:f.value===u.isReverse?0:1,size:f.value===u.isReverse?u.iconSize:25,position:f.value===u.isReverse?u.position:`calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)`,textColor:f.value===u.isReverse?u.textColor:`text-white`})),m=o([]),h=o(!1);function g(e){m.value.push(e.propertyName),m.value.includes(`color`)&&m.value.includes(`width`)&&m.value.includes(`height`)&&m.value.includes(`transform`)&&(h.value=!0,d(`animationEnded`))}return(e,t)=>(i(),r(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:c({zIndex:h.value?e.zIndex:void 0})},[n(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:c({opacity:p.value.opacity,transitionDuration:`${e.duration}ms`})},null,4),n(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:c({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${e.duration}ms`}),class:s([p.value.textColor,u.icon,{"transition-all":f.value}]),onTransitionend:g},null,38)],4))}}),u=l;export{u as b}; \ No newline at end of file diff --git a/assets/InputFile-BfCkG18J.js b/assets/InputFile-CWezcrJG.js similarity index 52% rename from assets/InputFile-BfCkG18J.js rename to assets/InputFile-CWezcrJG.js index eea5580b69450fbdb55d854d398176bcbeacb650..d04fe88cf8d38d14cdb794cb84b4fdef4372925b 100644 --- a/assets/InputFile-BfCkG18J.js +++ b/assets/InputFile-CWezcrJG.js @@ -1 +1 @@ -import{dU as e,dX as t,d_ as n,dn as r,e1 as i,e6 as a,e8 as o,eb as s,eh as c,el as l,em as u}from"./index-DEpwtsc8.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=n({__name:`InputFile`,props:i({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let i=s(n,`modelValue`),m=c(),h=c(!1),g=r(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),i.value=Array.from(t.files||[]),h.value=!1}return(n,r)=>(a(),t(`label`,{relative:``,class:u([`min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6`,[l(g)?`border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700`:`border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700`,l(g)?`bg-primary-50/5 dark:bg-primary-900/5`:`bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40`]]),border:`dashed 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`,onDragover:r[0]||=e=>h.value=!0,onDragleave:r[1]||=e=>h.value=!1},[e(`input`,{type:`file`,accept:n.accept,multiple:n.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),o(n.$slots,`default`,{isDragging:l(g),firstFile:m.value,files:i.value},()=>[e(`div`,{class:u([`flex flex-col items-center`,[l(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[r[2]||=e(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),r[3]||=e(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),l(g)?(a(),t(`p`,f,` Release to upload `)):(a(),t(`p`,p,` Click or drag and drop a file here `))],2)])],34))}}),h=m;export{h as b}; \ No newline at end of file +import{d$ as e,dV as t,dY as n,dn as r,e2 as i,e7 as a,e9 as o,ec as s,ei as c,em as l,en as u}from"./index-BF1-WNuF.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=e({__name:`InputFile`,props:i({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=s(e,`modelValue`),m=c(),h=c(!1),g=r(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),i.value=Array.from(t.files||[]),h.value=!1}return(e,r)=>(a(),n(`label`,{relative:``,class:u([`min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6`,[l(g)?`border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700`:`border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700`,l(g)?`bg-primary-50/5 dark:bg-primary-900/5`:`bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40`]]),border:`dashed 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`,onDragover:r[0]||=e=>h.value=!0,onDragleave:r[1]||=e=>h.value=!1},[t(`input`,{type:`file`,accept:e.accept,multiple:e.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),o(e.$slots,`default`,{isDragging:l(g),firstFile:m.value,files:i.value},()=>[t(`div`,{class:u([`flex flex-col items-center`,[l(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[r[2]||=t(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),r[3]||=t(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),l(g)?(a(),n(`p`,f,` Release to upload `)):(a(),n(`p`,p,` Click or drag and drop a file here `))],2)])],34))}}),h=m;export{h as b}; \ No newline at end of file diff --git a/assets/Scenes-C-Sbq7ai.js b/assets/Scenes-CogR6jTf.js similarity index 53% rename from assets/Scenes-C-Sbq7ai.js rename to assets/Scenes-CogR6jTf.js index 465394bc22c39447dc924ae9f64b68d350e452e8..c238e6ff791c2465ef71091d080c013a6f703b3c 100644 --- a/assets/Scenes-C-Sbq7ai.js +++ b/assets/Scenes-CogR6jTf.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-DFqcVPwo.js","assets/index-DEpwtsc8.js","assets/index-DStbve3n.css","assets/default-node-D0HoLEZS.js","assets/import-url-browser-DIrMeXJ_.js","assets/import-url-browser-D0zVIqhu.js","assets/duckdb-mvp-P5KShsBk.js","assets/import-url-node-Dl605kiZ.js"])))=>i.map(i=>d[i]); -import{b$ as e,bU as t,bV as n,bW as r,bX as i,bY as a,bZ as o,b_ as s,c0 as c,c1 as l,c2 as u,c3 as d,c4 as f,c5 as p,cA as m,cc as h,cd as g,ch as _,cu as v,cv as y,cw as b,cz as x,d7 as S,d8 as C,d9 as w,dA as T,dB as E,dC as D,dD as O,dE as k,dF as ee,dG as A,dH as j,dI as te,dJ as ne,dK as re,dP as ie,dR as M,dT as ae,dU as oe,dV as se,dW as ce,dX as le,dZ as ue,d_ as de,da as fe,dc as pe,de as me,dh as he,di as ge,dp as _e,dq as ve,dr as ye,ds as be,dt as xe,du as Se,dv as Ce,dw as we,dx as Te,dy as Ee,dz as De,e4 as Oe,e5 as ke,e6 as Ae,e8 as je,ed as Me,ee as Ne,ef as Pe,eh as Fe,ei as Ie,ek as Le,el as Re,eq as ze,er as Be,es as Ve,et as He,eu as Ue,n as We,o as Ge,q as Ke,r as qe,s as Je,v as Ye,w as Xe,y as Ze}from"./index-DEpwtsc8.js";import{b as Qe}from"./import-url-browser-D0zVIqhu.js"; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-Cp7ZP3Cb.js","assets/index-BF1-WNuF.js","assets/index-DStbve3n.css","assets/default-node-whATspOv.js","assets/import-url-browser-DIrMeXJ_.js","assets/import-url-browser-D0zVIqhu.js","assets/duckdb-mvp-P5KShsBk.js","assets/import-url-node-Dl605kiZ.js"])))=>i.map(i=>d[i]); +import{b$ as e,bU as t,bV as n,bW as r,bX as i,bY as a,bZ as o,b_ as s,c0 as c,c1 as l,c2 as u,c3 as d,c4 as f,c5 as p,cA as m,cc as h,cd as g,ch as _,cu as v,cv as y,cw as b,cz as x,d$ as S,d7 as C,d8 as w,d9 as T,dA as E,dB as D,dC as O,dD as k,dE as A,dF as ee,dG as j,dH as te,dI as ne,dJ as M,dK as N,dL as P,dQ as re,dS as ie,dU as ae,dV as oe,dW as se,dX as ce,dY as le,d_ as ue,da as de,dc as fe,de as pe,dh as me,di as he,dp as ge,dq as _e,dr as ve,ds as ye,dt as be,du as xe,dv as Se,dw as Ce,dx as we,dy as Te,dz as Ee,e5 as De,e6 as Oe,e7 as ke,e9 as Ae,ee as je,ef as Me,eg as Ne,ei as Pe,ej as Fe,el as Ie,em as Le,er as Re,es as ze,et as Be,eu as Ve,ev as He,n as Ue,o as We,q as Ge,r as Ke,s as qe,v as Je,w as Ye,y as Xe}from"./index-BF1-WNuF.js";import{b as Ze}from"./import-url-browser-D0zVIqhu.js"; /*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC @@ -7,16 +7,16 @@ import{b$ as e,bU as t,bV as n,bW as r,bX as i,bY as a,bZ as o,b_ as s,c0 as c,c * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -var $e;(function(e){e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`})($e||={});var et;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`})(et||={});var tt;(function(e){e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`})(tt||={});var nt;(function(e){e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`})(nt||={});var rt;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`})(rt||={});var N;(function(e){e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`})(N||={});var it;(function(e){e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`})(it||={});var at;(function(e){e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`})(at||={});var ot;(function(e){e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`})(ot||={});var st;(function(e){e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`})(st||={});var ct;(function(e){e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`})(ct||={});var lt;(function(e){e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`})(lt||={});var ut;(function(e){e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLY_ALPHA=2]=`PREMULTIPLY_ALPHA`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`})(ut||={});var dt;(function(e){e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`})(dt||={});var ft;(function(e){e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`})(ft||={});var pt;(function(e){e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`})(pt||={});var mt;(function(e){e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`})(mt||={});var ht;(function(e){e[e.RED=1]=`RED`,e[e.GREEN=2]=`GREEN`,e[e.BLUE=4]=`BLUE`,e[e.ALPHA=8]=`ALPHA`})(ht||={});var gt;(function(e){e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`})(gt||={});var _t;(function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`})(_t||={});var vt={createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var e;return(e=document.baseURI)??window.location.href},fetch:function(e,t){return fetch(e,t)}},yt=/iPhone/i,bt=/iPod/i,xt=/iPad/i,St=/\biOS-universal(?:.+)Mac\b/i,Ct=/\bAndroid(?:.+)Mobile\b/i,wt=/Android/i,Tt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Et=/Silk/i,Dt=/Windows Phone/i,Ot=/\bWindows(?:.+)ARM\b/i,kt=/BlackBerry/i,At=/BB10/i,jt=/Opera Mini/i,Mt=/\b(CriOS|Chrome)(?:.+)Mobile/i,Nt=/Mobile(?:.+)Firefox\b/i,Pt=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function Ft(e){return function(t){return t.test(e)}}function It(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=Ft(n),a={apple:{phone:i(yt)&&!i(Dt),ipod:i(bt),tablet:!i(yt)&&(i(xt)||Pt(t))&&!i(Dt),universal:i(St),device:(i(yt)||i(bt)||i(xt)||i(St)||Pt(t))&&!i(Dt)},amazon:{phone:i(Tt),tablet:!i(Tt)&&i(Et),device:i(Tt)||i(Et)},android:{phone:!i(Dt)&&i(Tt)||!i(Dt)&&i(Ct),tablet:!i(Dt)&&!i(Tt)&&!i(Ct)&&(i(Et)||i(wt)),device:!i(Dt)&&(i(Tt)||i(Et)||i(Ct)||i(wt))||i(/\bokhttp\b/i)},windows:{phone:i(Dt),tablet:i(Ot),device:i(Dt)||i(Ot)},other:{blackberry:i(kt),blackberry10:i(At),opera:i(jt),firefox:i(Nt),chrome:i(Mt),device:i(kt)||i(At)||i(jt)||i(Nt)||i(Mt)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var Lt=It(globalThis.navigator);function Rt(){return!Lt.apple.device}function zt(e){var t=!0;if(Lt.tablet||Lt.phone){if(Lt.apple.device){var n=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(n){var r=parseInt(n[1],10);r<11&&(t=!1)}}if(Lt.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);if(n){var r=parseInt(n[1],10);r<7&&(t=!1)}}}return t?e:4}var P={ADAPTER:vt,MIPMAP_TEXTURES:lt.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:gt.NONE,SPRITE_MAX_TEXTURES:zt(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:ft.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:ct.CLAMP,SCALE_MODE:st.LINEAR,PRECISION_VERTEX:pt.HIGH,PRECISION_FRAGMENT:Lt.apple.device?pt.HIGH:pt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Rt(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},Bt=ze(((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===te(e,t,n,r)>0)for(a=t;a=t;a-=r)o=ee(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(A(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(A(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),A(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),A(r),A(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new j(e.i,e.x,e.y),r=new j(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function ee(e,t,n,r){var i=new j(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function A(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function j(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(te(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}})),Ht=ze(((exports,t)=>{(function(n){var r=typeof exports==`object`&&exports&&!exports.nodeType&&exports,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=e.split(`.`),a=T(i,t).join(`.`);return r+a}function D(e){for(var t=[],n=0,r=e.length,i,a;n=55296&&i<=56319&&n65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function ee(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function A(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function j(e){var t=[],n=e.length,r,i=0,a=m,o=p,d,f,g,_,v,y,b,S,C;for(d=e.lastIndexOf(h),d<0&&(d=0),f=0;f=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(bx(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=A(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function te(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o=t&&vx((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;os&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(ee(_+E%T,0))),f=x(E/T);y.push(S(ee(f,0))),a=A(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function ne(e){return E(e,function(e){return g.test(e)?j(e.slice(4).toLowerCase()):e})}function re(e){return E(e,function(e){return _.test(e)?`xn--`+te(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:j,encode:te,toASCII:re,toUnicode:ne},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(exports)})),Ut=ze(((exports,t)=>{Object.defineProperty(exports,`__esModule`,{value:!0});function n(){let e,t,n=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.get(n)}else if(t)return t.get(n)},r=(n,r)=>{n&&(typeof n==`object`||typeof n==`function`)?(e||=new WeakMap,e.set(n,r)):(t||=new Map,t.set(n,r))},i=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.has(n)}else if(t)return t.has(n);return!1},a=e=>{if(!i(e))throw TypeError(`Side channel does not contain the given key`)};return{get:n,set:r,has:i,assert:a}}exports.default=n,(typeof exports.default==`object`&&exports.default!==null||typeof exports.default==`function`)&&(Object.assign(exports.default,exports),t.exports=exports.default)})),Wt=ze(((exports,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}})),Gt=ze(((exports,t)=>{var n=Wt(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],a=0;a=d?s.slice(l,l+d):s,f=[],p=0;p=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||o===n.RFC1738&&(m===40||m===41)){f[f.length]=u.charAt(p);continue}if(m<128){f[f.length]=a[m];continue}if(m<2048){f[f.length]=a[192|m>>6]+a[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=a[224|m>>12]+a[128|m>>6&63]+a[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=a[240|m>>18]+a[128|m>>12&63]+a[128|m>>6&63]+a[128|m&63]}c+=f.join(``)}return c},p=function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r{var n=Ut(),r=Gt(),i=Wt(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var ee=D.get(t);if(O+=1,ee!==void 0){if(ee===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;E=``}if(p(E)||r.isBuffer(E)){if(g){var A=C?i:g(i,f.encoder,w,`key`,x);return[S(A)+`=`+S(g(E,f.encoder,w,`value`,x))]}return[S(i)+`=`+S(String(E))]}var j=[];if(E===void 0)return j;var te;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,g)),te=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))te=_;else{var ne=Object.keys(E);te=v?ne.sort(v):ne}var re=h?String(i).replace(/\./g,`%2E`):String(i),ie=o&&s(E)&&E.length===1?re+`[]`:re;if(c&&s(E)&&E.length===0)return ie+`[]`;for(var M=0;M0?b+y:``}})),qt=ze(((exports,t)=>{var n=Gt(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h-1&&(x=i(x)?[x]:x);var S=r.call(u,b);S&&t.duplicates===`combine`?u[b]=n.combine(u[b],x):(!S||t.duplicates===`last`)&&(u[b]=x)}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10);!r.parseArrays&&p===``?u={0:c}:!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays&&m<=r.arrayLimit?(u=[],u[m]=c):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var f=0;n.depth>0&&(c=s.exec(a))!==null&&f{var n=Kt(),r=qt(),i=Wt();t.exports={formats:i,parse:r,stringify:n}})),Yt=ze((exports=>{var t=Ht();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`<`,`>`,`"`,"`",` `,`\r`,` -`,` `],s=[`{`,`}`,`|`,`\\`,`^`,"`"].concat(o),c=[`'`].concat(s),l=[`%`,`/`,`?`,`;`,`#`].concat(c),u=[`/`,`?`,`#`],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=Jt();function v(e,t,r){if(e&&typeof e==`object`&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,n,i){if(typeof e!=`string`)throw TypeError(`Parameter 'url' must be a string, not `+typeof e);var o=e.indexOf(`?`),s=o!==-1&&o127?ne+=`x`:ne+=te[re];if(!ne.match(f)){var M=A.slice(0,E),ae=A.slice(E+1),oe=te.match(p);oe&&(M.push(oe[1]),ae.unshift(oe[2])),ae.length&&(b=`/`+ae.join(`.`)+b),this.hostname=M.join(`.`);break}}}this.hostname.length>d?this.hostname=``:this.hostname=this.hostname.toLowerCase(),ee||(this.hostname=t.toASCII(this.hostname));var se=this.port?`:`+this.port:``,ce=this.hostname||``;this.host=ce+se,this.href+=this.host,ee&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!==`/`&&(b=`/`+b))}if(!m[C])for(var E=0,j=c.length;E0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path=`/`+r.search:r.path=null,r.href=r.format(),r;for(var T=S.slice(-1)[0],E=(r.host||e.host||S.length>1)&&(T===`.`||T===`..`)||T===``,D=0,O=S.length;O>=0;O--)T=S[O],T===`.`?S.splice(O,1):T===`..`?(S.splice(O,1),D++):D&&(S.splice(O,1),D--);if(!b&&!x)for(;D--;)S.unshift(`..`);b&&S[0]!==``&&(!S[0]||S[0].charAt(0)!==`/`)&&S.unshift(``),E&&S.join(`/`).substr(-1)!==`/`&&S.push(``);var k=S[0]===``||S[0]&&S[0].charAt(0)===`/`;if(C){r.hostname=k?``:S.length?S.shift():``,r.host=r.hostname;var w=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return b||=r.host&&S.length,b&&!k&&S.unshift(``),S.length>0?r.pathname=S.join(`/`):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},exports.parse=v,exports.resolve=b,exports.format=y})),Xt=Ue(Bt(),1);Vt();var Zt=Ue(Yt(),1),Qt={parse:Zt.parse,format:Zt.format,resolve:Zt.resolve};P.RETINA_PREFIX=/@([0-9\.]+)x/,P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var $t=!1,en=`6.5.10`;function tn(e){var t;if(!$t){if(P.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf(`chrome`)>-1){var n=[` - %c %c %c PixiJS `+en+` - ✰ `+e+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ +var Qe;(function(e){e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`})(Qe||={});var $e;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`})($e||={});var et;(function(e){e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`})(et||={});var tt;(function(e){e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`})(tt||={});var nt;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`})(nt||={});var F;(function(e){e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`})(F||={});var rt;(function(e){e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`})(rt||={});var it;(function(e){e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`})(it||={});var at;(function(e){e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`})(at||={});var ot;(function(e){e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`})(ot||={});var st;(function(e){e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`})(st||={});var ct;(function(e){e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`})(ct||={});var lt;(function(e){e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLY_ALPHA=2]=`PREMULTIPLY_ALPHA`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`})(lt||={});var ut;(function(e){e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`})(ut||={});var dt;(function(e){e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`})(dt||={});var ft;(function(e){e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`})(ft||={});var pt;(function(e){e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`})(pt||={});var mt;(function(e){e[e.RED=1]=`RED`,e[e.GREEN=2]=`GREEN`,e[e.BLUE=4]=`BLUE`,e[e.ALPHA=8]=`ALPHA`})(mt||={});var ht;(function(e){e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`})(ht||={});var gt;(function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`})(gt||={});var _t={createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var e;return(e=document.baseURI)??window.location.href},fetch:function(e,t){return fetch(e,t)}},vt=/iPhone/i,yt=/iPod/i,bt=/iPad/i,xt=/\biOS-universal(?:.+)Mac\b/i,St=/\bAndroid(?:.+)Mobile\b/i,Ct=/Android/i,wt=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Tt=/Silk/i,Et=/Windows Phone/i,Dt=/\bWindows(?:.+)ARM\b/i,Ot=/BlackBerry/i,kt=/BB10/i,At=/Opera Mini/i,jt=/\b(CriOS|Chrome)(?:.+)Mobile/i,Mt=/Mobile(?:.+)Firefox\b/i,Nt=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function Pt(e){return function(t){return t.test(e)}}function Ft(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=Pt(n),a={apple:{phone:i(vt)&&!i(Et),ipod:i(yt),tablet:!i(vt)&&(i(bt)||Nt(t))&&!i(Et),universal:i(xt),device:(i(vt)||i(yt)||i(bt)||i(xt)||Nt(t))&&!i(Et)},amazon:{phone:i(wt),tablet:!i(wt)&&i(Tt),device:i(wt)||i(Tt)},android:{phone:!i(Et)&&i(wt)||!i(Et)&&i(St),tablet:!i(Et)&&!i(wt)&&!i(St)&&(i(Tt)||i(Ct)),device:!i(Et)&&(i(wt)||i(Tt)||i(St)||i(Ct))||i(/\bokhttp\b/i)},windows:{phone:i(Et),tablet:i(Dt),device:i(Et)||i(Dt)},other:{blackberry:i(Ot),blackberry10:i(kt),opera:i(At),firefox:i(Mt),chrome:i(jt),device:i(Ot)||i(kt)||i(At)||i(Mt)||i(jt)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var It=Ft(globalThis.navigator);function Lt(){return!It.apple.device}function Rt(e){var t=!0;if(It.tablet||It.phone){if(It.apple.device){var n=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(n){var r=parseInt(n[1],10);r<11&&(t=!1)}}if(It.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);if(n){var r=parseInt(n[1],10);r<7&&(t=!1)}}}return t?e:4}var I={ADAPTER:_t,MIPMAP_TEXTURES:ct.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:ht.NONE,SPRITE_MAX_TEXTURES:Rt(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:dt.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:st.CLAMP,SCALE_MODE:ot.LINEAR,PRECISION_VERTEX:ft.HIGH,PRECISION_FRAGMENT:It.apple.device?ft.HIGH:ft.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Lt(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},zt=Re(((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===te(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(ee(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(ee(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),ee(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),ee(r),ee(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new j(e.i,e.x,e.y),r=new j(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new j(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ee(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function j(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(te(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}})),Vt=Re(((exports,t)=>{(function(n){var r=typeof exports==`object`&&exports&&!exports.nodeType&&exports,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=e.split(`.`),a=T(i,t).join(`.`);return r+a}function D(e){for(var t=[],n=0,r=e.length,i,a;n=55296&&i<=56319&&n65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function A(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function ee(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function j(e){var t=[],n=e.length,r,i=0,a=m,o=p,d,f,g,_,v,y,b,S,C;for(d=e.lastIndexOf(h),d<0&&(d=0),f=0;f=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(bx(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=ee(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function te(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o=t&&vx((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;os&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(A(_+E%T,0))),f=x(E/T);y.push(S(A(f,0))),a=ee(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function ne(e){return E(e,function(e){return g.test(e)?j(e.slice(4).toLowerCase()):e})}function M(e){return E(e,function(e){return _.test(e)?`xn--`+te(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:j,encode:te,toASCII:M,toUnicode:ne},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(exports)})),Ht=Re(((exports,t)=>{Object.defineProperty(exports,`__esModule`,{value:!0});function n(){let e,t,n=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.get(n)}else if(t)return t.get(n)},r=(n,r)=>{n&&(typeof n==`object`||typeof n==`function`)?(e||=new WeakMap,e.set(n,r)):(t||=new Map,t.set(n,r))},i=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.has(n)}else if(t)return t.has(n);return!1},a=e=>{if(!i(e))throw TypeError(`Side channel does not contain the given key`)};return{get:n,set:r,has:i,assert:a}}exports.default=n,(typeof exports.default==`object`&&exports.default!==null||typeof exports.default==`function`)&&(Object.assign(exports.default,exports),t.exports=exports.default)})),Ut=Re(((exports,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}})),Wt=Re(((exports,t)=>{var n=Ut(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],a=0;a=d?s.slice(l,l+d):s,f=[],p=0;p=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||o===n.RFC1738&&(m===40||m===41)){f[f.length]=u.charAt(p);continue}if(m<128){f[f.length]=a[m];continue}if(m<2048){f[f.length]=a[192|m>>6]+a[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=a[224|m>>12]+a[128|m>>6&63]+a[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=a[240|m>>18]+a[128|m>>12&63]+a[128|m>>6&63]+a[128|m&63]}c+=f.join(``)}return c},p=function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r{var n=Ht(),r=Wt(),i=Ut(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;E=``}if(p(E)||r.isBuffer(E)){if(g){var ee=C?i:g(i,f.encoder,w,`key`,x);return[S(ee)+`=`+S(g(E,f.encoder,w,`value`,x))]}return[S(i)+`=`+S(String(E))]}var j=[];if(E===void 0)return j;var te;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,g)),te=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))te=_;else{var ne=Object.keys(E);te=v?ne.sort(v):ne}var M=h?String(i).replace(/\./g,`%2E`):String(i),N=o&&s(E)&&E.length===1?M+`[]`:M;if(c&&s(E)&&E.length===0)return N+`[]`;for(var P=0;P0?b+y:``}})),Kt=Re(((exports,t)=>{var n=Wt(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h-1&&(x=i(x)?[x]:x);var S=r.call(u,b);S&&t.duplicates===`combine`?u[b]=n.combine(u[b],x):(!S||t.duplicates===`last`)&&(u[b]=x)}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10);!r.parseArrays&&p===``?u={0:c}:!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays&&m<=r.arrayLimit?(u=[],u[m]=c):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var f=0;n.depth>0&&(c=s.exec(a))!==null&&f{var n=Gt(),r=Kt(),i=Ut();t.exports={formats:i,parse:r,stringify:n}})),Jt=Re((exports=>{var t=Vt();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`<`,`>`,`"`,"`",` `,`\r`,` +`,` `],s=[`{`,`}`,`|`,`\\`,`^`,"`"].concat(o),c=[`'`].concat(s),l=[`%`,`/`,`?`,`;`,`#`].concat(c),u=[`/`,`?`,`#`],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=qt();function v(e,t,r){if(e&&typeof e==`object`&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,n,i){if(typeof e!=`string`)throw TypeError(`Parameter 'url' must be a string, not `+typeof e);var o=e.indexOf(`?`),s=o!==-1&&o127?ne+=`x`:ne+=te[M];if(!ne.match(f)){var P=ee.slice(0,E),re=ee.slice(E+1),ie=te.match(p);ie&&(P.push(ie[1]),re.unshift(ie[2])),re.length&&(b=`/`+re.join(`.`)+b),this.hostname=P.join(`.`);break}}}this.hostname.length>d?this.hostname=``:this.hostname=this.hostname.toLowerCase(),A||(this.hostname=t.toASCII(this.hostname));var ae=this.port?`:`+this.port:``,oe=this.hostname||``;this.host=oe+ae,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!==`/`&&(b=`/`+b))}if(!m[C])for(var E=0,j=c.length;E0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path=`/`+r.search:r.path=null,r.href=r.format(),r;for(var T=S.slice(-1)[0],E=(r.host||e.host||S.length>1)&&(T===`.`||T===`..`)||T===``,D=0,O=S.length;O>=0;O--)T=S[O],T===`.`?S.splice(O,1):T===`..`?(S.splice(O,1),D++):D&&(S.splice(O,1),D--);if(!b&&!x)for(;D--;)S.unshift(`..`);b&&S[0]!==``&&(!S[0]||S[0].charAt(0)!==`/`)&&S.unshift(``),E&&S.join(`/`).substr(-1)!==`/`&&S.push(``);var k=S[0]===``||S[0]&&S[0].charAt(0)===`/`;if(C){r.hostname=k?``:S.length?S.shift():``,r.host=r.hostname;var w=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return b||=r.host&&S.length,b&&!k&&S.unshift(``),S.length>0?r.pathname=S.join(`/`):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},exports.parse=v,exports.resolve=b,exports.format=y})),Yt=He(zt(),1);Bt();var Xt=He(Jt(),1),Zt={parse:Xt.parse,format:Xt.format,resolve:Xt.resolve};I.RETINA_PREFIX=/@([0-9\.]+)x/,I.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Qt=!1,$t=`6.5.10`;function en(e){var t;if(!Qt){if(I.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf(`chrome`)>-1){var n=[` + %c %c %c PixiJS `+$t+` - ✰ `+e+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ -`,`background: #ff66a5; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`color: #ff66a5; background: #030307; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`background: #ffc3dc; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log(`PixiJS `+en+` - `+e+` - http://www.pixijs.com/`);$t=!0}}var nn;function rn(){return nn===void 0&&(nn=(function(){var e={stencil:!0,failIfMajorPerformanceCaveat:P.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!P.ADAPTER.getWebGLRenderingContext())return!1;var t=P.ADAPTER.createCanvas(),n=t.getContext(`webgl`,e)||t.getContext(`experimental-webgl`,e),r=!!(n&&n.getContextAttributes().stencil);if(n){var i=n.getExtension(`WEBGL_lose_context`);i&&i.loseContext()}return n=null,r}catch{return!1}})()),nn}function an(e,t){return t===void 0&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(e&255)/255,t}function on(e){var t=e.toString(16);return t=`000000`.substring(0,6-t.length)+t,`#`+t}function sn(e){return(e[0]*255<<16)+(e[1]*255<<8)+(e[2]*255|0)}function cn(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[nt.NORMAL_NPM]=nt.NORMAL,e[nt.ADD_NPM]=nt.ADD,e[nt.SCREEN_NPM]=nt.SCREEN,t[nt.NORMAL]=nt.NORMAL_NPM,t[nt.ADD]=nt.ADD_NPM,t[nt.SCREEN]=nt.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}var ln=cn();function un(e,t){if(t===1)return(t*255<<24)+e;if(t===0)return 0;var n=e>>16&255,r=e>>8&255,i=e&255;return n=n*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(n<<16)+(r<<8)+i}function dn(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?`Float32Array`:e instanceof Uint32Array?`Uint32Array`:`Int32Array`;if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return`Uint16Array`}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return`Uint8Array`;return null}function fn(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function pn(e){return!(e&e-1)&&!!e}function mn(e){var t=(e>65535?1:0)<<4;e>>>=t;var n=(e>255?1:0)<<3;return e>>>=n,t|=n,n=(e>15?1:0)<<2,e>>>=n,t|=n,n=(e>3?1:0)<<1,e>>>=n,t|=n,t|e>>1}function hn(e,t,n){var r=e.length,i;if(!(t>=r||n===0)){n=t+n>r?r-t:n;var a=r-n;for(i=t;i>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(e&255)/255,t}function an(e){var t=e.toString(16);return t=`000000`.substring(0,6-t.length)+t,`#`+t}function on(e){return(e[0]*255<<16)+(e[1]*255<<8)+(e[2]*255|0)}function sn(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[tt.NORMAL_NPM]=tt.NORMAL,e[tt.ADD_NPM]=tt.ADD,e[tt.SCREEN_NPM]=tt.SCREEN,t[tt.NORMAL]=tt.NORMAL_NPM,t[tt.ADD]=tt.ADD_NPM,t[tt.SCREEN]=tt.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}var cn=sn();function ln(e,t){if(t===1)return(t*255<<24)+e;if(t===0)return 0;var n=e>>16&255,r=e>>8&255,i=e&255;return n=n*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(n<<16)+(r<<8)+i}function un(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?`Float32Array`:e instanceof Uint32Array?`Uint32Array`:`Int32Array`;if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return`Uint16Array`}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return`Uint8Array`;return null}function dn(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function fn(e){return!(e&e-1)&&!!e}function pn(e){var t=(e>65535?1:0)<<4;e>>>=t;var n=(e>255?1:0)<<3;return e>>>=n,t|=n,n=(e>15?1:0)<<2,e>>>=n,t|=n,n=(e>3?1:0)<<1,e>>>=n,t|=n,t|e>>1}function mn(e,t,n){var r=e.length,i;if(!(t>=r||n===0)){n=t+n>r?r-t:n;var a=r-n;for(i=t;i8)throw Error(`max arguments reached`);var c=this,l=c.name,u=c.items;this._aliasCount++;for(var d=0,f=u.length;d0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return this.items.indexOf(e)!==-1},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,`empty`,{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`name`,{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties(An.prototype,{dispatch:{value:An.prototype.emit},run:{value:An.prototype.emit}}),P.TARGET_FPMS=.06;var jn;(function(e){e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`})(jn||={});var Mn=function(){function e(e,t,n,r){t===void 0&&(t=null),n===void 0&&(n=0),r===void 0&&(r=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=r}return e.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},e.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},e.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},e.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},e}(),Nn=function(){function e(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Mn(null,null,1/0),this.deltaMS=1/P.TARGET_FPMS,this.elapsedMS=1/P.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return e.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},e.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},e.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},e.prototype.add=function(e,t,n){return n===void 0&&(n=jn.NORMAL),this._addListener(new Mn(e,t,n))},e.prototype.addOnce=function(e,t,n){return n===void 0&&(n=jn.NORMAL),this._addListener(new Mn(e,t,n,!0))},e.prototype._addListener=function(e){var t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var n=this._head.next;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,`count`,{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n=this.x&&e=this.y&&te.right?e.right:this.right;if(r<=n)return!1;var i=this.ye.bottom?e.bottom:this.bottom;return a>i}var o=this.left,s=this.right,c=this.top,l=this.bottom;if(s<=o||l<=c)return!1;var u=Bn[0].set(e.left,e.top),d=Bn[1].set(e.left,e.bottom),f=Bn[2].set(e.right,e.top),p=Bn[3].set(e.right,e.bottom);if(f.x<=u.x||d.y<=u.y)return!1;var m=Math.sign(t.a*t.d-t.b*t.c);if(m===0||(t.apply(u,u),t.apply(d,d),t.apply(f,f),t.apply(p,p),Math.max(u.x,d.x,f.x,p.x)<=o||Math.min(u.x,d.x,f.x,p.x)>=s||Math.max(u.y,d.y,f.y,p.y)<=c||Math.min(u.y,d.y,f.y,p.y)>=l))return!1;var h=m*(d.y-u.y),g=m*(u.x-d.x),_=h*o+g*c,v=h*s+g*c,y=h*o+g*l,b=h*s+g*l;if(Math.max(_,v,y,b)<=h*u.x+g*u.y||Math.min(_,v,y,b)>=h*p.x+g*p.y)return!1;var x=m*(u.y-f.y),S=m*(f.x-u.x),C=x*o+S*c,w=x*s+S*c,T=x*o+S*l,E=x*s+S*l;return!(Math.max(C,w,T,E)<=x*u.x+S*u.y||Math.min(C,w,T,E)>=x*p.x+S*p.y)},e.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this},e.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this},e.prototype.toString=function(){return`[@pixi/math:Rectangle x=`+this.x+` y=`+this.y+` width=`+this.width+` height=`+this.height+`]`},e}();(function(){function e(e,t,n){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=Rn.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n},e.prototype.getBounds=function(){return new Vn(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},e.prototype.toString=function(){return`[@pixi/math:Circle x=`+this.x+` y=`+this.y+` radius=`+this.radius+`]`},e})(),function(){function e(e,t,n,r){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),this.x=e,this.y=t,this.width=n,this.height=r,this.type=Rn.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,r=(t-this.y)/this.height;return n*=n,r*=r,n+r<=1},e.prototype.getBounds=function(){return new Vn(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return`[@pixi/math:Ellipse x=`+this.x+` y=`+this.y+` width=`+this.width+` height=`+this.height+`]`},e}(),function(){function e(){for(var e=arguments,t=[],n=0;nt!=l>t&&e<(c-o)*((t-s)/(l-s))+o;u&&(n=!n)}return n},e.prototype.toString=function(){return`[@pixi/math:Polygon`+(`closeStroke=`+this.closeStroke)+(`points=`+this.points.reduce(function(e,t){return e+`, `+t},``)+`]`)},e}(),function(){function e(e,t,n,r,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=20),this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i,this.type=Rn.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1},e.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=`+this.x+` y=`+this.y+(`width=`+this.width+` height=`+this.height+` radius=`+this.radius+`]`)},e}();var Hn=function(){function e(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0),this._x=n,this._y=r,this.cb=e,this.scope=t}return e.prototype.clone=function(t,n){return t===void 0&&(t=this.cb),n===void 0&&(n=this.scope),new e(t,n,this._x,this._y)},e.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=`+this.scope+`]`},Object.defineProperty(e.prototype,`x`,{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`y`,{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),Un=function(){function e(e,t,n,r,i,a){e===void 0&&(e=1),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=1),i===void 0&&(i=0),a===void 0&&(a=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this},e.prototype.toArray=function(e,t){this.array||=new Float32Array(9);var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},e.prototype.apply=function(e,t){t||=new zn;var n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t},e.prototype.applyInverse=function(e,t){t||=new zn;var n=1/(this.a*this.d+this.c*-this.b),r=e.x,i=e.y;return t.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this},e.prototype.append=function(e){var t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var n=this.a,r=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s);return c<1e-5||Math.abs(Fn-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return`[@pixi/math:Matrix a=`+this.a+` b=`+this.b+` c=`+this.c+` d=`+this.d+` tx=`+this.tx+` ty=`+this.ty+`]`},Object.defineProperty(e,`IDENTITY`,{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,`TEMP_MATRIX`,{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),Wn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Gn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Kn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],qn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Jn=[],Yn=[],Xn=Math.sign;function Zn(){for(var e=0;e<16;e++){var t=[];Jn.push(t);for(var n=0;n<16;n++)for(var r=Xn(Wn[e]*Wn[n]+Kn[e]*Gn[n]),i=Xn(Gn[e]*Wn[n]+qn[e]*Gn[n]),a=Xn(Wn[e]*Kn[n]+Kn[e]*qn[n]),o=Xn(Gn[e]*Kn[n]+qn[e]*qn[n]),s=0;s<16;s++)if(Wn[s]===r&&Gn[s]===i&&Kn[s]===a&&qn[s]===o){t.push(s);break}}for(var e=0;e<16;e++){var c=new Un;c.set(Wn[e],Gn[e],Kn[e],qn[e],0,0),Yn.push(c)}}Zn();var Qn={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return Wn[e]},uY:function(e){return Gn[e]},vX:function(e){return Kn[e]},vY:function(e){return qn[e]},inv:function(e){return e&8?e&15:-e&7},add:function(e,t){return Jn[e][t]},sub:function(e,t){return Jn[e][Qn.inv(t)]},rotate180:function(e){return e^4},isVertical:function(e){return(e&3)==2},byDirection:function(e,t){return Math.abs(e)*2<=Math.abs(t)?t>=0?Qn.S:Qn.N:Math.abs(t)*2<=Math.abs(e)?e>0?Qn.E:Qn.W:t>0?e>0?Qn.SE:Qn.SW:e>0?Qn.NE:Qn.NW},matrixAppendRotationInv:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=Yn[Qn.inv(t)];i.tx=n,i.ty=r,e.append(i)}},$n=function(){function e(){this.worldTransform=new Un,this.localTransform=new Un,this.position=new Hn(this.onChange,this,0,0),this.scale=new Hn(this.onChange,this,1,1),this.pivot=new Hn(this.onChange,this,0,0),this.skew=new Hn(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return`[@pixi/math:Transform `+(`position=(`+this.position.x+`, `+this.position.y+`) `)+(`rotation=`+this.rotation+` `)+(`scale=(`+this.scale.x+`, `+this.scale.y+`) `)+(`skew=(`+this.skew.x+`, `+this.skew.y+`) `)+`]`},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,r=this.worldTransform;r.a=t.a*n.a+t.b*n.c,r.b=t.a*n.b+t.b*n.d,r.c=t.c*n.a+t.d*n.c,r.d=t.c*n.b+t.d*n.d,r.tx=t.tx*n.a+t.ty*n.c+n.tx,r.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,`rotation`,{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}();P.PREFER_ENV=Lt.any?$e.WEBGL:$e.WEBGL2,P.STRICT_TEXTURE_CACHE=!1;var er=[];function tr(e,t){if(!e)return null;var n=``;if(typeof e==`string`){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);r&&(n=r[1].toLowerCase())}for(var i=er.length-1;i>=0;--i){var a=er[i];if(a.test&&a.test(e,n))return new a(e,t)}throw Error(`Unrecognized source type to auto-detect Resource`)} +var Tn=function(){return Tn=Object.assign||function(e){for(var t=arguments,n,r=1,i=arguments.length;r8)throw Error(`max arguments reached`);var c=this,l=c.name,u=c.items;this._aliasCount++;for(var d=0,f=u.length;d0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},e.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},e.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},e.prototype.contains=function(e){return this.items.indexOf(e)!==-1},e.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},e.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(e.prototype,`empty`,{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`name`,{get:function(){return this._name},enumerable:!1,configurable:!0}),e}();Object.defineProperties(kn.prototype,{dispatch:{value:kn.prototype.emit},run:{value:kn.prototype.emit}}),I.TARGET_FPMS=.06;var An;(function(e){e[e.INTERACTION=50]=`INTERACTION`,e[e.HIGH=25]=`HIGH`,e[e.NORMAL=0]=`NORMAL`,e[e.LOW=-25]=`LOW`,e[e.UTILITY=-50]=`UTILITY`})(An||={});var jn=function(){function e(e,t,n,r){t===void 0&&(t=null),n===void 0&&(n=0),r===void 0&&(r=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=n,this.once=r}return e.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},e.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},e.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},e.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},e}(),Mn=function(){function e(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new jn(null,null,1/0),this.deltaMS=1/I.TARGET_FPMS,this.elapsedMS=1/I.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return e.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},e.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},e.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},e.prototype.add=function(e,t,n){return n===void 0&&(n=An.NORMAL),this._addListener(new jn(e,t,n))},e.prototype.addOnce=function(e,t,n){return n===void 0&&(n=An.NORMAL),this._addListener(new jn(e,t,n,!0))},e.prototype._addListener=function(e){var t=this._head.next,n=this._head;if(!t)e.connect(n);else{for(;t;){if(e.priority>t.priority){e.connect(n);break}n=t,t=t.next}e.previous||e.connect(n)}return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var n=this._head.next;n;)n=n.match(e,t)?n.destroy():n.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,`count`,{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var n=e-this._lastFrame|0;if(n=this.x&&e=this.y&&te.right?e.right:this.right;if(r<=n)return!1;var i=this.ye.bottom?e.bottom:this.bottom;return a>i}var o=this.left,s=this.right,c=this.top,l=this.bottom;if(s<=o||l<=c)return!1;var u=zn[0].set(e.left,e.top),d=zn[1].set(e.left,e.bottom),f=zn[2].set(e.right,e.top),p=zn[3].set(e.right,e.bottom);if(f.x<=u.x||d.y<=u.y)return!1;var m=Math.sign(t.a*t.d-t.b*t.c);if(m===0||(t.apply(u,u),t.apply(d,d),t.apply(f,f),t.apply(p,p),Math.max(u.x,d.x,f.x,p.x)<=o||Math.min(u.x,d.x,f.x,p.x)>=s||Math.max(u.y,d.y,f.y,p.y)<=c||Math.min(u.y,d.y,f.y,p.y)>=l))return!1;var h=m*(d.y-u.y),g=m*(u.x-d.x),_=h*o+g*c,v=h*s+g*c,y=h*o+g*l,b=h*s+g*l;if(Math.max(_,v,y,b)<=h*u.x+g*u.y||Math.min(_,v,y,b)>=h*p.x+g*p.y)return!1;var x=m*(u.y-f.y),S=m*(f.x-u.x),C=x*o+S*c,w=x*s+S*c,T=x*o+S*l,E=x*s+S*l;return!(Math.max(C,w,T,E)<=x*u.x+S*u.y||Math.min(C,w,T,E)>=x*p.x+S*p.y)},e.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},e.prototype.fit=function(e){var t=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(n-t,0),this.y=r,this.height=Math.max(i-r,0),this},e.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var n=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=n-this.x,this.height=r-this.y,this},e.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=n-t,this.y=r,this.height=i-r,this},e.prototype.toString=function(){return`[@pixi/math:Rectangle x=`+this.x+` y=`+this.y+` width=`+this.width+` height=`+this.height+`]`},e}();(function(){function e(e,t,n){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),this.x=e,this.y=t,this.radius=n,this.type=Ln.CIRC}return e.prototype.clone=function(){return new e(this.x,this.y,this.radius)},e.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n},e.prototype.getBounds=function(){return new Bn(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},e.prototype.toString=function(){return`[@pixi/math:Circle x=`+this.x+` y=`+this.y+` radius=`+this.radius+`]`},e})(),function(){function e(e,t,n,r){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),this.x=e,this.y=t,this.width=n,this.height=r,this.type=Ln.ELIP}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,r=(t-this.y)/this.height;return n*=n,r*=r,n+r<=1},e.prototype.getBounds=function(){return new Bn(this.x-this.width,this.y-this.height,this.width,this.height)},e.prototype.toString=function(){return`[@pixi/math:Ellipse x=`+this.x+` y=`+this.y+` width=`+this.width+` height=`+this.height+`]`},e}(),function(){function e(){for(var e=arguments,t=[],n=0;nt!=l>t&&e<(c-o)*((t-s)/(l-s))+o;u&&(n=!n)}return n},e.prototype.toString=function(){return`[@pixi/math:Polygon`+(`closeStroke=`+this.closeStroke)+(`points=`+this.points.reduce(function(e,t){return e+`, `+t},``)+`]`)},e}(),function(){function e(e,t,n,r,i){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=20),this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i,this.type=Ln.RREC}return e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height,this.radius)},e.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;var r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1},e.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=`+this.x+` y=`+this.y+(`width=`+this.width+` height=`+this.height+` radius=`+this.radius+`]`)},e}();var Vn=function(){function e(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0),this._x=n,this._y=r,this.cb=e,this.scope=t}return e.prototype.clone=function(t,n){return t===void 0&&(t=this.cb),n===void 0&&(n=this.scope),new e(t,n,this._x,this._y)},e.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},e.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},e.prototype.copyTo=function(e){return e.set(this._x,this._y),e},e.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},e.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=0 y=0 scope=`+this.scope+`]`},Object.defineProperty(e.prototype,`x`,{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,`y`,{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),e}(),Hn=function(){function e(e,t,n,r,i,a){e===void 0&&(e=1),t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=1),i===void 0&&(i=0),a===void 0&&(a=0),this.array=null,this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a}return e.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},e.prototype.set=function(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.tx=i,this.ty=a,this},e.prototype.toArray=function(e,t){this.array||=new Float32Array(9);var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},e.prototype.apply=function(e,t){t||=new Rn;var n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t},e.prototype.applyInverse=function(e,t){t||=new Rn;var n=1/(this.a*this.d+this.c*-this.b),r=e.x,i=e.y;return t.x=this.d*n*r+-this.c*n*i+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*i+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t},e.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},e.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},e.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),r=this.a,i=this.c,a=this.tx;return this.a=r*t-this.b*n,this.b=r*n+this.b*t,this.c=i*t-this.d*n,this.d=i*n+this.d*t,this.tx=a*t-this.ty*n,this.ty=a*n+this.ty*t,this},e.prototype.append=function(e){var t=this.a,n=this.b,r=this.c,i=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*n+e.b*i,this.c=e.c*t+e.d*r,this.d=e.c*n+e.d*i,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*n+e.ty*i+this.ty,this},e.prototype.setTransform=function(e,t,n,r,i,a,o,s,c){return this.a=Math.cos(o+c)*i,this.b=Math.sin(o+c)*i,this.c=-Math.sin(o-s)*a,this.d=Math.cos(o-s)*a,this.tx=e-(n*this.a+r*this.c),this.ty=t-(n*this.b+r*this.d),this},e.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var n=this.a,r=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},e.prototype.decompose=function(e){var t=this.a,n=this.b,r=this.c,i=this.d,a=e.pivot,o=-Math.atan2(-r,i),s=Math.atan2(n,t),c=Math.abs(o+s);return c<1e-5||Math.abs(Pn-c)<1e-5?(e.rotation=s,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=s),e.scale.x=Math.sqrt(t*t+n*n),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(a.x*t+a.y*r),e.position.y=this.ty+(a.x*n+a.y*i),e},e.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,r=this.d,i=this.tx,a=e*r-t*n;return this.a=r/a,this.b=-t/a,this.c=-n/a,this.d=e/a,this.tx=(n*this.ty-r*i)/a,this.ty=-(e*this.ty-t*i)/a,this},e.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},e.prototype.clone=function(){var t=new e;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},e.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},e.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},e.prototype.toString=function(){return`[@pixi/math:Matrix a=`+this.a+` b=`+this.b+` c=`+this.c+` d=`+this.d+` tx=`+this.tx+` ty=`+this.ty+`]`},Object.defineProperty(e,`IDENTITY`,{get:function(){return new e},enumerable:!1,configurable:!0}),Object.defineProperty(e,`TEMP_MATRIX`,{get:function(){return new e},enumerable:!1,configurable:!0}),e}(),Un=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Wn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Gn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Kn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],qn=[],Jn=[],Yn=Math.sign;function Xn(){for(var e=0;e<16;e++){var t=[];qn.push(t);for(var n=0;n<16;n++)for(var r=Yn(Un[e]*Un[n]+Gn[e]*Wn[n]),i=Yn(Wn[e]*Un[n]+Kn[e]*Wn[n]),a=Yn(Un[e]*Gn[n]+Gn[e]*Kn[n]),o=Yn(Wn[e]*Gn[n]+Kn[e]*Kn[n]),s=0;s<16;s++)if(Un[s]===r&&Wn[s]===i&&Gn[s]===a&&Kn[s]===o){t.push(s);break}}for(var e=0;e<16;e++){var c=new Hn;c.set(Un[e],Wn[e],Gn[e],Kn[e],0,0),Jn.push(c)}}Xn();var Zn={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(e){return Un[e]},uY:function(e){return Wn[e]},vX:function(e){return Gn[e]},vY:function(e){return Kn[e]},inv:function(e){return e&8?e&15:-e&7},add:function(e,t){return qn[e][t]},sub:function(e,t){return qn[e][Zn.inv(t)]},rotate180:function(e){return e^4},isVertical:function(e){return(e&3)==2},byDirection:function(e,t){return Math.abs(e)*2<=Math.abs(t)?t>=0?Zn.S:Zn.N:Math.abs(t)*2<=Math.abs(e)?e>0?Zn.E:Zn.W:t>0?e>0?Zn.SE:Zn.SW:e>0?Zn.NE:Zn.NW},matrixAppendRotationInv:function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=0);var i=Jn[Zn.inv(t)];i.tx=n,i.ty=r,e.append(i)}},Qn=function(){function e(){this.worldTransform=new Hn,this.localTransform=new Hn,this.position=new Vn(this.onChange,this,0,0),this.scale=new Vn(this.onChange,this,1,1),this.pivot=new Vn(this.onChange,this,0,0),this.skew=new Vn(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return e.prototype.onChange=function(){this._localID++},e.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},e.prototype.toString=function(){return`[@pixi/math:Transform `+(`position=(`+this.position.x+`, `+this.position.y+`) `)+(`rotation=`+this.rotation+` `)+(`scale=(`+this.scale.x+`, `+this.scale.y+`) `)+(`skew=(`+this.skew.x+`, `+this.skew.y+`) `)+`]`},e.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},e.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var n=e.worldTransform,r=this.worldTransform;r.a=t.a*n.a+t.b*n.c,r.b=t.a*n.b+t.b*n.d,r.c=t.c*n.a+t.d*n.c,r.d=t.c*n.b+t.d*n.d,r.tx=t.tx*n.a+t.ty*n.c+n.tx,r.ty=t.tx*n.b+t.ty*n.d+n.ty,this._parentID=e._worldID,this._worldID++}},e.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(e.prototype,`rotation`,{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),e.IDENTITY=new e,e}();I.PREFER_ENV=It.any?Qe.WEBGL:Qe.WEBGL2,I.STRICT_TEXTURE_CACHE=!1;var $n=[];function er(e,t){if(!e)return null;var n=``;if(typeof e==`string`){var r=/\.(\w{3,4})(?:$|\?|#)/i.exec(e);r&&(n=r[1].toLowerCase())}for(var i=$n.length-1;i>=0;--i){var a=$n[i];if(a.test&&a.test(e,n))return new a(e,t)}throw Error(`Unrecognized source type to auto-detect Resource`)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -79,11 +79,11 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var nr=function(e,t){return nr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},nr(e,t)};function rr(e,t){nr(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ir=function(){return ir=Object.assign||function(e){for(var t=arguments,n,r=1,i=arguments.length;r0&&l>0,r.textureCacheIds=[],r.destroyed=!1,r.resource=null,r._batchEnabled=0,r._batchLocation=0,r.parentTextureArray=null,r.setResource(t),r}return Object.defineProperty(t.prototype,`realWidth`,{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`realHeight`,{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`mipmap`,{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`scaleMode`,{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`wrapMode`,{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n||=this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=pn(this.realWidth)&&pn(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit(`update`,this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw Error(`Resource can be set only once`);return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit(`update`,this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit(`loaded`,this),this.emit(`update`,this))},t.prototype.onError=function(e){this.emit(`error`,this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Sn[this.cacheId],delete xn[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit(`dispose`,this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,r){r===void 0&&(r=P.STRICT_TEXTURE_CACHE);var i=typeof e==`string`,a=null;if(i)a=e;else{if(!e._pixiId){var o=n&&n.pixiIdPrefix||`pixiid`;e._pixiId=o+`_`+_n()}a=e._pixiId}var s=Sn[a];if(i&&r&&!s)throw Error(`The cacheId "`+a+`" does not exist in BaseTextureCache.`);return s||(s=new t(e,n),s.cacheId=a,t.addToCache(s,a)),s},t.fromBuffer=function(e,n,r,i){e||=new Float32Array(n*r*4);var a=new sr(e,{width:n,height:r}),o=e instanceof Float32Array?at.FLOAT:at.UNSIGNED_BYTE;return new t(a,Object.assign({},cr,i||{width:n,height:r,type:o}))},t.addToCache=function(e,t){t&&(e.textureCacheIds.indexOf(t)===-1&&e.textureCacheIds.push(t),Sn[t]&&console.warn(`BaseTexture added to the cache with an id [`+t+`] that already had an entry`),Sn[t]=e)},t.removeFromCache=function(e){if(typeof e==`string`){var t=Sn[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete Sn[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0)if(e.resource)this.addResourceAt(e.resource,t);else throw Error(`CubeResource does not support copying of renderTexture.`);else e.target=it.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,a=0;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(fr),_r=function(e){rr(t,e);function t(n,r){var i=this;if(r||={},!(n instanceof HTMLVideoElement)){var a=document.createElement(`video`);a.setAttribute(`preload`,`auto`),a.setAttribute(`webkit-playsinline`,``),a.setAttribute(`playsinline`,``),typeof n==`string`&&(n=[n]);var o=n[0].src||n[0];fr.crossOrigin(a,o,r.crossorigin);for(var s=0;s2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Nn.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Nn.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(Nn.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener(`error`,this._onError,!0),t.pause(),t.src=``,t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,`autoUpdate`,{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Nn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Nn.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`updateFPS`,{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=[`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`h264`,`avi`,`mov`],t.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`},t}(fr),vr=function(e){rr(t,e);function t(t){return e.call(this,t)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<`u`&&e instanceof ImageBitmap},t}(fr);er.push(hr,vr,pr,_r,gr,sr,mr,dr);var yr={__proto__:null,Resource:or,BaseImageResource:fr,INSTALLED:er,autoDetectResource:tr,AbstractMultiResource:ur,ArrayResource:dr,BufferResource:sr,CanvasResource:pr,CubeResource:mr,ImageResource:hr,SVGResource:gr,VideoResource:_r,ImageBitmapResource:vr},br=function(e){rr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===ut.UNPACK);var i=t.realWidth,a=t.realHeight;return n.width===i&&n.height===a?r.texSubImage2D(t.target,0,0,0,i,a,t.format,n.type,this.data):(n.width=i,n.height=a,r.texImage2D(t.target,0,n.internalFormat,i,a,0,t.format,n.type,this.data)),!0},t}(sr),xr=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new An(`disposeFramebuffer`),this.multisample=gt.NONE}return Object.defineProperty(e.prototype,`colorTexture`,{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new lr(null,{scaleMode:st.NEAREST,resolution:1,mipmap:lt.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new lr(new br(null,{width:this.width,height:this.height}),{scaleMode:st.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:lt.OFF,format:N.DEPTH_COMPONENT,type:at.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete xn[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,o=n+i>this.baseTexture.height;if(a||o){var s=a&&o?`and`:`or`,c=`X: `+t+` + `+r+` = `+(t+r)+` > `+this.baseTexture.width,l=`Y: `+n+` + `+i+` = `+(n+i)+` > `+this.baseTexture.height;throw Error(`Texture Error: frame does not fit inside the base Texture dimensions: `+(c+` `+s+` `+l))}this.valid=r&&i&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`rotate`,{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`width`,{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,`EMPTY`,{get:function(){return t._EMPTY||(t._EMPTY=new t(new lr),Tr(t._EMPTY),Tr(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,`WHITE`,{get:function(){if(!t._WHITE){var e=P.ADAPTER.createCanvas(16,16),n=e.getContext(`2d`);e.width=16,e.height=16,n.fillStyle=`white`,n.fillRect(0,0,16,16),t._WHITE=new t(lr.from(e)),Tr(t._WHITE),Tr(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(Xt.default),Dr=function(e){rr(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return Object.defineProperty(t.prototype,`framebuffer`,{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`multisample`,{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){n===void 0&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,a=Math.round(t*r)/r;this.valid=i>0&&a>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(i,a),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i>>0,r>1&&(i+=r*4294967296)):i=r>1?-r:-1,this.texturePool[i]||(this.texturePool[i]=[]);var a=this.texturePool[i].pop();return a||=this.createTexture(e,t,r),a.filterPoolKey=i,a.setResolution(n),a},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||gt.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool){if(!(Number(t)<0))continue;var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&(u=this.getOptimalFilterTexture(l.width,l.height,t.resolution),u.filterFrame=l.filterFrame),n[d].apply(this,l,u,dt.CLEAR,t);var f=l;l=u,u=f}n[d].apply(this,l,c.renderTexture,dt.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(u)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){t===void 0&&(t=dt.CLEAR);var n=this.renderer,r=n.renderTexture,i=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame):r.bind(e);var o=i.stateId&1||this.forceClear;(t===dt.CLEAR||t===dt.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var i=this.renderer;i.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,i.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),i.geometry.bind(this.quadUv),i.geometry.draw(rt.TRIANGLES)):(i.geometry.bind(this.quad),i.geometry.draw(rt.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,a=t._texture.orig,o=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(Un.TEMP_MATRIX);return s.invert(),o.prepend(s),o.scale(1/a.width,1/a.height),o.translate(t.anchor.x,t.anchor.y),o},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return n===void 0&&(n=1),r===void 0&&(r=gt.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if(typeof e==`number`){var r=e;e=t,t=r}e||=this.activeState.renderTexture;var i=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||gt.NONE);return i.filterFrame=e.filterFrame,i},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=Ur[0],r=Ur[1],i=Ur[2],a=Ur[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(a,a);var o=Math.min(n.x,r.x,i.x,a.x),s=Math.min(n.y,r.y,i.y,a.y),c=Math.max(n.x,r.x,i.x,a.x),l=Math.max(n.y,r.y,i.y,a.y);t.x=o,t.y=s,t.width=c-o,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var a=i.a,o=i.b,s=i.c,c=i.d;if((Math.abs(o)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(c)>1e-4))return}i=i?Wr.copyFrom(i):Wr.identity(),i.translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),Kr=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),qr=function(){function e(e){this.renderer=e,this.emptyRenderer=new Kr(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,a=e.ids,o=e.count,s=0,c=0;c=0&&u=$e.WEBGL2&&(n=e.getContext(`webgl2`,t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext(`webgl`,t)||e.getContext(`experimental-webgl`,t),!n)throw Error(`This browser does not support WebGL. Try using the canvas renderer`);return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={loseContext:e.getExtension(`WEBGL_lose_context`),anisotropicFiltering:e.getExtension(`EXT_texture_filter_anisotropic`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),s3tc:e.getExtension(`WEBGL_compressed_texture_s3tc`),s3tc_sRGB:e.getExtension(`WEBGL_compressed_texture_s3tc_srgb`),etc:e.getExtension(`WEBGL_compressed_texture_etc`),etc1:e.getExtension(`WEBGL_compressed_texture_etc1`),pvrtc:e.getExtension(`WEBGL_compressed_texture_pvrtc`)||e.getExtension(`WEBKIT_WEBGL_compressed_texture_pvrtc`),atc:e.getExtension(`WEBGL_compressed_texture_atc`),astc:e.getExtension(`WEBGL_compressed_texture_astc`)};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension(`WEBGL_draw_buffers`),depthTexture:e.getExtension(`WEBGL_depth_texture`),vertexArrayObject:e.getExtension(`OES_vertex_array_object`)||e.getExtension(`MOZ_OES_vertex_array_object`)||e.getExtension(`WEBKIT_OES_vertex_array_object`),uint32ElementIndex:e.getExtension(`OES_element_index_uint`),floatTexture:e.getExtension(`OES_texture_float`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),textureHalfFloat:e.getExtension(`OES_texture_half_float`),textureHalfFloatLinear:e.getExtension(`OES_texture_half_float_linear`)}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension(`EXT_color_buffer_float`)})},e.prototype.handleContextLost=function(e){var t=this;e.preventDefault(),setTimeout(function(){t.gl.isContextLost()&&t.extensions.loseContext&&t.extensions.loseContext.restoreContext()},0)},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener(`webglcontextlost`,this.handleContextLost),e.removeEventListener(`webglcontextrestored`,this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn(`Provided WebGL context does not have a stencil buffer, masks may not render correctly`);var r=n||!!e.getExtension(`OES_element_index_uint`);this.supports.uint32Indices=r,r||console.warn(`Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly`)},e}(),Xr=function(){function e(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=gt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return e}(),Zr=new Vn,Qr=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new xr(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Vn,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;P.PREFER_ENV===$e.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){n===void 0&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat===e.dirtyFormat?i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)):(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)));for(var a=0;a>n,c=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,c)}else{var s=e.width>>n,c=e.height>>n;this.setViewport(0,0,s,c)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),(i.width!==n||i.height!==r||i.x!==e||i.y!==t)&&(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,`size`,{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,i){i===void 0&&(i=tt.COLOR|tt.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(i)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new Xr(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var a=0;a1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var o=[],s=0;s1&&n.drawBuffers(o),e.depthTexture){var u=this.writeDepthTexture;if(u){var d=e.depthTexture;this.renderer.texture.bind(d,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,d._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil)):r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null)},e.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=gt.NONE;if(e<=1||t===null)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n0&&l>0,r.textureCacheIds=[],r.destroyed=!1,r.resource=null,r._batchEnabled=0,r._batchLocation=0,r.parentTextureArray=null,r.setResource(t),r}return Object.defineProperty(t.prototype,`realWidth`,{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`realHeight`,{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`mipmap`,{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`scaleMode`,{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`wrapMode`,{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,t){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),t!==void 0&&t!==this.mipmap&&(this.mipmap=t,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,t,n){return n||=this.resolution,this.setRealSize(e*n,t*n,n)},t.prototype.setRealSize=function(e,t,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=fn(this.realWidth)&&fn(this.realHeight)},t.prototype.setResolution=function(e){var t=this.resolution;return t===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit(`update`,this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw Error(`Resource can be set only once`);return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit(`update`,this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit(`loaded`,this),this.emit(`update`,this))},t.prototype.onError=function(e){this.emit(`error`,this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete xn[this.cacheId],delete bn[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit(`dispose`,this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,n,r){r===void 0&&(r=I.STRICT_TEXTURE_CACHE);var i=typeof e==`string`,a=null;if(i)a=e;else{if(!e._pixiId){var o=n&&n.pixiIdPrefix||`pixiid`;e._pixiId=o+`_`+gn()}a=e._pixiId}var s=xn[a];if(i&&r&&!s)throw Error(`The cacheId "`+a+`" does not exist in BaseTextureCache.`);return s||(s=new t(e,n),s.cacheId=a,t.addToCache(s,a)),s},t.fromBuffer=function(e,n,r,i){e||=new Float32Array(n*r*4);var a=new or(e,{width:n,height:r}),o=e instanceof Float32Array?it.FLOAT:it.UNSIGNED_BYTE;return new t(a,Object.assign({},sr,i||{width:n,height:r,type:o}))},t.addToCache=function(e,t){t&&(e.textureCacheIds.indexOf(t)===-1&&e.textureCacheIds.push(t),xn[t]&&console.warn(`BaseTexture added to the cache with an id [`+t+`] that already had an entry`),xn[t]=e)},t.removeFromCache=function(e){if(typeof e==`string`){var t=xn[e];if(t){var n=t.textureCacheIds.indexOf(e);return n>-1&&t.textureCacheIds.splice(n,1),delete xn[e],t}}else if(e&&e.textureCacheIds){for(var r=0;r0)if(e.resource)this.addResourceAt(e.resource,t);else throw Error(`CubeResource does not support copying of renderTexture.`);else e.target=rt.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,n,r){for(var i=this.itemDirtyIds,a=0;a)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(dr),gr=function(e){nr(t,e);function t(n,r){var i=this;if(r||={},!(n instanceof HTMLVideoElement)){var a=document.createElement(`video`);a.setAttribute(`preload`,`auto`),a.setAttribute(`webkit-playsinline`,``),a.setAttribute(`playsinline`,``),typeof n==`string`&&(n=[n]);var o=n[0].src||n[0];dr.crossOrigin(a,o,r.crossorigin);for(var s=0;s2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Mn.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Mn.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(Mn.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener(`error`,this._onError,!0),t.pause(),t.src=``,t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,`autoUpdate`,{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Mn.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Mn.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`updateFPS`,{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,n){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(n)>-1},t.TYPES=[`mp4`,`m4v`,`webm`,`ogg`,`ogv`,`h264`,`avi`,`mov`],t.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`},t}(dr),_r=function(e){nr(t,e);function t(t){return e.call(this,t)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<`u`&&e instanceof ImageBitmap},t}(dr);$n.push(mr,_r,fr,gr,hr,or,pr,ur);var vr={__proto__:null,Resource:ar,BaseImageResource:dr,INSTALLED:$n,autoDetectResource:er,AbstractMultiResource:lr,ArrayResource:ur,BufferResource:or,CanvasResource:fr,CubeResource:pr,ImageResource:mr,SVGResource:hr,VideoResource:gr,ImageBitmapResource:_r},yr=function(e){nr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.upload=function(e,t,n){var r=e.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===lt.UNPACK);var i=t.realWidth,a=t.realHeight;return n.width===i&&n.height===a?r.texSubImage2D(t.target,0,0,0,i,a,t.format,n.type,this.data):(n.width=i,n.height=a,r.texImage2D(t.target,0,n.internalFormat,i,a,0,t.format,n.type,this.data)),!0},t}(or),br=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new kn(`disposeFramebuffer`),this.multisample=ht.NONE}return Object.defineProperty(e.prototype,`colorTexture`,{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new cr(null,{scaleMode:ot.NEAREST,resolution:1,mipmap:ct.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new cr(new yr(null,{width:this.width,height:this.height}),{scaleMode:ot.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ct.OFF,format:F.DEPTH_COMPONENT,type:it.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var n=0;n-1&&t.textureCacheIds.splice(n,1),delete bn[e],t}}else if(e&&e.textureCacheIds){for(var r=0;rthis.baseTexture.width,o=n+i>this.baseTexture.height;if(a||o){var s=a&&o?`and`:`or`,c=`X: `+t+` + `+r+` = `+(t+r)+` > `+this.baseTexture.width,l=`Y: `+n+` + `+i+` = `+(n+i)+` > `+this.baseTexture.height;throw Error(`Texture Error: frame does not fit inside the base Texture dimensions: `+(c+` `+s+` `+l))}this.valid=r&&i&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`rotate`,{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`width`,{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,`EMPTY`,{get:function(){return t._EMPTY||(t._EMPTY=new t(new cr),wr(t._EMPTY),wr(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,`WHITE`,{get:function(){if(!t._WHITE){var e=I.ADAPTER.createCanvas(16,16),n=e.getContext(`2d`);e.width=16,e.height=16,n.fillStyle=`white`,n.fillRect(0,0,16,16),t._WHITE=new t(cr.from(e)),wr(t._WHITE),wr(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(Yt.default),Er=function(e){nr(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.valid=!0,r.filterFrame=null,r.filterPoolKey=null,r.updateUvs(),r}return Object.defineProperty(t.prototype,`framebuffer`,{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`multisample`,{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,n){n===void 0&&(n=!0);var r=this.baseTexture.resolution,i=Math.round(e*r)/r,a=Math.round(t*r)/r;this.valid=i>0&&a>0,this._frame.width=this.orig.width=i,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(i,a),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var n=arguments,r=[],i=1;i>>0,r>1&&(i+=r*4294967296)):i=r>1?-r:-1,this.texturePool[i]||(this.texturePool[i]=[]);var a=this.texturePool[i].pop();return a||=this.createTexture(e,t,r),a.filterPoolKey=i,a.setResolution(n),a},e.prototype.getFilterTexture=function(e,t,n){var r=this.getOptimalTexture(e.width,e.height,t||e.resolution,n||ht.NONE);return r.filterFrame=e.filterFrame,r},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var n=this.texturePool[t];if(n)for(var r=0;r0&&e.height>0,this.texturePool){if(!(Number(t)<0))continue;var n=this.texturePool[t];if(n)for(var r=0;r1){for(var l=0;l1&&(u=this.getOptimalFilterTexture(l.width,l.height,t.resolution),u.filterFrame=l.filterFrame),n[d].apply(this,l,u,ut.CLEAR,t);var f=l;l=u,u=f}n[d].apply(this,l,c.renderTexture,ut.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(u)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){t===void 0&&(t=ut.CLEAR);var n=this.renderer,r=n.renderTexture,i=n.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,r.bind(e,e.filterFrame,a)}else e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame):r.bind(e);var o=i.stateId&1||this.forceClear;(t===ut.CLEAR||t===ut.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,n,r){var i=this.renderer;i.state.set(e.state),this.bindAndClear(n,r),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,i.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),i.geometry.bind(this.quadUv),i.geometry.draw(nt.TRIANGLES)):(i.geometry.bind(this.quad),i.geometry.draw(nt.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var n=this.activeState,r=n.sourceFrame,i=n.destinationFrame,a=t._texture.orig,o=e.set(i.width,0,0,i.height,r.x,r.y),s=t.worldTransform.copyTo(Hn.TEMP_MATRIX);return s.invert(),o.prepend(s),o.scale(1/a.width,1/a.height),o.translate(t.anchor.x,t.anchor.y),o},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,n,r){return n===void 0&&(n=1),r===void 0&&(r=ht.NONE),this.texturePool.getOptimalTexture(e,t,n,r)},e.prototype.getFilterTexture=function(e,t,n){if(typeof e==`number`){var r=e;e=t,t=r}e||=this.activeState.renderTexture;var i=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,n||ht.NONE);return i.filterFrame=e.filterFrame,i},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var n=Hr[0],r=Hr[1],i=Hr[2],a=Hr[3];n.set(t.left,t.top),r.set(t.left,t.bottom),i.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(n,n),e.apply(r,r),e.apply(i,i),e.apply(a,a);var o=Math.min(n.x,r.x,i.x,a.x),s=Math.min(n.y,r.y,i.y,a.y),c=Math.max(n.x,r.x,i.x,a.x),l=Math.max(n.y,r.y,i.y,a.y);t.x=o,t.y=s,t.width=c-o,t.height=l-s},e.prototype.roundFrame=function(e,t,n,r,i){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(i){var a=i.a,o=i.b,s=i.c,c=i.d;if((Math.abs(o)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(c)>1e-4))return}i=i?Ur.copyFrom(i):Ur.identity(),i.translate(-n.x,-n.y).scale(r.width/n.width,r.height/n.height).translate(r.x,r.y),this.transformAABB(i,e),e.ceil(t),this.transformAABB(i.invert(),e)}},e}(),Gr=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),Kr=function(){function e(e){this.renderer=e,this.emptyRenderer=new Gr(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var n=this.renderer.texture.boundTextures,r=t-1;r>=0;--r)e[r]=n[r]||null,e[r]&&(e[r]._batchLocation=r)},e.prototype.boundArray=function(e,t,n,r){for(var i=e.elements,a=e.ids,o=e.count,s=0,c=0;c=0&&u=Qe.WEBGL2&&(n=e.getContext(`webgl2`,t)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext(`webgl`,t)||e.getContext(`experimental-webgl`,t),!n)throw Error(`This browser does not support WebGL. Try using the canvas renderer`);return this.gl=n,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var e=this.gl,t={loseContext:e.getExtension(`WEBGL_lose_context`),anisotropicFiltering:e.getExtension(`EXT_texture_filter_anisotropic`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),s3tc:e.getExtension(`WEBGL_compressed_texture_s3tc`),s3tc_sRGB:e.getExtension(`WEBGL_compressed_texture_s3tc_srgb`),etc:e.getExtension(`WEBGL_compressed_texture_etc`),etc1:e.getExtension(`WEBGL_compressed_texture_etc1`),pvrtc:e.getExtension(`WEBGL_compressed_texture_pvrtc`)||e.getExtension(`WEBKIT_WEBGL_compressed_texture_pvrtc`),atc:e.getExtension(`WEBGL_compressed_texture_atc`),astc:e.getExtension(`WEBGL_compressed_texture_astc`)};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension(`WEBGL_draw_buffers`),depthTexture:e.getExtension(`WEBGL_depth_texture`),vertexArrayObject:e.getExtension(`OES_vertex_array_object`)||e.getExtension(`MOZ_OES_vertex_array_object`)||e.getExtension(`WEBKIT_OES_vertex_array_object`),uint32ElementIndex:e.getExtension(`OES_element_index_uint`),floatTexture:e.getExtension(`OES_texture_float`),floatTextureLinear:e.getExtension(`OES_texture_float_linear`),textureHalfFloat:e.getExtension(`OES_texture_half_float`),textureHalfFloatLinear:e.getExtension(`OES_texture_half_float_linear`)}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension(`EXT_color_buffer_float`)})},e.prototype.handleContextLost=function(e){var t=this;e.preventDefault(),setTimeout(function(){t.gl.isContextLost()&&t.extensions.loseContext&&t.extensions.loseContext.restoreContext()},0)},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener(`webglcontextlost`,this.handleContextLost),e.removeEventListener(`webglcontextrestored`,this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(e){var t=e.getContextAttributes(),n=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),t&&!t.stencil&&console.warn(`Provided WebGL context does not have a stencil buffer, masks may not render correctly`);var r=n||!!e.getExtension(`OES_element_index_uint`);this.supports.uint32Indices=r,r||console.warn(`Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly`)},e}(),Yr=function(){function e(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=ht.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return e}(),Xr=new Bn,Zr=function(){function e(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new br(10,10),this.msaaSamples=null}return e.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Bn,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;I.PREFER_ENV===Qe.WEBGL_LEGACY&&(t=null,n=null),t?e.drawBuffers=function(e){return t.drawBuffersWEBGL(e)}:(this.hasMRT=!1,e.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},e.prototype.bind=function(e,t,n){n===void 0&&(n=0);var r=this.gl;if(e){var i=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,i.mipLevel=n),i.dirtyId!==e.dirtyId&&(i.dirtyId=e.dirtyId,i.dirtyFormat===e.dirtyFormat?i.dirtySize!==e.dirtySize&&(i.dirtySize=e.dirtySize,this.resizeFramebuffer(e)):(i.dirtyFormat=e.dirtyFormat,i.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)));for(var a=0;a>n,c=t.height>>n,l=s/t.width;this.setViewport(t.x*l,t.y*l,s,c)}else{var s=e.width>>n,c=e.height>>n;this.setViewport(0,0,s,c)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(e,t,n,r){var i=this.viewport;e=Math.round(e),t=Math.round(t),n=Math.round(n),r=Math.round(r),(i.width!==n||i.height!==r||i.x!==e||i.y!==t)&&(i.x=e,i.y=t,i.width=n,i.height=r,this.gl.viewport(e,t,n,r))},Object.defineProperty(e.prototype,`size`,{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(e,t,n,r,i){i===void 0&&(i=et.COLOR|et.DEPTH);var a=this.gl;a.clearColor(e,t,n,r),a.clear(i)},e.prototype.initFramebuffer=function(e){var t=this.gl,n=new Yr(t.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n},e.prototype.resizeFramebuffer=function(e){var t=this.gl,n=e.glFramebuffers[this.CONTEXT_UID];n.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,n.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.RGBA8,e.width,e.height)),n.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,n.stencil),n.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,n.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var r=e.colorTextures,i=r.length;t.drawBuffers||(i=Math.min(i,1));for(var a=0;a1&&this.canMultisampleFramebuffer(e)?(r.msaaBuffer=r.msaaBuffer||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.RGBA8,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,r.msaaBuffer)):r.msaaBuffer&&(n.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));for(var o=[],s=0;s1&&n.drawBuffers(o),e.depthTexture){var u=this.writeDepthTexture;if(u){var d=e.depthTexture;this.renderer.texture.bind(d,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,d._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(r.stencil=r.stencil||n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,r.stencil),r.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,r.multisample,n.DEPTH24_STENCIL8,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,r.stencil)):r.stencil&&(n.deleteRenderbuffer(r.stencil),r.stencil=null)},e.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},e.prototype.detectSamples=function(e){var t=this.msaaSamples,n=ht.NONE;if(e<=1||t===null)return n;for(var r=0;r=0&&this.managedFramebuffers.splice(i,1),e.disposeRunner.remove(this),t||(r.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&r.deleteRenderbuffer(n.msaaBuffer),n.stencil&&r.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&n.blitFramebuffer.dispose()}},e.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var n=0;n=$e.WEBGL2&&(t=e.getContext(`webgl2`,{})),t||(t=e.getContext(`webgl`,{})||e.getContext(`experimental-webgl`,{}),t?t.getExtension(`WEBGL_draw_buffers`):t=null),ci=t}return ci}var ui;function di(){if(!ui){ui=pt.MEDIUM;var e=li();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);ui=t.precision?pt.HIGH:pt.MEDIUM}}return ui}function fi(e,t,n){if(e.substring(0,9)!==`precision`){var r=t;return t===pt.HIGH&&n!==pt.HIGH&&(r=pt.MEDIUM),`precision `+r+` float; -`+e}else if(n!==pt.HIGH&&e.substring(0,15)===`precision highp`)return e.replace(`precision highp`,`precision mediump`);return e}var pi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function mi(e){return pi[e]}var hi=null,gi={FLOAT:`float`,FLOAT_VEC2:`vec2`,FLOAT_VEC3:`vec3`,FLOAT_VEC4:`vec4`,INT:`int`,INT_VEC2:`ivec2`,INT_VEC3:`ivec3`,INT_VEC4:`ivec4`,UNSIGNED_INT:`uint`,UNSIGNED_INT_VEC2:`uvec2`,UNSIGNED_INT_VEC3:`uvec3`,UNSIGNED_INT_VEC4:`uvec4`,BOOL:`bool`,BOOL_VEC2:`bvec2`,BOOL_VEC3:`bvec3`,BOOL_VEC4:`bvec4`,FLOAT_MAT2:`mat2`,FLOAT_MAT3:`mat3`,FLOAT_MAT4:`mat4`,SAMPLER_2D:`sampler2D`,INT_SAMPLER_2D:`sampler2D`,UNSIGNED_INT_SAMPLER_2D:`sampler2D`,SAMPLER_CUBE:`samplerCube`,INT_SAMPLER_CUBE:`samplerCube`,UNSIGNED_INT_SAMPLER_CUBE:`samplerCube`,SAMPLER_2D_ARRAY:`sampler2DArray`,INT_SAMPLER_2D_ARRAY:`sampler2DArray`,UNSIGNED_INT_SAMPLER_2D_ARRAY:`sampler2DArray`};function _i(e,t){if(!hi){var n=Object.keys(gi);hi={};for(var r=0;r=Qe.WEBGL2&&(t=e.getContext(`webgl2`,{})),t||(t=e.getContext(`webgl`,{})||e.getContext(`experimental-webgl`,{}),t?t.getExtension(`WEBGL_draw_buffers`):t=null),si=t}return si}var li;function ui(){if(!li){li=ft.MEDIUM;var e=ci();if(e&&e.getShaderPrecisionFormat){var t=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT);li=t.precision?ft.HIGH:ft.MEDIUM}}return li}function di(e,t,n){if(e.substring(0,9)!==`precision`){var r=t;return t===ft.HIGH&&n!==ft.HIGH&&(r=ft.MEDIUM),`precision `+r+` float; +`+e}else if(n!==ft.HIGH&&e.substring(0,15)===`precision highp`)return e.replace(`precision highp`,`precision mediump`);return e}var fi={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function pi(e){return fi[e]}var mi=null,hi={FLOAT:`float`,FLOAT_VEC2:`vec2`,FLOAT_VEC3:`vec3`,FLOAT_VEC4:`vec4`,INT:`int`,INT_VEC2:`ivec2`,INT_VEC3:`ivec3`,INT_VEC4:`ivec4`,UNSIGNED_INT:`uint`,UNSIGNED_INT_VEC2:`uvec2`,UNSIGNED_INT_VEC3:`uvec3`,UNSIGNED_INT_VEC4:`uvec4`,BOOL:`bool`,BOOL_VEC2:`bvec2`,BOOL_VEC3:`bvec3`,BOOL_VEC4:`bvec4`,FLOAT_MAT2:`mat2`,FLOAT_MAT3:`mat3`,FLOAT_MAT4:`mat4`,SAMPLER_2D:`sampler2D`,INT_SAMPLER_2D:`sampler2D`,UNSIGNED_INT_SAMPLER_2D:`sampler2D`,SAMPLER_CUBE:`samplerCube`,INT_SAMPLER_CUBE:`samplerCube`,UNSIGNED_INT_SAMPLER_CUBE:`samplerCube`,SAMPLER_2D_ARRAY:`sampler2DArray`,INT_SAMPLER_2D_ARRAY:`sampler2DArray`,UNSIGNED_INT_SAMPLER_2D_ARRAY:`sampler2DArray`};function gi(e,t){if(!mi){var n=Object.keys(hi);mi={};for(var r=0;r0&&(t+=` -else `),n0&&(t+=` +else `),n0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!=0,(n&2)!=0,(n&4)!=0,(n&8)!=0)},e.prototype.destroy=function(){this.renderer=null},e}(),Yi=function(){function e(e){this.renderer=e,this.maskStack=[],this.glConst=0}return e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(e){var t=this.renderer.gl,n=this.getStackLength();this.maskStack=e;var r=this.getStackLength();r!==n&&(r===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){this.renderer=null,this.maskStack=null},e}(),Xi=new Un,Zi=[],Qi=function(e){rr(t,e);function t(t){var n=e.call(this,t)||this;return n.glConst=P.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var t;if(!e._scissorRectLocal){var n=e._scissorRect,r=e.maskObject,i=this.renderer,a=i.renderTexture,o=r.getBounds(!0,(t=Zi.pop())??new Vn);this.roundFrameToPixels(o,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),n&&o.fit(n),e._scissorRectLocal=o}},t.isMatrixRotated=function(e){if(!e)return!1;var t=e.a,n=e.b,r=e.c,i=e.d;return(Math.abs(n)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect()||t.isMatrixRotated(n.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,a){t.isMatrixRotated(a)||(a=a?Xi.copyFrom(a):Xi.identity(),a.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(a,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;e&&Zi.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,t;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},t}(Yi),$i=function(e){rr(t,e);function t(t){var n=e.call(this,t)||this;return n.glConst=P.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var i=e._colorMask;i!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(e._colorMask=i,n.colorMask((i&1)!=0,(i&2)!=0,(i&4)!=0,(i&8)!=0)),this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{var n=this.maskStack.length===0?null:this.maskStack[this.maskStack.length-1],r=n?n._colorMask:15;r!==0&&(n._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,r!==0&&(n._colorMask=r,t.colorMask((r&1)!=0,(r&2)!=0,(r&4)!=0,(r&8)!=0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(Yi),ea=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Un,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,a=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=a*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-a-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),ta=new Vn,na=new Vn,ra=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Vn,this.destinationFrame=new Vn,this.viewportFrame=new Vn}return e.prototype.bind=function(e,t,n){e===void 0&&(e=null);var r=this.renderer;this.current=e;var i,a,o;e?(i=e.baseTexture,o=i.resolution,t||(ta.width=e.frame.width,ta.height=e.frame.height,t=ta),n||(na.x=e.frame.x,na.y=e.frame.y,na.width=t.width,na.height=t.height,n=na),a=i.framebuffer):(o=r.resolution,t||(ta.width=r.screen.width,ta.height=r.screen.height,t=ta),n||(n=ta,n.width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=r.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(a,s),this.renderer.projection.update(n,t,o,!a),e?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){this.current?e||=this.current.baseTexture.clearColor:e||=this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var a=this.viewportFrame,o=a.x,s=a.y,c=a.width,l=a.height;o=Math.round(o),s=Math.round(s),c=Math.round(c),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,s,c,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function ia(e,t,n,r,i){n.buffer.update(i)}var aa={float:` +`,Wi=new Hn,Gi=function(){function e(e,t){this._texture=e,this.mapCoord=new Hn,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=t===void 0?.5:t,this.isSimple=!1}return Object.defineProperty(e.prototype,`texture`,{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),e.prototype.multiplyUvs=function(e,t){t===void 0&&(t=e);for(var n=this.mapCoord,r=0;r0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==t&&this.renderer.gl.colorMask((n&1)!=0,(n&2)!=0,(n&4)!=0,(n&8)!=0)},e.prototype.destroy=function(){this.renderer=null},e}(),Ji=function(){function e(e){this.renderer=e,this.maskStack=[],this.glConst=0}return e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(e){var t=this.renderer.gl,n=this.getStackLength();this.maskStack=e;var r=this.getStackLength();r!==n&&(r===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){this.renderer=null,this.maskStack=null},e}(),Yi=new Hn,Xi=[],Zi=function(e){nr(t,e);function t(t){var n=e.call(this,t)||this;return n.glConst=I.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var t;if(!e._scissorRectLocal){var n=e._scissorRect,r=e.maskObject,i=this.renderer,a=i.renderTexture,o=r.getBounds(!0,(t=Xi.pop())??new Bn);this.roundFrameToPixels(o,a.current?a.current.resolution:i.resolution,a.sourceFrame,a.destinationFrame,i.projection.transform),n&&o.fit(n),e._scissorRectLocal=o}},t.isMatrixRotated=function(e){if(!e)return!1;var t=e.a,n=e.b,r=e.c,i=e.d;return(Math.abs(n)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4)},t.prototype.testScissor=function(e){var n=e.maskObject;if(!n.isFastRect||!n.isFastRect()||t.isMatrixRotated(n.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var r=e._scissorRectLocal;return r.width>0&&r.height>0},t.prototype.roundFrameToPixels=function(e,n,r,i,a){t.isMatrixRotated(a)||(a=a?Yi.copyFrom(a):Yi.identity(),a.translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(a,e),e.fit(i),e.x=Math.round(e.x*n),e.y=Math.round(e.y*n),e.width=Math.round(e.width*n),e.height=Math.round(e.height*n))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;e&&Xi.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,t;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},t}(Ji),Qi=function(e){nr(t,e);function t(t){var n=e.call(this,t)||this;return n.glConst=I.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,n}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var t=e.maskObject,n=this.renderer.gl,r=e._stencilCounter;r===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var i=e._colorMask;i!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,r,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,i!==0&&(e._colorMask=i,n.colorMask((i&1)!=0,(i&2)!=0,(i&4)!=0,(i&8)!=0)),this._useCurrent()},t.prototype.pop=function(e){var t=this.renderer.gl;if(this.getStackLength()===0)t.disable(t.STENCIL_TEST);else{var n=this.maskStack.length===0?null:this.maskStack[this.maskStack.length-1],r=n?n._colorMask:15;r!==0&&(n._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,r!==0&&(n._colorMask=r,t.colorMask((r&1)!=0,(r&2)!=0,(r&4)!=0,(r&8)!=0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(Ji),$i=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Hn,this.transform=null}return e.prototype.update=function(e,t,n,r){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,r),this.transform&&this.projectionMatrix.append(this.transform);var i=this.renderer;i.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,i.globalUniforms.update(),i.shader.shader&&i.shader.syncUniformGroup(i.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,n,r){var i=this.projectionMatrix,a=r?-1:1;i.identity(),i.a=1/t.width*2,i.d=a*(1/t.height*2),i.tx=-1-t.x*i.a,i.ty=-a-t.y*i.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),ea=new Bn,ta=new Bn,na=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Bn,this.destinationFrame=new Bn,this.viewportFrame=new Bn}return e.prototype.bind=function(e,t,n){e===void 0&&(e=null);var r=this.renderer;this.current=e;var i,a,o;e?(i=e.baseTexture,o=i.resolution,t||(ea.width=e.frame.width,ea.height=e.frame.height,t=ea),n||(ta.x=e.frame.x,ta.y=e.frame.y,ta.width=t.width,ta.height=t.height,n=ta),a=i.framebuffer):(o=r.resolution,t||(ea.width=r.screen.width,ea.height=r.screen.height,t=ea),n||(n=ea,n.width=t.width,n.height=t.height));var s=this.viewportFrame;s.x=n.x*o,s.y=n.y*o,s.width=n.width*o,s.height=n.height*o,e||(s.y=r.view.height-(s.y+s.height)),s.ceil(),this.renderer.framebuffer.bind(a,s),this.renderer.projection.update(n,t,o,!a),e?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(n)},e.prototype.clear=function(e,t){this.current?e||=this.current.baseTexture.clearColor:e||=this.clearColor;var n=this.destinationFrame,r=this.current?this.current.baseTexture:this.renderer.screen,i=n.width!==r.width||n.height!==r.height;if(i){var a=this.viewportFrame,o=a.x,s=a.y,c=a.width,l=a.height;o=Math.round(o),s=Math.round(s),c=Math.round(c),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,s,c,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),i&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function ra(e,t,n,r,i){n.buffer.update(i)}var ia={float:` data[offset] = v; `,vec2:` data[offset] = v[0]; @@ -452,7 +452,7 @@ void main(void) { data[offset + i] = v[i]; } - `},oa={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function sa(e){for(var t=e.map(function(e){return{data:e,offset:0,dataLen:0,dirty:0}}),n=0,r=0,i=0,a=0;a1&&(n=Math.max(n,16)*o.data.size),o.dataLen=n,r%n!==0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=Math.ceil(i/16)*16,o.offset=i,i+=n,r=n):(o.offset=i,r+=n,i+=n)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function ca(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort(function(e,t){return e.index-t.index}),n}function la(e,t){if(!e.autoManage)return{size:0,syncFunc:ia};for(var n=ca(e.uniforms,t),r=sa(n),i=r.uboElements,a=r.size,o=[` + `},aa={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function oa(e){for(var t=e.map(function(e){return{data:e,offset:0,dataLen:0,dirty:0}}),n=0,r=0,i=0,a=0;a1&&(n=Math.max(n,16)*o.data.size),o.dataLen=n,r%n!==0&&r<16){var s=r%n%16;r+=s,i+=s}r+n>16?(i=Math.ceil(i/16)*16,o.offset=i,i+=n,r=n):(o.offset=i,r+=n,i+=n)}return i=Math.ceil(i/16)*16,{uboElements:t,size:i}}function sa(e,t){var n=[];for(var r in e)t[r]&&n.push(t[r]);return n.sort(function(e,t){return e.index-t.index}),n}function ca(e,t){if(!e.autoManage)return{size:0,syncFunc:ra};for(var n=sa(e.uniforms,t),r=oa(n),i=r.uboElements,a=r.size,o=[` var v = null; var v2 = null; var cv = null; @@ -460,7 +460,7 @@ void main(void) var gl = renderer.gl var index = 0; var data = buffer.data; - `],s=0;s1){var m=mi(c.data.type),h=Math.max(oa[c.data.type]/16,1),g=m/h,_=(4-g%4)%4;o.push(` + `],s=0;s1){var m=pi(c.data.type),h=Math.max(aa[c.data.type]/16,1),g=m/h,_=(4-g%4)%4;o.push(` cv = ud.`+u+`.value; v = uv.`+u+`; offset = `+c.offset/4+`; @@ -476,7 +476,7 @@ void main(void) offset += `+_+`; } - `)}else{var v=aa[c.data.type];o.push(` + `)}else{var v=ia[c.data.type];o.push(` cv = ud.`+u+`.value; v = uv.`+u+`; offset = `+c.offset/4+`; @@ -484,7 +484,7 @@ void main(void) `)}}return o.push(` renderer.buffer.update(buffer); `),{size:a,syncFunc:Function(`ud`,`uv`,`renderer`,`syncData`,`buffer`,o.join(` -`))}}(function(){function e(){}return e})();var ua=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();function da(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1});for(var o=0;o>=1,n++;this.stateId=e.data}for(var n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){for(var a=0,r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}();function Ea(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;return C=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext?(t={},t[at.UNSIGNED_BYTE]=(n={},n[N.RGBA]=e.RGBA8,n[N.RGB]=e.RGB8,n[N.RG]=e.RG8,n[N.RED]=e.R8,n[N.RGBA_INTEGER]=e.RGBA8UI,n[N.RGB_INTEGER]=e.RGB8UI,n[N.RG_INTEGER]=e.RG8UI,n[N.RED_INTEGER]=e.R8UI,n[N.ALPHA]=e.ALPHA,n[N.LUMINANCE]=e.LUMINANCE,n[N.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[at.BYTE]=(r={},r[N.RGBA]=e.RGBA8_SNORM,r[N.RGB]=e.RGB8_SNORM,r[N.RG]=e.RG8_SNORM,r[N.RED]=e.R8_SNORM,r[N.RGBA_INTEGER]=e.RGBA8I,r[N.RGB_INTEGER]=e.RGB8I,r[N.RG_INTEGER]=e.RG8I,r[N.RED_INTEGER]=e.R8I,r),t[at.UNSIGNED_SHORT]=(i={},i[N.RGBA_INTEGER]=e.RGBA16UI,i[N.RGB_INTEGER]=e.RGB16UI,i[N.RG_INTEGER]=e.RG16UI,i[N.RED_INTEGER]=e.R16UI,i[N.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,i),t[at.SHORT]=(a={},a[N.RGBA_INTEGER]=e.RGBA16I,a[N.RGB_INTEGER]=e.RGB16I,a[N.RG_INTEGER]=e.RG16I,a[N.RED_INTEGER]=e.R16I,a),t[at.UNSIGNED_INT]=(o={},o[N.RGBA_INTEGER]=e.RGBA32UI,o[N.RGB_INTEGER]=e.RGB32UI,o[N.RG_INTEGER]=e.RG32UI,o[N.RED_INTEGER]=e.R32UI,o[N.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,o),t[at.INT]=(s={},s[N.RGBA_INTEGER]=e.RGBA32I,s[N.RGB_INTEGER]=e.RGB32I,s[N.RG_INTEGER]=e.RG32I,s[N.RED_INTEGER]=e.R32I,s),t[at.FLOAT]=(c={},c[N.RGBA]=e.RGBA32F,c[N.RGB]=e.RGB32F,c[N.RG]=e.RG32F,c[N.RED]=e.R32F,c[N.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,c),t[at.HALF_FLOAT]=(l={},l[N.RGBA]=e.RGBA16F,l[N.RGB]=e.RGB16F,l[N.RG]=e.RG16F,l[N.RED]=e.R16F,l),t[at.UNSIGNED_SHORT_5_6_5]=(u={},u[N.RGB]=e.RGB565,u),t[at.UNSIGNED_SHORT_4_4_4_4]=(d={},d[N.RGBA]=e.RGBA4,d),t[at.UNSIGNED_SHORT_5_5_5_1]=(f={},f[N.RGBA]=e.RGB5_A1,f),t[at.UNSIGNED_INT_2_10_10_10_REV]=(p={},p[N.RGBA]=e.RGB10_A2,p[N.RGBA_INTEGER]=e.RGB10_A2UI,p),t[at.UNSIGNED_INT_10F_11F_11F_REV]=(m={},m[N.RGB]=e.R11F_G11F_B10F,m),t[at.UNSIGNED_INT_5_9_9_9_REV]=(h={},h[N.RGB]=e.RGB9_E5,h),t[at.UNSIGNED_INT_24_8]=(g={},g[N.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[at.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[N.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,_),t):(v={},v[at.UNSIGNED_BYTE]=(y={},y[N.RGBA]=e.RGBA,y[N.RGB]=e.RGB,y[N.ALPHA]=e.ALPHA,y[N.LUMINANCE]=e.LUMINANCE,y[N.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,y),v[at.UNSIGNED_SHORT_5_6_5]=(b={},b[N.RGB]=e.RGB,b),v[at.UNSIGNED_SHORT_4_4_4_4]=(x={},x[N.RGBA]=e.RGBA,x),v[at.UNSIGNED_SHORT_5_5_5_1]=(S={},S[N.RGBA]=e.RGBA,S),v),C}var Da=function(){function e(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=at.UNSIGNED_BYTE,this.internalFormat=N.RGBA,this.samplerType=0}return e}(),Oa=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new lr,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Ea(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n=0;--a){var o=n[a];if(o){var s=o._glTextures[i];s.samplerType!==ot.FLOAT&&this.renderer.texture.unbind(o)}}},e.prototype.initTexture=function(e){var t=new Da(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on(`dispose`,this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=(r=(n=this.internalFormats[e.type])?.[e.format])??e.format,this.webGLVersion===2&&e.type===at.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==ot.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,i=e.realHeight,a=n.gl;(t.width!==r||t.height!==i||t.dirtyId<0)&&(t.width=r,t.height=i,a.texImage2D(e.target,0,t.internalFormat,r,i,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off(`dispose`,this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);r!==-1&&hn(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===lt.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=ct.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==lt.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===st.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===st.LINEAR){var i=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===st.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===st.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),ka={__proto__:null,FilterSystem:Gr,BatchSystem:qr,ContextSystem:Yr,FramebufferSystem:Qr,GeometrySystem:ei,MaskSystem:Ji,ScissorSystem:Qi,StencilSystem:$i,ProjectionSystem:ea,RenderTextureSystem:ra,ShaderSystem:ga,StateSystem:wa,TextureGCSystem:Ta,TextureSystem:Oa},Aa=new Un,ja=function(e){rr(t,e);function t(t,n){t===void 0&&(t=et.UNKNOWN);var r=e.call(this)||this;return n=Object.assign({},P.RENDER_OPTIONS,n),r.options=n,r.type=t,r.screen=new Vn(0,0,n.width,n.height),r.view=n.view||P.ADAPTER.createCanvas(),r.resolution=n.resolution||P.RESOLUTION,r.useContextAlpha=n.useContextAlpha,r.autoDensity=!!n.autoDensity,r.preserveDrawingBuffer=n.preserveDrawingBuffer,r.clearBeforeRender=n.clearBeforeRender,r._backgroundColor=0,r._backgroundColorRgba=[0,0,0,1],r._backgroundColorString=`#000000`,r.backgroundColor=n.backgroundColor||r._backgroundColor,r.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(yn(`6.0.0`,`Option transparent is deprecated, please use backgroundAlpha instead.`),r.useContextAlpha=n.transparent,r.backgroundAlpha=n.transparent?0:1),r._lastObjectRendered=null,r.plugins={},r}return t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,`width`,{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+`px`,this.view.style.height=r+`px`),this.emit(`resize`,n,r)},t.prototype.generateTexture=function(e,t,n,r){t===void 0&&(t={}),typeof t==`number`&&(yn(`6.1.0`,`generateTexture options (scaleMode, resolution, region) are now object options.`),t={scaleMode:t,resolution:n,region:r});var i=t.region,a=ar(t,[`region`]);r=i||e.getLocalBounds(null,!0),r.width===0&&(r.width=1),r.height===0&&(r.height=1);var o=Dr.create(ir({width:r.width,height:r.height},a));return Aa.tx=-r.x,Aa.ty=-r.y,this.render(e,{renderTexture:o,clear:!1,transform:Aa,skipUpdateTransform:!!e.parent}),o},t.prototype.destroy=function(e){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=et.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,`backgroundColor`,{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=on(e),an(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`backgroundAlpha`,{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(Xt.default),Ma=function(){function e(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return e}(),Na=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this,n=t.gl,r=t.CONTEXT_UID,i=e._glBuffers[r]||this.createGLBuffer(e);n.bindBuffer(e.type,i.buffer)},e.prototype.bindBufferBase=function(e,t){var n=this,r=n.gl,i=n.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var a=e._glBuffers[i]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}},e.prototype.bindBufferRange=function(e,t,n){var r=this,i=r.gl,a=r.CONTEXT_UID;n||=0;var o=e._glBuffers[a]||this.createGLBuffer(e);i.bindBufferRange(i.UNIFORM_BUFFER,t||0,o.buffer,n*256,256)},e.prototype.update=function(e){var t=this,n=t.gl,r=t.CONTEXT_UID,i=e._glBuffers[r];if(e._updateID!==i.updateID)if(i.updateID=e._updateID,n.bindBuffer(e.type,i.buffer),i.byteLength>=e.data.byteLength)n.bufferSubData(e.type,0,e.data);else{var a=e.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,n.bufferData(e.type,e.data,a)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=gt.HIGH?this.multisample=gt.HIGH:t>=gt.MEDIUM?this.multisample=gt.MEDIUM:t>=gt.LOW?this.multisample=gt.LOW:this.multisample=gt.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw Error(`Whoops! The name "`+t+`" is already in use`);for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,a;if(t&&(t instanceof Dr?(yn(`6.0.0`,`Renderer#render arguments changed, use options instead.`),n=t,r=arguments[2],i=arguments[3],a=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit(`prerender`),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var o=e.enableTempParent();e.updateTransform(),e.disableTempParent(o)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(r===void 0?this.clearBeforeRender:r)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit(`postrender`)}},t.prototype.generateTexture=function(t,n,r,i){n===void 0&&(n={});var a=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),a},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,`extract`,{get:function(){return yn(`6.0.0`,`Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.`),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,t){yn(`6.5.0`,`Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.`),kn.add({name:e,type:Dn.RendererPlugin,ref:t})},t.__plugins={},t}(ja);kn.handleByMap(Dn.RendererPlugin,Pa.__plugins);function Fa(e){return Pa.create(e)}var Ia=`attribute vec2 aVertexPosition; +`))}}(function(){function e(){}return e})();var la=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();function ua(e,t){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;it?1:-1});for(var o=0;o>=1,n++;this.stateId=e.data}for(var n=0;nthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,n=!1,r=0;rthis.maxIdle&&(e.destroyTexture(i,!0),t[r]=null,n=!0)}if(n){for(var a=0,r=0;r=0;r--)this.unload(e.children[r])},e.prototype.destroy=function(){this.renderer=null},e}();function Ta(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C;return C=`WebGL2RenderingContext`in globalThis&&e instanceof globalThis.WebGL2RenderingContext?(t={},t[it.UNSIGNED_BYTE]=(n={},n[F.RGBA]=e.RGBA8,n[F.RGB]=e.RGB8,n[F.RG]=e.RG8,n[F.RED]=e.R8,n[F.RGBA_INTEGER]=e.RGBA8UI,n[F.RGB_INTEGER]=e.RGB8UI,n[F.RG_INTEGER]=e.RG8UI,n[F.RED_INTEGER]=e.R8UI,n[F.ALPHA]=e.ALPHA,n[F.LUMINANCE]=e.LUMINANCE,n[F.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,n),t[it.BYTE]=(r={},r[F.RGBA]=e.RGBA8_SNORM,r[F.RGB]=e.RGB8_SNORM,r[F.RG]=e.RG8_SNORM,r[F.RED]=e.R8_SNORM,r[F.RGBA_INTEGER]=e.RGBA8I,r[F.RGB_INTEGER]=e.RGB8I,r[F.RG_INTEGER]=e.RG8I,r[F.RED_INTEGER]=e.R8I,r),t[it.UNSIGNED_SHORT]=(i={},i[F.RGBA_INTEGER]=e.RGBA16UI,i[F.RGB_INTEGER]=e.RGB16UI,i[F.RG_INTEGER]=e.RG16UI,i[F.RED_INTEGER]=e.R16UI,i[F.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,i),t[it.SHORT]=(a={},a[F.RGBA_INTEGER]=e.RGBA16I,a[F.RGB_INTEGER]=e.RGB16I,a[F.RG_INTEGER]=e.RG16I,a[F.RED_INTEGER]=e.R16I,a),t[it.UNSIGNED_INT]=(o={},o[F.RGBA_INTEGER]=e.RGBA32UI,o[F.RGB_INTEGER]=e.RGB32UI,o[F.RG_INTEGER]=e.RG32UI,o[F.RED_INTEGER]=e.R32UI,o[F.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,o),t[it.INT]=(s={},s[F.RGBA_INTEGER]=e.RGBA32I,s[F.RGB_INTEGER]=e.RGB32I,s[F.RG_INTEGER]=e.RG32I,s[F.RED_INTEGER]=e.R32I,s),t[it.FLOAT]=(c={},c[F.RGBA]=e.RGBA32F,c[F.RGB]=e.RGB32F,c[F.RG]=e.RG32F,c[F.RED]=e.R32F,c[F.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,c),t[it.HALF_FLOAT]=(l={},l[F.RGBA]=e.RGBA16F,l[F.RGB]=e.RGB16F,l[F.RG]=e.RG16F,l[F.RED]=e.R16F,l),t[it.UNSIGNED_SHORT_5_6_5]=(u={},u[F.RGB]=e.RGB565,u),t[it.UNSIGNED_SHORT_4_4_4_4]=(d={},d[F.RGBA]=e.RGBA4,d),t[it.UNSIGNED_SHORT_5_5_5_1]=(f={},f[F.RGBA]=e.RGB5_A1,f),t[it.UNSIGNED_INT_2_10_10_10_REV]=(p={},p[F.RGBA]=e.RGB10_A2,p[F.RGBA_INTEGER]=e.RGB10_A2UI,p),t[it.UNSIGNED_INT_10F_11F_11F_REV]=(m={},m[F.RGB]=e.R11F_G11F_B10F,m),t[it.UNSIGNED_INT_5_9_9_9_REV]=(h={},h[F.RGB]=e.RGB9_E5,h),t[it.UNSIGNED_INT_24_8]=(g={},g[F.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,g),t[it.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[F.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,_),t):(v={},v[it.UNSIGNED_BYTE]=(y={},y[F.RGBA]=e.RGBA,y[F.RGB]=e.RGB,y[F.ALPHA]=e.ALPHA,y[F.LUMINANCE]=e.LUMINANCE,y[F.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,y),v[it.UNSIGNED_SHORT_5_6_5]=(b={},b[F.RGB]=e.RGB,b),v[it.UNSIGNED_SHORT_4_4_4_4]=(x={},x[F.RGBA]=e.RGBA,x),v[it.UNSIGNED_SHORT_5_5_5_1]=(S={},S[F.RGBA]=e.RGBA,S),v),C}var Ea=function(){function e(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=it.UNSIGNED_BYTE,this.internalFormat=F.RGBA,this.samplerType=0}return e}(),Da=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new cr,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Ta(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var n=0;n=0;--a){var o=n[a];if(o){var s=o._glTextures[i];s.samplerType!==at.FLOAT&&this.renderer.texture.unbind(o)}}},e.prototype.initTexture=function(e){var t=new Ea(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on(`dispose`,this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var n,r;t.internalFormat=(r=(n=this.internalFormats[e.type])?.[e.format])??e.format,this.webGLVersion===2&&e.type===it.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var n=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(n,e,t))t.samplerType!==at.FLOAT&&(this.hasIntegerTextures=!0);else{var r=e.realWidth,i=e.realHeight,a=n.gl;(t.width!==r||t.height!==i||t.dirtyId<0)&&(t.width=r,t.height=i,a.texImage2D(e.target,0,t.internalFormat,r,i,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var n=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off(`dispose`,this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var r=this.managedTextures.indexOf(e);r!==-1&&mn(this.managedTextures,r,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===ct.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=st.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var n=this.gl;if(t.mipmap&&e.mipmap!==ct.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,t.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===ot.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);var r=this.renderer.context.extensions.anisotropicFiltering;if(r&&e.anisotropicLevel>0&&e.scaleMode===ot.LINEAR){var i=Math.min(e.anisotropicLevel,n.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===ot.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===ot.LINEAR?n.LINEAR:n.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),Oa={__proto__:null,FilterSystem:Wr,BatchSystem:Kr,ContextSystem:Jr,FramebufferSystem:Zr,GeometrySystem:$r,MaskSystem:qi,ScissorSystem:Zi,StencilSystem:Qi,ProjectionSystem:$i,RenderTextureSystem:na,ShaderSystem:ha,StateSystem:Ca,TextureGCSystem:wa,TextureSystem:Da},ka=new Hn,Aa=function(e){nr(t,e);function t(t,n){t===void 0&&(t=$e.UNKNOWN);var r=e.call(this)||this;return n=Object.assign({},I.RENDER_OPTIONS,n),r.options=n,r.type=t,r.screen=new Bn(0,0,n.width,n.height),r.view=n.view||I.ADAPTER.createCanvas(),r.resolution=n.resolution||I.RESOLUTION,r.useContextAlpha=n.useContextAlpha,r.autoDensity=!!n.autoDensity,r.preserveDrawingBuffer=n.preserveDrawingBuffer,r.clearBeforeRender=n.clearBeforeRender,r._backgroundColor=0,r._backgroundColorRgba=[0,0,0,1],r._backgroundColorString=`#000000`,r.backgroundColor=n.backgroundColor||r._backgroundColor,r.backgroundAlpha=n.backgroundAlpha,n.transparent!==void 0&&(vn(`6.0.0`,`Option transparent is deprecated, please use backgroundAlpha instead.`),r.useContextAlpha=n.transparent,r.backgroundAlpha=n.transparent?0:1),r._lastObjectRendered=null,r.plugins={},r}return t.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(t.prototype,`width`,{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`height`,{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var n=this.view.width/this.resolution,r=this.view.height/this.resolution;this.screen.width=n,this.screen.height=r,this.autoDensity&&(this.view.style.width=n+`px`,this.view.style.height=r+`px`),this.emit(`resize`,n,r)},t.prototype.generateTexture=function(e,t,n,r){t===void 0&&(t={}),typeof t==`number`&&(vn(`6.1.0`,`generateTexture options (scaleMode, resolution, region) are now object options.`),t={scaleMode:t,resolution:n,region:r});var i=t.region,a=ir(t,[`region`]);r=i||e.getLocalBounds(null,!0),r.width===0&&(r.width=1),r.height===0&&(r.height=1);var o=Er.create(rr({width:r.width,height:r.height},a));return ka.tx=-r.x,ka.ty=-r.y,this.render(e,{renderTexture:o,clear:!1,transform:ka,skipUpdateTransform:!!e.parent}),o},t.prototype.destroy=function(e){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=$e.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,`backgroundColor`,{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=an(e),rn(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`backgroundAlpha`,{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(Yt.default),ja=function(){function e(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return e}(),Ma=function(){function e(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return e.prototype.destroy=function(){this.renderer=null},e.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},e.prototype.bind=function(e){var t=this,n=t.gl,r=t.CONTEXT_UID,i=e._glBuffers[r]||this.createGLBuffer(e);n.bindBuffer(e.type,i.buffer)},e.prototype.bindBufferBase=function(e,t){var n=this,r=n.gl,i=n.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var a=e._glBuffers[i]||this.createGLBuffer(e);this.boundBufferBases[t]=e,r.bindBufferBase(r.UNIFORM_BUFFER,t,a.buffer)}},e.prototype.bindBufferRange=function(e,t,n){var r=this,i=r.gl,a=r.CONTEXT_UID;n||=0;var o=e._glBuffers[a]||this.createGLBuffer(e);i.bindBufferRange(i.UNIFORM_BUFFER,t||0,o.buffer,n*256,256)},e.prototype.update=function(e){var t=this,n=t.gl,r=t.CONTEXT_UID,i=e._glBuffers[r];if(e._updateID!==i.updateID)if(i.updateID=e._updateID,n.bindBuffer(e.type,i.buffer),i.byteLength>=e.data.byteLength)n.bufferSubData(e.type,0,e.data);else{var a=e.static?n.STATIC_DRAW:n.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,n.bufferData(e.type,e.data,a)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var n=e._glBuffers[this.CONTEXT_UID],r=this.gl;e.disposeRunner.remove(this),n&&(t||r.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),n=0;n=ht.HIGH?this.multisample=ht.HIGH:t>=ht.MEDIUM?this.multisample=ht.MEDIUM:t>=ht.LOW?this.multisample=ht.LOW:this.multisample=ht.NONE},t.prototype.addSystem=function(e,t){var n=new e(this);if(this[t])throw Error(`Whoops! The name "`+t+`" is already in use`);for(var r in this[t]=n,this.runners)this.runners[r].add(n);return this},t.prototype.render=function(e,t){var n,r,i,a;if(t&&(t instanceof Er?(vn(`6.0.0`,`Renderer#render arguments changed, use options instead.`),n=t,r=arguments[2],i=arguments[3],a=arguments[4]):(n=t.renderTexture,r=t.clear,i=t.transform,a=t.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit(`prerender`),this.projection.transform=i,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var o=e.enableTempParent();e.updateTransform(),e.disableTempParent(o)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(r===void 0?this.clearBeforeRender:r)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit(`postrender`)}},t.prototype.generateTexture=function(t,n,r,i){n===void 0&&(n={});var a=e.prototype.generateTexture.call(this,t,n,r,i);return this.framebuffer.blit(),a},t.prototype.resize=function(t,n){e.prototype.resize.call(this,t,n),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var n in this.runners.destroy.emit(),this.runners)this.runners[n].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,`extract`,{get:function(){return vn(`6.0.0`,`Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.`),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,t){vn(`6.5.0`,`Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.`),On.add({name:e,type:En.RendererPlugin,ref:t})},t.__plugins={},t}(Aa);On.handleByMap(En.RendererPlugin,Na.__plugins);function Pa(e){return Na.create(e)}var Fa=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -495,7 +495,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,La=Ia;(function(){function e(e){yn(`6.1.0`,`System class is deprecated, implemement ISystem interface instead.`),this.renderer=e}return e.prototype.destroy=function(){this.renderer=null},e})();var Ra=function(){function e(){this.texArray=null,this.blend=0,this.type=rt.TRIANGLES,this.start=0,this.size=0,this.data=null}return e}(),za=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,n=e._bufferedTextures,r=e.MAX_TEXTURES,i=t._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,c=++lr._globalBatch,l=0,u=i[0],d=0;a.copyBoundTextures(o,r);for(var f=0;f=r&&(a.boundArray(u,o,c,r),this.buildDrawCalls(u,d,f),d=f,u=i[++l],++c),p._batchEnabled=c,p.touched=s,u.elements[u.count++]=p)}u.count>0&&(a.boundArray(u,o,c,r),this.buildDrawCalls(u,d,this._bufferSize),++l,++c);for(var f=0;fthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,n=e._bufferedTextures,r=e.MAX_TEXTURES,i=t._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,c=++cr._globalBatch,l=0,u=i[0],d=0;a.copyBoundTextures(o,r);for(var f=0;f=r&&(a.boundArray(u,o,c,r),this.buildDrawCalls(u,d,f),d=f,u=i[++l],++c),p._batchEnabled=c,p.touched=s,u.elements[u.count++]=p)}u.count>0&&(a.boundArray(u,o,c,r),this.buildDrawCalls(u,d,this._bufferSize),++l,++c);for(var f=0;f0&&(t+=` else `),nthis.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?Vn.EMPTY:(e||=new Vn(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addPointMatrix=function(e,t){var n=e.a,r=e.b,i=e.c,a=e.d,o=e.tx,s=e.ty,c=n*t.x+i*t.y+o,l=r*t.x+a*t.y+s;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},e.prototype.addQuad=function(e){var t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,a=e[0],o=e[1];t=ar?a:r,i=o>i?o:i,a=e[2],o=e[3],t=ar?a:r,i=o>i?o:i,a=e[4],o=e[5],t=ar?a:r,i=o>i?o:i,a=e[6],o=e[7],t=ar?a:r,i=o>i?o:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i},e.prototype.addFrame=function(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)},e.prototype.addFrameMatrix=function(e,t,n,r,i){var a=e.a,o=e.b,s=e.c,c=e.d,l=e.tx,u=e.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*t+s*n+l,g=o*t+c*n+u;d=hp?h:p,m=g>m?g:m,h=a*r+s*n+l,g=o*r+c*n+u,d=hp?h:p,m=g>m?g:m,h=a*t+s*i+l,g=o*t+c*i+u,d=hp?h:p,m=g>m?g:m,h=a*r+s*i+l,g=o*r+c*i+u,d=hp?h:p,m=g>m?g:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m},e.prototype.addVertexData=function(e,t,n){for(var r=this.minX,i=this.minY,a=this.maxX,o=this.maxY,s=t;sa?c:a,o=l>o?l:o}this.minX=r,this.minY=i,this.maxX=a,this.maxY=o},e.prototype.addVertices=function(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)},e.prototype.addVerticesMatrix=function(e,t,n,r,i,a){i===void 0&&(i=0),a===void 0&&(a=i);for(var o=e.a,s=e.b,c=e.c,l=e.d,u=e.tx,d=e.ty,f=this.minX,p=this.minY,m=this.maxX,h=this.maxY,g=n;gr?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i},e.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxXc?i:c,this.maxY=a>l?a:l}},e.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},e.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxXc?i:c,this.maxY=a>l?a:l}},e.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},e.prototype.addFramePad=function(e,t,n,r,i,a){e-=i,t-=a,n+=i,r+=a,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},e}(),eo=function(e,t){return eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},eo(e,t)};function to(e,t){eo(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var no=function(e){to(t,e);function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new $n,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new $a,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return t.mixin=function(e){for(var n=Object.keys(e),r=0;r1)for(var r=0;rthis.children.length)throw Error(e+`addChildAt: The index `+t+` supplied is out of bounds `+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit(`added`,this),this.emit(`childAdded`,e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n=this.children.length)throw Error(`The index `+t+` supplied is out of bounds `+this.children.length);var n=this.getChildIndex(e);hn(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (`+e+`) does not exist.`);return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],n=0;n1)for(var r=0;r0&&i<=r){a=this.children.splice(n,i);for(var o=0;o1&&this.children.sort(io),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&n.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0)),r&&n.intersects(r,i))this._render(e);else if(this.cullArea)return;for(var a=0,o=this.children.length;a=0;f--){var p=d[f],m=this.recursiveFindHit(e,p,n,r,c);if(m){if(!p.parent)continue;c=!1,m&&(e.target&&(r=!1),s=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(s=!0),t.interactive&&(s&&!e.target&&(e.target=t),n&&n(e,t,!!s))),s},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),ho={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor===`pointer`},set buttonMode(e){e?this.cursor=`pointer`:this.cursor===`pointer`&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};no.mixin(ho);var go=1,_o={target:null,data:{global:null}},vo=function(e){uo(t,e);function t(t,n){var r=e.call(this)||this;return n||={},r.renderer=t,r.autoPreventDefault=n.autoPreventDefault===void 0?!0:n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new co,r.mouse.identifier=go,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[go]=r.mouse,r.interactionDataPool=[],r.eventData=new fo,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!(`PointerEvent`in globalThis),r.supportsTouchEvents=`ontouchstart`in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:`inherit`,pointer:`pointer`},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new mo,r._tempDisplayObject=new ro,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=n.useSystemTicker===void 0?!0:n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return Object.defineProperty(t.prototype,`useSystemTicker`,{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lastObjectRendered`,{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return _o.target=null,_o.data.global=e,t||=this.lastObjectRendered,this.processInteractive(_o,t,null,!0),_o.target},t.prototype.setTargetElement=function(e,t){t===void 0&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Nn.system.add(this.tickerUpdate,this,jn.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(Nn.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var o=a===this.interactionDOMElement?``:`outside`,s=0;snew Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),xo=class e{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new e}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,t){this._currentTime+=t;let n=this._currentTime*2*3.14159;for(let t=0;t=1&&(r=1,this._blinkingState=To.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),n=1-r;break;case To.EyeState_Closed:r=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,r>=1&&(this._blinkingState=To.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),n=0;break;case To.EyeState_Opening:r=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,r>=1&&(r=1,this._blinkingState=To.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),n=r;break;case To.EyeState_Interval:this._nextBlinkingTime(e[e.EyeState_First=0]=`EyeState_First`,e[e.EyeState_Interval=1]=`EyeState_Interval`,e[e.EyeState_Closing=2]=`EyeState_Closing`,e[e.EyeState_Closed=3]=`EyeState_Closed`,e[e.EyeState_Opening=4]=`EyeState_Opening`,e))(To||{});const Eo=.001,Do=.5;var Oo=class e{static create(t){let n=new e;typeof t.FadeInTime==`number`&&(n._fadeTimeSeconds=t.FadeInTime,n._fadeTimeSeconds<=0&&(n._fadeTimeSeconds=Do));let r=t.Groups,i=r.length;for(let e=0;eEo){if(i>=0)break;i=o,a=e.getPartOpacityByIndex(n),a+=t/this._fadeTimeSeconds,a>1&&(a=1)}}i<0&&(i=0,a=1);for(let t=n;ts&&(r=1-s/(1-a)),t>r&&(t=r),e.setPartOpacityByIndex(n,t)}}}constructor(){this._fadeTimeSeconds=Do,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}},ko=class e{constructor(e){this.parameterIndex=0,this.partIndex=0,this.partId=``,this.link=[],e!=null&&this.assignment(e)}assignment(e){return this.partId=e.partId,this.link=e.link.map(e=>e.clone()),this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){let t=new e;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(e=>e.clone()),t}},Ao=class e{constructor(e,t){this.x=e||0,this.y=t||0}add(t){let n=new e(0,0);return n.x=this.x+t.x,n.y=this.y+t.y,n}substract(t){let n=new e(0,0);return n.x=this.x-t.x,n.y=this.y-t.y,n}multiply(t){let n=new e(0,0);return n.x=this.x*t.x,n.y=this.y*t.y,n}multiplyByScaler(t){return this.multiply(new e(t,t))}division(t){let n=new e(0,0);return n.x=this.x/t.x,n.y=this.y/t.y,n}divisionByScalar(t){return this.division(new e(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){let e=(this.x*this.x+this.y*this.y)**.5;this.x/=e,this.y/=e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}};const jo=class{static range(e,t,n){return en&&(e=n),e}static sin(e){return Math.sin(e)}static cos(e){return Math.cos(e)}static abs(e){return Math.abs(e)}static sqrt(e){return Math.sqrt(e)}static cbrt(e){if(e===0)return e;let t=e,n=t<0;n&&(t=-t);let r;return t===1/0?r=1/0:(r=Math.exp(Math.log(t)/3),r=(t/(r*r)+2*r)/3),n?-r:r}static getEasingSine(e){return e<0?0:e>1?1:.5-.5*this.cos(e*Math.PI)}static max(e,t){return e>t?e:t}static min(e,t){return e>t?t:e}static degreesToRadian(e){return e/180*Math.PI}static radianToDegrees(e){return e*180/Math.PI}static directionToRadian(e,t){let n=Math.atan2(t.y,t.x),r=Math.atan2(e.y,e.x),i=n-r;for(;i<-Math.PI;)i+=Math.PI*2;for(;i>Math.PI;)i-=Math.PI*2;return i}static directionToDegrees(e,t){let n=this.directionToRadian(e,t),r=this.radianToDegrees(n);return t.x-e.x>0&&(r=-r),r}static radianToDirection(e){let t=new Ao;return t.x=this.sin(e),t.y=this.cos(e),t}static quadraticEquation(e,t,n){return this.abs(e)1&&(e=1),t<0?t=0:t>1&&(t=1),n<0?n=0:n>1&&(n=1),r<0?r=0:r>1&&(r=1),this._modelColor.R=e,this._modelColor.G=t,this._modelColor.B=n,this._modelColor.A=r}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisortopy=e}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new Io,this._mvpMatrix4x4=new No,this._mvpMatrix4x4.loadIdentity()}},Fo=(e=>(e[e.CubismBlendMode_Normal=0]=`CubismBlendMode_Normal`,e[e.CubismBlendMode_Additive=1]=`CubismBlendMode_Additive`,e[e.CubismBlendMode_Multiplicative=2]=`CubismBlendMode_Multiplicative`,e))(Fo||{}),Io=class{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}};let Lo=!1,Ro=!1,zo;const Bo={vertexOffset:0,vertexStep:2};var Vo=class{static startUp(e){if(Lo)return Wo(`CubismFramework.startUp() is already done.`),Lo;if(Live2DCubismCore._isStarted)return Lo=!0,!0;if(Live2DCubismCore._isStarted=!0,zo=e,zo&&Live2DCubismCore.Logging.csmSetLogFunction(zo.logFunction),Lo=!0,Lo){let e=Live2DCubismCore.Version.csmGetVersion(),t=(e&4278190080)>>24,n=(e&16711680)>>16,r=e&65535,i=e;Wo(`Live2D Cubism Core version: {0}.{1}.{2} ({3})`,(`00`+t).slice(-2),(`00`+n).slice(-2),(`0000`+r).slice(-4),i)}return Wo(`CubismFramework.startUp() is complete.`),Lo}static cleanUp(){Lo=!1,Ro=!1,zo=void 0}static initialize(){if(!Lo){Go(`CubismFramework is not started.`);return}if(Ro){Go(`CubismFramework.initialize() skipped, already initialized.`);return}Ro=!0,Wo(`CubismFramework.initialize() is complete.`)}static dispose(){if(!Lo){Go(`CubismFramework is not started.`);return}if(!Ro){Go(`CubismFramework.dispose() skipped, not initialized.`);return}Po.staticRelease(),Ro=!1,Wo(`CubismFramework.dispose() is complete.`)}static isStarted(){return Lo}static isInitialized(){return Ro}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return zo==null?Ho.LogLevel_Off:zo.loggingLevel}constructor(){}},Ho=(e=>(e[e.LogLevel_Verbose=0]=`LogLevel_Verbose`,e[e.LogLevel_Debug=1]=`LogLevel_Debug`,e[e.LogLevel_Info=2]=`LogLevel_Info`,e[e.LogLevel_Warning=3]=`LogLevel_Warning`,e[e.LogLevel_Error=4]=`LogLevel_Error`,e[e.LogLevel_Off=5]=`LogLevel_Off`,e))(Ho||{});function Uo(e,...t){qo.print(Ho.LogLevel_Debug,`[CSM][D]`+e+` -`,t)}function Wo(e,...t){qo.print(Ho.LogLevel_Info,`[CSM][I]`+e+` -`,t)}function Go(e,...t){qo.print(Ho.LogLevel_Warning,`[CSM][W]`+e+` -`,t)}function Ko(e,...t){qo.print(Ho.LogLevel_Error,`[CSM][E]`+e+` -`,t)}var qo=class{static print(e,t,n){if(en[t]);r(i)}static dumpBytes(e,t,n){for(let r=0;r0?this.print(e,` +`,Ga=function(){function e(){}return e.create=function(e){var t=Object.assign({vertex:Ua,fragment:Wa,geometryClass:Ha,vertexSize:6},e),n=t.vertex,r=t.fragment,i=t.vertexSize,a=t.geometryClass;return function(e){nr(t,e);function t(t){var o=e.call(this,t)||this;return o.shaderGenerator=new Va(n,r),o.geometryClass=a,o.vertexSize=i,o}return t}(Ba)},Object.defineProperty(e,`defaultVertexSrc`,{get:function(){return Ua},enumerable:!1,configurable:!0}),Object.defineProperty(e,`defaultFragmentTemplate`,{get:function(){return Wa},enumerable:!1,configurable:!0}),e}(),Ka=Ga.create();Object.assign(Ka,{extension:{name:`batch`,type:En.RendererPlugin}});var qa={},Ja=function(e){Object.defineProperty(qa,e,{get:function(){return vn(`6.0.0`,`PIXI.systems.`+e+` has moved to PIXI.`+e),vr[e]}})};for(var Ya in vr)Ja(Ya);var Xa={},Za=function(e){Object.defineProperty(Xa,e,{get:function(){return vn(`6.0.0`,`PIXI.resources.`+e+` has moved to PIXI.`+e),Oa[e]}})};for(var Ya in Oa)Za(Ya);I.SORTABLE_CHILDREN=!1;var Qa=function(){function e(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?Bn.EMPTY:(e||=new Bn(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addPointMatrix=function(e,t){var n=e.a,r=e.b,i=e.c,a=e.d,o=e.tx,s=e.ty,c=n*t.x+i*t.y+o,l=r*t.x+a*t.y+s;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},e.prototype.addQuad=function(e){var t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,a=e[0],o=e[1];t=ar?a:r,i=o>i?o:i,a=e[2],o=e[3],t=ar?a:r,i=o>i?o:i,a=e[4],o=e[5],t=ar?a:r,i=o>i?o:i,a=e[6],o=e[7],t=ar?a:r,i=o>i?o:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i},e.prototype.addFrame=function(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)},e.prototype.addFrameMatrix=function(e,t,n,r,i){var a=e.a,o=e.b,s=e.c,c=e.d,l=e.tx,u=e.ty,d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,h=a*t+s*n+l,g=o*t+c*n+u;d=hp?h:p,m=g>m?g:m,h=a*r+s*n+l,g=o*r+c*n+u,d=hp?h:p,m=g>m?g:m,h=a*t+s*i+l,g=o*t+c*i+u,d=hp?h:p,m=g>m?g:m,h=a*r+s*i+l,g=o*r+c*i+u,d=hp?h:p,m=g>m?g:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m},e.prototype.addVertexData=function(e,t,n){for(var r=this.minX,i=this.minY,a=this.maxX,o=this.maxY,s=t;sa?c:a,o=l>o?l:o}this.minX=r,this.minY=i,this.maxX=a,this.maxY=o},e.prototype.addVertices=function(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)},e.prototype.addVerticesMatrix=function(e,t,n,r,i,a){i===void 0&&(i=0),a===void 0&&(a=i);for(var o=e.a,s=e.b,c=e.c,l=e.d,u=e.tx,d=e.ty,f=this.minX,p=this.minY,m=this.maxX,h=this.maxY,g=n;gr?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i},e.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxXc?i:c,this.maxY=a>l?a:l}},e.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},e.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxXc?i:c,this.maxY=a>l?a:l}},e.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},e.prototype.addFramePad=function(e,t,n,r,i,a){e-=i,t-=a,n+=i,r+=a,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},e}(),$a=function(e,t){return $a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},$a(e,t)};function eo(e,t){$a(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var to=function(e){eo(t,e);function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Qn,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new Qa,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return t.mixin=function(e){for(var n=Object.keys(e),r=0;r1)for(var r=0;rthis.children.length)throw Error(e+`addChildAt: The index `+t+` supplied is out of bounds `+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit(`added`,this),this.emit(`childAdded`,e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n=this.children.length)throw Error(`The index `+t+` supplied is out of bounds `+this.children.length);var n=this.getChildIndex(e);mn(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw Error(`getChildAt: Index (`+e+`) does not exist.`);return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],n=0;n1)for(var r=0;r0&&i<=r){a=this.children.splice(n,i);for(var o=0;o1&&this.children.sort(ro),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&n.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0)),r&&n.intersects(r,i))this._render(e);else if(this.cullArea)return;for(var a=0,o=this.children.length;a=0;f--){var p=d[f],m=this.recursiveFindHit(e,p,n,r,c);if(m){if(!p.parent)continue;c=!1,m&&(e.target&&(r=!1),s=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(s=!0),t.interactive&&(s&&!e.target&&(e.target=t),n&&n(e,t,!!s))),s},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),mo={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor===`pointer`},set buttonMode(e){e?this.cursor=`pointer`:this.cursor===`pointer`&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};to.mixin(mo);var ho=1,go={target:null,data:{global:null}},_o=function(e){lo(t,e);function t(t,n){var r=e.call(this)||this;return n||={},r.renderer=t,r.autoPreventDefault=n.autoPreventDefault===void 0?!0:n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new so,r.mouse.identifier=ho,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[ho]=r.mouse,r.interactionDataPool=[],r.eventData=new uo,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!(`PointerEvent`in globalThis),r.supportsTouchEvents=`ontouchstart`in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:`inherit`,pointer:`pointer`},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new po,r._tempDisplayObject=new no,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=n.useSystemTicker===void 0?!0:n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return Object.defineProperty(t.prototype,`useSystemTicker`,{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lastObjectRendered`,{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return go.target=null,go.data.global=e,t||=this.lastObjectRendered,this.processInteractive(go,t,null,!0),go.target},t.prototype.setTargetElement=function(e,t){t===void 0&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Mn.system.add(this.tickerUpdate,this,An.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(Mn.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var o=a===this.interactionDOMElement?``:`outside`,s=0;snew Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),bo=class e{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new e}setParameters(e){this._breathParameters=e}getParameters(){return this._breathParameters}updateParameters(e,t){this._currentTime+=t;let n=this._currentTime*2*3.14159;for(let t=0;t=1&&(r=1,this._blinkingState=wo.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),n=1-r;break;case wo.EyeState_Closed:r=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,r>=1&&(this._blinkingState=wo.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),n=0;break;case wo.EyeState_Opening:r=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,r>=1&&(r=1,this._blinkingState=wo.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),n=r;break;case wo.EyeState_Interval:this._nextBlinkingTime(e[e.EyeState_First=0]=`EyeState_First`,e[e.EyeState_Interval=1]=`EyeState_Interval`,e[e.EyeState_Closing=2]=`EyeState_Closing`,e[e.EyeState_Closed=3]=`EyeState_Closed`,e[e.EyeState_Opening=4]=`EyeState_Opening`,e))(wo||{});const To=.001,Eo=.5;var Do=class e{static create(t){let n=new e;typeof t.FadeInTime==`number`&&(n._fadeTimeSeconds=t.FadeInTime,n._fadeTimeSeconds<=0&&(n._fadeTimeSeconds=Eo));let r=t.Groups,i=r.length;for(let e=0;eTo){if(i>=0)break;i=o,a=e.getPartOpacityByIndex(n),a+=t/this._fadeTimeSeconds,a>1&&(a=1)}}i<0&&(i=0,a=1);for(let t=n;ts&&(r=1-s/(1-a)),t>r&&(t=r),e.setPartOpacityByIndex(n,t)}}}constructor(){this._fadeTimeSeconds=Eo,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}},Oo=class e{constructor(e){this.parameterIndex=0,this.partIndex=0,this.partId=``,this.link=[],e!=null&&this.assignment(e)}assignment(e){return this.partId=e.partId,this.link=e.link.map(e=>e.clone()),this}initialize(e){this.parameterIndex=e.getParameterIndex(this.partId),this.partIndex=e.getPartIndex(this.partId),e.setParameterValueByIndex(this.parameterIndex,1)}clone(){let t=new e;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(e=>e.clone()),t}},ko=class e{constructor(e,t){this.x=e||0,this.y=t||0}add(t){let n=new e(0,0);return n.x=this.x+t.x,n.y=this.y+t.y,n}substract(t){let n=new e(0,0);return n.x=this.x-t.x,n.y=this.y-t.y,n}multiply(t){let n=new e(0,0);return n.x=this.x*t.x,n.y=this.y*t.y,n}multiplyByScaler(t){return this.multiply(new e(t,t))}division(t){let n=new e(0,0);return n.x=this.x/t.x,n.y=this.y/t.y,n}divisionByScalar(t){return this.division(new e(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(e){return Math.sqrt((this.x-e.x)*(this.x-e.x)+(this.y-e.y)*(this.y-e.y))}dot(e){return this.x*e.x+this.y*e.y}normalize(){let e=(this.x*this.x+this.y*this.y)**.5;this.x/=e,this.y/=e}isEqual(e){return this.x==e.x&&this.y==e.y}isNotEqual(e){return!this.isEqual(e)}};const Ao=class{static range(e,t,n){return en&&(e=n),e}static sin(e){return Math.sin(e)}static cos(e){return Math.cos(e)}static abs(e){return Math.abs(e)}static sqrt(e){return Math.sqrt(e)}static cbrt(e){if(e===0)return e;let t=e,n=t<0;n&&(t=-t);let r;return t===1/0?r=1/0:(r=Math.exp(Math.log(t)/3),r=(t/(r*r)+2*r)/3),n?-r:r}static getEasingSine(e){return e<0?0:e>1?1:.5-.5*this.cos(e*Math.PI)}static max(e,t){return e>t?e:t}static min(e,t){return e>t?t:e}static degreesToRadian(e){return e/180*Math.PI}static radianToDegrees(e){return e*180/Math.PI}static directionToRadian(e,t){let n=Math.atan2(t.y,t.x),r=Math.atan2(e.y,e.x),i=n-r;for(;i<-Math.PI;)i+=Math.PI*2;for(;i>Math.PI;)i-=Math.PI*2;return i}static directionToDegrees(e,t){let n=this.directionToRadian(e,t),r=this.radianToDegrees(n);return t.x-e.x>0&&(r=-r),r}static radianToDirection(e){let t=new ko;return t.x=this.sin(e),t.y=this.cos(e),t}static quadraticEquation(e,t,n){return this.abs(e)1&&(e=1),t<0?t=0:t>1&&(t=1),n<0?n=0:n>1&&(n=1),r<0?r=0:r>1&&(r=1),this._modelColor.R=e,this._modelColor.G=t,this._modelColor.B=n,this._modelColor.A=r}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(e){this._isPremultipliedAlpha=e}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(e){this._isCulling=e}isCulling(){return this._isCulling}setAnisotropy(e){this._anisortopy=e}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new Fo,this._mvpMatrix4x4=new Mo,this._mvpMatrix4x4.loadIdentity()}},Po=(e=>(e[e.CubismBlendMode_Normal=0]=`CubismBlendMode_Normal`,e[e.CubismBlendMode_Additive=1]=`CubismBlendMode_Additive`,e[e.CubismBlendMode_Multiplicative=2]=`CubismBlendMode_Multiplicative`,e))(Po||{}),Fo=class{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}};let Io=!1,Lo=!1,Ro;const zo={vertexOffset:0,vertexStep:2};var Bo=class{static startUp(e){if(Io)return Uo(`CubismFramework.startUp() is already done.`),Io;if(Live2DCubismCore._isStarted)return Io=!0,!0;if(Live2DCubismCore._isStarted=!0,Ro=e,Ro&&Live2DCubismCore.Logging.csmSetLogFunction(Ro.logFunction),Io=!0,Io){let e=Live2DCubismCore.Version.csmGetVersion(),t=(e&4278190080)>>24,n=(e&16711680)>>16,r=e&65535,i=e;Uo(`Live2D Cubism Core version: {0}.{1}.{2} ({3})`,(`00`+t).slice(-2),(`00`+n).slice(-2),(`0000`+r).slice(-4),i)}return Uo(`CubismFramework.startUp() is complete.`),Io}static cleanUp(){Io=!1,Lo=!1,Ro=void 0}static initialize(){if(!Io){Wo(`CubismFramework is not started.`);return}if(Lo){Wo(`CubismFramework.initialize() skipped, already initialized.`);return}Lo=!0,Uo(`CubismFramework.initialize() is complete.`)}static dispose(){if(!Io){Wo(`CubismFramework is not started.`);return}if(!Lo){Wo(`CubismFramework.dispose() skipped, not initialized.`);return}No.staticRelease(),Lo=!1,Uo(`CubismFramework.dispose() is complete.`)}static isStarted(){return Io}static isInitialized(){return Lo}static coreLogFunction(e){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(e)}static getLoggingLevel(){return Ro==null?Vo.LogLevel_Off:Ro.loggingLevel}constructor(){}},Vo=(e=>(e[e.LogLevel_Verbose=0]=`LogLevel_Verbose`,e[e.LogLevel_Debug=1]=`LogLevel_Debug`,e[e.LogLevel_Info=2]=`LogLevel_Info`,e[e.LogLevel_Warning=3]=`LogLevel_Warning`,e[e.LogLevel_Error=4]=`LogLevel_Error`,e[e.LogLevel_Off=5]=`LogLevel_Off`,e))(Vo||{});function Ho(e,...t){Ko.print(Vo.LogLevel_Debug,`[CSM][D]`+e+` +`,t)}function Uo(e,...t){Ko.print(Vo.LogLevel_Info,`[CSM][I]`+e+` +`,t)}function Wo(e,...t){Ko.print(Vo.LogLevel_Warning,`[CSM][W]`+e+` +`,t)}function Go(e,...t){Ko.print(Vo.LogLevel_Error,`[CSM][E]`+e+` +`,t)}var Ko=class{static print(e,t,n){if(en[t]);r(i)}static dumpBytes(e,t,n){for(let r=0;r0?this.print(e,` `):r%8==0&&r>0&&this.print(e,` `),this.print(e,`{0} `,[t[r]&255]);this.print(e,` -`)}constructor(){}},Jo=class{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){let e=this._model.parameters.count,t=this._savedParameters.length;for(let n=0;nt&&(t=this._model.parameters.minimumValues[e]),this._parameterValues[e]=n==1?t:this._parameterValues[e]=this._parameterValues[e]*(1-n)+t*n}setParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.setParameterValueByIndex(r,t,n)}addParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+t*n)}addParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.addParameterValueByIndex(r,t,n)}multiplyParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.multiplyParameterValueByIndex(r,t,n)}multiplyParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(t-1)*n))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(e){let t=this._model.drawables.count;for(let n=0;nt&&(e=t);for(let t=0;t0&&t.getEndTime()(e[e.ExpressionBlendType_Add=0]=`ExpressionBlendType_Add`,e[e.ExpressionBlendType_Multiply=1]=`ExpressionBlendType_Multiply`,e[e.ExpressionBlendType_Overwrite=2]=`ExpressionBlendType_Overwrite`,e))($o||{}),es;(e=>{e.supportMoreMaskDivisions=!0,e.setOpacityFromMotion=!1})(es||={});var ts=(e=>(e[e.CubismMotionCurveTarget_Model=0]=`CubismMotionCurveTarget_Model`,e[e.CubismMotionCurveTarget_Parameter=1]=`CubismMotionCurveTarget_Parameter`,e[e.CubismMotionCurveTarget_PartOpacity=2]=`CubismMotionCurveTarget_PartOpacity`,e))(ts||{}),ns=(e=>(e[e.CubismMotionSegmentType_Linear=0]=`CubismMotionSegmentType_Linear`,e[e.CubismMotionSegmentType_Bezier=1]=`CubismMotionSegmentType_Bezier`,e[e.CubismMotionSegmentType_Stepped=2]=`CubismMotionSegmentType_Stepped`,e[e.CubismMotionSegmentType_InverseStepped=3]=`CubismMotionSegmentType_InverseStepped`,e))(ns||{}),rs=class{constructor(e=0,t=0){this.time=e,this.value=t}},os=class{constructor(){this.basePointIndex=0,this.segmentType=0}},ss=class{constructor(){this.id=``,this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}},cs=class{constructor(){this.fireTime=0,this.value=``}},ls=class{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}},us=class{constructor(e){this._json=e}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(e){return ds.EvaluationOptionFlag_AreBeziersRistricted==e?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(e){return this._json.Curves[e].Target}getMotionCurveId(e){return this._json.Curves[e].Id}getMotionCurveFadeInTime(e){return this._json.Curves[e].FadeInTime}getMotionCurveFadeOutTime(e){return this._json.Curves[e].FadeOutTime}getMotionCurveSegmentCount(e){return this._json.Curves[e].Segments.length}getMotionCurveSegment(e,t){return this._json.Curves[e].Segments[t]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(e){return this._json.UserData[e].Time}getEventValue(e){return this._json.UserData[e].Value}},ds=(e=>(e[e.EvaluationOptionFlag_AreBeziersRistricted=0]=`EvaluationOptionFlag_AreBeziersRistricted`,e))(ds||{});const fs=`EyeBlink`,ps=`LipSync`,ms=`Model`,hs=`Parameter`,gs=`PartOpacity`;function _s(e,t,n){let r=new rs;return r.time=e.time+(t.time-e.time)*n,r.value=e.value+(t.value-e.value)*n,r}function vs(e,t){let n=(t-e[0].time)/(e[1].time-e[0].time);return n<0&&(n=0),e[0].value+(e[1].value-e[0].value)*n}function ys(e,t){let n=(t-e[0].time)/(e[3].time-e[0].time);n<0&&(n=0);let r=_s(e[0],e[1],n),i=_s(e[1],e[2],n),a=_s(e[2],e[3],n),o=_s(r,i,n),s=_s(i,a,n);return _s(o,s,n).value}function bs(e,t){let n=t,r=e[0].time,i=e[3].time,a=e[1].time,o=e[2].time,s=i-3*o+3*a-r,c=3*o-6*a+3*r,l=3*a-3*r,u=r-n,d=Mo.cardanoAlgorithmForBezier(s,c,l,u),f=_s(e[0],e[1],d),p=_s(e[1],e[2],d),m=_s(e[2],e[3],d),h=_s(f,p,d),g=_s(p,m,d);return _s(h,g,d).value}function xs(e,t){return e[0].value}function Ss(e,t){return e[1].value}function Cs(e,t,n){let r=e.curves[t],i=-1,a=r.baseSegmentIndex+r.segmentCount,o=0;for(let t=r.baseSegmentIndex;tn){i=t;break}if(i==-1)return e.points[o].value;let s=e.segments[i];return s.evaluate(e.points.slice(s.basePointIndex),n)}var ws=class e extends Xo{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,n){let r=new e;return r.parse(t),r._sourceFrameRate=r._motionData.fps,r._loopDurationSeconds=r._motionData.duration,r._onFinishedMotion=n,r}doUpdateParameters(e,t,n,r){this._modelCurveIdEyeBlink??=fs,this._modelCurveIdLipSync??=ps;let i=t-r.getStartTime();i<0&&(i=0);let a=Number.MAX_VALUE,o=Number.MAX_VALUE,s=64,c=0,l=0;this._eyeBlinkParameterIds.length>s&&Uo(`too many eye blink targets : {0}`,this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>s&&Uo(`too many lip sync targets : {0}`,this._lipSyncParameterIds.length);let u=this._fadeInSeconds<=0?1:Mo.getEasingSine((t-r.getFadeInStartTime())/this._fadeInSeconds),d=this._fadeOutSeconds<=0||r.getEndTime()<0?1:Mo.getEasingSine((r.getEndTime()-t)/this._fadeOutSeconds),f,p,m,h=i;if(this._isLoop)for(;h>this._motionData.duration;)h-=this._motionData.duration;let g=this._motionData.curves;for(p=0;p>t&1)continue;let i=r+(o-r)*n;e.setParameterValueById(this._eyeBlinkParameterIds[t],i)}if(a!=Number.MAX_VALUE)for(let t=0;t>t&1)continue;let i=r+(a-r)*n;e.setParameterValueById(this._lipSyncParameterIds[t],i)}for(;p=this._motionData.duration&&(this._isLoop?(r.setStartTime(t),this._isLoopFadeIn&&r.setFadeInStartTime(t)):(this._onFinishedMotion&&this._onFinishedMotion(this),r.setIsFinished(!0))),this._lastWeight=n}setIsLoop(e){this._isLoop=e}isLoop(){return this._isLoop}setIsLoopFadeIn(e){this._isLoopFadeIn=e}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,t){let n=this._motionData.curves;for(let r=0;rnew ss),this._motionData.segments=Array.from({length:t.getMotionTotalSegmentCount()}).map(()=>new os),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new cs),this._motionData.points=[];let a=0,o=0;for(let e=0;ee&&this._motionData.events[n].fireTime<=t&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}},Ts=class{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,t){let n=t+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||nt!=null&&t._motionQueueEntryHandle==e)}setEventCallback(e,t=null){this._eventCallBack=e,this._eventCustomData=t}doUpdateMotion(e,t){let n=!1,r=0;for(;r(e[e.CubismPhysicsTargetType_Parameter=0]=`CubismPhysicsTargetType_Parameter`,e))(Os||{}),ks=(e=>(e[e.CubismPhysicsSource_X=0]=`CubismPhysicsSource_X`,e[e.CubismPhysicsSource_Y=1]=`CubismPhysicsSource_Y`,e[e.CubismPhysicsSource_Angle=2]=`CubismPhysicsSource_Angle`,e))(ks||{}),As=class{constructor(){this.initialPosition=new Ao(0,0),this.position=new Ao(0,0),this.lastPosition=new Ao(0,0),this.lastGravity=new Ao(0,0),this.force=new Ao(0,0),this.velocity=new Ao(0,0)}},js=class{constructor(){this.normalizationPosition={},this.normalizationAngle={}}},Ms=class{constructor(){this.source={}}},Ns=class{constructor(){this.destination={},this.translationScale=new Ao(0,0)}},Ps=class{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new Ao(0,0),this.wind=new Ao(0,0)}},Fs=class{constructor(e){this._json=e}release(){this._json=void 0}getGravity(){let e=new Ao(0,0);return e.x=this._json.Meta.EffectiveForces.Gravity.X,e.y=this._json.Meta.EffectiveForces.Gravity.Y,e}getWind(){let e=new Ao(0,0);return e.x=this._json.Meta.EffectiveForces.Wind.X,e.y=this._json.Meta.EffectiveForces.Wind.Y,e}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Default}getNormalizationAngleMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Default}getInputCount(e){return this._json.PhysicsSettings[e].Input.length}getInputWeight(e,t){return this._json.PhysicsSettings[e].Input[t].Weight}getInputReflect(e,t){return this._json.PhysicsSettings[e].Input[t].Reflect}getInputType(e,t){return this._json.PhysicsSettings[e].Input[t].Type}getInputSourceId(e,t){return this._json.PhysicsSettings[e].Input[t].Source.Id}getOutputCount(e){return this._json.PhysicsSettings[e].Output.length}getOutputVertexIndex(e,t){return this._json.PhysicsSettings[e].Output[t].VertexIndex}getOutputAngleScale(e,t){return this._json.PhysicsSettings[e].Output[t].Scale}getOutputWeight(e,t){return this._json.PhysicsSettings[e].Output[t].Weight}getOutputDestinationId(e,t){return this._json.PhysicsSettings[e].Output[t].Destination.Id}getOutputType(e,t){return this._json.PhysicsSettings[e].Output[t].Type}getOutputReflect(e,t){return this._json.PhysicsSettings[e].Output[t].Reflect}getParticleCount(e){return this._json.PhysicsSettings[e].Vertices.length}getParticleMobility(e,t){return this._json.PhysicsSettings[e].Vertices[t].Mobility}getParticleDelay(e,t){return this._json.PhysicsSettings[e].Vertices[t].Delay}getParticleAcceleration(e,t){return this._json.PhysicsSettings[e].Vertices[t].Acceleration}getParticleRadius(e,t){return this._json.PhysicsSettings[e].Vertices[t].Radius}getParticlePosition(e,t){let n=new Ao(0,0);return n.x=this._json.PhysicsSettings[e].Vertices[t].Position.X,n.y=this._json.PhysicsSettings[e].Vertices[t].Position.Y,n}};const Is=`X`,Ls=`Y`,Rs=`Angle`,zs=5,Bs=100,Vs=.001;var Hs=class e{static create(t){let n=new e;return n.parse(t),n._physicsRig.gravity.y=0,n}evaluate(e,t){let n,r,i,a,o=new Ao,s,c,l,u,d,f,p,m;d=e.getModel().parameters.values,f=e.getModel().parameters.maximumValues,p=e.getModel().parameters.minimumValues,m=e.getModel().parameters.defaultValues;for(let h=0;h=s.particleCount)break;l[t].destinationParameterIndex==-1&&(l[t].destinationParameterIndex=e.getParameterIndex(l[t].destination.id));let r=new Ao;r.x=u[n].position.x-u[n-1].position.x,r.y=u[n].position.y-u[n-1].position.y,a=l[t].getValue(r,u,n,l[t].reflect,this._options.gravity);let i=l[t].destinationParameterIndex,o=!Float32Array.prototype.slice&&`subarray`in Float32Array.prototype?JSON.parse(JSON.stringify(d.subarray(i))):d.slice(i);nc(o,p[i],f[i],a,l[t]);for(let e=i,t=0;e=2?t[n-1].position.substract(t[n-2].position):i.multiplyByScaler(-1),a=Mo.directionToRadian(i,e),r&&(a*=-1),a}function Xs(e,t){return Math.abs(Math.max(e,t)-Math.min(e,t))}function Zs(e,t){let n=Math.min(e,t);return n+Xs(e,t)/2}function Qs(e,t){return e.x}function $s(e,t){return e.y}function ec(e,t){return t}function tc(e,t,n,r,i,a,o,s){let c,l,u,d,f=new Ao(0,0),p=new Ao(0,0),m=new Ao(0,0),h=new Ao(0,0);e[0].position=new Ao(n.x,n.y),c=Mo.degreesToRadian(r),d=Mo.radianToDirection(c),d.normalize();for(let n=1;nn&&(o>i.valueExceededMaximum&&(i.valueExceededMaximum=o),o=n),s=i.weight/Bs,s>=1||(o=e[0]*(1-s)+o*s),e[0]=o}function rc(e,t,n,r,i,a,o,s){let c=0,l=Mo.max(n,t);le&&(e=u);let d=Mo.min(i,a),f=Mo.max(i,a),p=o,m=Zs(u,l),h=e-m;switch(Math.sign(h)){case 1:{let e=f-p,t=l-m;t!=0&&(c=h*(e/t),c+=p);break}case-1:{let e=d-p,t=u-m;t!=0&&(c=h*(e/t),c+=p);break}case 0:c=p;break}return s?c:c*-1}var ic=class{constructor(e=0,t=0,n=0,r=0){this.x=e,this.y=t,this.width=n,this.height=r}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,t){this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2}};const ac=4,oc=10;let sc,cc,lc;var uc=class{getChannelFlagAsColor(e){return this._channelColors[e]}getMaskRenderTexture(){let e=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,e=this._maskTexture.texture),e==0){let t=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),e=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,lc),this._maskTexture=new dc(this._currentFrameNo,e)}return e}setGL(e){this.gl=e}calcClippedDrawTotalBounds(e,t){let n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE,o=t._clippedDrawableIndexList.length;for(let s=0;sf&&(f=t),np&&(p=n)}if(u!=Number.MAX_VALUE)if(ui&&(i=f),p>a&&(a=p),n==Number.MAX_VALUE)t._allClippedDrawRect.x=0,t._allClippedDrawRect.y=0,t._allClippedDrawRect.width=0,t._allClippedDrawRect.height=0,t._isUsing=!1;else{t._isUsing=!0;let e=i-n,o=a-r;t._allClippedDrawRect.x=n,t._allClippedDrawRect.y=r,t._allClippedDrawRect.width=e,t._allClippedDrawRect.height=o}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new ic,this._tmpMatrix=new No,this._tmpMatrixForMask=new No,this._tmpMatrixForDraw=new No;let e=new Io;e.R=1,e.G=0,e.B=0,e.A=0,this._channelColors.push(e),e=new Io,e.R=0,e.G=1,e.B=0,e.A=0,this._channelColors.push(e),e=new Io,e.R=0,e.G=0,e.B=1,e.A=0,this._channelColors.push(e),e=new Io,e.R=0,e.G=0,e.B=0,e.A=1,this._channelColors.push(e)}release(){var e,t,n;let r=this;for(let t=0;t0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),t.getMvpMatrix(),t.preDraw(),this.setupLayoutBounds(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let n=0;n(e[e.ShaderNames_SetupMask=0]=`ShaderNames_SetupMask`,e[e.ShaderNames_NormalPremultipliedAlpha=1]=`ShaderNames_NormalPremultipliedAlpha`,e[e.ShaderNames_NormalMaskedPremultipliedAlpha=2]=`ShaderNames_NormalMaskedPremultipliedAlpha`,e[e.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]=`ShaderNames_NomralMaskedInvertedPremultipliedAlpha`,e[e.ShaderNames_AddPremultipliedAlpha=4]=`ShaderNames_AddPremultipliedAlpha`,e[e.ShaderNames_AddMaskedPremultipliedAlpha=5]=`ShaderNames_AddMaskedPremultipliedAlpha`,e[e.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]=`ShaderNames_AddMaskedPremultipliedAlphaInverted`,e[e.ShaderNames_MultPremultipliedAlpha=7]=`ShaderNames_MultPremultipliedAlpha`,e[e.ShaderNames_MultMaskedPremultipliedAlpha=8]=`ShaderNames_MultMaskedPremultipliedAlpha`,e[e.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]=`ShaderNames_MultMaskedPremultipliedAlphaInverted`,e))(mc||{});const hc=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,gc=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}`,_c=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,vc=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,yc=`precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}`,bc=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}`,xc=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}`;var Sc=class extends Po{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new uc,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(e){e.isUsingMasking()&&(this._clippingManager=new uc,this._clippingManager.initialize(e,e.getDrawableCount(),e.getDrawableMasks(),e.getDrawableMaskCounts()));for(let t=e.getDrawableCount()-1;t>=0;t--)this._sortedDrawableIndexList[t]=0;super.initialize(e)}bindTexture(e,t){this._textures[e]=t}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){this._clippingManager.release(),this._clippingManager=new uc,this._clippingManager.setClippingMaskBufferSize(e),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var e,t,n;let r=this;this._clippingManager.release(),r._clippingManager=void 0,(e=this.gl)==null||e.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(t=this.gl)==null||t.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(n=this.gl)==null||n.deleteBuffer(this._bufferData.index),this._bufferData.index=null,r._bufferData=void 0,r._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);let e=this.getModel().getDrawableCount(),t=this.getModel().getDrawableRenderOrders();for(let n=0;n{Sc.doStaticRelease()};var Cc=class{constructor(e){this.groups=e.Groups,this.hitAreas=e.HitAreas,this.layout=e.Layout,this.moc=e.FileReferences.Moc,this.expressions=e.FileReferences.Expressions,this.motions=e.FileReferences.Motions,this.textures=e.FileReferences.Textures,this.physics=e.FileReferences.Physics,this.pose=e.FileReferences.Pose}getEyeBlinkParameters(){var e,t;return(t=(e=this.groups)?.find(e=>e.Name===`EyeBlink`))?.Ids}getLipSyncParameters(){var e,t;return(t=(e=this.groups)?.find(e=>e.Name===`LipSync`))?.Ids}};const wc=`ParamAngleX`,Tc=`ParamAngleY`,Ec=`ParamAngleZ`,Dc=`ParamEyeBallX`,Oc=`ParamEyeBallY`,kc=`ParamBodyAngleX`,Ac=`ParamBreath`,jc=2,Mc=2;var Nc;(e=>{e.LOG_LEVEL_VERBOSE=0,e.LOG_LEVEL_WARNING=1,e.LOG_LEVEL_ERROR=2,e.LOG_LEVEL_NONE=999,e.logLevel=e.LOG_LEVEL_WARNING,e.sound=!0,e.motionSync=!0,e.motionFadingDuration=500,e.idleMotionFadingDuration=2e3,e.expressionFadingDuration=500,e.preserveExpressionOnMotion=!0,e.cubism4=es})(Nc||={});const Pc={log(e,...t){Nc.logLevel<=Nc.LOG_LEVEL_VERBOSE&&console.log(`[${e}]`,...t)},warn(e,...t){Nc.logLevel<=Nc.LOG_LEVEL_WARNING&&console.warn(`[${e}]`,...t)},error(e,...t){Nc.logLevel<=Nc.LOG_LEVEL_ERROR&&console.error(`[${e}]`,...t)}};function Fc(e,t,n){return en?n:e}function Ic(e,t){t.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!==`constructor`&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}function Lc(e){let t=e.lastIndexOf(`/`);return t!=-1&&(e=e.slice(0,t)),t=e.lastIndexOf(`/`),t!==-1&&(e=e.slice(t+1)),e}function Rc(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}var zc=class extends Xt.default{constructor(e,t){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=e,this.tag=`ExpressionManager(${e.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(e){return bo(this,null,function*(){if(!this.definitions[e]){Pc.warn(this.tag,`Undefined expression at [${e}]`);return}if(this.expressions[e]===null){Pc.warn(this.tag,`Cannot set expression at [${e}] because it's already failed in loading.`);return}if(this.expressions[e])return this.expressions[e];let t=yield this._loadExpression(e);return this.expressions[e]=t,t})}_loadExpression(e){throw Error(`Not implemented.`)}setRandomExpression(){return bo(this,null,function*(){if(this.definitions.length){let e=[];for(let t=0;t-1&&ec&&(a*=c/s,o*=c/s),this.vx+=a,this.vy+=o;let l=Math.sqrt(yo(this.vx,2)+yo(this.vy,2)),u=.5*(Math.sqrt(yo(c,2)+8*c*r)-c);l>u&&(this.vx*=u/l,this.vy*=u/l),this.x+=this.vx,this.y+=this.vy}},Wc=class{constructor(e){this.json=e;let t=e.url;if(typeof t!=`string`)throw TypeError("The `url` field in settings JSON must be defined as a string.");this.url=t,this.name=Lc(this.url)}resolveURL(e){return Qt.resolve(this.url,e)}replaceFiles(e){this.moc=e(this.moc,`moc`),this.pose!==void 0&&(this.pose=e(this.pose,`pose`)),this.physics!==void 0&&(this.physics=e(this.physics,`physics`));for(let t=0;t(e.push(t),t)),e}validateFiles(e){let t=(t,n)=>{let r=this.resolveURL(t);if(!e.includes(r)){if(n)throw Error(`File "${t}" is defined in settings, but doesn't exist in given files`);return!1}return!0},n=[this.moc,...this.textures];n.forEach(e=>t(e,!0));let r=this.getDefinedFiles();return r.filter(e=>t(e,!1))}},Gc=(e=>(e[e.NONE=0]=`NONE`,e[e.IDLE=1]=`IDLE`,e[e.NORMAL=2]=`NORMAL`,e[e.FORCE=3]=`FORCE`,e))(Gc||{}),Kc=class{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(e,t,n){if(n<=0)return Pc.log(this.tag,`Cannot start a motion with MotionPriority.NONE.`),!1;if(e===this.currentGroup&&t===this.currentIndex)return Pc.log(this.tag,`Motion is already playing.`,this.dump(e,t)),!1;if(e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex)return Pc.log(this.tag,`Motion is already reserved.`,this.dump(e,t)),!1;if(n===1){if(this.currentPriority!==0)return Pc.log(this.tag,`Cannot start idle motion because another motion is playing.`,this.dump(e,t)),!1;if(this.reservedIdleGroup!==void 0)return Pc.log(this.tag,`Cannot start idle motion because another idle motion has reserved.`,this.dump(e,t)),!1;this.setReservedIdle(e,t)}else{if(n<3){if(n<=this.currentPriority)return Pc.log(this.tag,`Cannot start motion because another motion is playing as an equivalent or higher priority.`,this.dump(e,t)),!1;if(n<=this.reservePriority)return Pc.log(this.tag,`Cannot start motion because another motion has reserved as an equivalent or higher priority.`,this.dump(e,t)),!1}this.setReserved(e,t,n)}return!0}start(e,t,n,r){if(r===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return Pc.log(this.tag,`Cannot start idle motion because another motion is playing.`,this.dump(t,n)),!1}else{if(t!==this.reservedGroup||n!==this.reservedIndex)return Pc.log(this.tag,`Cannot start motion because another motion has taken the place.`,this.dump(t,n)),!1;this.setReserved(void 0,void 0,0)}return e?(this.setCurrent(t,n,r),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(e,t,n){this.currentPriority=n,this.currentGroup=e,this.currentIndex=t}setReserved(e,t,n){this.reservePriority=n,this.reservedGroup=e,this.reservedIndex=t}setReservedIdle(e,t){this.reservedIdleGroup=e,this.reservedIdleIndex=t}isActive(e,t){return e===this.currentGroup&&t===this.currentIndex||e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!Nc.preserveExpressionOnMotion&&this.currentPriority>1}dump(e,t){if(this.debug){let n=[`currentPriority`,`reservePriority`,`currentGroup`,`currentIndex`,`reservedGroup`,`reservedIndex`,`reservedIdleGroup`,`reservedIdleIndex`];return` +`)}constructor(){}},qo=class{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){let e=this._model.parameters.count,t=this._savedParameters.length;for(let n=0;nt&&(t=this._model.parameters.minimumValues[e]),this._parameterValues[e]=n==1?t:this._parameterValues[e]=this._parameterValues[e]*(1-n)+t*n}setParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.setParameterValueByIndex(r,t,n)}addParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)+t*n)}addParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.addParameterValueByIndex(r,t,n)}multiplyParameterValueById(e,t,n=1){let r=this.getParameterIndex(e);this.multiplyParameterValueByIndex(r,t,n)}multiplyParameterValueByIndex(e,t,n=1){this.setParameterValueByIndex(e,this.getParameterValueByIndex(e)*(1+(t-1)*n))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(e){let t=this._model.drawables.count;for(let n=0;nt&&(e=t);for(let t=0;t0&&t.getEndTime()(e[e.ExpressionBlendType_Add=0]=`ExpressionBlendType_Add`,e[e.ExpressionBlendType_Multiply=1]=`ExpressionBlendType_Multiply`,e[e.ExpressionBlendType_Overwrite=2]=`ExpressionBlendType_Overwrite`,e))(Qo||{}),$o;(e=>{e.supportMoreMaskDivisions=!0,e.setOpacityFromMotion=!1})($o||={});var es=(e=>(e[e.CubismMotionCurveTarget_Model=0]=`CubismMotionCurveTarget_Model`,e[e.CubismMotionCurveTarget_Parameter=1]=`CubismMotionCurveTarget_Parameter`,e[e.CubismMotionCurveTarget_PartOpacity=2]=`CubismMotionCurveTarget_PartOpacity`,e))(es||{}),ts=(e=>(e[e.CubismMotionSegmentType_Linear=0]=`CubismMotionSegmentType_Linear`,e[e.CubismMotionSegmentType_Bezier=1]=`CubismMotionSegmentType_Bezier`,e[e.CubismMotionSegmentType_Stepped=2]=`CubismMotionSegmentType_Stepped`,e[e.CubismMotionSegmentType_InverseStepped=3]=`CubismMotionSegmentType_InverseStepped`,e))(ts||{}),ns=class{constructor(e=0,t=0){this.time=e,this.value=t}},rs=class{constructor(){this.basePointIndex=0,this.segmentType=0}},os=class{constructor(){this.id=``,this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}},ss=class{constructor(){this.fireTime=0,this.value=``}},cs=class{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}},ls=class{constructor(e){this._json=e}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(e){return us.EvaluationOptionFlag_AreBeziersRistricted==e?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(e){return this._json.Curves[e].Target}getMotionCurveId(e){return this._json.Curves[e].Id}getMotionCurveFadeInTime(e){return this._json.Curves[e].FadeInTime}getMotionCurveFadeOutTime(e){return this._json.Curves[e].FadeOutTime}getMotionCurveSegmentCount(e){return this._json.Curves[e].Segments.length}getMotionCurveSegment(e,t){return this._json.Curves[e].Segments[t]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(e){return this._json.UserData[e].Time}getEventValue(e){return this._json.UserData[e].Value}},us=(e=>(e[e.EvaluationOptionFlag_AreBeziersRistricted=0]=`EvaluationOptionFlag_AreBeziersRistricted`,e))(us||{});const ds=`EyeBlink`,fs=`LipSync`,ps=`Model`,ms=`Parameter`,hs=`PartOpacity`;function gs(e,t,n){let r=new ns;return r.time=e.time+(t.time-e.time)*n,r.value=e.value+(t.value-e.value)*n,r}function _s(e,t){let n=(t-e[0].time)/(e[1].time-e[0].time);return n<0&&(n=0),e[0].value+(e[1].value-e[0].value)*n}function vs(e,t){let n=(t-e[0].time)/(e[3].time-e[0].time);n<0&&(n=0);let r=gs(e[0],e[1],n),i=gs(e[1],e[2],n),a=gs(e[2],e[3],n),o=gs(r,i,n),s=gs(i,a,n);return gs(o,s,n).value}function ys(e,t){let n=t,r=e[0].time,i=e[3].time,a=e[1].time,o=e[2].time,s=i-3*o+3*a-r,c=3*o-6*a+3*r,l=3*a-3*r,u=r-n,d=jo.cardanoAlgorithmForBezier(s,c,l,u),f=gs(e[0],e[1],d),p=gs(e[1],e[2],d),m=gs(e[2],e[3],d),h=gs(f,p,d),g=gs(p,m,d);return gs(h,g,d).value}function bs(e,t){return e[0].value}function xs(e,t){return e[1].value}function Ss(e,t,n){let r=e.curves[t],i=-1,a=r.baseSegmentIndex+r.segmentCount,o=0;for(let t=r.baseSegmentIndex;tn){i=t;break}if(i==-1)return e.points[o].value;let s=e.segments[i];return s.evaluate(e.points.slice(s.basePointIndex),n)}var Cs=class e extends Yo{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,n){let r=new e;return r.parse(t),r._sourceFrameRate=r._motionData.fps,r._loopDurationSeconds=r._motionData.duration,r._onFinishedMotion=n,r}doUpdateParameters(e,t,n,r){this._modelCurveIdEyeBlink??=ds,this._modelCurveIdLipSync??=fs;let i=t-r.getStartTime();i<0&&(i=0);let a=Number.MAX_VALUE,o=Number.MAX_VALUE,s=64,c=0,l=0;this._eyeBlinkParameterIds.length>s&&Ho(`too many eye blink targets : {0}`,this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>s&&Ho(`too many lip sync targets : {0}`,this._lipSyncParameterIds.length);let u=this._fadeInSeconds<=0?1:jo.getEasingSine((t-r.getFadeInStartTime())/this._fadeInSeconds),d=this._fadeOutSeconds<=0||r.getEndTime()<0?1:jo.getEasingSine((r.getEndTime()-t)/this._fadeOutSeconds),f,p,m,h=i;if(this._isLoop)for(;h>this._motionData.duration;)h-=this._motionData.duration;let g=this._motionData.curves;for(p=0;p>t&1)continue;let i=r+(o-r)*n;e.setParameterValueById(this._eyeBlinkParameterIds[t],i)}if(a!=Number.MAX_VALUE)for(let t=0;t>t&1)continue;let i=r+(a-r)*n;e.setParameterValueById(this._lipSyncParameterIds[t],i)}for(;p=this._motionData.duration&&(this._isLoop?(r.setStartTime(t),this._isLoopFadeIn&&r.setFadeInStartTime(t)):(this._onFinishedMotion&&this._onFinishedMotion(this),r.setIsFinished(!0))),this._lastWeight=n}setIsLoop(e){this._isLoop=e}isLoop(){return this._isLoop}setIsLoopFadeIn(e){this._isLoopFadeIn=e}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(e,t){let n=this._motionData.curves;for(let r=0;rnew os),this._motionData.segments=Array.from({length:t.getMotionTotalSegmentCount()}).map(()=>new rs),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new ss),this._motionData.points=[];let a=0,o=0;for(let e=0;ee&&this._motionData.events[n].fireTime<=t&&this._firedEventValues.push(this._motionData.events[n].value);return this._firedEventValues}},ws=class{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(e){this._fadeOutSeconds=e,this._isTriggeredFadeOut=!0}startFadeOut(e,t){let n=t+e;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||nt!=null&&t._motionQueueEntryHandle==e)}setEventCallback(e,t=null){this._eventCallBack=e,this._eventCustomData=t}doUpdateMotion(e,t){let n=!1,r=0;for(;r(e[e.CubismPhysicsTargetType_Parameter=0]=`CubismPhysicsTargetType_Parameter`,e))(Ds||{}),Os=(e=>(e[e.CubismPhysicsSource_X=0]=`CubismPhysicsSource_X`,e[e.CubismPhysicsSource_Y=1]=`CubismPhysicsSource_Y`,e[e.CubismPhysicsSource_Angle=2]=`CubismPhysicsSource_Angle`,e))(Os||{}),ks=class{constructor(){this.initialPosition=new ko(0,0),this.position=new ko(0,0),this.lastPosition=new ko(0,0),this.lastGravity=new ko(0,0),this.force=new ko(0,0),this.velocity=new ko(0,0)}},As=class{constructor(){this.normalizationPosition={},this.normalizationAngle={}}},js=class{constructor(){this.source={}}},Ms=class{constructor(){this.destination={},this.translationScale=new ko(0,0)}},Ns=class{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new ko(0,0),this.wind=new ko(0,0)}},Ps=class{constructor(e){this._json=e}release(){this._json=void 0}getGravity(){let e=new ko(0,0);return e.x=this._json.Meta.EffectiveForces.Gravity.X,e.y=this._json.Meta.EffectiveForces.Gravity.Y,e}getWind(){let e=new ko(0,0);return e.x=this._json.Meta.EffectiveForces.Wind.X,e.y=this._json.Meta.EffectiveForces.Wind.Y,e}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Position.Default}getNormalizationAngleMinimumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(e){return this._json.PhysicsSettings[e].Normalization.Angle.Default}getInputCount(e){return this._json.PhysicsSettings[e].Input.length}getInputWeight(e,t){return this._json.PhysicsSettings[e].Input[t].Weight}getInputReflect(e,t){return this._json.PhysicsSettings[e].Input[t].Reflect}getInputType(e,t){return this._json.PhysicsSettings[e].Input[t].Type}getInputSourceId(e,t){return this._json.PhysicsSettings[e].Input[t].Source.Id}getOutputCount(e){return this._json.PhysicsSettings[e].Output.length}getOutputVertexIndex(e,t){return this._json.PhysicsSettings[e].Output[t].VertexIndex}getOutputAngleScale(e,t){return this._json.PhysicsSettings[e].Output[t].Scale}getOutputWeight(e,t){return this._json.PhysicsSettings[e].Output[t].Weight}getOutputDestinationId(e,t){return this._json.PhysicsSettings[e].Output[t].Destination.Id}getOutputType(e,t){return this._json.PhysicsSettings[e].Output[t].Type}getOutputReflect(e,t){return this._json.PhysicsSettings[e].Output[t].Reflect}getParticleCount(e){return this._json.PhysicsSettings[e].Vertices.length}getParticleMobility(e,t){return this._json.PhysicsSettings[e].Vertices[t].Mobility}getParticleDelay(e,t){return this._json.PhysicsSettings[e].Vertices[t].Delay}getParticleAcceleration(e,t){return this._json.PhysicsSettings[e].Vertices[t].Acceleration}getParticleRadius(e,t){return this._json.PhysicsSettings[e].Vertices[t].Radius}getParticlePosition(e,t){let n=new ko(0,0);return n.x=this._json.PhysicsSettings[e].Vertices[t].Position.X,n.y=this._json.PhysicsSettings[e].Vertices[t].Position.Y,n}};const Fs=`X`,Is=`Y`,Ls=`Angle`,Rs=5,zs=100,Bs=.001;var Vs=class e{static create(t){let n=new e;return n.parse(t),n._physicsRig.gravity.y=0,n}evaluate(e,t){let n,r,i,a,o=new ko,s,c,l,u,d,f,p,m;d=e.getModel().parameters.values,f=e.getModel().parameters.maximumValues,p=e.getModel().parameters.minimumValues,m=e.getModel().parameters.defaultValues;for(let h=0;h=s.particleCount)break;l[t].destinationParameterIndex==-1&&(l[t].destinationParameterIndex=e.getParameterIndex(l[t].destination.id));let r=new ko;r.x=u[n].position.x-u[n-1].position.x,r.y=u[n].position.y-u[n-1].position.y,a=l[t].getValue(r,u,n,l[t].reflect,this._options.gravity);let i=l[t].destinationParameterIndex,o=!Float32Array.prototype.slice&&`subarray`in Float32Array.prototype?JSON.parse(JSON.stringify(d.subarray(i))):d.slice(i);tc(o,p[i],f[i],a,l[t]);for(let e=i,t=0;e=2?t[n-1].position.substract(t[n-2].position):i.multiplyByScaler(-1),a=jo.directionToRadian(i,e),r&&(a*=-1),a}function Ys(e,t){return Math.abs(Math.max(e,t)-Math.min(e,t))}function Xs(e,t){let n=Math.min(e,t);return n+Ys(e,t)/2}function Zs(e,t){return e.x}function Qs(e,t){return e.y}function $s(e,t){return t}function ec(e,t,n,r,i,a,o,s){let c,l,u,d,f=new ko(0,0),p=new ko(0,0),m=new ko(0,0),h=new ko(0,0);e[0].position=new ko(n.x,n.y),c=jo.degreesToRadian(r),d=jo.radianToDirection(c),d.normalize();for(let n=1;nn&&(o>i.valueExceededMaximum&&(i.valueExceededMaximum=o),o=n),s=i.weight/zs,s>=1||(o=e[0]*(1-s)+o*s),e[0]=o}function nc(e,t,n,r,i,a,o,s){let c=0,l=jo.max(n,t);le&&(e=u);let d=jo.min(i,a),f=jo.max(i,a),p=o,m=Xs(u,l),h=e-m;switch(Math.sign(h)){case 1:{let e=f-p,t=l-m;t!=0&&(c=h*(e/t),c+=p);break}case-1:{let e=d-p,t=u-m;t!=0&&(c=h*(e/t),c+=p);break}case 0:c=p;break}return s?c:c*-1}var rc=class{constructor(e=0,t=0,n=0,r=0){this.x=e,this.y=t,this.width=n,this.height=r}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}expand(e,t){this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2}};const ic=4,ac=10;let oc,sc,cc;var lc=class{getChannelFlagAsColor(e){return this._channelColors[e]}getMaskRenderTexture(){let e=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,e=this._maskTexture.texture),e==0){let t=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,t,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),e=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,cc),this._maskTexture=new uc(this._currentFrameNo,e)}return e}setGL(e){this.gl=e}calcClippedDrawTotalBounds(e,t){let n=Number.MAX_VALUE,r=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MIN_VALUE,o=t._clippedDrawableIndexList.length;for(let s=0;sf&&(f=t),np&&(p=n)}if(u!=Number.MAX_VALUE)if(ui&&(i=f),p>a&&(a=p),n==Number.MAX_VALUE)t._allClippedDrawRect.x=0,t._allClippedDrawRect.y=0,t._allClippedDrawRect.width=0,t._allClippedDrawRect.height=0,t._isUsing=!1;else{t._isUsing=!0;let e=i-n,o=a-r;t._allClippedDrawRect.x=n,t._allClippedDrawRect.y=r,t._allClippedDrawRect.width=e,t._allClippedDrawRect.height=o}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new rc,this._tmpMatrix=new Mo,this._tmpMatrixForMask=new Mo,this._tmpMatrixForDraw=new Mo;let e=new Fo;e.R=1,e.G=0,e.B=0,e.A=0,this._channelColors.push(e),e=new Fo,e.R=0,e.G=1,e.B=0,e.A=0,this._channelColors.push(e),e=new Fo,e.R=0,e.G=0,e.B=1,e.A=0,this._channelColors.push(e),e=new Fo,e.R=0,e.G=0,e.B=0,e.A=1,this._channelColors.push(e)}release(){var e,t,n;let r=this;for(let t=0;t0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),t.getMvpMatrix(),t.preDraw(),this.setupLayoutBounds(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let n=0;n(e[e.ShaderNames_SetupMask=0]=`ShaderNames_SetupMask`,e[e.ShaderNames_NormalPremultipliedAlpha=1]=`ShaderNames_NormalPremultipliedAlpha`,e[e.ShaderNames_NormalMaskedPremultipliedAlpha=2]=`ShaderNames_NormalMaskedPremultipliedAlpha`,e[e.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]=`ShaderNames_NomralMaskedInvertedPremultipliedAlpha`,e[e.ShaderNames_AddPremultipliedAlpha=4]=`ShaderNames_AddPremultipliedAlpha`,e[e.ShaderNames_AddMaskedPremultipliedAlpha=5]=`ShaderNames_AddMaskedPremultipliedAlpha`,e[e.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]=`ShaderNames_AddMaskedPremultipliedAlphaInverted`,e[e.ShaderNames_MultPremultipliedAlpha=7]=`ShaderNames_MultPremultipliedAlpha`,e[e.ShaderNames_MultMaskedPremultipliedAlpha=8]=`ShaderNames_MultMaskedPremultipliedAlpha`,e[e.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]=`ShaderNames_MultMaskedPremultipliedAlphaInverted`,e))(pc||{});const mc=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,hc=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}`,gc=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,_c=`attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}`,vc=`precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}`,yc=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}`,bc=`precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}`;var xc=class extends No{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new lc,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(e){e.isUsingMasking()&&(this._clippingManager=new lc,this._clippingManager.initialize(e,e.getDrawableCount(),e.getDrawableMasks(),e.getDrawableMaskCounts()));for(let t=e.getDrawableCount()-1;t>=0;t--)this._sortedDrawableIndexList[t]=0;super.initialize(e)}bindTexture(e,t){this._textures[e]=t}getBindedTextures(){return this._textures}setClippingMaskBufferSize(e){this._clippingManager.release(),this._clippingManager=new lc,this._clippingManager.setClippingMaskBufferSize(e),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var e,t,n;let r=this;this._clippingManager.release(),r._clippingManager=void 0,(e=this.gl)==null||e.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(t=this.gl)==null||t.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(n=this.gl)==null||n.deleteBuffer(this._bufferData.index),this._bufferData.index=null,r._bufferData=void 0,r._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);let e=this.getModel().getDrawableCount(),t=this.getModel().getDrawableRenderOrders();for(let n=0;n{xc.doStaticRelease()};var Sc=class{constructor(e){this.groups=e.Groups,this.hitAreas=e.HitAreas,this.layout=e.Layout,this.moc=e.FileReferences.Moc,this.expressions=e.FileReferences.Expressions,this.motions=e.FileReferences.Motions,this.textures=e.FileReferences.Textures,this.physics=e.FileReferences.Physics,this.pose=e.FileReferences.Pose}getEyeBlinkParameters(){var e,t;return(t=(e=this.groups)?.find(e=>e.Name===`EyeBlink`))?.Ids}getLipSyncParameters(){var e,t;return(t=(e=this.groups)?.find(e=>e.Name===`LipSync`))?.Ids}};const Cc=`ParamAngleX`,wc=`ParamAngleY`,Tc=`ParamAngleZ`,Ec=`ParamEyeBallX`,Dc=`ParamEyeBallY`,Oc=`ParamBodyAngleX`,kc=`ParamBreath`,Ac=2,jc=2;var Mc;(e=>{e.LOG_LEVEL_VERBOSE=0,e.LOG_LEVEL_WARNING=1,e.LOG_LEVEL_ERROR=2,e.LOG_LEVEL_NONE=999,e.logLevel=e.LOG_LEVEL_WARNING,e.sound=!0,e.motionSync=!0,e.motionFadingDuration=500,e.idleMotionFadingDuration=2e3,e.expressionFadingDuration=500,e.preserveExpressionOnMotion=!0,e.cubism4=$o})(Mc||={});const Nc={log(e,...t){Mc.logLevel<=Mc.LOG_LEVEL_VERBOSE&&console.log(`[${e}]`,...t)},warn(e,...t){Mc.logLevel<=Mc.LOG_LEVEL_WARNING&&console.warn(`[${e}]`,...t)},error(e,...t){Mc.logLevel<=Mc.LOG_LEVEL_ERROR&&console.error(`[${e}]`,...t)}};function Pc(e,t,n){return en?n:e}function Fc(e,t){t.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!==`constructor`&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})}function Ic(e){let t=e.lastIndexOf(`/`);return t!=-1&&(e=e.slice(0,t)),t=e.lastIndexOf(`/`),t!==-1&&(e=e.slice(t+1)),e}function Lc(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}var Rc=class extends Yt.default{constructor(e,t){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=e,this.tag=`ExpressionManager(${e.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(e){return yo(this,null,function*(){if(!this.definitions[e]){Nc.warn(this.tag,`Undefined expression at [${e}]`);return}if(this.expressions[e]===null){Nc.warn(this.tag,`Cannot set expression at [${e}] because it's already failed in loading.`);return}if(this.expressions[e])return this.expressions[e];let t=yield this._loadExpression(e);return this.expressions[e]=t,t})}_loadExpression(e){throw Error(`Not implemented.`)}setRandomExpression(){return yo(this,null,function*(){if(this.definitions.length){let e=[];for(let t=0;t-1&&ec&&(a*=c/s,o*=c/s),this.vx+=a,this.vy+=o;let l=Math.sqrt(vo(this.vx,2)+vo(this.vy,2)),u=.5*(Math.sqrt(vo(c,2)+8*c*r)-c);l>u&&(this.vx*=u/l,this.vy*=u/l),this.x+=this.vx,this.y+=this.vy}},Uc=class{constructor(e){this.json=e;let t=e.url;if(typeof t!=`string`)throw TypeError("The `url` field in settings JSON must be defined as a string.");this.url=t,this.name=Ic(this.url)}resolveURL(e){return Zt.resolve(this.url,e)}replaceFiles(e){this.moc=e(this.moc,`moc`),this.pose!==void 0&&(this.pose=e(this.pose,`pose`)),this.physics!==void 0&&(this.physics=e(this.physics,`physics`));for(let t=0;t(e.push(t),t)),e}validateFiles(e){let t=(t,n)=>{let r=this.resolveURL(t);if(!e.includes(r)){if(n)throw Error(`File "${t}" is defined in settings, but doesn't exist in given files`);return!1}return!0},n=[this.moc,...this.textures];n.forEach(e=>t(e,!0));let r=this.getDefinedFiles();return r.filter(e=>t(e,!1))}},Wc=(e=>(e[e.NONE=0]=`NONE`,e[e.IDLE=1]=`IDLE`,e[e.NORMAL=2]=`NORMAL`,e[e.FORCE=3]=`FORCE`,e))(Wc||{}),Gc=class{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(e,t,n){if(n<=0)return Nc.log(this.tag,`Cannot start a motion with MotionPriority.NONE.`),!1;if(e===this.currentGroup&&t===this.currentIndex)return Nc.log(this.tag,`Motion is already playing.`,this.dump(e,t)),!1;if(e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex)return Nc.log(this.tag,`Motion is already reserved.`,this.dump(e,t)),!1;if(n===1){if(this.currentPriority!==0)return Nc.log(this.tag,`Cannot start idle motion because another motion is playing.`,this.dump(e,t)),!1;if(this.reservedIdleGroup!==void 0)return Nc.log(this.tag,`Cannot start idle motion because another idle motion has reserved.`,this.dump(e,t)),!1;this.setReservedIdle(e,t)}else{if(n<3){if(n<=this.currentPriority)return Nc.log(this.tag,`Cannot start motion because another motion is playing as an equivalent or higher priority.`,this.dump(e,t)),!1;if(n<=this.reservePriority)return Nc.log(this.tag,`Cannot start motion because another motion has reserved as an equivalent or higher priority.`,this.dump(e,t)),!1}this.setReserved(e,t,n)}return!0}start(e,t,n,r){if(r===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return Nc.log(this.tag,`Cannot start idle motion because another motion is playing.`,this.dump(t,n)),!1}else{if(t!==this.reservedGroup||n!==this.reservedIndex)return Nc.log(this.tag,`Cannot start motion because another motion has taken the place.`,this.dump(t,n)),!1;this.setReserved(void 0,void 0,0)}return e?(this.setCurrent(t,n,r),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(e,t,n){this.currentPriority=n,this.currentGroup=e,this.currentIndex=t}setReserved(e,t,n){this.reservePriority=n,this.reservedGroup=e,this.reservedIndex=t}setReservedIdle(e,t){this.reservedIdleGroup=e,this.reservedIdleIndex=t}isActive(e,t){return e===this.currentGroup&&t===this.currentIndex||e===this.reservedGroup&&t===this.reservedIndex||e===this.reservedIdleGroup&&t===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!Mc.preserveExpressionOnMotion&&this.currentPriority>1}dump(e,t){if(this.debug){let n=[`currentPriority`,`reservePriority`,`currentGroup`,`currentIndex`,`reservedGroup`,`reservedIndex`,`reservedIdleGroup`,`reservedIdleIndex`];return` group = "${e}", index = ${t} `+n.map(e=>`[`+e+`] `+this[e]).join(` -`)}return``}};const qc=`SoundManager`,Jc=.5;var Yc=class{static get volume(){return this._volume}static set volume(e){this._volume=(e>1?1:e<0?0:e)||0,this.audios.forEach(e=>e.volume=this._volume)}static add(e,t,n){let r=new Audio(e);return r.volume=this._volume,r.preload=`auto`,r.addEventListener(`ended`,()=>{this.dispose(r),t?.()}),r.addEventListener(`error`,t=>{this.dispose(r),Pc.warn(qc,`Error occurred on "${e}"`,t.error),n?.(t.error)}),this.audios.push(r),r}static play(e){return new Promise((t,n)=>{var r;(r=e.play())==null||r.catch(t=>{e.dispatchEvent(new ErrorEvent(`error`,{error:t})),n(t)}),e.readyState===e.HAVE_ENOUGH_DATA?t():e.addEventListener(`canplaythrough`,t)})}static dispose(e){e.pause(),e.removeAttribute(`src`),Rc(this.audios,e)}static destroy(){for(let e=this.audios.length-1;e>=0;e--)this.dispose(this.audios[e])}};Yc.audios=[],Yc._volume=Jc;var Xc=class extends Xt.default{constructor(e,t){super(),this.motionGroups={},this.state=new Kc,this.playing=!1,this.destroyed=!1,this.settings=e,this.tag=`MotionManager(${e.name})`,this.state.tag=this.tag}init(e){e?.idleMotionGroup&&(this.groups.idle=e.idleMotionGroup),this.setupMotions(e),this.stopAllMotions()}setupMotions(e){for(let e of Object.keys(this.definitions))this.motionGroups[e]=[];let t;switch(e?.motionPreload){case`NONE`:return;case`ALL`:t=Object.keys(this.definitions);break;case`IDLE`:default:t=[this.groups.idle];break}for(let e of t)if(this.definitions[e])for(let t=0;tthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=a}catch(t){Pc.warn(this.tag,`Failed to create audio`,e,t)}}let o=yield this.loadMotion(e,t);if(a){let e=Yc.play(a).catch(e=>Pc.warn(this.tag,`Failed to play audio`,a.src,e));Nc.motionSync&&(yield e)}return this.state.start(o,e,t,n)?(Pc.log(this.tag,`Start motion:`,this.getMotionName(i)),this.emit(`motionStart`,e,t,a),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(o),!0):(a&&(Yc.dispose(a),this.currentAudio=void 0),!1)})}startRandomMotion(e,t){return bo(this,null,function*(){let n=this.definitions[e];if(n?.length){let r=[];for(let t=0;te.index>=0);for(let t of e)this.hitAreas[t.name]=t}hitTest(e,t){return Object.keys(this.hitAreas).filter(n=>this.isHit(n,e,t))}isHit(e,t,n){if(!this.hitAreas[e])return!1;let r=this.hitAreas[e].index,i=this.getDrawableBounds(r,Zc);return i.x<=t&&t<=i.x+i.width&&i.y<=n&&n<=i.y+i.height}getDrawableBounds(e,t){let n=this.getDrawableVertices(e),r=n[0],i=n[0],a=n[1],o=n[1];for(let e=0;e{(a.status===200||a.status===0)&&a.response?r(a.response):a.onerror()},a.onerror=()=>{Pc.warn($c,`Failed to load resource as ${a.responseType} (Status ${a.status}): ${t}`),i(new el(`Network error.`,t,a.status))},a.onabort=()=>i(new el(`Aborted.`,t,a.status,!0)),a.onloadend=()=>{var t;tl.allXhrSet.delete(a),e&&((t=tl.xhrMap.get(e))==null||t.delete(a))},a}static cancelXHRs(){var e;(e=tl.xhrMap.get(this))==null||e.forEach(e=>{e.abort(),tl.allXhrSet.delete(e)}),tl.xhrMap.delete(this)}static release(){tl.allXhrSet.forEach(e=>e.abort()),tl.allXhrSet.clear(),tl.xhrMap=new WeakMap}};let nl=tl;nl.xhrMap=new WeakMap,nl.allXhrSet=new Set,nl.loader=(e,t)=>new Promise((t,n)=>{let r=tl.createXHR(e.target,e.settings?e.settings.resolveURL(e.url):e.url,e.type,n=>{e.result=n,t()},n);r.send()});function rl(e,t){let n=-1;return r(0);function r(i,a){if(a)return Promise.reject(a);if(i<=n)return Promise.reject(Error(`next() called multiple times`));n=i;let o=e[i];if(!o)return Promise.resolve();try{return Promise.resolve(o(t,r.bind(null,i+1)))}catch(e){return Promise.reject(e)}}}var il=class{static load(e){return rl(this.middlewares,e).then(()=>e.result)}};il.middlewares=[nl.loader];function al(e,t={}){var n;let r={resourceOptions:{crossorigin:t.crossOrigin}};if(Er.fromURL)return Er.fromURL(e,r).catch(e=>{if(e instanceof Error)throw e;let t=Error(`Texture loading error`);throw t.event=e,t});r.resourceOptions.autoLoad=!1;let i=Er.from(e,r);if(i.baseTexture.valid)return Promise.resolve(i);let a=i.baseTexture.resource;return(n=a._live2d_load)??(a._live2d_load=new Promise((e,t)=>{let n=e=>{a.source.removeEventListener(`error`,n);let r=Error(`Texture loading error`);r.event=e,t(r)};a.source.addEventListener(`error`,n),a.load().then(()=>e(i)).catch(n)})),a._live2d_load}const ol=`Live2DFactory`,sl=(e,t)=>bo(void 0,null,function*(){if(typeof e.source==`string`){let t=yield il.load({url:e.source,type:`json`,target:e.live2dModel});t.url=e.source,e.source=t,e.live2dModel.emit(`settingsJSONLoaded`,t)}return t()}),cl=(e,t)=>bo(void 0,null,function*(){if(e.source instanceof Wc)return e.settings=e.source,t();if(typeof e.source==`object`){let n=ml.findRuntime(e.source);if(n){let r=n.createModelSettings(e.source);return e.settings=r,e.live2dModel.emit(`settingsLoaded`,r),t()}}throw TypeError(`Unknown settings format.`)}),ll=(e,t)=>{if(e.settings){let n=ml.findRuntime(e.settings);if(n)return n.ready().then(t)}return t()},ul=(e,t)=>bo(void 0,null,function*(){yield t();let n=e.internalModel;if(n){let t=e.settings,r=ml.findRuntime(t);if(r){let i=[];t.pose&&i.push(il.load({settings:t,url:t.pose,type:`json`,target:n}).then(t=>{n.pose=r.createPose(n.coreModel,t),e.live2dModel.emit(`poseLoaded`,n.pose)}).catch(t=>{e.live2dModel.emit(`poseLoadError`,t),Pc.warn(ol,`Failed to load pose.`,t)})),t.physics&&i.push(il.load({settings:t,url:t.physics,type:`json`,target:n}).then(t=>{n.physics=r.createPhysics(n.coreModel,t),e.live2dModel.emit(`physicsLoaded`,n.physics)}).catch(t=>{e.live2dModel.emit(`physicsLoadError`,t),Pc.warn(ol,`Failed to load physics.`,t)})),i.length&&(yield Promise.all(i))}}}),dl=(e,t)=>bo(void 0,null,function*(){if(e.settings){let n=e.live2dModel,r=e.settings.textures.map(t=>{let n=e.settings.resolveURL(t);return al(n,{crossOrigin:e.options.crossOrigin})});if(yield t(),e.internalModel)n.internalModel=e.internalModel,n.emit(`modelLoaded`,e.internalModel);else throw TypeError(`Missing internal model.`);n.textures=yield Promise.all(r),n.emit(`textureLoaded`,n.textures)}else throw TypeError(`Missing settings.`)}),fl=(e,t)=>bo(void 0,null,function*(){let n=e.settings;if(n instanceof Wc){let r=ml.findRuntime(n);if(!r)throw TypeError(`Unknown model settings.`);let i=yield il.load({settings:n,url:n.moc,type:`arraybuffer`,target:e.live2dModel});if(!r.isValidMoc(i))throw Error(`Invalid moc data`);let a=r.createCoreModel(i);return e.internalModel=r.createInternalModel(a,n,e.options),t()}throw TypeError(`Missing settings.`)}),pl=class{static registerRuntime(e){pl.runtimes.push(e),pl.runtimes.sort((e,t)=>t.version-e.version)}static findRuntime(e){for(let t of pl.runtimes)if(t.test(e))return t}static setupLive2DModel(e,t,n){return bo(this,null,function*(){let r=new Promise(t=>e.once(`textureLoaded`,t)),i=new Promise(t=>e.once(`modelLoaded`,t)),a=Promise.all([r,i]).then(()=>e.emit(`ready`));yield rl(pl.live2DModelMiddlewares,{live2dModel:e,source:t,options:n||{}}),yield a,e.emit(`load`)})}static loadMotion(e,t,n){var r,i;let a=r=>e.emit(`motionLoadError`,t,n,r);try{let o=(r=e.definitions[t])?.[n];if(!o)return Promise.resolve(void 0);e.listeners(`destroy`).includes(pl.releaseTasks)||e.once(`destroy`,pl.releaseTasks);let s=pl.motionTasksMap.get(e);s||(s={},pl.motionTasksMap.set(e,s));let c=s[t];c||(c=[],s[t]=c);let l=e.getMotionFile(o);return(i=c[n])??(c[n]=il.load({url:l,settings:e.settings,type:e.motionDataType,target:e}).then(r=>{var i;let a=(i=pl.motionTasksMap.get(e))?.[t];a&&delete a[n];let s=e.createMotion(r,t,o);return e.emit(`motionLoaded`,t,n,s),s}).catch(t=>{Pc.warn(e.tag,`Failed to load motion: ${l} -`,t),a(t)})),c[n]}catch(r){Pc.warn(e.tag,`Failed to load motion at "${t}"[${n}] -`,r),a(r)}return Promise.resolve(void 0)}static loadExpression(e,t){var n;let r=n=>e.emit(`expressionLoadError`,t,n);try{let i=e.definitions[t];if(!i)return Promise.resolve(void 0);e.listeners(`destroy`).includes(pl.releaseTasks)||e.once(`destroy`,pl.releaseTasks);let a=pl.expressionTasksMap.get(e);a||(a=[],pl.expressionTasksMap.set(e,a));let o=e.getExpressionFile(i);return(n=a[t])??(a[t]=il.load({url:o,settings:e.settings,type:`json`,target:e}).then(n=>{let r=pl.expressionTasksMap.get(e);r&&delete r[t];let a=e.createExpression(n,i);return e.emit(`expressionLoaded`,t,a),a}).catch(t=>{Pc.warn(e.tag,`Failed to load expression: ${o} -`,t),r(t)})),a[t]}catch(n){Pc.warn(e.tag,`Failed to load expression at [${t}] -`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Xc?pl.motionTasksMap.delete(this):pl.expressionTasksMap.delete(this)}};let ml=pl;ml.runtimes=[],ml.urlToJSON=sl,ml.jsonToSettings=cl,ml.waitUntilReady=ll,ml.setupOptionals=ul,ml.setupEssentials=dl,ml.createInternalModel=fl,ml.live2DModelMiddlewares=[sl,cl,ll,ul,dl,fl],ml.motionTasksMap=new WeakMap,ml.expressionTasksMap=new WeakMap,Xc.prototype._loadMotion=function(e,t){return ml.loadMotion(this,e,t)},zc.prototype._loadExpression=function(e){return ml.loadExpression(this,e)};var hl=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,gl,this):this.off(`pointertap`,gl,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,_l,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,_l,this),this.interactionManager=void 0)}};function gl(e){this.tap(e.data.global.x,e.data.global.y)}function _l(e){this.focus(e.data.global.x,e.data.global.y)}var vl=class extends $n{};const yl=new zn,bl=new Un;let xl;var Sl=class extends ao{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new vl,this.anchor=new Hn(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once(`modelLoaded`,()=>this.init(e))}static from(e,t){let n=new this(t);return ml.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return ml.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){xl=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;xl||=(t=window.PIXI)?.Ticker,e?this._destroyed||(xl?(xl.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):Pc.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(xl?.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;let t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){yl.x=e,yl.y=t,this.toModelPosition(yl,yl,!0);let r=yl.x/this.internalModel.originalWidth*2-1,i=yl.y/this.internalModel.originalHeight*2-1,a=Math.atan2(i,r);this.internalModel.focusController.focus(Math.cos(a),-Math.sin(a),n)}tap(e,t){let n=this.hitTest(e,t);n.length&&(Pc.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return yl.x=e,yl.y=t,this.toModelPosition(yl,yl),this.internalModel.hitTest(yl.x,yl.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(xl.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let n=0;nt.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}};Ic(Sl,[hl]);const Cl=class{static resolveURL(e,t){var n;let r=(n=Cl.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return bo(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(Qt.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}Cl.filesMap[t._objectURL]=n})}static createSettings(e){return bo(this,null,function*(){let t=e.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`));if(!t)throw TypeError(`Settings file not found`);let n=yield Cl.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=ml.findRuntime(r);if(!i)throw Error(`Unknown settings JSON`);let a=i.createModelSettings(r);return a._objectURL=URL.createObjectURL(t),a})}static readText(e){return bo(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsText(e,`utf8`)})})}};let wl=Cl;wl.filesMap={},wl.factory=(e,t)=>bo(void 0,null,function*(){if(Array.isArray(e.source)&&e.source[0]instanceof File){let t=e.source,n=t.settings;if(!n)n=yield Cl.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield Cl.upload(t,n),n.resolveURL=function(e){return Cl.resolveURL(this._objectURL,e)},e.source=n,e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){let e=this.settings._objectURL;if(URL.revokeObjectURL(e),Cl.filesMap[e])for(let t of Object.values(Cl.filesMap[e]))URL.revokeObjectURL(t);delete Cl.filesMap[e]})})}return t()}),ml.live2DModelMiddlewares.unshift(wl.factory);const Tl=class{static unzip(e,t){return bo(this,null,function*(){let n=yield Tl.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(Qt.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield Tl.getFiles(e,r);for(let e=0;ee.endsWith(`model.json`)||e.endsWith(`model3.json`));if(!n)throw Error(`Settings file not found`);let r=yield Tl.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=ml.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return bo(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return bo(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return bo(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return bo(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let El=Tl;if(El.ZIP_PROTOCOL=`zip://`,El.uid=0,El.factory=(e,t)=>bo(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(Tl.ZIP_PROTOCOL))?(r=n.startsWith(Tl.ZIP_PROTOCOL)?n.slice(Tl.ZIP_PROTOCOL.length):n,i=yield il.load({url:r,type:`blob`,target:e.live2dModel})):Array.isArray(n)&&n.length===1&&n[0]instanceof File&&n[0].name.endsWith(`.zip`)&&(i=n[0],r=URL.createObjectURL(i),a=n.settings),i){if(!i.size)throw Error(`Empty zip file`);let t=yield Tl.zipReader(i,r);a||=yield Tl.createSettings(t),a._objectURL=Tl.ZIP_PROTOCOL+Tl.uid+`/`+a.url;let n=yield Tl.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),Tl.releaseReader(t)}return t()}),ml.live2DModelMiddlewares.unshift(El.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var Dl=class extends zc{constructor(e,t){var n;super(e,t),this.queueManager=new Es,this.definitions=(n=e.expressions)??[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return Qo.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}},Ol=class e extends Wc{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new Cc(t))}static isValidJSON(e){var t;return!!e?.FileReferences&&typeof e.FileReferences.Moc==`string`&&(t=e.FileReferences.Textures)?.length>0&&e.FileReferences.Textures.every(e=>typeof e==`string`)}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(let[t,n]of Object.entries(this.motions))for(let r=0;r{this.emit(`motion:`+t)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){let r=ws.create(e),i=new us(e),a=(t===this.groups.idle?Nc.idleMotionFadingDuration:Nc.motionFadingDuration)/1e3;return i.getMotionFadeInTime()===void 0&&r.setFadeInTime(n.FadeInTime>0?n.FadeInTime:a),i.getMotionFadeOutTime()===void 0&&r.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:a),r.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),r}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}};const Al=new No;var jl=class extends Qc{constructor(e,t,n){super(),this.lipSync=!0,this.breath=xo.create(),this.renderer=new Sc,this.idParamAngleX=wc,this.idParamAngleY=Tc,this.idParamAngleZ=Ec,this.idParamEyeBallX=Dc,this.idParamEyeBallY=Oc,this.idParamBodyAngleX=kc,this.idParamBreath=Ac,this.pixelsPerUnit=1,this.centeringTransform=new Un,this.coreModel=e,this.settings=t,this.motionManager=new kl(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=wo.create(this.settings)),this.breath.setParameters([new So(this.idParamAngleX,0,15,6.5345,.5),new So(this.idParamAngleY,0,8,3.5345,.5),new So(this.idParamAngleZ,0,10,5.5345,.5),new So(this.idParamBodyAngleX,0,4,15.5345,.5),new So(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){let e={};if(this.settings.layout)for(let t of Object.keys(this.settings.layout)){let n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,pc.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)?.map(e=>({id:e.Id,name:e.Name,index:this.coreModel.getDrawableIndex(e.Id)})))??[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e==`string`&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw TypeError(`Unable to find drawable ID: `+e);let t=this.coreModel.getDrawableVertices(e).slice();for(let e=0;e{function n(){try{Fl(),e()}catch(e){if(Nl--,Nl<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}Pc.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),Ml)}function Fl(e){e=Object.assign({logFunction:console.log,loggingLevel:Ho.LogLevel_Verbose},e),Vo.startUp(e),Vo.initialize()}ml.registerRuntime({version:4,ready:Pl,test(e){return e instanceof Ol||Ol.isValidJSON(e)},isValidMoc(e){if(e.byteLength<4)return!1;let t=new Int8Array(e,0,4);return String.fromCharCode(...t)===`MOC3`},createModelSettings(e){return new Ol(e)},createCoreModel(e){let t=Yo.create(e);try{let e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(e,t,n){let r=new jl(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,Il)),r},createPhysics(e,t){return Hs.create(t)},createPose(e,t){return Oo.create(t)}});function Il(){var e;(e=this.__moc)==null||e.release()}var Ll=de({__name:`Canvas`,props:{width:{},height:{},resolution:{default:2}},setup(e,{expose:t}){let n=e,r=Fe(),i=Fe(!1),a=Fe(),o=Fe();async function s(e){i.value=!0,Sl.registerTicker(Nn),kn.add(Pn),kn.add(vo),a.value=new so({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),o.value=a.value.view,o.value.style.width=`100%`,o.value.style.height=`100%`,o.value.style.objectFit=`cover`,o.value.style.display=`block`,e.appendChild(a.value.view),i.value=!0}function c(){a.value&&a.value.renderer.resize(n.width,n.height)}Me([()=>n.width,()=>n.height],()=>c()),Me(()=>n.resolution,e=>{a.value&&e&&(a.value.renderer.resolution=e,c())}),Oe(async()=>r.value&&await s(r.value)),ke(()=>a.value?.destroy());async function l(){let e=new Promise(e=>{if(!o.value||!a.value)return e(null);a.value.render(),o.value.toBlob(e)});return e}function u(){return o.value}return t({captureFrame:l,canvasElement:u}),(e,t)=>(Ae(),le(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[i.value?je(e.$slots,`default`,{key:0,app:a.value}):ce(``,!0)],512))}}),Rl=Ll,zl=function(e,t){return zl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},zl(e,t)};function Bl(e,t){zl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Vl=`attribute vec2 aVertexPosition; +`)}return``}};const Kc=`SoundManager`,qc=.5;var Jc=class{static get volume(){return this._volume}static set volume(e){this._volume=(e>1?1:e<0?0:e)||0,this.audios.forEach(e=>e.volume=this._volume)}static add(e,t,n){let r=new Audio(e);return r.volume=this._volume,r.preload=`auto`,r.addEventListener(`ended`,()=>{this.dispose(r),t?.()}),r.addEventListener(`error`,t=>{this.dispose(r),Nc.warn(Kc,`Error occurred on "${e}"`,t.error),n?.(t.error)}),this.audios.push(r),r}static play(e){return new Promise((t,n)=>{var r;(r=e.play())==null||r.catch(t=>{e.dispatchEvent(new ErrorEvent(`error`,{error:t})),n(t)}),e.readyState===e.HAVE_ENOUGH_DATA?t():e.addEventListener(`canplaythrough`,t)})}static dispose(e){e.pause(),e.removeAttribute(`src`),Lc(this.audios,e)}static destroy(){for(let e=this.audios.length-1;e>=0;e--)this.dispose(this.audios[e])}};Jc.audios=[],Jc._volume=qc;var Yc=class extends Yt.default{constructor(e,t){super(),this.motionGroups={},this.state=new Gc,this.playing=!1,this.destroyed=!1,this.settings=e,this.tag=`MotionManager(${e.name})`,this.state.tag=this.tag}init(e){e?.idleMotionGroup&&(this.groups.idle=e.idleMotionGroup),this.setupMotions(e),this.stopAllMotions()}setupMotions(e){for(let e of Object.keys(this.definitions))this.motionGroups[e]=[];let t;switch(e?.motionPreload){case`NONE`:return;case`ALL`:t=Object.keys(this.definitions);break;case`IDLE`:default:t=[this.groups.idle];break}for(let e of t)if(this.definitions[e])for(let t=0;tthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=a}catch(t){Nc.warn(this.tag,`Failed to create audio`,e,t)}}let o=yield this.loadMotion(e,t);if(a){let e=Jc.play(a).catch(e=>Nc.warn(this.tag,`Failed to play audio`,a.src,e));Mc.motionSync&&(yield e)}return this.state.start(o,e,t,n)?(Nc.log(this.tag,`Start motion:`,this.getMotionName(i)),this.emit(`motionStart`,e,t,a),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(o),!0):(a&&(Jc.dispose(a),this.currentAudio=void 0),!1)})}startRandomMotion(e,t){return yo(this,null,function*(){let n=this.definitions[e];if(n?.length){let r=[];for(let t=0;te.index>=0);for(let t of e)this.hitAreas[t.name]=t}hitTest(e,t){return Object.keys(this.hitAreas).filter(n=>this.isHit(n,e,t))}isHit(e,t,n){if(!this.hitAreas[e])return!1;let r=this.hitAreas[e].index,i=this.getDrawableBounds(r,Xc);return i.x<=t&&t<=i.x+i.width&&i.y<=n&&n<=i.y+i.height}getDrawableBounds(e,t){let n=this.getDrawableVertices(e),r=n[0],i=n[0],a=n[1],o=n[1];for(let e=0;e{(a.status===200||a.status===0)&&a.response?r(a.response):a.onerror()},a.onerror=()=>{Nc.warn(Qc,`Failed to load resource as ${a.responseType} (Status ${a.status}): ${t}`),i(new $c(`Network error.`,t,a.status))},a.onabort=()=>i(new $c(`Aborted.`,t,a.status,!0)),a.onloadend=()=>{var t;el.allXhrSet.delete(a),e&&((t=el.xhrMap.get(e))==null||t.delete(a))},a}static cancelXHRs(){var e;(e=el.xhrMap.get(this))==null||e.forEach(e=>{e.abort(),el.allXhrSet.delete(e)}),el.xhrMap.delete(this)}static release(){el.allXhrSet.forEach(e=>e.abort()),el.allXhrSet.clear(),el.xhrMap=new WeakMap}};let tl=el;tl.xhrMap=new WeakMap,tl.allXhrSet=new Set,tl.loader=(e,t)=>new Promise((t,n)=>{let r=el.createXHR(e.target,e.settings?e.settings.resolveURL(e.url):e.url,e.type,n=>{e.result=n,t()},n);r.send()});function nl(e,t){let n=-1;return r(0);function r(i,a){if(a)return Promise.reject(a);if(i<=n)return Promise.reject(Error(`next() called multiple times`));n=i;let o=e[i];if(!o)return Promise.resolve();try{return Promise.resolve(o(t,r.bind(null,i+1)))}catch(e){return Promise.reject(e)}}}var rl=class{static load(e){return nl(this.middlewares,e).then(()=>e.result)}};rl.middlewares=[tl.loader];function il(e,t={}){var n;let r={resourceOptions:{crossorigin:t.crossOrigin}};if(Tr.fromURL)return Tr.fromURL(e,r).catch(e=>{if(e instanceof Error)throw e;let t=Error(`Texture loading error`);throw t.event=e,t});r.resourceOptions.autoLoad=!1;let i=Tr.from(e,r);if(i.baseTexture.valid)return Promise.resolve(i);let a=i.baseTexture.resource;return(n=a._live2d_load)??(a._live2d_load=new Promise((e,t)=>{let n=e=>{a.source.removeEventListener(`error`,n);let r=Error(`Texture loading error`);r.event=e,t(r)};a.source.addEventListener(`error`,n),a.load().then(()=>e(i)).catch(n)})),a._live2d_load}const al=`Live2DFactory`,ol=(e,t)=>yo(void 0,null,function*(){if(typeof e.source==`string`){let t=yield rl.load({url:e.source,type:`json`,target:e.live2dModel});t.url=e.source,e.source=t,e.live2dModel.emit(`settingsJSONLoaded`,t)}return t()}),sl=(e,t)=>yo(void 0,null,function*(){if(e.source instanceof Uc)return e.settings=e.source,t();if(typeof e.source==`object`){let n=pl.findRuntime(e.source);if(n){let r=n.createModelSettings(e.source);return e.settings=r,e.live2dModel.emit(`settingsLoaded`,r),t()}}throw TypeError(`Unknown settings format.`)}),cl=(e,t)=>{if(e.settings){let n=pl.findRuntime(e.settings);if(n)return n.ready().then(t)}return t()},ll=(e,t)=>yo(void 0,null,function*(){yield t();let n=e.internalModel;if(n){let t=e.settings,r=pl.findRuntime(t);if(r){let i=[];t.pose&&i.push(rl.load({settings:t,url:t.pose,type:`json`,target:n}).then(t=>{n.pose=r.createPose(n.coreModel,t),e.live2dModel.emit(`poseLoaded`,n.pose)}).catch(t=>{e.live2dModel.emit(`poseLoadError`,t),Nc.warn(al,`Failed to load pose.`,t)})),t.physics&&i.push(rl.load({settings:t,url:t.physics,type:`json`,target:n}).then(t=>{n.physics=r.createPhysics(n.coreModel,t),e.live2dModel.emit(`physicsLoaded`,n.physics)}).catch(t=>{e.live2dModel.emit(`physicsLoadError`,t),Nc.warn(al,`Failed to load physics.`,t)})),i.length&&(yield Promise.all(i))}}}),ul=(e,t)=>yo(void 0,null,function*(){if(e.settings){let n=e.live2dModel,r=e.settings.textures.map(t=>{let n=e.settings.resolveURL(t);return il(n,{crossOrigin:e.options.crossOrigin})});if(yield t(),e.internalModel)n.internalModel=e.internalModel,n.emit(`modelLoaded`,e.internalModel);else throw TypeError(`Missing internal model.`);n.textures=yield Promise.all(r),n.emit(`textureLoaded`,n.textures)}else throw TypeError(`Missing settings.`)}),dl=(e,t)=>yo(void 0,null,function*(){let n=e.settings;if(n instanceof Uc){let r=pl.findRuntime(n);if(!r)throw TypeError(`Unknown model settings.`);let i=yield rl.load({settings:n,url:n.moc,type:`arraybuffer`,target:e.live2dModel});if(!r.isValidMoc(i))throw Error(`Invalid moc data`);let a=r.createCoreModel(i);return e.internalModel=r.createInternalModel(a,n,e.options),t()}throw TypeError(`Missing settings.`)}),fl=class{static registerRuntime(e){fl.runtimes.push(e),fl.runtimes.sort((e,t)=>t.version-e.version)}static findRuntime(e){for(let t of fl.runtimes)if(t.test(e))return t}static setupLive2DModel(e,t,n){return yo(this,null,function*(){let r=new Promise(t=>e.once(`textureLoaded`,t)),i=new Promise(t=>e.once(`modelLoaded`,t)),a=Promise.all([r,i]).then(()=>e.emit(`ready`));yield nl(fl.live2DModelMiddlewares,{live2dModel:e,source:t,options:n||{}}),yield a,e.emit(`load`)})}static loadMotion(e,t,n){var r,i;let a=r=>e.emit(`motionLoadError`,t,n,r);try{let o=(r=e.definitions[t])?.[n];if(!o)return Promise.resolve(void 0);e.listeners(`destroy`).includes(fl.releaseTasks)||e.once(`destroy`,fl.releaseTasks);let s=fl.motionTasksMap.get(e);s||(s={},fl.motionTasksMap.set(e,s));let c=s[t];c||(c=[],s[t]=c);let l=e.getMotionFile(o);return(i=c[n])??(c[n]=rl.load({url:l,settings:e.settings,type:e.motionDataType,target:e}).then(r=>{var i;let a=(i=fl.motionTasksMap.get(e))?.[t];a&&delete a[n];let s=e.createMotion(r,t,o);return e.emit(`motionLoaded`,t,n,s),s}).catch(t=>{Nc.warn(e.tag,`Failed to load motion: ${l} +`,t),a(t)})),c[n]}catch(r){Nc.warn(e.tag,`Failed to load motion at "${t}"[${n}] +`,r),a(r)}return Promise.resolve(void 0)}static loadExpression(e,t){var n;let r=n=>e.emit(`expressionLoadError`,t,n);try{let i=e.definitions[t];if(!i)return Promise.resolve(void 0);e.listeners(`destroy`).includes(fl.releaseTasks)||e.once(`destroy`,fl.releaseTasks);let a=fl.expressionTasksMap.get(e);a||(a=[],fl.expressionTasksMap.set(e,a));let o=e.getExpressionFile(i);return(n=a[t])??(a[t]=rl.load({url:o,settings:e.settings,type:`json`,target:e}).then(n=>{let r=fl.expressionTasksMap.get(e);r&&delete r[t];let a=e.createExpression(n,i);return e.emit(`expressionLoaded`,t,a),a}).catch(t=>{Nc.warn(e.tag,`Failed to load expression: ${o} +`,t),r(t)})),a[t]}catch(n){Nc.warn(e.tag,`Failed to load expression at [${t}] +`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Yc?fl.motionTasksMap.delete(this):fl.expressionTasksMap.delete(this)}};let pl=fl;pl.runtimes=[],pl.urlToJSON=ol,pl.jsonToSettings=sl,pl.waitUntilReady=cl,pl.setupOptionals=ll,pl.setupEssentials=ul,pl.createInternalModel=dl,pl.live2DModelMiddlewares=[ol,sl,cl,ll,ul,dl],pl.motionTasksMap=new WeakMap,pl.expressionTasksMap=new WeakMap,Yc.prototype._loadMotion=function(e,t){return pl.loadMotion(this,e,t)},Rc.prototype._loadExpression=function(e){return pl.loadExpression(this,e)};var ml=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,hl,this):this.off(`pointertap`,hl,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,gl,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,gl,this),this.interactionManager=void 0)}};function hl(e){this.tap(e.data.global.x,e.data.global.y)}function gl(e){this.focus(e.data.global.x,e.data.global.y)}var _l=class extends Qn{};const vl=new Rn,yl=new Hn;let bl;var xl=class extends io{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new _l,this.anchor=new Vn(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once(`modelLoaded`,()=>this.init(e))}static from(e,t){let n=new this(t);return pl.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return pl.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){bl=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;bl||=(t=window.PIXI)?.Ticker,e?this._destroyed||(bl?(bl.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):Nc.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(bl?.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;let t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){vl.x=e,vl.y=t,this.toModelPosition(vl,vl,!0);let r=vl.x/this.internalModel.originalWidth*2-1,i=vl.y/this.internalModel.originalHeight*2-1,a=Math.atan2(i,r);this.internalModel.focusController.focus(Math.cos(a),-Math.sin(a),n)}tap(e,t){let n=this.hitTest(e,t);n.length&&(Nc.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return vl.x=e,vl.y=t,this.toModelPosition(vl,vl),this.internalModel.hitTest(vl.x,vl.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(bl.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let n=0;nt.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}};Fc(xl,[ml]);const Sl=class{static resolveURL(e,t){var n;let r=(n=Sl.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return yo(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(Zt.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}Sl.filesMap[t._objectURL]=n})}static createSettings(e){return yo(this,null,function*(){let t=e.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`));if(!t)throw TypeError(`Settings file not found`);let n=yield Sl.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=pl.findRuntime(r);if(!i)throw Error(`Unknown settings JSON`);let a=i.createModelSettings(r);return a._objectURL=URL.createObjectURL(t),a})}static readText(e){return yo(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsText(e,`utf8`)})})}};let Cl=Sl;Cl.filesMap={},Cl.factory=(e,t)=>yo(void 0,null,function*(){if(Array.isArray(e.source)&&e.source[0]instanceof File){let t=e.source,n=t.settings;if(!n)n=yield Sl.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield Sl.upload(t,n),n.resolveURL=function(e){return Sl.resolveURL(this._objectURL,e)},e.source=n,e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){let e=this.settings._objectURL;if(URL.revokeObjectURL(e),Sl.filesMap[e])for(let t of Object.values(Sl.filesMap[e]))URL.revokeObjectURL(t);delete Sl.filesMap[e]})})}return t()}),pl.live2DModelMiddlewares.unshift(Cl.factory);const wl=class{static unzip(e,t){return yo(this,null,function*(){let n=yield wl.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(Zt.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield wl.getFiles(e,r);for(let e=0;ee.endsWith(`model.json`)||e.endsWith(`model3.json`));if(!n)throw Error(`Settings file not found`);let r=yield wl.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=pl.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return yo(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return yo(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return yo(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return yo(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let Tl=wl;if(Tl.ZIP_PROTOCOL=`zip://`,Tl.uid=0,Tl.factory=(e,t)=>yo(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(wl.ZIP_PROTOCOL))?(r=n.startsWith(wl.ZIP_PROTOCOL)?n.slice(wl.ZIP_PROTOCOL.length):n,i=yield rl.load({url:r,type:`blob`,target:e.live2dModel})):Array.isArray(n)&&n.length===1&&n[0]instanceof File&&n[0].name.endsWith(`.zip`)&&(i=n[0],r=URL.createObjectURL(i),a=n.settings),i){if(!i.size)throw Error(`Empty zip file`);let t=yield wl.zipReader(i,r);a||=yield wl.createSettings(t),a._objectURL=wl.ZIP_PROTOCOL+wl.uid+`/`+a.url;let n=yield wl.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),wl.releaseReader(t)}return t()}),pl.live2DModelMiddlewares.unshift(Tl.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var El=class extends Rc{constructor(e,t){var n;super(e,t),this.queueManager=new Ts,this.definitions=(n=e.expressions)??[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return Zo.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}},Dl=class e extends Uc{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new Sc(t))}static isValidJSON(e){var t;return!!e?.FileReferences&&typeof e.FileReferences.Moc==`string`&&(t=e.FileReferences.Textures)?.length>0&&e.FileReferences.Textures.every(e=>typeof e==`string`)}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(let[t,n]of Object.entries(this.motions))for(let r=0;r{this.emit(`motion:`+t)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){let r=Cs.create(e),i=new ls(e),a=(t===this.groups.idle?Mc.idleMotionFadingDuration:Mc.motionFadingDuration)/1e3;return i.getMotionFadeInTime()===void 0&&r.setFadeInTime(n.FadeInTime>0?n.FadeInTime:a),i.getMotionFadeOutTime()===void 0&&r.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:a),r.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),r}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}};const kl=new Mo;var Al=class extends Zc{constructor(e,t,n){super(),this.lipSync=!0,this.breath=bo.create(),this.renderer=new xc,this.idParamAngleX=Cc,this.idParamAngleY=wc,this.idParamAngleZ=Tc,this.idParamEyeBallX=Ec,this.idParamEyeBallY=Dc,this.idParamBodyAngleX=Oc,this.idParamBreath=kc,this.pixelsPerUnit=1,this.centeringTransform=new Hn,this.coreModel=e,this.settings=t,this.motionManager=new Ol(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=Co.create(this.settings)),this.breath.setParameters([new xo(this.idParamAngleX,0,15,6.5345,.5),new xo(this.idParamAngleY,0,8,3.5345,.5),new xo(this.idParamAngleZ,0,10,5.5345,.5),new xo(this.idParamBodyAngleX,0,4,15.5345,.5),new xo(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){let e={};if(this.settings.layout)for(let t of Object.keys(this.settings.layout)){let n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,fc.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)?.map(e=>({id:e.Id,name:e.Name,index:this.coreModel.getDrawableIndex(e.Id)})))??[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e==`string`&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw TypeError(`Unable to find drawable ID: `+e);let t=this.coreModel.getDrawableVertices(e).slice();for(let e=0;e{function n(){try{Pl(),e()}catch(e){if(Ml--,Ml<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}Nc.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),jl)}function Pl(e){e=Object.assign({logFunction:console.log,loggingLevel:Vo.LogLevel_Verbose},e),Bo.startUp(e),Bo.initialize()}pl.registerRuntime({version:4,ready:Nl,test(e){return e instanceof Dl||Dl.isValidJSON(e)},isValidMoc(e){if(e.byteLength<4)return!1;let t=new Int8Array(e,0,4);return String.fromCharCode(...t)===`MOC3`},createModelSettings(e){return new Dl(e)},createCoreModel(e){let t=Jo.create(e);try{let e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(e,t,n){let r=new Al(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,Fl)),r},createPhysics(e,t){return Vs.create(t)},createPose(e,t){return Do.create(t)}});function Fl(){var e;(e=this.__moc)==null||e.release()}var Il=S({__name:`Canvas`,props:{width:{},height:{},resolution:{default:2}},setup(e,{expose:t}){let n=e,r=Pe(),i=Pe(!1),a=Pe(),o=Pe();async function s(e){i.value=!0,xl.registerTicker(Mn),On.add(Nn),On.add(_o),a.value=new oo({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),o.value=a.value.view,o.value.style.width=`100%`,o.value.style.height=`100%`,o.value.style.objectFit=`cover`,o.value.style.display=`block`,e.appendChild(a.value.view),i.value=!0}function c(){a.value&&a.value.renderer.resize(n.width,n.height)}je([()=>n.width,()=>n.height],()=>c()),je(()=>n.resolution,e=>{a.value&&e&&(a.value.renderer.resolution=e,c())}),De(async()=>r.value&&await s(r.value)),Oe(()=>a.value?.destroy());async function l(){let e=new Promise(e=>{if(!o.value||!a.value)return e(null);a.value.render(),o.value.toBlob(e)});return e}function u(){return o.value}return t({captureFrame:l,canvasElement:u}),(e,t)=>(ke(),le(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[i.value?Ae(e.$slots,`default`,{key:0,app:a.value}):ce(``,!0)],512))}}),Ll=Il,Rl=function(e,t){return Rl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Rl(e,t)};function zl(e,t){Rl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Bl=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -558,7 +558,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,Hl=`varying vec2 vTextureCoord; +}`,Vl=`varying vec2 vTextureCoord; uniform sampler2D uSampler; uniform float gamma; @@ -589,7 +589,7 @@ void main(void) gl_FragColor = c * alpha; } -`;(function(e){Bl(t,e);function t(t){var n=e.call(this,Vl,Hl)||this;return n.gamma=1,n.saturation=1,n.contrast=1,n.brightness=1,n.red=1,n.green=1,n.blue=1,n.alpha=1,Object.assign(n,t),n}return t.prototype.apply=function(e,t,n,r){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,n,r)},t})(Hi); +`;(function(e){zl(t,e);function t(t){var n=e.call(this,Bl,Vl)||this;return n.gamma=1,n.saturation=1,n.contrast=1,n.brightness=1,n.red=1,n.green=1,n.blue=1,n.alpha=1,Object.assign(n,t),n}return t.prototype.apply=function(e,t,n,r){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,n,r)},t})(Vi); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -617,7 +617,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var Ul=function(e,t){return Ul=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ul(e,t)};function Wl(e,t){Ul(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Gl=`attribute vec2 aVertexPosition; +var Hl=function(e,t){return Hl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Hl(e,t)};function Ul(e,t){Hl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Wl=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -628,7 +628,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,Kl=` +}`,Gl=` varying vec2 vTextureCoord; uniform sampler2D uSampler; @@ -654,7 +654,7 @@ void main(void) color *= 0.25; gl_FragColor = color; -}`,ql=` +}`,Kl=` varying vec2 vTextureCoord; uniform sampler2D uSampler; @@ -682,7 +682,7 @@ void main(void) gl_FragColor = color; } -`,Jl=function(e){Wl(t,e);function t(t,n,r){t===void 0&&(t=4),n===void 0&&(n=3),r===void 0&&(r=!1);var i=e.call(this,Gl,r?ql:Kl)||this;return i._kernels=[],i._blur=4,i._quality=3,i.uniforms.uOffset=new Float32Array(2),i._pixelSize=new zn,i.pixelSize=1,i._clamp=r,Array.isArray(t)?i.kernels=t:(i._blur=t,i.quality=n),i}return t.prototype.apply=function(e,t,n,r){var i=this._pixelSize.x/t._frame.width,a=this._pixelSize.y/t._frame.height,o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*i,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,t,n,r);else{for(var s=e.getFilterTexture(),c=t,l=s,u=void 0,d=this._quality-1,f=0;f0)for(var r=e,i=e/t,a=1;a0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`clamp`,{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`pixelSize`,{get:function(){return this._pixelSize},set:function(e){typeof e==`number`?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof zn?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`quality`,{get:function(){return this._quality},set:function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blur`,{get:function(){return this._blur},set:function(e){this._blur=e,this._generateKernels()},enumerable:!1,configurable:!0}),t}(Hi),Yl=function(e,t){return Yl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Yl(e,t)};function Xl(e,t){Yl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Zl=`attribute vec2 aVertexPosition; +`,ql=function(e){Ul(t,e);function t(t,n,r){t===void 0&&(t=4),n===void 0&&(n=3),r===void 0&&(r=!1);var i=e.call(this,Wl,r?Kl:Gl)||this;return i._kernels=[],i._blur=4,i._quality=3,i.uniforms.uOffset=new Float32Array(2),i._pixelSize=new Rn,i.pixelSize=1,i._clamp=r,Array.isArray(t)?i.kernels=t:(i._blur=t,i.quality=n),i}return t.prototype.apply=function(e,t,n,r){var i=this._pixelSize.x/t._frame.width,a=this._pixelSize.y/t._frame.height,o;if(this._quality===1||this._blur===0)o=this._kernels[0]+.5,this.uniforms.uOffset[0]=o*i,this.uniforms.uOffset[1]=o*a,e.applyFilter(this,t,n,r);else{for(var s=e.getFilterTexture(),c=t,l=s,u=void 0,d=this._quality-1,f=0;f0)for(var r=e,i=e/t,a=1;a0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`clamp`,{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`pixelSize`,{get:function(){return this._pixelSize},set:function(e){typeof e==`number`?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof Rn?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`quality`,{get:function(){return this._quality},set:function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blur`,{get:function(){return this._blur},set:function(e){this._blur=e,this._generateKernels()},enumerable:!1,configurable:!0}),t}(Vi),Jl=function(e,t){return Jl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Jl(e,t)};function Yl(e,t){Jl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Xl=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -693,7 +693,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,Ql=` +}`,Zl=` uniform sampler2D uSampler; varying vec2 vTextureCoord; @@ -714,7 +714,7 @@ void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } } -`,$l=function(e){Xl(t,e);function t(t){t===void 0&&(t=.5);var n=e.call(this,Zl,Ql)||this;return n.threshold=t,n}return Object.defineProperty(t.prototype,`threshold`,{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),t}(Hi),eu=`uniform sampler2D uSampler; +`,Ql=function(e){Yl(t,e);function t(t){t===void 0&&(t=.5);var n=e.call(this,Xl,Zl)||this;return n.threshold=t,n}return Object.defineProperty(t.prototype,`threshold`,{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),t}(Vi),$l=`uniform sampler2D uSampler; varying vec2 vTextureCoord; uniform sampler2D bloomTexture; @@ -728,7 +728,7 @@ void main() { bloomColor.rgb *= bloomScale; gl_FragColor = color + bloomColor; } -`;(function(e){Xl(t,e);function t(n){var r=e.call(this,Zl,eu)||this;r.bloomScale=1,r.brightness=1,r._resolution=P.FILTER_RESOLUTION,typeof n==`number`&&(n={threshold:n});var i=Object.assign(t.defaults,n);r.bloomScale=i.bloomScale,r.brightness=i.brightness;var a=i.kernels,o=i.blur,s=i.quality,c=i.pixelSize,l=i.resolution;return r._extractFilter=new $l(i.threshold),r._extractFilter.resolution=l,r._blurFilter=a?new Jl(a):new Jl(o,s),r.pixelSize=c,r.resolution=l,r}return t.prototype.apply=function(e,t,n,r,i){var a=e.getFilterTexture();this._extractFilter.apply(e,t,a,1,i);var o=e.getFilterTexture();this._blurFilter.apply(e,a,o,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=o,e.applyFilter(this,t,n,r),e.returnFilterTexture(o),e.returnFilterTexture(a)},Object.defineProperty(t.prototype,`resolution`,{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`threshold`,{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`kernels`,{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blur`,{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`quality`,{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`pixelSize`,{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),t.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:P.FILTER_RESOLUTION},t})(Hi); +`;(function(e){Yl(t,e);function t(n){var r=e.call(this,Xl,$l)||this;r.bloomScale=1,r.brightness=1,r._resolution=I.FILTER_RESOLUTION,typeof n==`number`&&(n={threshold:n});var i=Object.assign(t.defaults,n);r.bloomScale=i.bloomScale,r.brightness=i.brightness;var a=i.kernels,o=i.blur,s=i.quality,c=i.pixelSize,l=i.resolution;return r._extractFilter=new Ql(i.threshold),r._extractFilter.resolution=l,r._blurFilter=a?new ql(a):new ql(o,s),r.pixelSize=c,r.resolution=l,r}return t.prototype.apply=function(e,t,n,r,i){var a=e.getFilterTexture();this._extractFilter.apply(e,t,a,1,i);var o=e.getFilterTexture();this._blurFilter.apply(e,a,o,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=o,e.applyFilter(this,t,n,r),e.returnFilterTexture(o),e.returnFilterTexture(a)},Object.defineProperty(t.prototype,`resolution`,{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`threshold`,{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`kernels`,{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`blur`,{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`quality`,{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`pixelSize`,{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),t.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:I.FILTER_RESOLUTION},t})(Vi); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -756,7 +756,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var tu=function(e,t){return tu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},tu(e,t)};function nu(e,t){tu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ru=`attribute vec2 aVertexPosition; +var eu=function(e,t){return eu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},eu(e,t)};function tu(e,t){eu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var nu=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -767,7 +767,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,iu=`varying vec2 vTextureCoord; +}`,ru=`varying vec2 vTextureCoord; uniform vec4 filterArea; uniform float pixelSize; @@ -841,7 +841,7 @@ void main() gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0); } -`;(function(e){nu(t,e);function t(t){t===void 0&&(t=8);var n=e.call(this,ru,iu)||this;return n.size=t,n}return Object.defineProperty(t.prototype,`size`,{get:function(){return this.uniforms.pixelSize},set:function(e){this.uniforms.pixelSize=e},enumerable:!1,configurable:!0}),t})(Hi); +`;(function(e){tu(t,e);function t(t){t===void 0&&(t=8);var n=e.call(this,nu,ru)||this;return n.size=t,n}return Object.defineProperty(t.prototype,`size`,{get:function(){return this.uniforms.pixelSize},set:function(e){this.uniforms.pixelSize=e},enumerable:!1,configurable:!0}),t})(Vi); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -869,7 +869,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var au=function(e,t){return au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},au(e,t)};function ou(e,t){au(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var su=`attribute vec2 aVertexPosition; +var iu=function(e,t){return iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},iu(e,t)};function au(e,t){iu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ou=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -880,7 +880,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,cu=`precision mediump float; +}`,su=`precision mediump float; varying vec2 vTextureCoord; uniform sampler2D uSampler; @@ -903,7 +903,7 @@ void main(void) { color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0)); gl_FragColor = vec4(color.rgb * color.a, color.a); } -`;(function(e){ou(t,e);function t(t){var n=e.call(this,su,cu)||this;return n._thickness=2,n._angle=0,n.uniforms.lightColor=new Float32Array(3),n.uniforms.shadowColor=new Float32Array(3),Object.assign(n,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),n.padding=1,n}return t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,`rotation`,{get:function(){return this._angle/Ln},set:function(e){this._angle=e*Ln,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`thickness`,{get:function(){return this._thickness},set:function(e){this._thickness=e,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lightColor`,{get:function(){return sn(this.uniforms.lightColor)},set:function(e){an(e,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lightAlpha`,{get:function(){return this.uniforms.lightAlpha},set:function(e){this.uniforms.lightAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`shadowColor`,{get:function(){return sn(this.uniforms.shadowColor)},set:function(e){an(e,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`shadowAlpha`,{get:function(){return this.uniforms.shadowAlpha},set:function(e){this.uniforms.shadowAlpha=e},enumerable:!1,configurable:!0}),t})(Hi); +`;(function(e){au(t,e);function t(t){var n=e.call(this,ou,su)||this;return n._thickness=2,n._angle=0,n.uniforms.lightColor=new Float32Array(3),n.uniforms.shadowColor=new Float32Array(3),Object.assign(n,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},t),n.padding=1,n}return t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,`rotation`,{get:function(){return this._angle/In},set:function(e){this._angle=e*In,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`thickness`,{get:function(){return this._thickness},set:function(e){this._thickness=e,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lightColor`,{get:function(){return on(this.uniforms.lightColor)},set:function(e){rn(e,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lightAlpha`,{get:function(){return this.uniforms.lightAlpha},set:function(e){this.uniforms.lightAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`shadowColor`,{get:function(){return on(this.uniforms.shadowColor)},set:function(e){rn(e,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`shadowAlpha`,{get:function(){return this.uniforms.shadowAlpha},set:function(e){this.uniforms.shadowAlpha=e},enumerable:!1,configurable:!0}),t})(Vi); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -931,7 +931,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var lu=function(e,t){return lu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},lu(e,t)};function uu(e,t){lu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var du=`varying vec2 vTextureCoord; +var cu=function(e,t){return cu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},cu(e,t)};function lu(e,t){cu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var uu=`varying vec2 vTextureCoord; uniform sampler2D uSampler; uniform float uAlpha; @@ -940,7 +940,7 @@ void main(void) { gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha; } -`,fu=function(e){uu(t,e);function t(t){t===void 0&&(t=1);var n=e.call(this,La,du,{uAlpha:1})||this;return n.alpha=t,n}return Object.defineProperty(t.prototype,`alpha`,{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(Hi),pu=function(e,t){return pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},pu(e,t)};function mu(e,t){pu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var hu=` +`,du=function(e){lu(t,e);function t(t){t===void 0&&(t=1);var n=e.call(this,Ia,uu,{uAlpha:1})||this;return n.alpha=t,n}return Object.defineProperty(t.prototype,`alpha`,{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(Vi),fu=function(e,t){return fu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},fu(e,t)};function pu(e,t){fu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var mu=` attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; @@ -970,10 +970,10 @@ void main(void) vec2 textureCoord = filterTextureCoord(); %blur% - }`;function gu(e,t){var n=Math.ceil(e/2),r=hu,i=``,a;a=t?`vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);`:`vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);`;for(var o=0;o=n&&(o=e-s-1),c=c.replace(`%value%`,t[o].toString()),i+=c,i+=` -`}return r=r.replace(`%blur%`,i),r=r.replace(`%size%`,e.toString()),r}var bu=function(e){mu(t,e);function t(t,n,r,i,a){n===void 0&&(n=8),r===void 0&&(r=4),i===void 0&&(i=P.FILTER_RESOLUTION),a===void 0&&(a=5);var o=this,s=gu(a,t),c=yu(a);return o=e.call(this,s,c)||this,o.horizontal=t,o.resolution=i,o._quality=0,o.quality=r,o.blur=n,o}return t.prototype.apply=function(e,t,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/t.width):this.uniforms.strength=1/n.height*(n.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,t,n,r);else{var i=e.getFilterTexture(),a=e.renderer,o=t,s=i;this.state.blend=!1,e.applyFilter(this,o,s,dt.CLEAR);for(var c=1;c=n&&(o=e-s-1),c=c.replace(`%value%`,t[o].toString()),i+=c,i+=` +`}return r=r.replace(`%blur%`,i),r=r.replace(`%size%`,e.toString()),r}var yu=function(e){pu(t,e);function t(t,n,r,i,a){n===void 0&&(n=8),r===void 0&&(r=4),i===void 0&&(i=I.FILTER_RESOLUTION),a===void 0&&(a=5);var o=this,s=hu(a,t),c=vu(a);return o=e.call(this,s,c)||this,o.horizontal=t,o.resolution=i,o._quality=0,o.quality=r,o.blur=n,o}return t.prototype.apply=function(e,t,n,r){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/t.width):this.uniforms.strength=1/n.height*(n.height/t.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/t.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/t.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,t,n,r);else{var i=e.getFilterTexture(),a=e.renderer,o=t,s=i;this.state.blend=!1,e.applyFilter(this,o,s,ut.CLEAR);for(var c=1;c0;n--){var r=Math.random()*n>>0,i=e[n];e[n]=e[r],e[r]=i}},t.prototype._randomizeOffsets=function(){for(var e=0;e0?r:0,c=r<0?-r:0;n.fillStyle=`rgba(`+s+`, `+c+`, 0, 1)`,n.fillRect(0,i>>0,e,o+1>>0),i+=o}t.baseTexture.update(),this.uniforms.displacementMap=t},Object.defineProperty(t.prototype,`sizes`,{get:function(){return this._sizes},set:function(e){for(var t=Math.min(this._slices,e.length),n=0;n0;n--){var r=Math.random()*n>>0,i=e[n];e[n]=e[r],e[r]=i}},t.prototype._randomizeOffsets=function(){for(var e=0;e0?r:0,c=r<0?-r:0;n.fillStyle=`rgba(`+s+`, `+c+`, 0, 1)`,n.fillRect(0,i>>0,e,o+1>>0),i+=o}t.baseTexture.update(),this.uniforms.displacementMap=t},Object.defineProperty(t.prototype,`sizes`,{get:function(){return this._sizes},set:function(e){for(var t=Math.min(this._slices,e.length),n=0;n>0)+1},Object.defineProperty(t.prototype,`offset`,{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),t})(Hi); +`;(function(e){wd(t,e);function t(t,n,r){t===void 0&&(t=[0,0]),n===void 0&&(n=5),r===void 0&&(r=0);var i=e.call(this,Td,Ed)||this;return i.kernelSize=5,i.uniforms.uVelocity=new Float32Array(2),i._velocity=new Vn(i.velocityChanged,i),i.setVelocity(t),i.kernelSize=n,i.offset=r,i}return t.prototype.apply=function(e,t,n,r){var i=this.velocity,a=i.x,o=i.y;this.uniforms.uKernelSize=a!==0||o!==0?this.kernelSize:0,e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,`velocity`,{get:function(){return this._velocity},set:function(e){this.setVelocity(e)},enumerable:!1,configurable:!0}),t.prototype.setVelocity=function(e){if(Array.isArray(e)){var t=e[0],n=e[1];this._velocity.set(t,n)}else this._velocity.copyFrom(e)},t.prototype.velocityChanged=function(){this.uniforms.uVelocity[0]=this._velocity.x,this.uniforms.uVelocity[1]=this._velocity.y,this.padding=(Math.max(Math.abs(this._velocity.x),Math.abs(this._velocity.y))>>0)+1},Object.defineProperty(t.prototype,`offset`,{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),t})(Vi); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -2183,7 +2183,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -var Od=function(e,t){return Od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Od(e,t)};function kd(e,t){Od(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ad=`attribute vec2 aVertexPosition; +var Dd=function(e,t){return Dd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Dd(e,t)};function Od(e,t){Dd(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var kd=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -2194,7 +2194,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,jd=`varying vec2 vTextureCoord; +}`,Ad=`varying vec2 vTextureCoord; uniform sampler2D uSampler; uniform float epsilon; @@ -2232,7 +2232,7 @@ void main(void) } } } -`;(function(e){kd(t,e);function t(t,n,r){n===void 0&&(n=.05),r===void 0&&(r=t.length);var i=e.call(this,Ad,jd.replace(/%maxColors%/g,r.toFixed(0)))||this;return i._replacements=[],i._maxColors=0,i.epsilon=n,i._maxColors=r,i.uniforms.originalColors=new Float32Array(r*3),i.uniforms.targetColors=new Float32Array(r*3),i.replacements=t,i}return Object.defineProperty(t.prototype,`replacements`,{get:function(){return this._replacements},set:function(e){var t=this.uniforms.originalColors,n=this.uniforms.targetColors,r=e.length;if(r>this._maxColors)throw Error(`Length of replacements (`+r+`) exceeds the maximum colors length (`+this._maxColors+`)`);t[r*3]=-1;for(var i=0;ithis._maxColors)throw Error(`Length of replacements (`+r+`) exceeds the maximum colors length (`+this._maxColors+`)`);t[r*3]=-1;for(var i=0;i=t||a({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:n}){let r=e,i=n;function a(){let e=Number.parseFloat(String(r.xOffset))||0,t=Number.parseFloat(String(r.yOffset))||0;return String(r.xOffset).endsWith(`%`)&&(e=Number.parseFloat(String(r.xOffset).replace(`%`,``))/100*r.width),String(r.yOffset).endsWith(`%`)&&(t=Number.parseFloat(String(r.yOffset).replace(`%`,``))/100*r.height),{xOffset:e,yOffset:t}}let o=Le(()=>r.modelSrc),s=Le(()=>r.modelFile),c=ge(s),l=ae(()=>c.value?c.value:o.value?o.value:``),u=ae(()=>a()),d=Le(()=>r.app),f=Le(()=>r.paused),p=Le(()=>r.focusAt),h=Fe(),g=Fe(0),_=Fe(0),v=ae(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),y=Fe(0),b=pe(),x=fe(w),S=ae(()=>x.between(`sm`,`md`).value||x.smaller(`sm`).value),T=Of(),E=Ie(new od({alpha:.2,blur:0,distance:20,rotation:45}));function D(){return h.value.internalModel.coreModel}function O(){if(!h.value)return;let e=2.2;S.value&&(e=2.2);let t=r.height*.95/_.value*e,n=r.width*.95/g.value*e,i=Math.min(t,n);h.value.scale.set(i*r.scale,i*r.scale),h.value.x=r.width/2+u.value.xOffset,h.value.y=r.height+u.value.yOffset}let{modelFile:k,loadingModel:ee,currentMotion:A,availableMotions:j}=C(Ke()),{themeColorsHue:te,themeColorsHueDynamic:ne}=C(Ge()),re=Fe({group:`Idle`,index:0});async function ie(){if(!d.value)return;if(h.value&&(d.value.stage.removeChild(h.value),h.value.destroy(),h.value=void 0),!l.value){console.warn(`No Live2D model source provided.`);return}let e=new Sl;await ml.setupLive2DModel(e,l.value,{autoInteract:!1}),h.value=e,d.value.stage.addChild(h.value),g.value=h.value.width,_.value=h.value.height,h.value.anchor.set(.5,.5),O(),h.value.on(`hit`,e=>{h.value&&e.includes(`body`)&&h.value.motion(`tap_body`)});let t=h.value.internalModel,n=t.coreModel,r=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,v.value),j.value=Object.entries(r.definitions).flatMap(([e,t])=>t?t.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File})):[]).filter(Boolean),r.groups.idle&&r.motionGroups[r.groups.idle]?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let a=r.update;r.update=function(e,n){return y.value=n,a?.call(this,e,n),!r.state.currentGroup||r.state.currentGroup===r.groups.idle?(T.update(t,n),t.eyeBlink!=null&&t.eyeBlink.updateParameters(e,(n-y.value)/1e3),!0):!1},r.on(`motionStart`,(e,t)=>{re.value={group:e,index:t}}),k.value&&await kf.default.setItem(`live2dModel`,k.value),i(`modelLoaded`),ee.value=!1}async function se(e,t){await h.value?.motion(e,t,Gc.FORCE)}let ce=ve(O,100),ue=Fe(),de=Fe(0);function me(){if(h.value){let e=getComputedStyle(ue.value).backgroundColor;E.value.color=Number(m(e).replace(`#`,`0x`)),h.value.filters=[E.value]}}Me([()=>r.width,()=>r.height],()=>ce()),Me(l,()=>ie(),{immediate:!0}),Me(b,me,{immediate:!0}),Me([h,te],me),Me(u,O),Me(()=>r.scale,O);function he(){me(),de.value=requestAnimationFrame(he)}Me(ne,()=>{ne.value?de.value=requestAnimationFrame(he):(cancelAnimationFrame(de.value),de.value=0)},{immediate:!0}),Me(v,e=>D().setParameterValueById(`ParamMouthOpenY`,e)),Me(A,e=>se(e.group,e.index)),Me(f,e=>e?d.value?.stop():d.value?.start()),Me(p,e=>{h.value&&(r.disableFocusAt||h.value.focus(e.x,e.y))}),ye(ee,e=>{e&&ie()},{debounce:1e3}),Oe(()=>me());function _e(){cancelAnimationFrame(de.value),h.value&&d.value?.stage.removeChild(h.value)}ke(()=>{_e()});function be(){return j.value}return t({setMotion:se,listMotionGroups:be}),(e,t)=>(Ae(),le(M,null,[oe(`div`,{ref_key:`dropShadowColorComputer`,ref:ue,hidden:``,bg:`primary-400 dark:primary-500`},null,512),je(e.$slots,`default`)],64))}}),jf=Af,Mf=ze(((exports,t)=>{ +`;(function(e){Cf(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=wf(i,[`maxKernelSize`]);return r=e.call(this,Tf,Ef.replace("${maxKernelSize}",a.toFixed(1)))||this,Object.assign(r,o),r}return Object.defineProperty(t.prototype,`center`,{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`strength`,{get:function(){return this.uniforms.uStrength},set:function(e){this.uniforms.uStrength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`innerRadius`,{get:function(){return this.uniforms.uInnerRadius},set:function(e){this.uniforms.uInnerRadius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},t})(Vi);function Df(){let t=-1,n,r=-1;function i(i,a){(a>=t||a({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:n}){let r=e,i=n;function a(){let e=Number.parseFloat(String(r.xOffset))||0,t=Number.parseFloat(String(r.yOffset))||0;return String(r.xOffset).endsWith(`%`)&&(e=Number.parseFloat(String(r.xOffset).replace(`%`,``))/100*r.width),String(r.yOffset).endsWith(`%`)&&(t=Number.parseFloat(String(r.yOffset).replace(`%`,``))/100*r.height),{xOffset:e,yOffset:t}}let o=Ie(()=>r.modelSrc),s=Ie(()=>r.modelFile),c=he(s),l=ae(()=>c.value?c.value:o.value?o.value:``),u=ae(()=>a()),d=Ie(()=>r.app),f=Ie(()=>r.paused),p=Ie(()=>r.focusAt),h=Pe(),g=Pe(0),_=Pe(0),v=ae(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),y=Pe(0),b=fe(),x=de(T),S=ae(()=>x.between(`sm`,`md`).value||x.smaller(`sm`).value),C=Df(),E=Fe(new ad({alpha:.2,blur:0,distance:20,rotation:45}));function D(){return h.value.internalModel.coreModel}function O(){if(!h.value)return;let e=2.2;S.value&&(e=2.2);let t=r.height*.95/_.value*e,n=r.width*.95/g.value*e,i=Math.min(t,n);h.value.scale.set(i*r.scale,i*r.scale),h.value.x=r.width/2+u.value.xOffset,h.value.y=r.height+u.value.yOffset}let{modelFile:k,loadingModel:A,currentMotion:ee,availableMotions:j}=w(Ge()),{themeColorsHue:te,themeColorsHueDynamic:ne}=w(We()),M=Pe({group:`Idle`,index:0});async function N(){if(!d.value)return;if(h.value&&(d.value.stage.removeChild(h.value),h.value.destroy(),h.value=void 0),!l.value){console.warn(`No Live2D model source provided.`);return}let e=new xl;await pl.setupLive2DModel(e,l.value,{autoInteract:!1}),h.value=e,d.value.stage.addChild(h.value),g.value=h.value.width,_.value=h.value.height,h.value.anchor.set(.5,.5),O(),h.value.on(`hit`,e=>{h.value&&e.includes(`body`)&&h.value.motion(`tap_body`)});let t=h.value.internalModel,n=t.coreModel,r=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,v.value),j.value=Object.entries(r.definitions).flatMap(([e,t])=>t?t.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File})):[]).filter(Boolean),r.groups.idle&&r.motionGroups[r.groups.idle]?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let a=r.update;r.update=function(e,n){return y.value=n,a?.call(this,e,n),!r.state.currentGroup||r.state.currentGroup===r.groups.idle?(C.update(t,n),t.eyeBlink!=null&&t.eyeBlink.updateParameters(e,(n-y.value)/1e3),!0):!1},r.on(`motionStart`,(e,t)=>{M.value={group:e,index:t}}),k.value&&await Of.default.setItem(`live2dModel`,k.value),i(`modelLoaded`),A.value=!1}async function P(e,t){await h.value?.motion(e,t,Wc.FORCE)}let re=_e(O,100),se=Pe(),ce=Pe(0);function ue(){if(h.value){let e=getComputedStyle(se.value).backgroundColor;E.value.color=Number(m(e).replace(`#`,`0x`)),h.value.filters=[E.value]}}je([()=>r.width,()=>r.height],()=>re()),je(l,()=>N(),{immediate:!0}),je(b,ue,{immediate:!0}),je([h,te],ue),je(u,O),je(()=>r.scale,O);function pe(){ue(),ce.value=requestAnimationFrame(pe)}je(ne,()=>{ne.value?ce.value=requestAnimationFrame(pe):(cancelAnimationFrame(ce.value),ce.value=0)},{immediate:!0}),je(v,e=>D().setParameterValueById(`ParamMouthOpenY`,e)),je(ee,e=>P(e.group,e.index)),je(f,e=>e?d.value?.stop():d.value?.start()),je(p,e=>{h.value&&(r.disableFocusAt||h.value.focus(e.x,e.y))}),ve(A,e=>{e&&N()},{debounce:1e3}),De(()=>ue());function me(){cancelAnimationFrame(ce.value),h.value&&d.value?.stage.removeChild(h.value)}Oe(()=>{me()});function ge(){return j.value}return t({setMotion:P,listMotionGroups:ge}),(e,t)=>(ke(),le(ie,null,[oe(`div`,{ref_key:`dropShadowColorComputer`,ref:se,hidden:``,bg:`primary-400 dark:primary-500`},null,512),Ae(e.$slots,`default`)],64))}}),Af=kf,jf=Re(((exports,t)=>{ /*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -3235,13 +3235,13 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */ -(function(n){typeof exports==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof Ve==`function`&&Ve;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof Ve==`function`&&Ve,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var ee=0,A=0;E&&(ee|=16),o===`UNIX`?(A=798,ee|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(A=20,ee|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var j=``;return j+=` -\0`,j+=r(k,2),j+=m.magic,j+=r(d,2),j+=r(f,2),j+=r(O.crc32,4),j+=r(O.compressedSize,4),j+=r(O.uncompressedSize,4),j+=r(g.length,2),j+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+j+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(A,2)+j+r(y.length,2)+`\0\0\0\0`+r(ee,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{var e=function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,ee=3,A=4;function j(e,t){return e.msg=c[t],t}function te(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function ie(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,re(e.strm)}function M(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function oe(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function se(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(se(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,ie(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(ie(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ie(e,!0),e.strm.avail_out===0?ee:A):(e.strstart>e.block_start&&(ie(e,!1),e.strm.avail_out),O)}),new ue(4,4,8,4,ce),new ue(4,5,16,8,ce),new ue(4,6,32,32,ce),new ue(4,4,16,16,le),new ue(8,16,32,32,le),new ue(8,16,128,128,le),new ue(8,32,128,256,le),new ue(32,128,258,1024,le),new ue(32,258,258,4096,le)],n.deflateInit=function(e,t){return me(e,t,g,15,8,0)},n.deflateInit2=me,n.deflateReset=pe,n.deflateResetKeep=fe,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),M(i,i.gzhead.time>>16&255),M(i,i.gzhead.time>>24&255),M(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),M(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(M(i,255&i.gzhead.extra.length),M(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(M(i,0),M(i,0),M(i,0),M(i,0),M(i,0),M(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),M(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,ae(i,p),i.strstart!==0&&(ae(i,e.adler>>>16),ae(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),re(e),o=i.pending,i.pending!==i.pending_buf_size));)M(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),re(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),re(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&re(e),i.pending+2<=i.pending_buf_size&&(M(i,255&e.adler),M(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(re(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&te(t)<=te(n)&&t!==u)return j(e,-5);if(i.status===666&&e.avail_in!==0)return j(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(se(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(ie(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ie(e,!0),e.strm.avail_out===0?ee:A):e.last_lit&&(ie(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(se(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(ie(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(ie(e,!0),e.strm.avail_out===0?ee:A):e.last_lit&&(ie(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==ee&&m!==A||(i.status=666),m===O||m===ee)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(ne(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),re(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(M(i,255&e.adler),M(i,e.adler>>8&255),M(i,e.adler>>16&255),M(i,e.adler>>24&255),M(i,255&e.total_in),M(i,e.total_in>>8&255),M(i,e.total_in>>16&255),M(i,e.total_in>>24&255)):(ae(i,e.adler>>>16),ae(i,65535&e.adler)),re(e),0=n.w_size&&(s===0&&(ne(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,se(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,se,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,re=8+(15&(b>>>=4)),n.wbits===0)n.wbits=re;else if(re>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(se[0]=255&b,se[1]=b>>>8&255,n.check=a(n.check,se,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,se[2]=b>>>16&255,se[3]=b>>>24&255,n.check=a(n.check,se,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(se[0]=255&b,se[1]=b>>>8&255,n.check=a(n.check,se,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,se,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(re=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,re)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;re=p[g+ E++],n.head&&re&&n.length<65536&&(n.head.name+=String.fromCharCode(re)),re&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[ce[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,M={bits:n.lenbits},ie=s(0,n.lens,0,19,n.lencode,0,n.work,M),n.lenbits=M.bits,ie){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,A=65535&oe,!((k=oe>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=A;else{if(A===16){for(ae=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}re=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(A===17){for(ae=k+3;x>>=k)),b>>>=3,x-=3}else{for(ae=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=re}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,M={bits:n.lenbits},ie=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,M),n.lenbits=M.bits,ie){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,M={bits:n.distbits},ie=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,M),n.distbits=M.bits,ie){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;ee=(oe=n.lencode[b&(1<>>16&255,A=65535&oe,!((k=oe>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>j)])>>>16&255,A=65535&oe,!(j+(k=oe>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=j,x-=j,n.back+=j}if(b>>>=k,x-=k,n.back+=k,n.length=A,ee===0){n.mode=26;break}if(32&ee){n.back=-1,n.mode=12;break}if(64&ee){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&ee,n.mode=22;case 22:if(n.extra){for(ae=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;ee=(oe=n.distcode[b&(1<>>16&255,A=65535&oe,!((k=oe>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>j)])>>>16&255,A=65535&oe,!(j+(k=oe>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=j,x-=j,n.back+=j}if(b>>>=k,x-=k,n.back+=k,64&ee){e.msg=`invalid distance code`,n.mode=30;break}n.offset=A,n.extra=15&ee,n.mode=24;case 24:if(n.extra){for(ae=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=M[ae+d[w]],te[ne+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?j=0:(j&=p-1,j+=p),w++,--re[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function M(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function ae(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function ce(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=se(a[s]++,s))}}function le(e){var t;for(t=0;t>1;1<=n;n--)fe(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fe(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,fe(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?ve(e,t,n,r):e.strategy===4||s===o?(ae(e,2+(r?1:0),3),pe(e,T,E)):(ae(e,4+(r?1:0),3),function(e,t,n,r){var i;for(ae(e,t-257,5),ae(e,n-1,5),ae(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*ie(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){ae(e,2,3),oe(e,_,T),function(e){e.bi_valid===16?(M(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){"use strict";if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})})),Nf=Ue(Mf());El.zipReader=(e,t)=>Nf.default.loadAsync(e);const Pf=El.createSettings;El.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>Ff(e))?Pf(e):Rf(t)};function Ff(e){return e.endsWith(`model3.json`)}function If(e){return e.endsWith(`.moc3`)}function Lf(e){return e.split(/[\\/]/).pop()}function Rf(e){let t=e.filter(e=>If(e));if(t.length!==1){let e=t.length?`(${t.map(e=>`"${e}"`).join(`,`)})`:``;throw Error(`Expected exactly one moc file, got ${t.length} ${e}`)}let n=t[0],r=Lf(n).replace(/\.moc3?/,``),i=e.filter(e=>e.endsWith(`.png`));if(!i.length)throw Error(`Textures not found`);let a=e.filter(e=>e.endsWith(`.mtn`)||e.endsWith(`.motion3.json`)),o=e.find(e=>e.includes(`physics`)),s=e.find(e=>e.includes(`pose`)),c=new Ol({url:`${r}.model3.json`,Version:3,FileReferences:{Moc:n,Textures:i,Physics:o,Pose:s,Motions:a.length?{"":a.map(e=>({File:e}))}:void 0}});return c.name=r,c._objectURL=`example://${c.url}`,c}El.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},El.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},El.getFiles=(e,t)=>Promise.all(t.map(async t=>{let n=t.slice(t.lastIndexOf(`/`)+1),r=await e.file(t).async(`blob`);return new File([r],n)}));var zf=de({__name:`Live2D`,props:{modelSrc:{},modelFile:{},paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},disableFocusAt:{type:Boolean},xOffset:{},yOffset:{},scale:{default:1}},setup(e){return(e,t)=>(Ae(),se(_,{relative:``},{default:Ne(({width:t,height:n})=>[ue(Rl,{width:t,height:n,resolution:2,"max-h":`100dvh`},{default:Ne(({app:r})=>[ue(jf,{"model-src":e.modelSrc,"model-file":e.modelFile,app:r,"mouth-open-size":e.mouthOpenSize,width:t,height:n,paused:e.paused,"focus-at":e.focusAt,"x-offset":e.xOffset,"y-offset":e.yOffset,scale:e.scale,"disable-focus-at":e.disableFocusAt},null,8,[`model-src`,`model-file`,`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`,`disable-focus-at`])]),_:2},1032,[`width`,`height`])]),_:1}))}}),Bf=zf;function Vf(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Hf(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Uf(e){return this instanceof Uf?(this.v=e,this):new Uf(e)}function Wf(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Uf?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Gf(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Uf(e[r](t)),done:!1}:i?i(t):t}:i}}function Kf(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Hf==`function`?Hf(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const qf=new TextDecoder(`utf-8`),Jf=e=>qf.decode(e),Yf=new TextEncoder,Xf=e=>Yf.encode(e),Zf=e=>typeof e==`number`,Qf=e=>typeof e==`boolean`,$f=e=>typeof e==`function`,ep=e=>e!=null&&Object(e)===e,tp=e=>ep(e)&&$f(e.then),np=e=>ep(e)&&$f(e[Symbol.iterator]),rp=e=>ep(e)&&$f(e[Symbol.asyncIterator]),ip=e=>ep(e)&&ep(e.schema),ap=e=>ep(e)&&`done`in e&&`value`in e,op=e=>ep(e)&&$f(e.stat)&&Zf(e.fd),sp=e=>ep(e)&&up(e.body),cp=e=>`_getDOMStream`in e&&`_getNodeStream`in e,lp=e=>ep(e)&&$f(e.abort)&&$f(e.getWriter)&&!cp(e),up=e=>ep(e)&&$f(e.cancel)&&$f(e.getReader)&&!cp(e),dp=e=>ep(e)&&$f(e.end)&&$f(e.write)&&Qf(e.writable)&&!cp(e),fp=e=>ep(e)&&$f(e.read)&&$f(e.pipe)&&Qf(e.readable)&&!cp(e),pp=e=>ep(e)&&$f(e.clear)&&$f(e.bytes)&&$f(e.position)&&$f(e.setPosition)&&$f(e.capacity)&&$f(e.getBufferIdentifier)&&$f(e.createLong),mp=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function hp(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++cvp(Int32Array,e),bp=e=>vp(BigInt64Array,e),xp=e=>vp(Uint8Array,e),Sp=e=>(e.next(),e);function*Cp(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof mp?n(t):np(t)?t:n(t);return yield*Sp((function*(t){let n=null;do n=t.next(yield vp(e,n));while(!n.done)})(r[Symbol.iterator]())),new e}const wp=e=>Cp(Uint8Array,e);function Tp(e,t){return Wf(this,arguments,function*(){if(tp(t))return yield Uf(yield Uf(yield*Gf(Kf(Tp(e,yield Uf(t))))));let n=function(e){return Wf(this,arguments,function*(){yield yield Uf(yield Uf(e))})},r=function(e){return Wf(this,arguments,function*(){yield Uf(yield*Gf(Kf(Sp((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof mp?n(t):np(t)?r(t):rp(t)?t:n(t);return yield Uf(yield*Gf(Kf(Sp((function(t){return Wf(this,arguments,function*(){let n=null;do n=yield Uf(t.next(yield yield Uf(vp(e,n))));while(!n.done)})})(i[Symbol.asyncIterator]()))))),yield Uf(new e)})}const Ep=e=>Tp(Uint8Array,e);function Dp(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*jp(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?_p(r,o)[0]:([i,r,s]=_p(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=wp(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?l.next():l.next(o-s),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield c());while(onull)()))||{cmd:`read`,size:0});let l=Ep(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield Uf(l.next()):yield Uf(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield Uf(c()));while(onull)()))||{cmd:`read`,size:0});let l=new Pp(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield Uf(l.read()):yield Uf(l.read(o-s)),!t&&i.byteLength>0&&(r.push(xp(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield Uf(c()));while(o{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return Vf(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return Vf(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array};let t=yield this.reader.read();return!t.done&&(t.value=xp(t)),t})}};const Fp=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Ip(e){return Wf(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?_p(c,o)[0]:([l,c,s]=_p(c,o),l)}if({cmd:a,size:o}=(yield yield Uf((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield Uf(new Uint8Array),yield Uf(null);try{t[0]=Fp(e,`end`),t[1]=Fp(e,`error`);do{if(t[2]=Fp(e,`readable`),[n,i]=yield Uf(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=xp(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield Uf(u()));while(o{for(let[n,r]of t)e.off(n,r);try{let t=e.destroy;t&&t.call(e,n),n=void 0}catch(e){n=e||n}finally{n==null?r():i(n)}})}})}var Lp;(function(e){e[e.V1=0]=`V1`,e[e.V2=1]=`V2`,e[e.V3=2]=`V3`,e[e.V4=3]=`V4`,e[e.V5=4]=`V5`})(Lp||={});var Rp;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(Rp||={});var zp;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(zp||={});var Bp;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(Bp||={});var Vp;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(Vp||={});var Hp;(function(e){e[e.YEAR_MONTH=0]=`YEAR_MONTH`,e[e.DAY_TIME=1]=`DAY_TIME`,e[e.MONTH_DAY_NANO=2]=`MONTH_DAY_NANO`})(Hp||={});const Up=2,Wp=4,Gp=4,Kp=4,qp=new Int32Array(2),Jp=new Float32Array(qp.buffer),Yp=new Float64Array(qp.buffer),Xp=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Zp;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(Zp||={});var Qp=class e{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Jp[0]=t,this.writeInt32(e,qp[0])}writeFloat64(e,t){Yp[0]=t,this.writeInt32(e,qp[Xp?0:1]),this.writeInt32(e+4,qp[Xp?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]==0?0:e-this.vtable[t]);let r=2;this.addInt16(e-this.object_start);let i=(n+r)*Up;this.addInt16(i);let a=0,o=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,Wp+r),this.addOffset(e),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),i=t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){let t=e.endObject();return t}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},Am=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+Kp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){let t=e.endObject();return t}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},jm;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.FloatingPoint=3]=`FloatingPoint`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct_=13]=`Struct_`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.LargeList=21]=`LargeList`,e[e.RunEndEncoded=22]=`RunEndEncoded`})(jm||={});var Mm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+Kp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):jm.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new um).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new dm).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,jm.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){let t=e.endObject();return t}},Nm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+Kp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):sm.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Mm).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new dm).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,sm.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){let t=e.endObject();return t}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(t,n,r,i,a){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,a),e.endSchema(t)}},Pm;(function(e){e[e.NONE=0]=`NONE`,e[e.Schema=1]=`Schema`,e[e.DictionaryBatch=2]=`DictionaryBatch`,e[e.RecordBatch=3]=`RecordBatch`,e[e.Tensor=4]=`Tensor`,e[e.SparseTensor=5]=`SparseTensor`})(Pm||={});var F;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.Float=3]=`Float`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct=13]=`Struct`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.Dictionary=-1]=`Dictionary`,e[e.Int8=-2]=`Int8`,e[e.Int16=-3]=`Int16`,e[e.Int32=-4]=`Int32`,e[e.Int64=-5]=`Int64`,e[e.Uint8=-6]=`Uint8`,e[e.Uint16=-7]=`Uint16`,e[e.Uint32=-8]=`Uint32`,e[e.Uint64=-9]=`Uint64`,e[e.Float16=-10]=`Float16`,e[e.Float32=-11]=`Float32`,e[e.Float64=-12]=`Float64`,e[e.DateDay=-13]=`DateDay`,e[e.DateMillisecond=-14]=`DateMillisecond`,e[e.TimestampSecond=-15]=`TimestampSecond`,e[e.TimestampMillisecond=-16]=`TimestampMillisecond`,e[e.TimestampMicrosecond=-17]=`TimestampMicrosecond`,e[e.TimestampNanosecond=-18]=`TimestampNanosecond`,e[e.TimeSecond=-19]=`TimeSecond`,e[e.TimeMillisecond=-20]=`TimeMillisecond`,e[e.TimeMicrosecond=-21]=`TimeMicrosecond`,e[e.TimeNanosecond=-22]=`TimeNanosecond`,e[e.DenseUnion=-23]=`DenseUnion`,e[e.SparseUnion=-24]=`SparseUnion`,e[e.IntervalDayTime=-25]=`IntervalDayTime`,e[e.IntervalYearMonth=-26]=`IntervalYearMonth`,e[e.DurationSecond=-27]=`DurationSecond`,e[e.DurationMillisecond=-28]=`DurationMillisecond`,e[e.DurationMicrosecond=-29]=`DurationMicrosecond`,e[e.DurationNanosecond=-30]=`DurationNanosecond`})(F||={});var Fm;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(Fm||={});const Im=void 0;function Lm(e){if(e===null)return`null`;if(e===Im)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>Lm(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function Rm(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function zm(e,t){return Rm(e/t)+Rm(e%t)/Rm(t)}const Bm=Symbol.for(`isArrowBigNum`);function Vm(e,...t){return t.length===0?Object.setPrototypeOf(vp(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Vm.prototype[Bm]=!0,Vm.prototype.toJSON=function(){return`"${Jm(this)}"`},Vm.prototype.valueOf=function(e){return qm(this,e)},Vm.prototype.toString=function(){return Jm(this)},Vm.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return qm(this);case`string`:return Jm(this);case`default`:return Ym(this)}return Jm(this)};function Hm(...e){return Vm.apply(this,e)}function Um(...e){return Vm.apply(this,e)}function Wm(...e){return Vm.apply(this,e)}Object.setPrototypeOf(Hm.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Um.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Wm.prototype,Object.create(Uint32Array.prototype)),Object.assign(Hm.prototype,Vm.prototype,{constructor:Hm,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Um.prototype,Vm.prototype,{constructor:Um,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(Wm.prototype,Vm.prototype,{constructor:Wm,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Gm=BigInt(4294967296)*BigInt(4294967296),Km=Gm-BigInt(1);function qm(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<=0)return Xm(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(I.prototype);var bh=class extends I{constructor(){super(F.Null)}toString(){return`Null`}};$m=Symbol.toStringTag,bh[$m]=(e=>e[Symbol.toStringTag]=`Null`)(bh.prototype);var xh=class extends I{constructor(e,t){super(F.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};eh=Symbol.toStringTag,xh[eh]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(xh.prototype);var Sh=class extends xh{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Ch=class extends xh{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},wh=class extends xh{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Th=class extends xh{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Eh=class extends xh{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Dh=class extends xh{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Oh=class extends xh{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},kh=class extends xh{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Sh.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(Ch.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(wh.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(Th.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(Eh.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(Dh.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(Oh.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(kh.prototype,`ArrayType`,{value:BigUint64Array});var Ah=class extends I{constructor(e){super(F.Float),this.precision=e}get ArrayType(){switch(this.precision){case zp.HALF:return Uint16Array;case zp.SINGLE:return Float32Array;case zp.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};th=Symbol.toStringTag,Ah[th]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(Ah.prototype);var jh=class extends Ah{constructor(){super(zp.HALF)}},Mh=class extends Ah{constructor(){super(zp.SINGLE)}},Nh=class extends Ah{constructor(){super(zp.DOUBLE)}};Object.defineProperty(jh.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(Mh.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(Nh.prototype,`ArrayType`,{value:Float64Array});var Ph=class extends I{constructor(){super(F.Binary)}toString(){return`Binary`}};nh=Symbol.toStringTag,Ph[nh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(Ph.prototype);var Fh=class extends I{constructor(){super(F.LargeBinary)}toString(){return`LargeBinary`}};rh=Symbol.toStringTag,Fh[rh]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(Fh.prototype);var Ih=class extends I{constructor(){super(F.Utf8)}toString(){return`Utf8`}};ih=Symbol.toStringTag,Ih[ih]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(Ih.prototype);var Lh=class extends I{constructor(){super(F.LargeUtf8)}toString(){return`LargeUtf8`}};ah=Symbol.toStringTag,Lh[ah]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(Lh.prototype);var Rh=class extends I{constructor(){super(F.Bool)}toString(){return`Bool`}};oh=Symbol.toStringTag,Rh[oh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(Rh.prototype);var zh=class extends I{constructor(e,t,n=128){super(F.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};sh=Symbol.toStringTag,zh[sh]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(zh.prototype);var Bh=class extends I{constructor(e){super(F.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${Bp[this.unit]}>`}get ArrayType(){return this.unit===Bp.DAY?Int32Array:BigInt64Array}};ch=Symbol.toStringTag,Bh[ch]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(Bh.prototype);var Vh=class extends I{constructor(e,t){super(F.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${Vp[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};lh=Symbol.toStringTag,Vh[lh]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(Vh.prototype);var Hh=class extends I{constructor(e,t){super(F.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${Vp[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};uh=Symbol.toStringTag,Hh[uh]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(Hh.prototype);var Uh=class extends I{constructor(e){super(F.Interval),this.unit=e}toString(){return`Interval<${Hp[this.unit]}>`}};dh=Symbol.toStringTag,Uh[dh]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(Uh.prototype);var Wh=class extends I{constructor(e){super(F.Duration),this.unit=e}toString(){return`Duration<${Vp[this.unit]}>`}};fh=Symbol.toStringTag,Wh[fh]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Wh.prototype);var Gh=class extends I{constructor(e){super(F.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ph=Symbol.toStringTag,Gh[ph]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Gh.prototype);var Kh=class extends I{constructor(e){super(F.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};mh=Symbol.toStringTag,Kh[mh]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Kh.prototype);var qh=class extends I{constructor(e,t,n){super(F.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};hh=Symbol.toStringTag,qh[hh]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(qh.prototype);var Jh=class extends I{constructor(e){super(F.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};gh=Symbol.toStringTag,Jh[gh]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(Jh.prototype);var Yh=class extends I{constructor(e,t){super(F.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};_h=Symbol.toStringTag,Yh[_h]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Yh.prototype);var Xh=class extends I{constructor(e,t=!1){var n,r,i;if(super(F.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};vh=Symbol.toStringTag,Xh[vh]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(Xh.prototype);const Zh=(e=>()=>++e)(-1);var Qh=class extends I{constructor(e,t,n,r){super(F.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Zh():Rm(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};yh=Symbol.toStringTag,Qh[yh]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(Qh.prototype);function $h(e){let t=e;switch(e.typeId){case F.Decimal:return e.bitWidth/32;case F.Interval:return 1+t.unit;case F.FixedSizeList:return t.listSize;case F.FixedSizeBinary:return t.byteWidth;default:return 1}}var eg=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return tg(this,e,t)}getVisitFnByTypeId(e,t=!0){return ng(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function tg(e,t,n=!0){return typeof t==`number`?ng(e,t,n):typeof t==`string`&&t in F?ng(e,F[t],n):t&&t instanceof I?ng(e,rg(t),n):t?.type&&t.type instanceof I?ng(e,rg(t.type),n):ng(e,F.NONE,n)}function ng(e,t,n=!0){let r=null;switch(t){case F.Null:r=e.visitNull;break;case F.Bool:r=e.visitBool;break;case F.Int:r=e.visitInt;break;case F.Int8:r=e.visitInt8||e.visitInt;break;case F.Int16:r=e.visitInt16||e.visitInt;break;case F.Int32:r=e.visitInt32||e.visitInt;break;case F.Int64:r=e.visitInt64||e.visitInt;break;case F.Uint8:r=e.visitUint8||e.visitInt;break;case F.Uint16:r=e.visitUint16||e.visitInt;break;case F.Uint32:r=e.visitUint32||e.visitInt;break;case F.Uint64:r=e.visitUint64||e.visitInt;break;case F.Float:r=e.visitFloat;break;case F.Float16:r=e.visitFloat16||e.visitFloat;break;case F.Float32:r=e.visitFloat32||e.visitFloat;break;case F.Float64:r=e.visitFloat64||e.visitFloat;break;case F.Utf8:r=e.visitUtf8;break;case F.LargeUtf8:r=e.visitLargeUtf8;break;case F.Binary:r=e.visitBinary;break;case F.LargeBinary:r=e.visitLargeBinary;break;case F.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case F.Date:r=e.visitDate;break;case F.DateDay:r=e.visitDateDay||e.visitDate;break;case F.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case F.Timestamp:r=e.visitTimestamp;break;case F.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case F.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case F.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case F.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case F.Time:r=e.visitTime;break;case F.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case F.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case F.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case F.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case F.Decimal:r=e.visitDecimal;break;case F.List:r=e.visitList;break;case F.Struct:r=e.visitStruct;break;case F.Union:r=e.visitUnion;break;case F.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case F.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case F.Dictionary:r=e.visitDictionary;break;case F.Interval:r=e.visitInterval;break;case F.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case F.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case F.Duration:r=e.visitDuration;break;case F.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case F.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case F.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case F.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case F.FixedSizeList:r=e.visitFixedSizeList;break;case F.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${F[t]}'`)}function rg(e){switch(e.typeId){case F.Null:return F.Null;case F.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?F.Int8:F.Uint8;case 16:return n?F.Int16:F.Uint16;case 32:return n?F.Int32:F.Uint32;case 64:return n?F.Int64:F.Uint64}return F.Int}case F.Float:switch(e.precision){case zp.HALF:return F.Float16;case zp.SINGLE:return F.Float32;case zp.DOUBLE:return F.Float64}return F.Float;case F.Binary:return F.Binary;case F.LargeBinary:return F.LargeBinary;case F.Utf8:return F.Utf8;case F.LargeUtf8:return F.LargeUtf8;case F.Bool:return F.Bool;case F.Decimal:return F.Decimal;case F.Time:switch(e.unit){case Vp.SECOND:return F.TimeSecond;case Vp.MILLISECOND:return F.TimeMillisecond;case Vp.MICROSECOND:return F.TimeMicrosecond;case Vp.NANOSECOND:return F.TimeNanosecond}return F.Time;case F.Timestamp:switch(e.unit){case Vp.SECOND:return F.TimestampSecond;case Vp.MILLISECOND:return F.TimestampMillisecond;case Vp.MICROSECOND:return F.TimestampMicrosecond;case Vp.NANOSECOND:return F.TimestampNanosecond}return F.Timestamp;case F.Date:switch(e.unit){case Bp.DAY:return F.DateDay;case Bp.MILLISECOND:return F.DateMillisecond}return F.Date;case F.Interval:switch(e.unit){case Hp.DAY_TIME:return F.IntervalDayTime;case Hp.YEAR_MONTH:return F.IntervalYearMonth}return F.Interval;case F.Duration:switch(e.unit){case Vp.SECOND:return F.DurationSecond;case Vp.MILLISECOND:return F.DurationMillisecond;case Vp.MICROSECOND:return F.DurationMicrosecond;case Vp.NANOSECOND:return F.DurationNanosecond}return F.Duration;case F.Map:return F.Map;case F.List:return F.List;case F.Struct:return F.Struct;case F.Union:switch(e.mode){case Rp.Dense:return F.DenseUnion;case Rp.Sparse:return F.SparseUnion}return F.Union;case F.FixedSizeBinary:return F.FixedSizeBinary;case F.FixedSizeList:return F.FixedSizeList;case F.Dictionary:return F.Dictionary}throw Error(`Unrecognized type '${F[e.typeId]}'`)}eg.prototype.visitInt8=null,eg.prototype.visitInt16=null,eg.prototype.visitInt32=null,eg.prototype.visitInt64=null,eg.prototype.visitUint8=null,eg.prototype.visitUint16=null,eg.prototype.visitUint32=null,eg.prototype.visitUint64=null,eg.prototype.visitFloat16=null,eg.prototype.visitFloat32=null,eg.prototype.visitFloat64=null,eg.prototype.visitDateDay=null,eg.prototype.visitDateMillisecond=null,eg.prototype.visitTimestampSecond=null,eg.prototype.visitTimestampMillisecond=null,eg.prototype.visitTimestampMicrosecond=null,eg.prototype.visitTimestampNanosecond=null,eg.prototype.visitTimeSecond=null,eg.prototype.visitTimeMillisecond=null,eg.prototype.visitTimeMicrosecond=null,eg.prototype.visitTimeNanosecond=null,eg.prototype.visitDenseUnion=null,eg.prototype.visitSparseUnion=null,eg.prototype.visitIntervalDayTime=null,eg.prototype.visitIntervalYearMonth=null,eg.prototype.visitDuration=null,eg.prototype.visitDurationSecond=null,eg.prototype.visitDurationMillisecond=null,eg.prototype.visitDurationMicrosecond=null,eg.prototype.visitDurationNanosecond=null;const ig=new Float64Array(1),ag=new Uint32Array(ig.buffer);function og(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function sg(e){if(e!==e)return 32256;ig[0]=e;let t=(ag[1]&2147483648)>>16&65535,n=ag[1]&2146435072,r=0;return n>=1089470464?ag[0]>0?n=31744:(n=(n&2080374784)>>16,r=(ag[1]&1048575)>>10):n<=1056964608?(r=1048576+(ag[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(ag[1]&1048575)+512>>10),t|n|r&65535}var cg=class extends eg{};function lg(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const ug=(e,t,n)=>{e[t]=Math.floor(n/864e5)},dg=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},mg=({values:e},t,n)=>{e[t]=n},hg=({values:e},t,n)=>{e[t]=sg(n)},gg=(e,t,n)=>{switch(e.type.precision){case zp.HALF:return hg(e,t,n);case zp.SINGLE:case zp.DOUBLE:return mg(e,t,n)}},_g=({values:e},t,n)=>{ug(e,t,n.valueOf())},vg=({values:e},t,n)=>{e[t]=BigInt(n)},yg=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},bg=({values:e,valueOffsets:t},n,r)=>dg(e,t,n,r),xg=({values:e,valueOffsets:t},n,r)=>dg(e,t,n,Xf(r)),Sg=(e,t,n)=>{e.type.unit===Bp.DAY?_g(e,t,n):vg(e,t,n)},Cg=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},wg=({values:e},t,n)=>{e[t]=BigInt(n)},Tg=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},Eg=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},Dg=(e,t,n)=>{switch(e.type.unit){case Vp.SECOND:return Cg(e,t,n);case Vp.MILLISECOND:return wg(e,t,n);case Vp.MICROSECOND:return Tg(e,t,n);case Vp.NANOSECOND:return Eg(e,t,n)}},Og=({values:e},t,n)=>{e[t]=n},kg=({values:e},t,n)=>{e[t]=n},Ag=({values:e},t,n)=>{e[t]=n},jg=({values:e},t,n)=>{e[t]=n},Mg=(e,t,n)=>{switch(e.type.unit){case Vp.SECOND:return Og(e,t,n);case Vp.MILLISECOND:return kg(e,t,n);case Vp.MICROSECOND:return Ag(e,t,n);case Vp.NANOSECOND:return jg(e,t,n)}},Ng=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},Pg=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=e_.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=e_.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},Ig=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),Lg=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),Rg=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),zg=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),Bg=(e,t,n)=>{let r=e.type.children.map(e=>e_.getVisitFn(e.type)),i=n instanceof Map?Rg(t,n):n instanceof Xv?Lg(t,n):Array.isArray(n)?Ig(t,n):zg(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},Vg=(e,t,n)=>{e.type.mode===Rp.Dense?Hg(e,t,n):Ug(e,t,n)},Hg=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];e_.visit(i,e.valueOffsets[t],n)},Ug=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];e_.visit(i,t,n)},Wg=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},Gg=(e,t,n)=>{e.type.unit===Hp.DAY_TIME?Kg(e,t,n):qg(e,t,n)},Kg=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},qg=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Jg=({values:e},t,n)=>{e[t]=n},Yg=({values:e},t,n)=>{e[t]=n},Xg=({values:e},t,n)=>{e[t]=n},Zg=({values:e},t,n)=>{e[t]=n},Qg=(e,t,n)=>{switch(e.type.unit){case Vp.SECOND:return Jg(e,t,n);case Vp.MILLISECOND:return Yg(e,t,n);case Vp.MICROSECOND:return Xg(e,t,n);case Vp.NANOSECOND:return Zg(e,t,n)}},$g=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=e_.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${Lm(e)}: ${Lm(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new i_(this[t_],this[n_])}},i_=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[t_].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[t_].type.children.findIndex(e=>e.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[t_].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=Y_.visit(e[t_].children[n],e[n_]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[t_].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(e_.visit(e[t_].children[r],e[n_],n),Reflect.set(e,t,n))}},L=class extends eg{};function o_(e){return(t,n)=>t.getValid(n)?e(t,n):null}const s_=(e,t)=>864e5*e[t],c_=(e,t)=>null,l_=(e,t,n)=>{if(n+1>=t.length)return null;let r=Rm(t[n]),i=Rm(t[n+1]);return e.subarray(r,i)},u_=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<s_(e,t),f_=({values:e},t)=>Rm(e[t]),p_=({stride:e,values:t},n)=>t[e*n],m_=({stride:e,values:t},n)=>og(t[e*n]),h_=({values:e},t)=>e[t],g_=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),__=({values:e,valueOffsets:t},n)=>l_(e,t,n),v_=({values:e,valueOffsets:t},n)=>{let r=l_(e,t,n);return r===null?null:Jf(r)},y_=({values:e},t)=>e[t],b_=({type:e,values:t},n)=>e.precision===zp.HALF?og(t[n]):t[n],x_=(e,t)=>e.type.unit===Bp.DAY?d_(e,t):f_(e,t),S_=({values:e},t)=>1e3*Rm(e[t]),C_=({values:e},t)=>Rm(e[t]),w_=({values:e},t)=>zm(e[t],BigInt(1e3)),T_=({values:e},t)=>zm(e[t],BigInt(1e6)),E_=(e,t)=>{switch(e.type.unit){case Vp.SECOND:return S_(e,t);case Vp.MILLISECOND:return C_(e,t);case Vp.MICROSECOND:return w_(e,t);case Vp.NANOSECOND:return T_(e,t)}},D_=({values:e},t)=>e[t],O_=({values:e},t)=>e[t],k_=({values:e},t)=>e[t],A_=({values:e},t)=>e[t],j_=(e,t)=>{switch(e.type.unit){case Vp.SECOND:return D_(e,t);case Vp.MILLISECOND:return O_(e,t);case Vp.MICROSECOND:return k_(e,t);case Vp.NANOSECOND:return A_(e,t)}},M_=({values:e,stride:t},n)=>Zm.decimal(e.subarray(t*n,t*(n+1))),N_=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new Xv([c])},P_=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new ev(o.slice(i,a-i))},F_=(e,t)=>new r_(e,t),I_=(e,t)=>e.type.mode===Rp.Dense?L_(e,t):R_(e,t),L_=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Y_.visit(r,e.valueOffsets[t])},R_=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Y_.visit(r,t)},z_=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},B_=(e,t)=>e.type.unit===Hp.DAY_TIME?V_(e,t):H_(e,t),V_=({values:e},t)=>e.subarray(2*t,2*(t+1)),H_=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},U_=({values:e},t)=>e[t],W_=({values:e},t)=>e[t],G_=({values:e},t)=>e[t],K_=({values:e},t)=>e[t],q_=(e,t)=>{switch(e.type.unit){case Vp.SECOND:return U_(e,t);case Vp.MILLISECOND:return W_(e,t);case Vp.MICROSECOND:return G_(e,t);case Vp.NANOSECOND:return K_(e,t)}},J_=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new Xv([a])};L.prototype.visitNull=o_(c_),L.prototype.visitBool=o_(u_),L.prototype.visitInt=o_(y_),L.prototype.visitInt8=o_(p_),L.prototype.visitInt16=o_(p_),L.prototype.visitInt32=o_(p_),L.prototype.visitInt64=o_(h_),L.prototype.visitUint8=o_(p_),L.prototype.visitUint16=o_(p_),L.prototype.visitUint32=o_(p_),L.prototype.visitUint64=o_(h_),L.prototype.visitFloat=o_(b_),L.prototype.visitFloat16=o_(m_),L.prototype.visitFloat32=o_(p_),L.prototype.visitFloat64=o_(p_),L.prototype.visitUtf8=o_(v_),L.prototype.visitLargeUtf8=o_(v_),L.prototype.visitBinary=o_(__),L.prototype.visitLargeBinary=o_(__),L.prototype.visitFixedSizeBinary=o_(g_),L.prototype.visitDate=o_(x_),L.prototype.visitDateDay=o_(d_),L.prototype.visitDateMillisecond=o_(f_),L.prototype.visitTimestamp=o_(E_),L.prototype.visitTimestampSecond=o_(S_),L.prototype.visitTimestampMillisecond=o_(C_),L.prototype.visitTimestampMicrosecond=o_(w_),L.prototype.visitTimestampNanosecond=o_(T_),L.prototype.visitTime=o_(j_),L.prototype.visitTimeSecond=o_(D_),L.prototype.visitTimeMillisecond=o_(O_),L.prototype.visitTimeMicrosecond=o_(k_),L.prototype.visitTimeNanosecond=o_(A_),L.prototype.visitDecimal=o_(M_),L.prototype.visitList=o_(N_),L.prototype.visitStruct=o_(F_),L.prototype.visitUnion=o_(I_),L.prototype.visitDenseUnion=o_(L_),L.prototype.visitSparseUnion=o_(R_),L.prototype.visitDictionary=o_(z_),L.prototype.visitInterval=o_(B_),L.prototype.visitIntervalDayTime=o_(V_),L.prototype.visitIntervalYearMonth=o_(H_),L.prototype.visitDuration=o_(q_),L.prototype.visitDurationSecond=o_(U_),L.prototype.visitDurationMillisecond=o_(W_),L.prototype.visitDurationMicrosecond=o_(G_),L.prototype.visitDurationNanosecond=o_(K_),L.prototype.visitFixedSizeList=o_(J_),L.prototype.visitMap=o_(P_);const Y_=new L,X_=Symbol.for(`keys`),Z_=Symbol.for(`vals`),Q_=Symbol.for(`kKeysAsStrings`),$_=Symbol.for(`_kKeysAsStrings`);var ev=class{constructor(e){return this[X_]=new Xv([e.children[0]]).memoize(),this[Z_]=e.children[1],new Proxy(this,new nv)}get[Q_](){return this[$_]||(this[$_]=Array.from(this[X_].toArray(),String))}[Symbol.iterator](){return new tv(this[X_],this[Z_])}get size(){return this[X_].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[X_],t=this[Z_],n={};for(let r=-1,i=e.length;++r`${Lm(e)}: ${Lm(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},tv=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),Y_.visit(this.vals,e)]})}},nv=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Q_]}has(e,t){return e[Q_].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[Q_].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Q_].indexOf(t);if(n!==-1){let r=Y_.visit(Reflect.get(e,Z_),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Q_].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(e_.visit(Reflect.get(e,Z_),r,n),Reflect.set(e,t,n))}};Object.defineProperties(ev.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[X_]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Z_]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$_]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let rv;function iv(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const av=(e,t)=>e<0?t+e:e,ov=e=>e!==e;function sv(e){let t=typeof e;if(t!==`object`||e===null)return ov(e)?ov:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?Op(e,t):!1:e instanceof Map?lv(e):Array.isArray(e)?cv(e):e instanceof Xv?uv(e):dv(e,!0)}function cv(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return pv(e,n);case Map:return hv(e,n,n.keys());case ev:case r_:case Object:case void 0:return hv(e,n,t||Object.keys(n))}return n instanceof Xv?mv(e,n):!1}}function pv(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function vv(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):yv(new bv(n,e,t,null,gv)).subarray(0,r)),i}return n}function yv(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var bv=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return xv(e,t,i)+xv(e,r,n)+Sv(e,i>>3,r-i>>3)}function Sv(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=Cv(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=Cv(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=Cv(a.getUint8(i)),i+=1;return r}function Cv(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const wv=-1;var Tv=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return I.isSparseUnion(e)||I.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(I.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=wv&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-xv(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=$h(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(I.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===Rp.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(vv(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===F.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(vv(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[Fm.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[Fm.TYPE])&&(a[Fm.TYPE]=i.subarray(e,e+t)),(i=a[Fm.OFFSET])&&(a[Fm.OFFSET]=i.subarray(e,e+t+1))||(i=a[Fm.DATA])&&(a[Fm.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};Tv.prototype.children=Object.freeze([]);var Ev=class e extends eg{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new Tv(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=xp(e.data),i=xp(e.nullBitmap),a=yp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new Tv(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=xp(e.data),i=xp(e.nullBitmap),a=bp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new Tv(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=xp(e.data),i=xp(e.nullBitmap),a=yp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new Tv(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=xp(e.data),i=xp(e.nullBitmap),a=bp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new Tv(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length/$h(t),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length/$h(t),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length/$h(t),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length/$h(t),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length/$h(t),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=xp(e.nullBitmap),a=yp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new Tv(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=xp(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=vp(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(I.isSparseUnion(t))return new Tv(t,n,a,o,[void 0,void 0,void 0,i],r);let s=yp(e.valueOffsets);return new Tv(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=xp(t.nullBitmap),a=vp(n.indices.ArrayType,t.data),{dictionary:o=new Xv([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new Tv(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length/$h(t),nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=xp(e.nullBitmap),i=vp(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new Tv(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=xp(t.nullBitmap),{length:o=i.length/$h(n),nullCount:s=t.nullBitmap?-1:0}=t;return new Tv(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=xp(t.nullBitmap),o=yp(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new Tv(n,r,s,c,[o,void 0,a],[i])}};const Dv=new Ev;function Ov(e){return Dv.visit(e)}var kv=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function jv(e){return e.reduce((e,t)=>e+t.nullCount,0)}function Mv(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function Nv(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function Pv(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function Bv(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new bv(n,e.offset+(t||0),e.length,n,gv)){if(!i)return r;++r}return-1}function Vv(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case F.Union:break;case F.Dictionary:break;default:return Bv(e,n)}let r=Y_.getVisitFn(e),i=sv(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new kv(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new Gv(a)})}var Gv=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof Tv)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=Jv[o.typeId],r=a[0];this.isValid=e=>Fv(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,Yv[o.typeId]),this._offsets=Mv(a);break}this.data=a,this.type=o,this.stride=$h(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return Av(this.data)}get nullCount(){return jv(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${F[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(av(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Kv.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(iv(this,t,n,({data:e,_offsets:t},n,r)=>Nv(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case F.Int:case F.Float:case F.Decimal:case F.Time:case F.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return I.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(I.isDictionary(this.type)){let t=new Zv(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new Zv(this)}unmemoize(){if(I.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};qv=Symbol.toStringTag,Xv[qv]=(e=>{e.type=I.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(F).map(e=>F[e]).filter(e=>typeof e==`number`&&e!==F.NONE);for(let n of t){let t=Y_.getVisitFnByTypeId(n),r=e_.getVisitFnByTypeId(n),i=Uv.getVisitFnByTypeId(n);Jv[n]={get:t,set:r,indexOf:i},Yv[n]=Object.create(e,{isValid:{value:Iv(Fv)},get:{value:Iv(Y_.getVisitFnByTypeId(n))},set:{value:Lv(e_.getVisitFnByTypeId(n))},indexOf:{value:Rv(Uv.getVisitFnByTypeId(n))}})}return`Vector`})(Xv.prototype);var Zv=class e extends Xv{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new Xv(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},Qv=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,r){return e.prep(8,24),e.writeInt64(BigInt(r??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}},$v=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+Kp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Lp.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Nm).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Qv).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new Qv).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new dm).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Lp.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){let t=e.endObject();return t}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},ey=class e{constructor(e=[],t,n,r=Lp.V5){this.fields=e||[],this.metadata=t||new Map,n||=ry(this.fields),this.dictionaries=n,this.metadataVersion=r}get[Symbol.toStringTag](){return`Schema`}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(`, `)} }>`}select(t){let n=new Set(t),r=this.fields.filter(e=>n.has(e.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(e=>this.fields[e]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=ny(ny(new Map,this.metadata),n.metadata),a=n.fields.filter(e=>{let t=r.findIndex(t=>t.name===e.name);return~t?(r[t]=e.clone({metadata:ny(ny(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=ry(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};ey.prototype.fields=null,ey.prototype.metadata=null,ey.prototype.dictionaries=null;var ty=class e{static new(...t){let[n,r,i,a]=t;return t[0]&&typeof t[0]==`object`&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),a===void 0&&(a=t[0].metadata)),new e(`${n}`,r,i,a)}constructor(e,t,n=!1,r){this.name=e,this.type=t,this.nullable=n,this.metadata=r||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return`Field`}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,a]=t;return!t[0]||typeof t[0]!=`object`?[n=this.name,r=this.type,i=this.nullable,a=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:a=this.metadata}=t[0],e.new(n,r,i,a)}};ty.prototype.type=null,ty.prototype.name=null,ty.prototype.nullable=null,ty.prototype.metadata=null;function ny(e,t){return new Map([...e||new Map,...t||new Map])}function ry(e,t=new Map){for(let n=-1,r=e.length;++n0&&ry(i.children,t)}return t}var iy=$p,ay=Qp,oy=class{static decode(e){e=new ay(xp(e));let t=$v.getRootAsFooter(e),n=ey.decode(t.schema(),new Map,t.version());return new sy(n,t)}static encode(e){let t=new iy,n=ey.encode(t,e.schema);$v.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())cy.encode(t,n);let r=t.endVector();$v.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())cy.encode(t,n);let i=t.endVector();return $v.startFooter(t),$v.addSchema(t,n),$v.addVersion(t,Lp.V5),$v.addRecordBatches(t,r),$v.addDictionaries(t,i),$v.finishFooterBuffer(t,$v.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=Lp.V5,n,r){this.schema=e,this.version=t,n&&(this._recordBatches=n),r&&(this._dictionaryBatches=r)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return Vf(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(ly);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return kp.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return kp.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return Vf(this,void 0,void 0,function*(){return yield this.abort(e),ly})}return(e){return Vf(this,void 0,void 0,function*(){return yield this.close(),ly})}read(e){return Vf(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return Vf(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,t)=>{this.resolvers.push({resolve:e,reject:t})}):Promise.resolve(ly)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},py=class extends fy{write(e){if((e=xp(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Jf(this.toUint8Array(!0)):this.toUint8Array(!1).then(Jf)}toUint8Array(e=!1){return e?_p(this._values)[0]:(()=>Vf(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=Kf(this),c;c=yield s.next(),e=c.done,!e;o=!0){r=c.value,o=!1;let e=r;i.push(e),a+=e.byteLength}}catch(e){t={error:e}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}return _p(i,a)[0]}))()}},my=class{constructor(e){e&&(this.source=new gy(kp.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},hy=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof py?this.source=new _y(kp.fromAsyncIterable(t)):fp(t)?this.source=new _y(kp.fromNodeStream(t)):up(t)?this.source=new _y(kp.fromDOMStream(t)):sp(t)?this.source=new _y(kp.fromDOMStream(t.body)):np(t)?this.source=new _y(kp.fromIterable(t)):(tp(t)||rp(t))&&(this.source=new _y(kp.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},gy=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,`peek`).value}read(e){return this.next(e,`read`).value}next(e,t=`read`){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||ly)}return(e){return Object.create(this.source.return&&this.source.return(e)||ly)}},_y=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return Vf(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return Vf(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return Vf(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return Vf(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return Vf(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||ly;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return Vf(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||ly;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},vy=class extends my{constructor(e,t){super(),this.position=0,this.buffer=xp(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eVf(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return Vf(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return Vf(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${xy(this.buffer[3])} ${xy(this.buffer[2])} ${xy(this.buffer[1])} ${xy(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;n0&&this.readData(e,n)||new Uint8Array}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}},ky=class extends Oy{constructor(e,t,n,r,i){super(new Uint8Array,t,n,r,i),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array:yv(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return vp(Uint8Array,vp(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return vp(Uint8Array,vp(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return I.isTimestamp(e)||(I.isInt(e)||I.isTime(e))&&e.bitWidth===64||I.isDuration(e)||I.isDate(e)&&e.unit===Bp.MILLISECOND?vp(Uint8Array,Ey.convertArray(n[t])):I.isDecimal(e)?vp(Uint8Array,Dy.convertArray(n[t])):I.isBinary(e)||I.isLargeBinary(e)||I.isFixedSizeBinary(e)?Ay(n[t]):I.isBool(e)?yv(n[t]):I.isUtf8(e)||I.isLargeUtf8(e)?Xf(n[t].join(``)):vp(Uint8Array,vp(e.ArrayType,n[t].map(e=>+e)))}};function Ay(e){let t=e.join(``),n=new Uint8Array(t.length/2);for(let e=0;e>1]=Number.parseInt(t.slice(e,e+2),16);return n}var B=class extends eg{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function jy(e,t){return t instanceof e.constructor}function My(e,t){return e===t||jy(e,t)}function Ny(e,t){return e===t||jy(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Py(e,t){return e===t||jy(e,t)&&e.precision===t.precision}function Fy(e,t){return e===t||jy(e,t)&&e.byteWidth===t.byteWidth}function Iy(e,t){return e===t||jy(e,t)&&e.unit===t.unit}function Ly(e,t){return e===t||jy(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Ry(e,t){return e===t||jy(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function zy(e,t){return e===t||jy(e,t)&&e.children.length===t.children.length&&qy.compareManyFields(e.children,t.children)}function By(e,t){return e===t||jy(e,t)&&e.children.length===t.children.length&&qy.compareManyFields(e.children,t.children)}function Vy(e,t){return e===t||jy(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&qy.compareManyFields(e.children,t.children)}function Hy(e,t){return e===t||jy(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&qy.visit(e.indices,t.indices)&&qy.visit(e.dictionary,t.dictionary)}function Uy(e,t){return e===t||jy(e,t)&&e.unit===t.unit}function Wy(e,t){return e===t||jy(e,t)&&e.unit===t.unit}function Gy(e,t){return e===t||jy(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&qy.compareManyFields(e.children,t.children)}function Ky(e,t){return e===t||jy(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&qy.compareManyFields(e.children,t.children)}B.prototype.visitNull=My,B.prototype.visitBool=My,B.prototype.visitInt=Ny,B.prototype.visitInt8=Ny,B.prototype.visitInt16=Ny,B.prototype.visitInt32=Ny,B.prototype.visitInt64=Ny,B.prototype.visitUint8=Ny,B.prototype.visitUint16=Ny,B.prototype.visitUint32=Ny,B.prototype.visitUint64=Ny,B.prototype.visitFloat=Py,B.prototype.visitFloat16=Py,B.prototype.visitFloat32=Py,B.prototype.visitFloat64=Py,B.prototype.visitUtf8=My,B.prototype.visitLargeUtf8=My,B.prototype.visitBinary=My,B.prototype.visitLargeBinary=My,B.prototype.visitFixedSizeBinary=Fy,B.prototype.visitDate=Iy,B.prototype.visitDateDay=Iy,B.prototype.visitDateMillisecond=Iy,B.prototype.visitTimestamp=Ly,B.prototype.visitTimestampSecond=Ly,B.prototype.visitTimestampMillisecond=Ly,B.prototype.visitTimestampMicrosecond=Ly,B.prototype.visitTimestampNanosecond=Ly,B.prototype.visitTime=Ry,B.prototype.visitTimeSecond=Ry,B.prototype.visitTimeMillisecond=Ry,B.prototype.visitTimeMicrosecond=Ry,B.prototype.visitTimeNanosecond=Ry,B.prototype.visitDecimal=My,B.prototype.visitList=zy,B.prototype.visitStruct=By,B.prototype.visitUnion=Vy,B.prototype.visitDenseUnion=Vy,B.prototype.visitSparseUnion=Vy,B.prototype.visitDictionary=Hy,B.prototype.visitInterval=Uy,B.prototype.visitIntervalDayTime=Uy,B.prototype.visitIntervalYearMonth=Uy,B.prototype.visitDuration=Wy,B.prototype.visitDurationSecond=Wy,B.prototype.visitDurationMillisecond=Wy,B.prototype.visitDurationMicrosecond=Wy,B.prototype.visitDurationNanosecond=Wy,B.prototype.visitFixedSizeList=Gy,B.prototype.visitMap=Ky;const qy=new B;function Jy(e,t){return qy.compareSchemas(e,t)}function Yy(e,t){return Xy(e,t.map(e=>e.data.concat()))}function Xy(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((e,t)=>Math.max(e,t.length),0)},a=0,o=0,s=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(o=1/0,s=-1;++s0&&(r[a++]=Ov({type:new Kh(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new tb(e,t))]}function Zy(e,t,n,r,i){var a;let o=(t+63&-64)>>3;for(let s=-1,c=r.length;++s=t)l===t?n[s]=c:(n[s]=c.slice(0,t),i.numBatches=Math.max(i.numBatches,r[s].unshift(c.slice(t,l-t))));else{let r=e[s];e[s]=r.clone({nullable:!0}),n[s]=(a=c?._changeLengthAndBackfillNullBitmap(t))??Ov({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var Qy,$y=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new ey([]),this._offsets=[0],this;let i,a;t[0]instanceof ey&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof tb)return[t];if(t instanceof e)return t.batches;if(t instanceof Tv){if(t.type instanceof Kh)return[new tb(new ey(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>o(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>o(e));else if(typeof t==`object`){let e=Object.keys(t),n=e.map(e=>new Xv([t[e]])),r=i??new ey(e.map((e,t)=>new ty(String(e),n[t].type,n[t].nullable))),[,a]=Yy(r,n);return a.length===0?[new tb(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new ey([]),!(i instanceof ey))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof tb))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!Jy(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??Mv(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=jv(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(av(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Kv.visit(new Xv(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, - `)}\n]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:e})=>e));return new e(n,r.map(e=>new tb(n,e)))}slice(t,n){let r=this.schema;[t,n]=iv({length:this.numRows},t,n);let i=Nv(this.data,this._offsets,t,n);return new e(r,i.map(e=>new tb(r,e)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&et.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],r=Ov({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new Xv(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)?.findIndex(t=>t.name===e),t)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(t));[e[t],o[t]]=[a,n],[r,i]=Yy(r,o)}return new e(r,i)}select(e){let t=this.schema.fields.reduce((e,t,n)=>e.set(t.name,n),new Map);return this.selectAt(e.map(e=>t.get(e)).filter(e=>e>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(e=>e.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((e,t,r)=>{let[i,a]=e,o=n.findIndex(e=>e.name===t.name);return~o?a[o]=r:i.push(r),e},[[],[]]),a=this.schema.assign(t.schema),o=[...n.map((e,t)=>[t,i[t]]).map(([e,n])=>n===void 0?this.getChildAt(e):t.getChildAt(n)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new e(...Yy(a,o))}};Qy=Symbol.toStringTag,$y[Qy]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Iv(Fv),e.get=Iv(Y_.getVisitFn(F.Struct)),e.set=Lv(e_.getVisitFn(F.Struct)),e.indexOf=Rv(Uv.getVisitFn(F.Struct)),`Table`))($y.prototype);var eb,tb=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof ey)||([,this.data=Ov({nullCount:0,type:new Kh(this.schema.fields),children:this.schema.fields.map(e=>Ov({type:e.type,nullCount:0}))})]=e,!(this.data instanceof Tv)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=nb(this.schema,this.data.children);break;case 1:{let[t]=e,{fields:n,children:r,length:i}=Object.keys(t).reduce((e,n,r)=>(e.children[r]=t[n],e.length=Math.max(e.length,t[n].length),e.fields[r]=ty.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new ey(n),o=Ov({type:new Kh(n),length:i,children:r,nullCount:0});[this.schema,this.data]=nb(a,o.children,i);break}default:throw TypeError(`RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.`)}}get dictionaries(){return this._dictionaries||=rb(this.schema.fields,this.data.children)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return Y_.visit(this.data,e)}at(e){return this.get(av(e,this.numRows))}set(e,t){return e_.visit(this.data,e,t)}indexOf(e,t){return Uv.visit(this.data,e,t)}[Symbol.iterator](){return Kv.visit(new Xv([this.data]))}toArray(){return[...this]}concat(...e){return new $y(this.schema,[this,...e])}slice(t,n){let[r]=new Xv([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)?.findIndex(t=>t.name===e))}getChildAt(e){return e>-1&&et.name===e),t)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new e(n,Ov({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(e=>this.data.children[e]).filter(Boolean),i=Ov({type:new Kh(n.fields),length:this.numRows,children:r});return new e(n,i)}};eb=Symbol.toStringTag,tb[eb]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(tb.prototype);function nb(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){var r;let i=[...e.fields],a=[...t],o=(n+63&-64)>>3;for(let[s,c]of e.fields.entries()){let e=t[s];(!e||e.length!==n)&&(i[s]=c.clone({nullable:!0}),a[s]=(r=e?._changeLengthAndBackfillNullBitmap(n))??Ov({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),Ov({type:new Kh(i),length:n,children:a})]}function rb(e,t,n=new Map){var r,i;if(((r=e?.length)??0)>0&&e?.length===t?.length)for(let r=-1,a=e.length;++rOv({type:e.type})),n=Ov({type:new Kh(e.fields),nullCount:0,children:t});super(e,n)}},ab=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+Kp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Lp.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):Pm.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt(`0`)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new dm).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Lp.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,Pm.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt(`0`))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){let t=e.endObject();return t}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(t,n,r,i,a,o){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,a),e.addCustomMetadata(t,o),e.endMessage(t)}},ob=class extends eg{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Tm.startNull(t),Tm.endNull(t)}visitInt(e,t){return lm.startInt(t),lm.addBitWidth(t,e.bitWidth),lm.addIsSigned(t,e.isSigned),lm.endInt(t)}visitFloat(e,t){return ym.startFloatingPoint(t),ym.addPrecision(t,e.precision),ym.endFloatingPoint(t)}visitBinary(e,t){return fm.startBinary(t),fm.endBinary(t)}visitLargeBinary(e,t){return xm.startLargeBinary(t),xm.endLargeBinary(t)}visitBool(e,t){return pm.startBool(t),pm.endBool(t)}visitUtf8(e,t){return Am.startUtf8(t),Am.endUtf8(t)}visitLargeUtf8(e,t){return Sm.startLargeUtf8(t),Sm.endLargeUtf8(t)}visitDecimal(e,t){return hm.startDecimal(t),hm.addScale(t,e.scale),hm.addPrecision(t,e.precision),hm.addBitWidth(t,e.bitWidth),hm.endDecimal(t)}visitDate(e,t){return mm.startDate(t),mm.addUnit(t,e.unit),mm.endDate(t)}visitTime(e,t){return Dm.startTime(t),Dm.addUnit(t,e.unit),Dm.addBitWidth(t,e.bitWidth),Dm.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return Om.startTimestamp(t),Om.addUnit(t,e.unit),n!==void 0&&Om.addTimezone(t,n),Om.endTimestamp(t)}visitInterval(e,t){return bm.startInterval(t),bm.addUnit(t,e.unit),bm.endInterval(t)}visitDuration(e,t){return gm.startDuration(t),gm.addUnit(t,e.unit),gm.endDuration(t)}visitList(e,t){return Cm.startList(t),Cm.endList(t)}visitStruct(e,t){return Em.startStruct_(t),Em.endStruct_(t)}visitUnion(e,t){km.startTypeIdsVector(t,e.typeIds.length);let n=km.createTypeIdsVector(t,e.typeIds);return km.startUnion(t),km.addMode(t,e.mode),km.addTypeIds(t,n),km.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return um.startDictionaryEncoding(t),um.addId(t,BigInt(e.id)),um.addIsOrdered(t,e.isOrdered),n!==void 0&&um.addIndexType(t,n),um.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return _m.startFixedSizeBinary(t),_m.addByteWidth(t,e.byteWidth),_m.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return vm.startFixedSizeList(t),vm.addListSize(t,e.listSize),vm.endFixedSizeList(t)}visitMap(e,t){return wm.startMap(t),wm.addKeysSorted(t,e.keysSorted),wm.endMap(t)}};const sb=new ob;function cb(e,t=new Map){return new ey(db(e,t),_b(e.metadata),t)}function lb(e){return new Cb(e.count,pb(e.columns),mb(e.columns))}function ub(e){return new wb(lb(e.data),e.id,e.isDelta)}function db(e,t){return(e.fields||[]).filter(Boolean).map(e=>ty.fromJSON(e,t))}function fb(e,t){return(e.children||[]).filter(Boolean).map(e=>ty.fromJSON(e,t))}function pb(e){return(e||[]).reduce((e,t)=>[...e,new Eb(t.count,hb(t.VALIDITY)),...pb(t.children)],[])}function mb(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function gb(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=yb(e,fb(e,t)),i=new ty(e.name,o,e.nullable,_b(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?vb(r):new wh,s=new Qh(t.get(n),r,n,a.isOrdered),i=new ty(e.name,s,e.nullable,_b(e.metadata))):(r=(r=a.indexType)?vb(r):new wh,t.set(n,o=yb(e,fb(e,t))),s=new Qh(o,r,n,a.isOrdered),i=new ty(e.name,s,e.nullable,_b(e.metadata))),i||null}function _b(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function vb(e){return new xh(e.isSigned,e.bitWidth)}function yb(e,t){let n=e.type.name;switch(n){case`NONE`:return new bh;case`null`:return new bh;case`binary`:return new Ph;case`largebinary`:return new Fh;case`utf8`:return new Ih;case`largeutf8`:return new Lh;case`bool`:return new Rh;case`list`:return new Gh((t||[])[0]);case`struct`:return new Kh(t||[]);case`struct_`:return new Kh(t||[])}switch(n){case`int`:{let t=e.type;return new xh(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new Ah(zp[t.precision])}case`decimal`:{let t=e.type;return new zh(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new Bh(Bp[t.unit])}case`time`:{let t=e.type;return new Vh(Vp[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new Hh(Vp[t.unit],t.timezone)}case`interval`:{let t=e.type;return new Uh(Hp[t.unit])}case`duration`:{let t=e.type;return new Wh(Vp[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new qh(Rp[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new Jh(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Yh(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new Xh((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var bb=$p,xb=Qp,Sb=class e{static fromJSON(t,n){let r=new e(0,Lp.V5,n);return r._createHeader=Db(t,n),r}static decode(t){t=new xb(xp(t));let n=ab.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=Ob(n,a),o}static encode(e){let t=new bb,n=-1;return e.isSchema()?n=ey.encode(t,e.header()):e.isRecordBatch()?n=Cb.encode(t,e.header()):e.isDictionaryBatch()&&(n=wb.encode(t,e.header())),ab.startMessage(t),ab.addVersion(t,Lp.V5),ab.addHeader(t,n),ab.addHeaderType(t,e.headerType),ab.addBodyLength(t,BigInt(e.bodyLength)),ab.finishMessageBuffer(t,ab.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof ey)return new e(0,Lp.V5,Pm.Schema,t);if(t instanceof Cb)return new e(n,Lp.V5,Pm.RecordBatch,t);if(t instanceof wb)return new e(n,Lp.V5,Pm.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Pm.Schema}isRecordBatch(){return this.headerType===Pm.RecordBatch}isDictionaryBatch(){return this.headerType===Pm.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=Rm(e)}},Cb=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=Rm(e)}},wb=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=Rm(t)}},Tb=class{constructor(e,t){this.offset=Rm(e),this.length=Rm(t)}},Eb=class{constructor(e,t){this.length=Rm(e),this.nullCount=Rm(t)}};function Db(e,t){return(()=>{switch(t){case Pm.Schema:return ey.fromJSON(e);case Pm.RecordBatch:return Cb.fromJSON(e);case Pm.DictionaryBatch:return wb.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${Pm[t]}, type: ${t} }`)})}function Ob(e,t){return(()=>{switch(t){case Pm.Schema:return ey.decode(e.header(new Nm),new Map,e.version());case Pm.RecordBatch:return Cb.decode(e.header(new am),e.version());case Pm.DictionaryBatch:return wb.decode(e.header(new om),e.version())}throw Error(`Unrecognized Message type: { name: ${Pm[t]}, type: ${t} }`)})}ty.encode=Ub,ty.decode=Rb,ty.fromJSON=gb,ey.encode=Hb,ey.decode=kb,ey.fromJSON=cb,Cb.encode=Wb,Cb.decode=Ab,Cb.fromJSON=lb,wb.encode=Gb,wb.decode=jb,wb.fromJSON=ub,Eb.encode=Kb,Eb.decode=Nb,Tb.encode=qb,Tb.decode=Mb;function kb(e,t=new Map,n=Lp.V5){let r=Ib(e,t);return new ey(r,zb(e),t,n)}function Ab(e,t=Lp.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new Cb(e.length(),Pb(e),Fb(e,t))}function jb(e,t=Lp.V5){return new wb(Cb.decode(e.data(),t),e.id(),e.isDelta())}function Mb(e){return new Tb(e.offset(),e.length())}function Nb(e){return new Eb(e.length(),e.nullCount())}function Pb(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rty.encode(e,t));Nm.startFieldsVector(e,n.length);let r=Nm.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?Nm.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return dm.startKeyValue(e),dm.addKey(e,r),dm.addValue(e,i),dm.endKeyValue(e)})):-1;return Nm.startSchema(e),Nm.addFields(e,r),Nm.addEndianness(e,Jb?sm.Little:sm.Big),i!==-1&&Nm.addCustomMetadata(e,i),Nm.endSchema(e)}function Ub(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;I.isDictionary(a)?(o=a.dictionary.typeId,i=sb.visit(a,e),r=sb.visit(a.dictionary,e)):r=sb.visit(a,e);let s=(a.children||[]).map(t=>ty.encode(e,t)),c=Mm.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?Mm.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return dm.startKeyValue(e),dm.addKey(e,r),dm.addValue(e,i),dm.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),Mm.startField(e),Mm.addType(e,r),Mm.addTypeType(e,o),Mm.addChildren(e,c),Mm.addNullable(e,!!t.nullable),n!==-1&&Mm.addName(e,n),i!==-1&&Mm.addDictionary(e,i),l!==-1&&Mm.addCustomMetadata(e,l),Mm.endField(e)}function Wb(e,t){let n=t.nodes||[],r=t.buffers||[];am.startNodesVector(e,n.length);for(let t of n.slice().reverse())Eb.encode(e,t);let i=e.endVector();am.startBuffersVector(e,r.length);for(let t of r.slice().reverse())Tb.encode(e,t);let a=e.endVector();return am.startRecordBatch(e),am.addLength(e,BigInt(t.length)),am.addNodes(e,i),am.addBuffers(e,a),am.endRecordBatch(e)}function Gb(e,t){let n=Cb.encode(e,t.data);return om.startDictionaryBatch(e),om.addId(e,BigInt(t.id)),om.addIsDelta(e,t.isDelta),om.addData(e,n),om.endDictionaryBatch(e)}function Kb(e,t){return im.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function qb(e,t){return rm.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const Jb=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Yb=e=>`Expected ${Pm[e]} Message in stream, but was null or length 0.`,Xb=e=>`Header pointer of flatbuffer-encoded ${Pm[e]} Message is null or length 0.`,Zb=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Qb=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var $b=class{constructor(e){this.source=e instanceof my?e:new my(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?ly:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Yb(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=xp(this.source.read(e));if(t.byteLength[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Yb(e));return t.value}readSchema(){let e=Pm.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(Xb(e));return n}};const nx=4,rx=`ARROW1`,ix=new Uint8Array(6);for(let e=0;e<6;e+=1)ix[e]=rx.codePointAt(e);function ax(e,t=0){for(let n=-1,r=ix.length;++nthis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return kp.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kp.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}static from(t){return t instanceof e?t:ip(t)?Cx(t):op(t)?Ex(t):tp(t)?(()=>Vf(this,void 0,void 0,function*(){return yield e.from(yield t)}))():sp(t)||up(t)||fp(t)||rp(t)?Tx(new hy(t)):wx(new my(t))}static readAll(t){return t instanceof e?t.isSync()?xx(t):Sx(t):ip(t)||ArrayBuffer.isView(t)||np(t)||ap(t)?xx(t):Sx(t)}},ux=class extends lx{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Wf(this,arguments,function*(){yield Uf(yield*Gf(Kf(this[Symbol.iterator]())))})}},dx=class extends lx{constructor(e){super(e),this._impl=e}readAll(){return Vf(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=Kf(this),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw Error(`AsyncRecordBatchStreamReader is not Iterable`)}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},fx=class extends ux{constructor(e){super(e),this._impl=e}},px=class extends dx{constructor(e){super(e),this._impl=e}},mx=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let n=this._loadVectors(e,t,this.schema.fields),r=Ov({type:new Kh(this.schema.fields),length:e.length,children:n});return new tb(this.schema,r)}_loadDictionaryBatch(e,t){let{id:n,isDelta:r}=e,{dictionaries:i,schema:a}=this,o=i.get(n),s=a.dictionaries.get(n),c=this._loadVectors(e.data,t,[s]);return(o&&r?o.concat(new Xv(c)):new Xv(c)).memoize()}_loadVectors(e,t,n){return new Oy(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},hx=class extends mx{constructor(e,t){super(t),this._reader=ip(e)?new tx(this._handle=e):new $b(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=bx(this,e),(this.schema||=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):ly}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):ly}next(){if(this.closed)return ly;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ib(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},gx=class extends mx{constructor(e,t){super(t),this._reader=new ex(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Vf(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return Vf(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=bx(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return Vf(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):ly})}return(e){return Vf(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):ly})}next(){return Vf(this,void 0,void 0,function*(){if(this.closed)return ly;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ib(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return Vf(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},_x=class extends hx{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof vy?e:new vy(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)?.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(Pm.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(Pm.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}}_readFooter(){let{_handle:e}=this,t=e.size-sx,n=e.readInt32(t),r=e.readAt(t-n,n);return oy.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Vf(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return Vf(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)?.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(Pm.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null})}_readDictionaryBatch(e){return Vf(this,void 0,void 0,function*(){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(Pm.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}})}_readFooter(){return Vf(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-sx,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return oy.decode(r)})}_readNextMessageAndValidate(e){return Vf(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?ax(t)?new fx(new _x(e.read())):new ux(new hx(e)):new ux(new hx(function*(){}()))}function Tx(e){return Vf(this,void 0,void 0,function*(){let t=yield e.peek(ox+7&-8);return t&&t.byteLength>=4?ax(t)?new fx(new _x(yield e.read())):new dx(new gx(e)):new dx(new gx(function(){return Wf(this,arguments,function*(){})}()))})}function Ex(e){return Vf(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new yy(e,t);return t>=cx&&ax(yield n.readAt(0,ox+7&-8))?new px(new vx(n)):new dx(new gx(n))})}var Dx=class e extends eg{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof tb?e.data.children:e.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof Xv)return this.visitMany(e.data),this;let{type:t}=e;if(!I.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(I.isUnion(t))this.nodes.push(new Eb(n,0));else{let{nullCount:r}=e;I.isNull(t)||Ox.call(this,r<=0?new Uint8Array:vv(e.offset,n,e.nullBitmap)),this.nodes.push(new Eb(n,r))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Ox(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Tb(this._byteLength,t)),this._byteLength+=t,this}function kx(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(Ox.call(this,i),n.mode===Rp.Sparse)return Px.call(this,e);if(n.mode===Rp.Dense){if(e.offset<=0)return Ox.call(this,a),Px.call(this,e);{let o=new Int32Array(r),s=Object.create(null),c=Object.create(null);for(let e,n,l=-1;++l{let i=n.typeIds[t],a=s[i],o=c[i];return e.slice(a,Math.min(r,o))}))}}return this}function Ax(e){let t;return e.nullCount>=e.length?Ox.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?Ox.call(this,vv(e.offset,e.length,t)):Ox.call(this,yv(e.values))}function jx(e){return Ox.call(this,e.values.subarray(0,e.length*e.stride))}function Mx(e){let{length:t,values:n,valueOffsets:r}=e,i=Rm(r[0]),a=Rm(r[t]),o=Math.min(a-i,n.byteLength-i);return Ox.call(this,Dp(-i,t+1,r)),Ox.call(this,n.subarray(i,i+o)),this}function Nx(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return Ox.call(this,Dp(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function Px(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Dx.prototype.visitBool=Ax,Dx.prototype.visitInt=jx,Dx.prototype.visitFloat=jx,Dx.prototype.visitUtf8=Mx,Dx.prototype.visitLargeUtf8=Mx,Dx.prototype.visitBinary=Mx,Dx.prototype.visitLargeBinary=Mx,Dx.prototype.visitFixedSizeBinary=jx,Dx.prototype.visitDate=jx,Dx.prototype.visitTimestamp=jx,Dx.prototype.visitTime=jx,Dx.prototype.visitDecimal=jx,Dx.prototype.visitList=Nx,Dx.prototype.visitStruct=Px,Dx.prototype.visitUnion=kx,Dx.prototype.visitInterval=jx,Dx.prototype.visitDuration=jx,Dx.prototype.visitFixedSizeList=Nx,Dx.prototype.visitMap=Nx;var Fx=class extends dy{static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}constructor(e){super(),this._position=0,this._started=!1,this._sink=new py,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,ep(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy==`boolean`?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat==`boolean`?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return tp(e)?e.then(e=>this.writeAll(e)):rp(e)?zx(this,e):Rx(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof py?this._sink=e:(this._sink=new py,e&&lp(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&dp(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!Jy(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null||e instanceof $y&&!(t=e.schema)||e instanceof tb&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!Jy(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof tb?e instanceof ib||this._writeRecordBatch(e):e instanceof $y?this.writeAll(e.batches):np(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=Sb.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===Pm.RecordBatch?this._recordBatchBlocks.push(new cy(o,e.bodyLength,this._position)):e.headerType===Pm.DictionaryBatch&&this._dictionaryBlocks.push(new cy(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),i>0&&this._write(r),this._writePadding(s)}_write(e){if(this._started){let t=xp(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(Sb.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ix)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=Dx.assemble(e),a=new Cb(e.numRows,n,r),o=Sb.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(e,t,n=!1){let{byteLength:r,nodes:i,bufferRegions:a,buffers:o}=Dx.assemble(new Xv([e])),s=new Cb(e.length,i,a),c=new wb(s,t,n),l=Sb.from(c,r);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,r;for(let i=-1,a=e.length;++i0&&(this._write(t),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(e){var t,n;for(let[r,i]of e.dictionaries){let e=(t=i?.data)??[],a=this._seenDictionaries.get(r),o=(n=this._dictionaryDeltaOffsets.get(r))??0;if(!a||a.data[0]!==e[0])for(let[t,n]of e.entries())this._writeDictionaryBatch(n,r,t>0);else if(or.writeAll(e)):rp(t)?zx(r,t):Rx(r,t)}},Lx=class e extends Fx{static writeAll(t){let n=new e;return tp(t)?t.then(e=>n.writeAll(e)):rp(t)?zx(n,t):Rx(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw Error(`The Arrow File format does not support replacement dictionaries. `);return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=oy.encode(new oy(e,Lp.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function Rx(e,t){let n=t;t instanceof $y&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function zx(e,t){return Vf(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=Kf(t);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;let t=c;e.write(t)}}catch(e){o={error:e}}finally{try{!n&&!a&&(s=r.return)&&(yield s.call(r))}finally{if(o)throw o.error}}return e.finish()})}function Bx(e,t=`stream`){return(t===`stream`?Ix:Lx).writeAll(e).toUint8Array(!0)}var Vx=Object.create,Hx=Object.defineProperty,Ux=Object.getOwnPropertyDescriptor,Wx=Object.getOwnPropertyNames,Gx=Object.getPrototypeOf,Kx=Object.prototype.hasOwnProperty,qx=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jx=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Wx(t))!Kx.call(e,i)&&i!==n&&Hx(e,i,{get:()=>t[i],enumerable:!(r=Ux(t,i))||r.enumerable});return e},Yx=(e,t,n)=>(n=e==null?{}:Vx(Gx(e)),Jx(t||!e||!e.__esModule?Hx(n,`default`,{value:e,enumerable:!0}):n,e)),Xx=qx((e,t)=>{t.exports=Worker}),Zx=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.AUTOMATIC=1]=`AUTOMATIC`,e[e.READ_ONLY=2]=`READ_ONLY`,e[e.READ_WRITE=3]=`READ_WRITE`,e))(Zx||{}),Qx=(e=>(e[e.IDENTIFIER=0]=`IDENTIFIER`,e[e.NUMERIC_CONSTANT=1]=`NUMERIC_CONSTANT`,e[e.STRING_CONSTANT=2]=`STRING_CONSTANT`,e[e.OPERATOR=3]=`OPERATOR`,e[e.KEYWORD=4]=`KEYWORD`,e[e.COMMENT=5]=`COMMENT`,e))(Qx||{}),$x=(e=>(e[e.NONE=0]=`NONE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARNING=3]=`WARNING`,e[e.ERROR=4]=`ERROR`,e))($x||{}),eS=(e=>(e[e.NONE=0]=`NONE`,e[e.CONNECT=1]=`CONNECT`,e[e.DISCONNECT=2]=`DISCONNECT`,e[e.OPEN=3]=`OPEN`,e[e.QUERY=4]=`QUERY`,e[e.INSTANTIATE=5]=`INSTANTIATE`,e))(eS||{}),tS=(e=>(e[e.NONE=0]=`NONE`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`,e[e.START=3]=`START`,e[e.RUN=4]=`RUN`,e[e.CAPTURE=5]=`CAPTURE`,e))(tS||{}),nS=(e=>(e[e.NONE=0]=`NONE`,e[e.WEB_WORKER=1]=`WEB_WORKER`,e[e.NODE_WORKER=2]=`NODE_WORKER`,e[e.BINDINGS=3]=`BINDINGS`,e[e.ASYNC_DUCKDB=4]=`ASYNC_DUCKDB`,e))(nS||{}),rS=class{log(e){}},iS=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},aS=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(aS||{}),oS=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=lx.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new $y(n)}async send(e,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let n=await this._bindings.startPendingQuery(this._conn,e,t);for(;n==null;)n=await this._bindings.pollPendingQuery(this._conn);let r=new sS(this._bindings,this._conn,n),i=await lx.from(r);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new cS(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=Bx(e,`stream`);await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},sS=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight==null?e=await this.db.fetchQueryResults(this.conn):(e=await this._inFlight,this._inFlight=null),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},cS=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=lx.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new $y(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new sS(this.bindings,this.connectionId,t),r=await lx.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},lS=(e=>(e.CANCEL_PENDING_QUERY=`CANCEL_PENDING_QUERY`,e.CLOSE_PREPARED=`CLOSE_PREPARED`,e.COLLECT_FILE_STATISTICS=`COLLECT_FILE_STATISTICS`,e.REGISTER_OPFS_FILE_NAME=`REGISTER_OPFS_FILE_NAME`,e.CONNECT=`CONNECT`,e.COPY_FILE_TO_BUFFER=`COPY_FILE_TO_BUFFER`,e.COPY_FILE_TO_PATH=`COPY_FILE_TO_PATH`,e.CREATE_PREPARED=`CREATE_PREPARED`,e.DISCONNECT=`DISCONNECT`,e.DROP_FILE=`DROP_FILE`,e.DROP_FILES=`DROP_FILES`,e.EXPORT_FILE_STATISTICS=`EXPORT_FILE_STATISTICS`,e.FETCH_QUERY_RESULTS=`FETCH_QUERY_RESULTS`,e.FLUSH_FILES=`FLUSH_FILES`,e.GET_FEATURE_FLAGS=`GET_FEATURE_FLAGS`,e.GET_TABLE_NAMES=`GET_TABLE_NAMES`,e.GET_VERSION=`GET_VERSION`,e.GLOB_FILE_INFOS=`GLOB_FILE_INFOS`,e.INSERT_ARROW_FROM_IPC_STREAM=`INSERT_ARROW_FROM_IPC_STREAM`,e.INSERT_CSV_FROM_PATH=`IMPORT_CSV_FROM_PATH`,e.INSERT_JSON_FROM_PATH=`IMPORT_JSON_FROM_PATH`,e.INSTANTIATE=`INSTANTIATE`,e.OPEN=`OPEN`,e.PING=`PING`,e.POLL_PENDING_QUERY=`POLL_PENDING_QUERY`,e.REGISTER_FILE_BUFFER=`REGISTER_FILE_BUFFER`,e.REGISTER_FILE_HANDLE=`REGISTER_FILE_HANDLE`,e.REGISTER_FILE_URL=`REGISTER_FILE_URL`,e.RESET=`RESET`,e.RUN_PREPARED=`RUN_PREPARED`,e.RUN_QUERY=`RUN_QUERY`,e.SEND_PREPARED=`SEND_PREPARED`,e.START_PENDING_QUERY=`START_PENDING_QUERY`,e.TOKENIZE=`TOKENIZE`,e))(lS||{}),uS=(e=>(e.CONNECTION_INFO=`CONNECTION_INFO`,e.ERROR=`ERROR`,e.FEATURE_FLAGS=`FEATURE_FLAGS`,e.FILE_BUFFER=`FILE_BUFFER`,e.FILE_INFOS=`FILE_INFOS`,e.FILE_SIZE=`FILE_SIZE`,e.FILE_STATISTICS=`FILE_STATISTICS`,e.INSTANTIATE_PROGRESS=`INSTANTIATE_PROGRESS`,e.LOG=`LOG`,e.OK=`OK`,e.PREPARED_STATEMENT_ID=`PREPARED_STATEMENT_ID`,e.QUERY_PLAN=`QUERY_PLAN`,e.QUERY_RESULT=`QUERY_RESULT`,e.QUERY_RESULT_CHUNK=`QUERY_RESULT_CHUNK`,e.QUERY_RESULT_HEADER=`QUERY_RESULT_HEADER`,e.QUERY_RESULT_HEADER_OR_NULL=`QUERY_RESULT_HEADER_OR_NULL`,e.REGISTERED_FILE=`REGISTERED_FILE`,e.SCRIPT_TOKENS=`SCRIPT_TOKENS`,e.SUCCESS=`SUCCESS`,e.TABLE_NAMES=`TABLE_NAMES`,e.VERSION_STRING=`VERSION_STRING`,e))(uS||{}),dS=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((e,t)=>{this.promiseResolver=e,this.promiseRejecter=t})}};function fS(e){switch(e.typeId){case F.Binary:return{sqlType:`binary`};case F.Bool:return{sqlType:`bool`};case F.Date:return{sqlType:`date`};case F.DateDay:return{sqlType:`date32[d]`};case F.DateMillisecond:return{sqlType:`date64[ms]`};case F.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case F.Float:return{sqlType:`float`};case F.Float16:return{sqlType:`float16`};case F.Float32:return{sqlType:`float32`};case F.Float64:return{sqlType:`float64`};case F.Int:return{sqlType:`int32`};case F.Int16:return{sqlType:`int16`};case F.Int32:return{sqlType:`int32`};case F.Int64:return{sqlType:`int64`};case F.Uint16:return{sqlType:`uint16`};case F.Uint32:return{sqlType:`uint32`};case F.Uint64:return{sqlType:`uint64`};case F.Uint8:return{sqlType:`uint8`};case F.IntervalDayTime:return{sqlType:`interval[dt]`};case F.IntervalYearMonth:return{sqlType:`interval[m]`};case F.List:return{sqlType:`list`,valueType:fS(e.valueType)};case F.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case F.Null:return{sqlType:`null`};case F.Utf8:return{sqlType:`utf8`};case F.Struct:return{sqlType:`struct`,fields:e.children.map(e=>pS(e.name,e.type))};case F.Map:{let t=e;return{sqlType:`map`,keyType:fS(t.keyType),valueType:fS(t.valueType)}}case F.Time:return{sqlType:`time[s]`};case F.TimeMicrosecond:return{sqlType:`time[us]`};case F.TimeMillisecond:return{sqlType:`time[ms]`};case F.TimeNanosecond:return{sqlType:`time[ns]`};case F.TimeSecond:return{sqlType:`time[s]`};case F.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case F.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case F.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case F.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case F.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function pS(e,t){let n=fS(t);return n.name=e,n}var mS=new TextEncoder,hS=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener(`message`,this._onMessageHandler),this._worker.addEventListener(`error`,this._onErrorHandler),this._worker.addEventListener(`close`,this._onCloseHandler),this._workerShutdownPromise=new Promise((e,t)=>{this._workerShutdownResolver=e})}detach(){this._worker&&(this._worker.removeEventListener(`message`,this._onMessageHandler),this._worker.removeEventListener(`error`,this._onErrorHandler),this._worker.removeEventListener(`close`,this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error(`cannot send a message since the worker is not set!`);return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case`LOG`:this._logger.log(n.data);return;case`INSTANTIATE_PROGRESS`:for(let e of this._onInstantiationProgress)e(n.data);return}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn(`unassociated response: [${n.requestId}, ${n.type.toString()}]`);return}if(this._pendingRequests.delete(n.requestId),n.type==`ERROR`){let e=Error(n.data.message);e.name=n.data.name,(t=Object.getOwnPropertyDescriptor(e,`stack`))!=null&&t.writable&&(e.stack=n.data.stack),r.promiseRejecter(e);return}switch(r.type){case`CLOSE_PREPARED`:case`COLLECT_FILE_STATISTICS`:case`REGISTER_OPFS_FILE_NAME`:case`COPY_FILE_TO_PATH`:case`DISCONNECT`:case`DROP_FILE`:case`DROP_FILES`:case`FLUSH_FILES`:case`INSERT_ARROW_FROM_IPC_STREAM`:case`IMPORT_CSV_FROM_PATH`:case`IMPORT_JSON_FROM_PATH`:case`OPEN`:case`PING`:case`REGISTER_FILE_BUFFER`:case`REGISTER_FILE_HANDLE`:case`REGISTER_FILE_URL`:case`RESET`:if(n.type==`OK`){r.promiseResolver(n.data);return}break;case`INSTANTIATE`:if(this._onInstantiationProgress=[],n.type==`OK`){r.promiseResolver(n.data);return}break;case`GLOB_FILE_INFOS`:if(n.type==`FILE_INFOS`){r.promiseResolver(n.data);return}break;case`GET_VERSION`:if(n.type==`VERSION_STRING`){r.promiseResolver(n.data);return}break;case`GET_FEATURE_FLAGS`:if(n.type==`FEATURE_FLAGS`){r.promiseResolver(n.data);return}break;case`GET_TABLE_NAMES`:if(n.type==`TABLE_NAMES`){r.promiseResolver(n.data);return}break;case`TOKENIZE`:if(n.type==`SCRIPT_TOKENS`){r.promiseResolver(n.data);return}break;case`COPY_FILE_TO_BUFFER`:if(n.type==`FILE_BUFFER`){r.promiseResolver(n.data);return}break;case`EXPORT_FILE_STATISTICS`:if(n.type==`FILE_STATISTICS`){r.promiseResolver(n.data);return}break;case`CONNECT`:if(n.type==`CONNECTION_INFO`){r.promiseResolver(n.data);return}break;case`RUN_PREPARED`:case`RUN_QUERY`:if(n.type==`QUERY_RESULT`){r.promiseResolver(n.data);return}break;case`SEND_PREPARED`:if(n.type==`QUERY_RESULT_HEADER`){r.promiseResolver(n.data);return}break;case`START_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`POLL_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`CANCEL_PENDING_QUERY`:if(this._onInstantiationProgress=[],n.type==`SUCCESS`){r.promiseResolver(n.data);return}break;case`FETCH_QUERY_RESULTS`:if(n.type==`QUERY_RESULT_CHUNK`){r.promiseResolver(n.data);return}break;case`CREATE_PREPARED`:if(n.type==`PREPARED_STATEMENT_ID`){r.promiseResolver(n.data);return}break}r.promiseRejecter(Error(`unexpected response type: ${n.type.toString()}`))}onError(e){console.error(e),console.error(`error in duckdb worker: ${e.message}`),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn(`worker terminated with ${this._pendingRequests.size} pending requests`);return}this._pendingRequests.clear()}async reset(){let e=new dS(`RESET`,null);return await this.postTask(e)}async ping(){let e=new dS(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new dS(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new dS(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new dS(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new dS(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new dS(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new dS(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new dS(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new dS(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new dS(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new oS(this,e)}async disconnect(e){let t=new dS(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new dS(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new dS(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new dS(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new dS(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new dS(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new dS(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new dS(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new dS(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new dS(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new dS(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new dS(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=mS.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new dS(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new dS(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new dS(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new dS(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new dS(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new dS(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new dS(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new dS(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new dS(`INSERT_ARROW_FROM_IPC_STREAM`,[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(pS(t,r))}n.columnsFlat=e,delete n.columns}let r=new dS(`IMPORT_CSV_FROM_PATH`,[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(pS(t,r))}n.columnsFlat=e,delete n.columns}let r=new dS(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function gS(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}gS();var _S=(e=>(e[e.BUFFER=0]=`BUFFER`,e[e.NODE_FS=1]=`NODE_FS`,e[e.BROWSER_FILEREADER=2]=`BROWSER_FILEREADER`,e[e.BROWSER_FSACCESS=3]=`BROWSER_FSACCESS`,e[e.HTTP=4]=`HTTP`,e[e.S3=5]=`S3`,e))(_S||{}),vS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),yS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),bS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),xS=()=>(async e=>{try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),SS={name:`@duckdb/duckdb-wasm`,version:`1.29.1-dev68.0`,description:`DuckDB powered by WebAssembly`,license:`MIT`,repository:{type:`git`,url:`https://github.com/duckdb/duckdb-wasm.git`},keywords:[`sql`,`duckdb`,`relational`,`database`,`data`,`query`,`wasm`,`analytics`,`olap`,`arrow`,`parquet`,`json`,`csv`],dependencies:{"apache-arrow":`^17.0.0`},devDependencies:{"@types/emscripten":`^1.39.10`,"@types/jasmine":`^5.1.4`,"@typescript-eslint/eslint-plugin":`^6.21.0`,"@typescript-eslint/parser":`^6.21.0`,esbuild:`^0.20.2`,eslint:`^8.57.0`,"eslint-plugin-jasmine":`^4.1.3`,"eslint-plugin-react":`^7.34.0`,"fast-glob":`^3.3.2`,jasmine:`^5.1.0`,"jasmine-core":`^5.1.2`,"jasmine-spec-reporter":`^7.0.0`,"js-sha256":`^0.11.0`,karma:`^6.4.2`,"karma-chrome-launcher":`^3.2.0`,"karma-coverage":`^2.2.1`,"karma-firefox-launcher":`^2.1.3`,"karma-jasmine":`^5.1.0`,"karma-jasmine-html-reporter":`^2.1.0`,"karma-sourcemap-loader":`^0.4.0`,"karma-spec-reporter":`^0.0.36`,"make-dir":`^4.0.0`,nyc:`^15.1.0`,prettier:`^3.2.5`,puppeteer:`^22.8.0`,rimraf:`^5.0.5`,s3rver:`^3.7.1`,typedoc:`^0.25.13`,typescript:`^5.3.3`,"wasm-feature-detect":`^1.6.1`,"web-worker":`^1.2.0`},scripts:{"build:debug":`node bundle.mjs debug && tsc --emitDeclarationOnly`,"build:release":`node bundle.mjs release && tsc --emitDeclarationOnly`,docs:`typedoc`,report:`node ./coverage.mjs`,"test:node":`node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:debug":`node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:coverage":`nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:firefox":`karma start ./karma/tests-firefox.cjs`,"test:chrome":`karma start ./karma/tests-chrome.cjs`,"test:chrome:eh":`karma start ./karma/tests-chrome-eh.cjs`,"test:chrome:coverage":`karma start ./karma/tests-chrome-coverage.cjs`,"test:browser":`karma start ./karma/tests-all.cjs`,"test:browser:debug":`karma start ./karma/tests-debug.cjs`,test:`npm run test:chrome && npm run test:node`,"test:coverage":`npm run test:chrome:coverage && npm run test:node:coverage && npm run report`,lint:`eslint src test`},files:[`dist`,`!dist/tests-*`,`!dist/duckdb-browser-mvp.worker.js.map`,`!dist/types/test`],main:`dist/duckdb-browser.cjs`,module:`dist/duckdb-browser.mjs`,types:`dist/duckdb-browser.d.ts`,jsdelivr:`dist/duckdb-browser.cjs`,unpkg:`dist/duckdb-browser.mjs`,sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":`./dist/duckdb-mvp.wasm`,"./dist/duckdb-eh.wasm":`./dist/duckdb-eh.wasm`,"./dist/duckdb-coi.wasm":`./dist/duckdb-coi.wasm`,"./dist/duckdb-browser":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser.cjs":`./dist/duckdb-browser.cjs`,"./dist/duckdb-browser.mjs":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser-coi.pthread.worker.js":`./dist/duckdb-browser-coi.pthread.worker.js`,"./dist/duckdb-browser-coi.worker.js":`./dist/duckdb-browser-coi.worker.js`,"./dist/duckdb-browser-eh.worker.js":`./dist/duckdb-browser-eh.worker.js`,"./dist/duckdb-browser-mvp.worker.js":`./dist/duckdb-browser-mvp.worker.js`,"./dist/duckdb-node":`./dist/duckdb-node.cjs`,"./dist/duckdb-node.cjs":`./dist/duckdb-node.cjs`,"./dist/duckdb-node-blocking":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-blocking.cjs":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-eh.worker.cjs":`./dist/duckdb-node-eh.worker.cjs`,"./dist/duckdb-node-mvp.worker.cjs":`./dist/duckdb-node-mvp.worker.cjs`,"./blocking":{node:{types:`./dist/duckdb-node-blocking.d.ts`,require:`./dist/duckdb-node-blocking.cjs`,import:`./dist/duckdb-node-blocking.cjs`},types:`./dist/duckdb-node-blocking.d.ts`,import:`./dist/duckdb-node-blocking.mjs`,require:`./dist/duckdb-node-blocking.cjs`},".":{browser:{types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`},node:{types:`./dist/duckdb-node.d.ts`,import:`./dist/duckdb-node.cjs`,require:`./dist/duckdb-node.cjs`},types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`}}};SS.name,SS.version;var CS=SS.version.split(`.`);CS[0],CS[1],CS[2];var wS=()=>typeof navigator>`u`,TS=null,ES=null,DS=null,OS=null,kS=null;async function AS(){return TS??=typeof BigInt64Array<`u`,ES??=await yS(),DS??=await xS(),OS??=await bS(),kS??=await vS(),{bigInt64Array:TS,crossOriginIsolated:wS()||globalThis.crossOriginIsolated||!1,wasmExceptions:ES,wasmSIMD:OS,wasmThreads:DS,wasmBulkMemory:kS}}async function jS(e){let t=await AS();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}Yx(Xx()),Symbol.for(`constructDateFrom`);const MS={},NS={};function PS(e,t){try{let n=MS[e]||=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format,r=n(t).split(`GMT`)[1]||``;return r in NS?NS[r]:IS(r,r.split(`:`))}catch{if(e in NS)return NS[e];let t=e?.match(FS);return t?IS(e,t.slice(1)):NaN}}const FS=/([+-]\d\d):?(\d\d)?/;function IS(e,t){let n=+t[0],r=+(t[1]||0);return NS[e]=n>0?n*60+r:n*60-r}var LS=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(PS(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),VS(this,NaN),zS(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-PS(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),zS(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const RS=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!RS.test(e))return;let t=e.replace(RS,`$1UTC`);LS.prototype[t]&&(e.startsWith(`get`)?LS.prototype[e]=function(){return this.internal[t]()}:(LS.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),BS(this),+this},LS.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),zS(this),+this}))});function zS(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function BS(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),VS(e)}function VS(e){let t=PS(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=PS(e.timeZone,e),l=-new Date(+e).getTimezoneOffset(),u=l-c,d=c!==t,f=u-s;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=PS(e.timeZone,e),n=c-t;n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}(class e extends LS{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${HS(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=e>0?`-`:`+`,n=String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),r=String(Math.abs(e)%60).padStart(2,`0`);return[t,n,r]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}});function HS(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const US=new TextDecoder(`utf-8`),WS=e=>US.decode(e),GS=new TextEncoder,KS=e=>GS.encode(e),qS=e=>typeof e==`function`,JS=e=>e!=null&&Object(e)===e,YS=e=>JS(e)&&qS(e.then),XS=e=>JS(e)&&qS(e[Symbol.iterator]),ZS=e=>JS(e)&&qS(e[Symbol.asyncIterator]),QS=e=>JS(e)&&`done`in e&&`value`in e,$S=e=>JS(e)&&qS(e.clear)&&qS(e.bytes)&&qS(e.position)&&qS(e.setPosition)&&qS(e.capacity)&&qS(e.getBufferIdentifier)&&qS(e.createLong);var eC={};Be(eC,{compareArrayLike:()=>zC,joinUint8Arrays:()=>iC,memcpy:()=>rC,rebaseValueOffsets:()=>RC,toArrayBufferView:()=>aC,toArrayBufferViewAsyncIterator:()=>OC,toArrayBufferViewIterator:()=>vC,toBigInt64Array:()=>lC,toBigUint64Array:()=>pC,toFloat32Array:()=>mC,toFloat32ArrayAsyncIterator:()=>FC,toFloat32ArrayIterator:()=>TC,toFloat64Array:()=>hC,toFloat64ArrayAsyncIterator:()=>IC,toFloat64ArrayIterator:()=>EC,toInt16Array:()=>sC,toInt16ArrayAsyncIterator:()=>AC,toInt16ArrayIterator:()=>bC,toInt32Array:()=>cC,toInt32ArrayAsyncIterator:()=>jC,toInt32ArrayIterator:()=>xC,toInt8Array:()=>oC,toInt8ArrayAsyncIterator:()=>kC,toInt8ArrayIterator:()=>yC,toUint16Array:()=>dC,toUint16ArrayAsyncIterator:()=>NC,toUint16ArrayIterator:()=>CC,toUint32Array:()=>fC,toUint32ArrayAsyncIterator:()=>PC,toUint32ArrayIterator:()=>wC,toUint8Array:()=>uC,toUint8ArrayAsyncIterator:()=>MC,toUint8ArrayIterator:()=>SC,toUint8ClampedArray:()=>gC,toUint8ClampedArrayAsyncIterator:()=>LC,toUint8ClampedArrayIterator:()=>DC});const tC=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function nC(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++caC(Int8Array,e),sC=e=>aC(Int16Array,e),cC=e=>aC(Int32Array,e),lC=e=>aC(BigInt64Array,e),uC=e=>aC(Uint8Array,e),dC=e=>aC(Uint16Array,e),fC=e=>aC(Uint32Array,e),pC=e=>aC(BigUint64Array,e),mC=e=>aC(Float32Array,e),hC=e=>aC(Float64Array,e),gC=e=>aC(Uint8ClampedArray,e),_C=e=>(e.next(),e);function*vC(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof tC?n(t):XS(t)?t:n(t);return yield*_C((function*(t){let n=null;do n=t.next(yield aC(e,n));while(!n.done)})(r[Symbol.iterator]())),new e}const yC=e=>vC(Int8Array,e),bC=e=>vC(Int16Array,e),xC=e=>vC(Int32Array,e),SC=e=>vC(Uint8Array,e),CC=e=>vC(Uint16Array,e),wC=e=>vC(Uint32Array,e),TC=e=>vC(Float32Array,e),EC=e=>vC(Float64Array,e),DC=e=>vC(Uint8ClampedArray,e);function OC(e,t){return Wf(this,arguments,function*(){if(YS(t))return yield Uf(yield Uf(yield*Gf(Kf(OC(e,yield Uf(t))))));let n=function(e){return Wf(this,arguments,function*(){yield yield Uf(yield Uf(e))})},r=function(e){return Wf(this,arguments,function*(){yield Uf(yield*Gf(Kf(_C((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof tC?n(t):XS(t)?r(t):ZS(t)?t:n(t);return yield Uf(yield*Gf(Kf(_C((function(t){return Wf(this,arguments,function*(){let n=null;do n=yield Uf(t.next(yield yield Uf(aC(e,n))));while(!n.done)})})(i[Symbol.asyncIterator]()))))),yield Uf(new e)})}const kC=e=>OC(Int8Array,e),AC=e=>OC(Int16Array,e),jC=e=>OC(Int32Array,e),MC=e=>OC(Uint8Array,e),NC=e=>OC(Uint16Array,e),PC=e=>OC(Uint32Array,e),FC=e=>OC(Float32Array,e),IC=e=>OC(Float64Array,e),LC=e=>OC(Uint8ClampedArray,e);function RC(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++nJC});const qC=void 0;function JC(e){if(e===null)return`null`;if(e===qC)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>JC(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function YC(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function XC(e,t){return YC(e/t)+YC(e%t)/YC(t)}var ZC={};Be(ZC,{BN:()=>lw,bigNumToBigInt:()=>sw,bigNumToNumber:()=>aw,bigNumToString:()=>ow,isArrowBigNumSymbol:()=>QC});const QC=Symbol.for(`isArrowBigNum`);function $C(e,...t){return t.length===0?Object.setPrototypeOf(aC(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}$C.prototype[QC]=!0,$C.prototype.toJSON=function(){return`"${ow(this)}"`},$C.prototype.valueOf=function(e){return aw(this,e)},$C.prototype.toString=function(){return ow(this)},$C.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return aw(this);case`string`:return ow(this);case`default`:return sw(this)}return ow(this)};function ew(...e){return $C.apply(this,e)}function tw(...e){return $C.apply(this,e)}function nw(...e){return $C.apply(this,e)}Object.setPrototypeOf(ew.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(tw.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(nw.prototype,Object.create(Uint32Array.prototype)),Object.assign(ew.prototype,$C.prototype,{constructor:ew,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(tw.prototype,$C.prototype,{constructor:tw,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(nw.prototype,$C.prototype,{constructor:nw,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const rw=BigInt(4294967296)*BigInt(4294967296),iw=rw-BigInt(1);function aw(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<0){let e=BigInt(`1`.padEnd(t+1,`0`)),n=c/e,r=s?-(c%e):c%e,i=YC(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return YC(c)}function ow(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return cw(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return cw(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(H.prototype);var Mw=class extends H{constructor(){super(V.Null)}toString(){return`Null`}};dw=Symbol.toStringTag,Mw[dw]=(e=>e[Symbol.toStringTag]=`Null`)(Mw.prototype);var Nw=class extends H{constructor(e,t){super(V.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};fw=Symbol.toStringTag,Nw[fw]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(Nw.prototype);var Pw=class extends Nw{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Fw=class extends Nw{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Iw=class extends Nw{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Lw=class extends Nw{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Rw=class extends Nw{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},zw=class extends Nw{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Bw=class extends Nw{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Vw=class extends Nw{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Pw.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(Fw.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(Iw.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(Lw.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(Rw.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(zw.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(Bw.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(Vw.prototype,`ArrayType`,{value:BigUint64Array});var Hw=class extends H{constructor(e){super(V.Float),this.precision=e}get ArrayType(){switch(this.precision){case VC.HALF:return Uint16Array;case VC.SINGLE:return Float32Array;case VC.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};pw=Symbol.toStringTag,Hw[pw]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(Hw.prototype);var Uw=class extends Hw{constructor(){super(VC.HALF)}},Ww=class extends Hw{constructor(){super(VC.SINGLE)}},Gw=class extends Hw{constructor(){super(VC.DOUBLE)}};Object.defineProperty(Uw.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(Ww.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(Gw.prototype,`ArrayType`,{value:Float64Array});var Kw=class extends H{constructor(){super(V.Binary)}toString(){return`Binary`}};mw=Symbol.toStringTag,Kw[mw]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(Kw.prototype);var qw=class extends H{constructor(){super(V.LargeBinary)}toString(){return`LargeBinary`}};hw=Symbol.toStringTag,qw[hw]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(qw.prototype);var Jw=class extends H{constructor(){super(V.Utf8)}toString(){return`Utf8`}};gw=Symbol.toStringTag,Jw[gw]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(Jw.prototype);var Yw=class extends H{constructor(){super(V.LargeUtf8)}toString(){return`LargeUtf8`}};_w=Symbol.toStringTag,Yw[_w]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(Yw.prototype);var Xw=class extends H{constructor(){super(V.Bool)}toString(){return`Bool`}};vw=Symbol.toStringTag,Xw[vw]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(Xw.prototype);var Zw=class extends H{constructor(e,t,n=128){super(V.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};yw=Symbol.toStringTag,Zw[yw]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(Zw.prototype);var Qw=class extends H{constructor(e){super(V.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${HC[this.unit]}>`}get ArrayType(){return this.unit===HC.DAY?Int32Array:BigInt64Array}};bw=Symbol.toStringTag,Qw[bw]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(Qw.prototype);var $w=class extends H{constructor(e,t){super(V.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${UC[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};xw=Symbol.toStringTag,$w[xw]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))($w.prototype);var eT=class extends H{constructor(e,t){super(V.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${UC[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};Sw=Symbol.toStringTag,eT[Sw]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(eT.prototype);var tT=class extends H{constructor(e){super(V.Interval),this.unit=e}toString(){return`Interval<${WC[this.unit]}>`}};Cw=Symbol.toStringTag,tT[Cw]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(tT.prototype);var nT=class extends H{constructor(e){super(V.Duration),this.unit=e}toString(){return`Duration<${UC[this.unit]}>`}};ww=Symbol.toStringTag,nT[ww]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(nT.prototype);var rT=class extends H{constructor(e){super(V.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Tw=Symbol.toStringTag,rT[Tw]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(rT.prototype);var iT=class extends H{constructor(e){super(V.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Ew=Symbol.toStringTag,iT[Ew]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(iT.prototype);var aT=class extends H{constructor(e,t,n){super(V.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};Dw=Symbol.toStringTag,aT[Dw]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(aT.prototype);var oT=class extends H{constructor(e){super(V.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Ow=Symbol.toStringTag,oT[Ow]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(oT.prototype);var sT=class extends H{constructor(e,t){super(V.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};kw=Symbol.toStringTag,sT[kw]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(sT.prototype);var cT=class extends H{constructor(e,t=!1){var n,r,i;if(super(V.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Aw=Symbol.toStringTag,cT[Aw]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(cT.prototype);const lT=(e=>()=>++e)(-1);var uT=class extends H{constructor(e,t,n,r){super(V.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?lT():YC(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};jw=Symbol.toStringTag,uT[jw]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(uT.prototype);function dT(e){let t=e;switch(e.typeId){case V.Decimal:return e.bitWidth/32;case V.Interval:return t.unit===WC.MONTH_DAY_NANO?4:1+t.unit;case V.FixedSizeList:return t.listSize;case V.FixedSizeBinary:return t.byteWidth;default:return 1}}var fT=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return pT(this,e,t)}getVisitFnByTypeId(e,t=!0){return mT(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function pT(e,t,n=!0){return typeof t==`number`?mT(e,t,n):typeof t==`string`&&t in V?mT(e,V[t],n):t&&t instanceof H?mT(e,hT(t),n):t?.type&&t.type instanceof H?mT(e,hT(t.type),n):mT(e,V.NONE,n)}function mT(e,t,n=!0){let r=null;switch(t){case V.Null:r=e.visitNull;break;case V.Bool:r=e.visitBool;break;case V.Int:r=e.visitInt;break;case V.Int8:r=e.visitInt8||e.visitInt;break;case V.Int16:r=e.visitInt16||e.visitInt;break;case V.Int32:r=e.visitInt32||e.visitInt;break;case V.Int64:r=e.visitInt64||e.visitInt;break;case V.Uint8:r=e.visitUint8||e.visitInt;break;case V.Uint16:r=e.visitUint16||e.visitInt;break;case V.Uint32:r=e.visitUint32||e.visitInt;break;case V.Uint64:r=e.visitUint64||e.visitInt;break;case V.Float:r=e.visitFloat;break;case V.Float16:r=e.visitFloat16||e.visitFloat;break;case V.Float32:r=e.visitFloat32||e.visitFloat;break;case V.Float64:r=e.visitFloat64||e.visitFloat;break;case V.Utf8:r=e.visitUtf8;break;case V.LargeUtf8:r=e.visitLargeUtf8;break;case V.Binary:r=e.visitBinary;break;case V.LargeBinary:r=e.visitLargeBinary;break;case V.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case V.Date:r=e.visitDate;break;case V.DateDay:r=e.visitDateDay||e.visitDate;break;case V.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case V.Timestamp:r=e.visitTimestamp;break;case V.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case V.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case V.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case V.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case V.Time:r=e.visitTime;break;case V.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case V.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case V.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case V.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case V.Decimal:r=e.visitDecimal;break;case V.List:r=e.visitList;break;case V.Struct:r=e.visitStruct;break;case V.Union:r=e.visitUnion;break;case V.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case V.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case V.Dictionary:r=e.visitDictionary;break;case V.Interval:r=e.visitInterval;break;case V.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case V.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case V.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case V.Duration:r=e.visitDuration;break;case V.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case V.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case V.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case V.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case V.FixedSizeList:r=e.visitFixedSizeList;break;case V.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${V[t]}'`)}function hT(e){switch(e.typeId){case V.Null:return V.Null;case V.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?V.Int8:V.Uint8;case 16:return n?V.Int16:V.Uint16;case 32:return n?V.Int32:V.Uint32;case 64:return n?V.Int64:V.Uint64}return V.Int}case V.Float:switch(e.precision){case VC.HALF:return V.Float16;case VC.SINGLE:return V.Float32;case VC.DOUBLE:return V.Float64}return V.Float;case V.Binary:return V.Binary;case V.LargeBinary:return V.LargeBinary;case V.Utf8:return V.Utf8;case V.LargeUtf8:return V.LargeUtf8;case V.Bool:return V.Bool;case V.Decimal:return V.Decimal;case V.Time:switch(e.unit){case UC.SECOND:return V.TimeSecond;case UC.MILLISECOND:return V.TimeMillisecond;case UC.MICROSECOND:return V.TimeMicrosecond;case UC.NANOSECOND:return V.TimeNanosecond}return V.Time;case V.Timestamp:switch(e.unit){case UC.SECOND:return V.TimestampSecond;case UC.MILLISECOND:return V.TimestampMillisecond;case UC.MICROSECOND:return V.TimestampMicrosecond;case UC.NANOSECOND:return V.TimestampNanosecond}return V.Timestamp;case V.Date:switch(e.unit){case HC.DAY:return V.DateDay;case HC.MILLISECOND:return V.DateMillisecond}return V.Date;case V.Interval:switch(e.unit){case WC.DAY_TIME:return V.IntervalDayTime;case WC.YEAR_MONTH:return V.IntervalYearMonth;case WC.MONTH_DAY_NANO:return V.IntervalMonthDayNano}return V.Interval;case V.Duration:switch(e.unit){case UC.SECOND:return V.DurationSecond;case UC.MILLISECOND:return V.DurationMillisecond;case UC.MICROSECOND:return V.DurationMicrosecond;case UC.NANOSECOND:return V.DurationNanosecond}return V.Duration;case V.Map:return V.Map;case V.List:return V.List;case V.Struct:return V.Struct;case V.Union:switch(e.mode){case BC.Dense:return V.DenseUnion;case BC.Sparse:return V.SparseUnion}return V.Union;case V.FixedSizeBinary:return V.FixedSizeBinary;case V.FixedSizeList:return V.FixedSizeList;case V.Dictionary:return V.Dictionary}throw Error(`Unrecognized type '${V[e.typeId]}'`)}fT.prototype.visitInt8=null,fT.prototype.visitInt16=null,fT.prototype.visitInt32=null,fT.prototype.visitInt64=null,fT.prototype.visitUint8=null,fT.prototype.visitUint16=null,fT.prototype.visitUint32=null,fT.prototype.visitUint64=null,fT.prototype.visitFloat16=null,fT.prototype.visitFloat32=null,fT.prototype.visitFloat64=null,fT.prototype.visitDateDay=null,fT.prototype.visitDateMillisecond=null,fT.prototype.visitTimestampSecond=null,fT.prototype.visitTimestampMillisecond=null,fT.prototype.visitTimestampMicrosecond=null,fT.prototype.visitTimestampNanosecond=null,fT.prototype.visitTimeSecond=null,fT.prototype.visitTimeMillisecond=null,fT.prototype.visitTimeMicrosecond=null,fT.prototype.visitTimeNanosecond=null,fT.prototype.visitDenseUnion=null,fT.prototype.visitSparseUnion=null,fT.prototype.visitIntervalDayTime=null,fT.prototype.visitIntervalYearMonth=null,fT.prototype.visitIntervalMonthDayNano=null,fT.prototype.visitDuration=null,fT.prototype.visitDurationSecond=null,fT.prototype.visitDurationMillisecond=null,fT.prototype.visitDurationMicrosecond=null,fT.prototype.visitDurationNanosecond=null;var gT={};Be(gT,{float64ToUint16:()=>bT,uint16ToFloat64:()=>yT});const _T=new Float64Array(1),vT=new Uint32Array(_T.buffer);function yT(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function bT(e){if(e!==e)return 32256;_T[0]=e;let t=(vT[1]&2147483648)>>16&65535,n=vT[1]&2146435072,r=0;return n>=1089470464?vT[0]>0?n=31744:(n=(n&2080374784)>>16,r=(vT[1]&1048575)>>10):n<=1056964608?(r=1048576+(vT[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(vT[1]&1048575)+512>>10),t|n|r&65535}var U=class extends fT{};function xT(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const ST=(e,t,n)=>{e[t]=Math.floor(n/864e5)},CT=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},ET=({values:e},t,n)=>{e[t]=n},DT=({values:e},t,n)=>{e[t]=bT(n)},OT=(e,t,n)=>{switch(e.type.precision){case VC.HALF:return DT(e,t,n);case VC.SINGLE:case VC.DOUBLE:return ET(e,t,n)}},kT=({values:e},t,n)=>{ST(e,t,n.valueOf())},AT=({values:e},t,n)=>{e[t]=BigInt(n)},jT=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},MT=({values:e,valueOffsets:t},n,r)=>CT(e,t,n,r),NT=({values:e,valueOffsets:t},n,r)=>CT(e,t,n,KS(r)),PT=(e,t,n)=>{e.type.unit===HC.DAY?kT(e,t,n):AT(e,t,n)},FT=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},IT=({values:e},t,n)=>{e[t]=BigInt(n)},LT=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},RT=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},zT=(e,t,n)=>{switch(e.type.unit){case UC.SECOND:return FT(e,t,n);case UC.MILLISECOND:return IT(e,t,n);case UC.MICROSECOND:return LT(e,t,n);case UC.NANOSECOND:return RT(e,t,n)}},BT=({values:e},t,n)=>{e[t]=n},VT=({values:e},t,n)=>{e[t]=n},HT=({values:e},t,n)=>{e[t]=n},UT=({values:e},t,n)=>{e[t]=n},WT=(e,t,n)=>{switch(e.type.unit){case UC.SECOND:return BT(e,t,n);case UC.MILLISECOND:return VT(e,t,n);case UC.MICROSECOND:return HT(e,t,n);case UC.NANOSECOND:return UT(e,t,n)}},GT=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},KT=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=pE.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=pE.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},JT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),YT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),XT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),ZT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),QT=(e,t,n)=>{let r=e.type.children.map(e=>pE.getVisitFn(e.type)),i=n instanceof Map?XT(t,n):n instanceof uO?YT(t,n):Array.isArray(n)?JT(t,n):ZT(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},$T=(e,t,n)=>{e.type.mode===BC.Dense?eE(e,t,n):tE(e,t,n)},eE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];pE.visit(i,e.valueOffsets[t],n)},tE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];pE.visit(i,t,n)},nE=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},rE=(e,t,n)=>{switch(e.type.unit){case WC.YEAR_MONTH:return aE(e,t,n);case WC.DAY_TIME:return iE(e,t,n);case WC.MONTH_DAY_NANO:return oE(e,t,n)}},iE=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},aE=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},oE=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},sE=({values:e},t,n)=>{e[t]=n},cE=({values:e},t,n)=>{e[t]=n},lE=({values:e},t,n)=>{e[t]=n},uE=({values:e},t,n)=>{e[t]=n},dE=(e,t,n)=>{switch(e.type.unit){case UC.SECOND:return sE(e,t,n);case UC.MILLISECOND:return cE(e,t,n);case UC.MICROSECOND:return lE(e,t,n);case UC.NANOSECOND:return uE(e,t,n)}},fE=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=pE.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${JC(e)}: ${JC(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new _E(this[mE],this[hE])}},_E=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[mE].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[mE].type.children.some(e=>e.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[mE].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=lD.visit(e[mE].children[n],e[hE]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[mE].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(pE.visit(e[mE].children[r],e[hE],n),Reflect.set(e,t,n))}};const yE=new vE;var W=class extends fT{};function G(e){return(t,n)=>t.getValid(n)?e(t,n):null}const bE=(e,t)=>864e5*e[t],xE=(e,t)=>null,SE=(e,t,n)=>{if(n+1>=t.length)return null;let r=YC(t[n]),i=YC(t[n+1]);return e.subarray(r,i)},CE=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<bE(e,t),TE=({values:e},t)=>YC(e[t]),EE=({stride:e,values:t},n)=>t[e*n],DE=({stride:e,values:t},n)=>yT(t[e*n]),OE=({values:e},t)=>e[t],kE=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),AE=({values:e,valueOffsets:t},n)=>SE(e,t,n),jE=({values:e,valueOffsets:t},n)=>{let r=SE(e,t,n);return r===null?null:WS(r)},ME=({values:e},t)=>e[t],NE=({type:e,values:t},n)=>e.precision===VC.HALF?yT(t[n]):t[n],PE=(e,t)=>e.type.unit===HC.DAY?wE(e,t):TE(e,t),FE=({values:e},t)=>1e3*YC(e[t]),IE=({values:e},t)=>YC(e[t]),LE=({values:e},t)=>XC(e[t],BigInt(1e3)),RE=({values:e},t)=>XC(e[t],BigInt(1e6)),zE=(e,t)=>{switch(e.type.unit){case UC.SECOND:return FE(e,t);case UC.MILLISECOND:return IE(e,t);case UC.MICROSECOND:return LE(e,t);case UC.NANOSECOND:return RE(e,t)}},BE=({values:e},t)=>e[t],VE=({values:e},t)=>e[t],HE=({values:e},t)=>e[t],UE=({values:e},t)=>e[t],WE=(e,t)=>{switch(e.type.unit){case UC.SECOND:return BE(e,t);case UC.MILLISECOND:return VE(e,t);case UC.MICROSECOND:return HE(e,t);case UC.NANOSECOND:return UE(e,t)}},GE=({values:e,stride:t},n)=>lw.decimal(e.subarray(t*n,t*(n+1))),KE=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new uO([c])},qE=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new mD(o.slice(i,a-i))},JE=(e,t)=>new gE(e,t),YE=(e,t)=>e.type.mode===BC.Dense?XE(e,t):ZE(e,t),XE=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return lD.visit(r,e.valueOffsets[t])},ZE=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return lD.visit(r,t)},QE=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},$E=(e,t)=>e.type.unit===WC.MONTH_DAY_NANO?nD(e,t):e.type.unit===WC.DAY_TIME?eD(e,t):tD(e,t),eD=({values:e},t)=>e.subarray(2*t,2*(t+1)),tD=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},nD=({values:e},t)=>e.subarray(4*t,4*(t+1)),rD=({values:e},t)=>e[t],iD=({values:e},t)=>e[t],aD=({values:e},t)=>e[t],oD=({values:e},t)=>e[t],sD=(e,t)=>{switch(e.type.unit){case UC.SECOND:return rD(e,t);case UC.MILLISECOND:return iD(e,t);case UC.MICROSECOND:return aD(e,t);case UC.NANOSECOND:return oD(e,t)}},cD=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new uO([a])};W.prototype.visitNull=G(xE),W.prototype.visitBool=G(CE),W.prototype.visitInt=G(ME),W.prototype.visitInt8=G(EE),W.prototype.visitInt16=G(EE),W.prototype.visitInt32=G(EE),W.prototype.visitInt64=G(OE),W.prototype.visitUint8=G(EE),W.prototype.visitUint16=G(EE),W.prototype.visitUint32=G(EE),W.prototype.visitUint64=G(OE),W.prototype.visitFloat=G(NE),W.prototype.visitFloat16=G(DE),W.prototype.visitFloat32=G(EE),W.prototype.visitFloat64=G(EE),W.prototype.visitUtf8=G(jE),W.prototype.visitLargeUtf8=G(jE),W.prototype.visitBinary=G(AE),W.prototype.visitLargeBinary=G(AE),W.prototype.visitFixedSizeBinary=G(kE),W.prototype.visitDate=G(PE),W.prototype.visitDateDay=G(wE),W.prototype.visitDateMillisecond=G(TE),W.prototype.visitTimestamp=G(zE),W.prototype.visitTimestampSecond=G(FE),W.prototype.visitTimestampMillisecond=G(IE),W.prototype.visitTimestampMicrosecond=G(LE),W.prototype.visitTimestampNanosecond=G(RE),W.prototype.visitTime=G(WE),W.prototype.visitTimeSecond=G(BE),W.prototype.visitTimeMillisecond=G(VE),W.prototype.visitTimeMicrosecond=G(HE),W.prototype.visitTimeNanosecond=G(UE),W.prototype.visitDecimal=G(GE),W.prototype.visitList=G(KE),W.prototype.visitStruct=G(JE),W.prototype.visitUnion=G(YE),W.prototype.visitDenseUnion=G(XE),W.prototype.visitSparseUnion=G(ZE),W.prototype.visitDictionary=G(QE),W.prototype.visitInterval=G($E),W.prototype.visitIntervalDayTime=G(eD),W.prototype.visitIntervalYearMonth=G(tD),W.prototype.visitIntervalMonthDayNano=G(nD),W.prototype.visitDuration=G(sD),W.prototype.visitDurationSecond=G(rD),W.prototype.visitDurationMillisecond=G(iD),W.prototype.visitDurationMicrosecond=G(aD),W.prototype.visitDurationNanosecond=G(oD),W.prototype.visitFixedSizeList=G(cD),W.prototype.visitMap=G(qE);const lD=new W,uD=Symbol.for(`keys`),dD=Symbol.for(`vals`),fD=Symbol.for(`kKeysAsStrings`),pD=Symbol.for(`_kKeysAsStrings`);var mD=class{constructor(e){return this[uD]=new uO([e.children[0]]).memoize(),this[dD]=e.children[1],new Proxy(this,new gD)}get[fD](){return this[pD]||(this[pD]=Array.from(this[uD].toArray(),String))}[Symbol.iterator](){return new hD(this[uD],this[dD])}get size(){return this[uD].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[uD],t=this[dD],n={};for(let r=-1,i=e.length;++r`${JC(e)}: ${JC(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},hD=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),lD.visit(this.vals,e)]})}},gD=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[fD]}has(e,t){return e[fD].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[fD].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[fD].indexOf(t);if(n!==-1){let r=lD.visit(Reflect.get(e,dD),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[fD].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(pE.visit(Reflect.get(e,dD),r,n),Reflect.set(e,t,n))}};Object.defineProperties(mD.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[uD]:{writable:!0,enumerable:!1,configurable:!1,value:null},[dD]:{writable:!0,enumerable:!1,configurable:!1,value:null},[pD]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var _D={};Be(_D,{clampRange:()=>yD,createElementComparator:()=>SD,wrapIndex:()=>bD});let vD;function yD(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const bD=(e,t)=>e<0?t+e:e,xD=e=>e!==e;function SD(e){let t=typeof e;if(t!==`object`||e===null)return xD(e)?xD:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?zC(e,t):!1:e instanceof Map?wD(e):Array.isArray(e)?CD(e):e instanceof uO?TD(e):ED(e,!0)}function CD(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return OD(e,n);case Map:return AD(e,n,n.keys());case mD:case gE:case Object:case void 0:return AD(e,n,t||Object.keys(n))}return n instanceof uO?kD(e,n):!1}}function OD(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rLD,getBit:()=>ND,getBool:()=>MD,packBools:()=>ID,popcnt_array:()=>zD,popcnt_bit_range:()=>RD,popcnt_uint32:()=>BD,setBool:()=>PD,truncateBitmap:()=>FD});function MD(e,t,n,r){return(n&1<>r}function PD(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):ID(new LD(n,e,t,null,MD)).subarray(0,r)),i}return n}function ID(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var LD=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return RD(e,t,i)+RD(e,r,n)+zD(e,i>>3,r-i>>3)}function zD(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=BD(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=BD(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=BD(a.getUint8(i)),i+=1;return r}function BD(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const VD=-1;var HD=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return H.isSparseUnion(e)||H.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(H.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=VD&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-RD(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=dT(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(H.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===BC.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(FD(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===V.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(FD(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[GC.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[GC.TYPE])&&(a[GC.TYPE]=i.subarray(e,e+t)),(i=a[GC.OFFSET])&&(a[GC.OFFSET]=i.subarray(e,e+t+1))||(i=a[GC.DATA])&&(a[GC.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};HD.prototype.children=Object.freeze([]);var UD=class e extends fT{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new HD(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=uC(e.data),i=uC(e.nullBitmap),a=cC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=uC(e.data),i=uC(e.nullBitmap),a=lC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=uC(e.data),i=uC(e.nullBitmap),a=cC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=uC(e.data),i=uC(e.nullBitmap),a=lC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length/dT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length/dT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length/dT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length/dT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length/dT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=uC(e.nullBitmap),a=cC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=uC(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=aC(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(H.isSparseUnion(t))return new HD(t,n,a,o,[void 0,void 0,void 0,i],r);let s=cC(e.valueOffsets);return new HD(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=uC(t.nullBitmap),a=aC(n.indices.ArrayType,t.data),{dictionary:o=new uO([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new HD(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length/dT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=uC(e.nullBitmap),i=aC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=uC(t.nullBitmap),{length:o=i.length/dT(n),nullCount:s=t.nullBitmap?-1:0}=t;return new HD(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=uC(t.nullBitmap),o=cC(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new HD(n,r,s,c,[o,void 0,a],[i])}};new UD;var WD=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function KD(e){return e.reduce((e,t)=>e+t.nullCount,0)}function qD(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function JD(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function YD(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function tO(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new LD(n,e.offset+(t||0),e.length,n,MD)){if(!i)return r;++r}return-1}function nO(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case V.Union:break;case V.Dictionary:break;default:return tO(e,n)}let r=lD.getVisitFn(e),i=SD(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new WD(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new aO(a)})}var aO=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof HD)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=cO[o.typeId],r=a[0];this.isValid=e=>XD(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,lO[o.typeId]),this._offsets=qD(a);break}this.data=a,this.type=o,this.stride=dT(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return GD(this.data)}get nullCount(){return KD(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${V[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(bD(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return oO.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(yD(this,t,n,({data:e,_offsets:t},n,r)=>JD(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case V.Int:case V.Float:case V.Decimal:case V.Time:case V.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return H.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(H.isDictionary(this.type)){let t=new dO(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new dO(this)}unmemoize(){if(H.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};sO=Symbol.toStringTag,uO[sO]=(e=>{e.type=H.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(V).map(e=>V[e]).filter(e=>typeof e==`number`&&e!==V.NONE);for(let n of t){let t=lD.getVisitFnByTypeId(n),r=pE.getVisitFnByTypeId(n),i=iO.getVisitFnByTypeId(n);cO[n]={get:t,set:r,indexOf:i},lO[n]=Object.create(e,{isValid:{value:ZD(XD)},get:{value:ZD(lD.getVisitFnByTypeId(n))},set:{value:QD(pE.getVisitFnByTypeId(n))},indexOf:{value:$D(iO.getVisitFnByTypeId(n))}})}return`Vector`})(uO.prototype);var dO=class e extends uO{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new uO(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},fO={};Be(fO,{BaseInt64:()=>_O,Int128:()=>bO,Int64:()=>yO,Uint64:()=>vO});const pO=65536;function mO(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const hO=8,gO=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var _O=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${mO(this.buffer[3])} ${mO(this.buffer[2])} ${mO(this.buffer[1])} ${mO(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;nSO,toIntervalDayTimeObjects:()=>wO,toIntervalMonthDayNanoInt32Array:()=>CO,toIntervalMonthDayNanoObjects:()=>TO});function SO(e){var t,n;let r=e.length,i=new Int32Array(r*2);for(let a=0,o=0;a>BigInt(32))):o+=2}return i}function wO(e){let t=e.length,n=Array(t/2);for(let r=0,i=0;r>>0);r[a++]={months:e[i],days:e[i+1],nanoseconds:t?`${n}`:n}}return r}var Y=class extends fT{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function EO(e,t){return t instanceof e.constructor}function DO(e,t){return e===t||EO(e,t)}function OO(e,t){return e===t||EO(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function kO(e,t){return e===t||EO(e,t)&&e.precision===t.precision}function AO(e,t){return e===t||EO(e,t)&&e.byteWidth===t.byteWidth}function jO(e,t){return e===t||EO(e,t)&&e.unit===t.unit}function MO(e,t){return e===t||EO(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function NO(e,t){return e===t||EO(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function PO(e,t){return e===t||EO(e,t)&&e.children.length===t.children.length&&HO.compareManyFields(e.children,t.children)}function FO(e,t){return e===t||EO(e,t)&&e.children.length===t.children.length&&HO.compareManyFields(e.children,t.children)}function IO(e,t){return e===t||EO(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&HO.compareManyFields(e.children,t.children)}function LO(e,t){return e===t||EO(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&HO.visit(e.indices,t.indices)&&HO.visit(e.dictionary,t.dictionary)}function RO(e,t){return e===t||EO(e,t)&&e.unit===t.unit}function zO(e,t){return e===t||EO(e,t)&&e.unit===t.unit}function BO(e,t){return e===t||EO(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&HO.compareManyFields(e.children,t.children)}function VO(e,t){return e===t||EO(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&HO.compareManyFields(e.children,t.children)}Y.prototype.visitNull=DO,Y.prototype.visitBool=DO,Y.prototype.visitInt=OO,Y.prototype.visitInt8=OO,Y.prototype.visitInt16=OO,Y.prototype.visitInt32=OO,Y.prototype.visitInt64=OO,Y.prototype.visitUint8=OO,Y.prototype.visitUint16=OO,Y.prototype.visitUint32=OO,Y.prototype.visitUint64=OO,Y.prototype.visitFloat=kO,Y.prototype.visitFloat16=kO,Y.prototype.visitFloat32=kO,Y.prototype.visitFloat64=kO,Y.prototype.visitUtf8=DO,Y.prototype.visitLargeUtf8=DO,Y.prototype.visitBinary=DO,Y.prototype.visitLargeBinary=DO,Y.prototype.visitFixedSizeBinary=AO,Y.prototype.visitDate=jO,Y.prototype.visitDateDay=jO,Y.prototype.visitDateMillisecond=jO,Y.prototype.visitTimestamp=MO,Y.prototype.visitTimestampSecond=MO,Y.prototype.visitTimestampMillisecond=MO,Y.prototype.visitTimestampMicrosecond=MO,Y.prototype.visitTimestampNanosecond=MO,Y.prototype.visitTime=NO,Y.prototype.visitTimeSecond=NO,Y.prototype.visitTimeMillisecond=NO,Y.prototype.visitTimeMicrosecond=NO,Y.prototype.visitTimeNanosecond=NO,Y.prototype.visitDecimal=DO,Y.prototype.visitList=PO,Y.prototype.visitStruct=FO,Y.prototype.visitUnion=IO,Y.prototype.visitDenseUnion=IO,Y.prototype.visitSparseUnion=IO,Y.prototype.visitDictionary=LO,Y.prototype.visitInterval=RO,Y.prototype.visitIntervalDayTime=RO,Y.prototype.visitIntervalYearMonth=RO,Y.prototype.visitIntervalMonthDayNano=RO,Y.prototype.visitDuration=zO,Y.prototype.visitDurationSecond=zO,Y.prototype.visitDurationMillisecond=zO,Y.prototype.visitDurationMicrosecond=zO,Y.prototype.visitDurationNanosecond=zO,Y.prototype.visitFixedSizeList=BO,Y.prototype.visitMap=VO;const HO=new Y;function UO(e,t){return HO.compareSchemas(e,t)}function WO(e,t){return HO.compareFields(e,t)}function GO(e,t){return HO.visit(e,t)}const KO=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ZC),fO),jD),gT),eC),_D),KC),xO),{compareSchemas:UO,compareFields:WO,compareTypes:GO}),qO=365.2425,JO=6048e5,YO=864e5,XO=3600,ZO=XO*24;ZO*7;const QO=ZO*qO,$O=QO/12;$O*3;const ek=Symbol.for(`constructDateFrom`);function tk(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&ek in e?e[ek](t):e instanceof Date?new e.constructor(t):new Date(t)}function nk(e,t){return tk(t||e,e)}let rk={};function ik(){return rk}function ak(e,t){let n=ik(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=nk(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ck(e){let t=nk(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function lk(e,...t){let n=tk.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function uk(e,t){let n=nk(e,t?.in);return n.setHours(0,0,0,0),n}function dk(e,t,n){let[r,i]=lk(n?.in,e,t),a=uk(r),o=uk(i),s=+a-ck(a),c=+o-ck(o);return Math.round((s-c)/YO)}function fk(e,t){let n=sk(e,t),r=tk(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ok(r)}function pk(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function mk(e){return!(!pk(e)&&typeof e!=`number`||isNaN(+nk(e)))}function hk(e,t){let n=nk(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const gk={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},_k=(e,t,n)=>{let r,i=gk[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function vk(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const yk={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},bk={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},xk={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},Sk={date:vk({formats:yk,defaultWidth:`full`}),time:vk({formats:bk,defaultWidth:`full`}),dateTime:vk({formats:xk,defaultWidth:`full`})},Ck={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},wk=(e,t,n,r)=>Ck[e];function Tk(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const Ek={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},Dk={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},Ok={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},kk={narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},Ak={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},jk={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},Mk=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},Nk={ordinalNumber:Mk,era:Tk({values:Ek,defaultWidth:`wide`}),quarter:Tk({values:Dk,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Tk({values:Ok,defaultWidth:`wide`}),day:Tk({values:kk,defaultWidth:`wide`}),dayPeriod:Tk({values:Ak,defaultWidth:`wide`,formattingValues:jk,defaultFormattingWidth:`wide`})};function Pk(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Ik(s,e=>e.test(o)):Fk(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Fk(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ik(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const Rk=/^(\d+)(th|st|nd|rd)?/i,zk=/\d+/i,Bk={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Vk={any:[/^b/i,/^(a|c)/i]},Hk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Uk={any:[/1/i,/2/i,/3/i,/4/i]},Wk={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Gk={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Kk={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qk={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jk={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yk={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Xk={ordinalNumber:Lk({matchPattern:Rk,parsePattern:zk,valueCallback:e=>parseInt(e,10)}),era:Pk({matchPatterns:Bk,defaultMatchWidth:`wide`,parsePatterns:Vk,defaultParseWidth:`any`}),quarter:Pk({matchPatterns:Hk,defaultMatchWidth:`wide`,parsePatterns:Uk,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Pk({matchPatterns:Wk,defaultMatchWidth:`wide`,parsePatterns:Gk,defaultParseWidth:`any`}),day:Pk({matchPatterns:Kk,defaultMatchWidth:`wide`,parsePatterns:qk,defaultParseWidth:`any`}),dayPeriod:Pk({matchPatterns:Jk,defaultMatchWidth:`any`,parsePatterns:Yk,defaultParseWidth:`any`})},Zk={code:`en-US`,formatDistance:_k,formatLong:Sk,formatRelative:wk,localize:Nk,match:Xk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qk(e,t){let n=nk(e,t?.in),r=dk(n,hk(n)),i=r+1;return i}function $k(e,t){let n=nk(e,t?.in),r=ok(n)-+fk(n);return Math.round(r/JO)+1}function eA(e,t){let n=nk(e,t?.in),r=n.getFullYear(),i=ik(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=tk(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=ak(o,t),c=tk(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=ak(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function tA(e,t){let n=ik(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=eA(e,t),a=tk(t?.in||e,0);a.setFullYear(i,0,r),a.setHours(0,0,0,0);let o=ak(a,t);return o}function nA(e,t){let n=nk(e,t?.in),r=ak(n,t)-+tA(n,t);return Math.round(r/JO)+1}function rA(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const iA={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return rA(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):rA(n+1,2)},d(e,t){return rA(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return rA(e.getHours()%12||12,t.length)},H(e,t){return rA(e.getHours(),t.length)},m(e,t){return rA(e.getMinutes(),t.length)},s(e,t){return rA(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return rA(i,t.length)}},aA={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},oA={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return iA.y(e,t)},Y:function(e,t,n,r){let i=eA(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return rA(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):rA(a,t.length)},R:function(e,t){let n=sk(e);return rA(n,t.length)},u:function(e,t){let n=e.getFullYear();return rA(n,t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return rA(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return rA(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return iA.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return rA(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=nA(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):rA(i,t.length)},I:function(e,t,n){let r=$k(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):rA(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):iA.d(e,t)},D:function(e,t,n){let r=Qk(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):rA(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return rA(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return rA(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return rA(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours(),i=r/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?aA.noon:r===0?aA.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?aA.evening:r>=12?aA.afternoon:r>=4?aA.morning:aA.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return iA.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):iA.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):rA(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):rA(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):iA.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):iA.s(e,t)},S:function(e,t){return iA.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return cA(r);case`XXXX`:case`XX`:return lA(r);case`XXXXX`:case`XXX`:default:return lA(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return cA(r);case`xxxx`:case`xx`:return lA(r);case`xxxxx`:case`xxx`:default:return lA(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+sA(r,`:`);case`OOOO`:default:return`GMT`+lA(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+sA(r,`:`);case`zzzz`:default:return`GMT`+lA(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return rA(r,t.length)},T:function(e,t,n){return rA(+e,t.length)}};function sA(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+rA(a,2)}function cA(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+rA(Math.abs(e)/60,2)}return lA(e,t)}function lA(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=rA(Math.trunc(r/60),2),a=rA(r%60,2);return n+i+t+a}const uA=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},dA=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}},fA=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return uA(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,uA(r,t)).replace(`{{time}}`,dA(i,t))},pA={p:dA,P:fA},mA=/^D+$/,hA=/^Y+$/,gA=[`D`,`DD`,`YY`,`YYYY`];function _A(e){return mA.test(e)}function vA(e){return hA.test(e)}function yA(e,t,n){let r=bA(e,t,n);if(console.warn(r),gA.includes(e))throw RangeError(r)}function bA(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const xA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,CA=/^'([^]*?)'?$/,wA=/''/g,TA=/[a-zA-Z]/;function EA(e,t,n){let r=ik(),i=n?.locale??r.locale??Zk,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=nk(e,n?.in);if(!mk(s))throw RangeError(`Invalid time value`);let c=t.match(SA).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=pA[t];return n(e,i.formatLong)}return e}).join(``).match(xA).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:DA(e)};if(oA[t])return{isToken:!0,value:e};if(t.match(TA))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&vA(a)||!n?.useAdditionalDayOfYearTokens&&_A(a))&&yA(a,t,String(e));let o=oA[a[0]];return o(s,a,i.localize,l)}).join(``)}function DA(e){let t=e.match(CA);return t?t[1].replace(wA,`'`):e}function OA(e,t){return nk(e*1e3,t?.in)}function kA(e,t){let n=AA(t)?new t(0):tk(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function AA(e){return typeof e==`function`&&e.prototype?.constructor===e}function jA(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function MA(e){return e==null}function NA(e){return e!=null}async function PA(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await S(()=>import(`./__vite-browser-external-DFqcVPwo.js`).then(He(1)),__vite__mapDeps([0,1,2]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function FA(e){return MA(e)?!1:H.isInt(e.type)&&!VA(e)||IA(e)}function IA(e){return MA(e)?!1:H.isInt(e.type)&&e.type.isSigned===!1}function LA(e){return MA(e)?!1:H.isFloat(e.type)??!1}function RA(e){return MA(e)?!1:H.isDecimal(e.type)}function zA(e){return MA(e)?!1:H.isBool(e.type)}function BA(e){return MA(e)?!1:H.isDuration(e.type)}function VA(e){return MA(e)?!1:H.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function HA(e){return MA(e)?!1:H.isTimestamp(e.type)}function UA(e){return MA(e)?!1:H.isDate(e.type)}function WA(e){return MA(e)?!1:H.isTime(e.type)}function GA(e){return MA(e)?!1:H.isList(e.type)||H.isFixedSizeList(e.type)}function KA(e){return MA(e)?!1:H.isStruct(e.type)||H.isMap(e.type)}function qA(e){return MA(e)?!1:H.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||H.isInterval(e.type)}new Date(1970,0,1);function JA(e,t){let n;if(t===UC.MILLISECOND)n=1e3;else if(t===UC.MICROSECOND)n=1e3*1e3;else if(t===UC.NANOSECOND)n=1e3*1e3*1e3;else return Number(e);return typeof e==`bigint`&&!Number.isSafeInteger(Number(e))?Number(e/BigInt(n)):Number(e)/n}function YA(e,t){let n=JA(e,t?.type?.unit??UC.SECOND);return OA(n)}function XA(e,t){let n=YA(e,t);return EA(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function ZA(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?EA(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function QA(e,t){if(!(e instanceof Date||typeof e==`number`&&Number.isFinite(e)))return console.warn(`Unsupported datetime value: ${e}`),null;let n,r=t?.type?.timezone;return n=r?new LS(e,r):new LS(e),kA(n,Date)}function $A(e,t){let n=t?.type?.scale||0,r=KO.bigNumToString(new KO.BN(e)).padStart(n,`0`);if(n===0)return r;let i=``;r.startsWith(`-`)&&(i=`-`,r=r.slice(1));let a=r.slice(0,-n)||`0`,o=jA(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function ej(e){let t=e[0],n=e[1],r=[];return t!==0&&r.push(`${t} year${t>1?`s`:``}`),n!==0&&r.push(`${n} month${n>1?`s`:``}`),r.length?r.join(` `):`0 months`}function tj(e,t){if(H.isInterval(t?.type))return ej(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){let n=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),{closed:r}=n,i=e.toJSON(),a=r===`both`||r===`left`?`[`:`(`,o=r===`both`||r===`right`?`]`:`)`,s=rj(i.left,t.type?.children?.[0]),c=rj(i.right,t.type?.children?.[1]);return`${a+s}, ${c+o}`}return String(e)}function nj(e,t){return t?.type instanceof iT?JSON.parse(JSON.stringify(e,(e,t)=>{if(NA(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function rj(e,t){if(MA(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&UA(t))return ZA(e);if(typeof e==`bigint`&&WA(t))return XA(Number(e),t);if(n&&HA(t))return QA(e,t);if(VA(t))throw Error(`Period type is not supported yet`);if(qA(t))return tj(e,t);if(BA(t))throw Error(`Duration type is not supported yet`);return RA(t)?$A(e,t):LA(t)&&Number.isFinite(e)||FA(t)?e:KA(t)||GA(t)?nj(e,t):zA(t)?!!e:String(e)}function ij(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=rj(t[e.name],e)),t));return n}let aj=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function oj(e){let t=be(e,{logger:!1}),n,r,i=await PA();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await S(async()=>{let{getBundles:e}=await import(`./default-browser-ZWdN_TIR.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await jS(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await S(async()=>{let{getBundles:e}=await import(`./default-node-D0HoLEZS.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));t.bundles=await e()}r=await jS(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await S(()=>import(`./browser-DPkKpj_5.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new iS:t.logger===!1?new rS:t.logger;let o=new hS(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case aj.ORIGIN_PRIVATE_FS:try{let e=t.storage.path;e.startsWith(`/`)&&(e=e.slice(1)),await o.open({path:`opfs://${e}`,accessMode:t.storage.accessMode})}catch(e){throw await o.terminate(),await n.terminate(),e}break;case aj.NODE_FS:try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(e){throw await o.terminate(),await n.terminate(),e}break}let s=await o.connect();async function c(e,t=[]){if(!t||t.length===0){let t=await s.query(e);return{_results:t,_schema:t.schema,columns:t.schema.fields,rows:ij(t)}}let n=await s.prepare(e),r=await n.query(...t);return n.close(),{_results:r,_schema:r.schema,columns:r.schema.fields,rows:ij(r)}}return{worker:n,db:o,conn:s,query:async(e,t=[])=>c(e,t).then(e=>e.rows),queryWithColumns:async(e,t=[])=>c(e,t),close:async()=>{await s.close(),await o.terminate(),await n.terminate()}}}async function sj(e,t){await(await e).conn.send(`BEGIN TRANSACTION`);try{let n=await t(e);return await(await e).conn.send(`COMMIT`),n}catch(t){throw await(await e).conn.send(`ROLLBACK`),t}}async function cj(e,t,n){await(await e).conn.send(`SAVEPOINT ${t}`);try{let r=await n(e);return await(await e).conn.send(`RELEASE SAVEPOINT ${t}`),r}catch(n){throw await(await e).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const X=Symbol.for(`drizzle:entityKind`);Symbol.for(`drizzle:hasOwnEntityKind`);function Z(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,X))throw Error(`Class "${t.name??``}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(X in n&&n[X]===t[X])return!0;n=Object.getPrototypeOf(n)}return!1}var lj=class{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[X]=`Column`;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},uj=class{static[X]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}};const dj=Symbol.for(`drizzle:Name`);var fj=class{static[X]=`PgForeignKeyBuilder`;reference;_onUpdate=`no action`;_onDelete=`no action`;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new pj(e,this)}},pj=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[X]=`PgForeignKey`;reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[dj],...r,n[0].table[dj],...i];return e??`${a.join(`_`)}_fk`}};function mj(e,...t){return e(...t)}function hj(e,t){return`${e[dj]}_${t.join(`_`)}_unique`}function gj(e,t,n){for(let r=t;rArray.isArray(e)?yj(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var bj=class extends uj{foreignKeyConfigs=[];static[X]=`PgColumnBuilder`;array(e){return new Cj(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>mj((n,r)=>{let i=new fj(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new Sj(e,this.config)}},xj=class extends lj{constructor(e,t){t.uniqueName||=hj(e,[t.name]),super(e,t),this.table=e}static[X]=`PgColumn`},Sj=class extends xj{static[X]=`ExtraConfigColumn`;getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass};defaultConfig={order:`asc`,nulls:`last`,opClass:void 0};asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},Cj=class extends bj{static[X]=`PgArrayBuilder`;constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new wj(e,this.config,t)}},wj=class e extends xj{constructor(e,t,n,r){super(e,t),this.baseColumn=n,this.range=r,this.size=t.size}size;static[X]=`PgArray`;getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=vj(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(t,n=!1){let r=t.map(t=>t===null?null:Z(this.baseColumn,e)?this.baseColumn.mapToDriverValue(t,!0):this.baseColumn.mapToDriverValue(t));return n?r:yj(r)}};const Tj=Symbol.for(`drizzle:isPgEnum`);function Ej(e){return!!e&&typeof e==`function`&&Tj in e&&e[Tj]===!0}var Dj=class{static[X]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},Oj=class extends Dj{static[X]=`WithSubquery`},kj=`0.44.4`;let Aj,jj;const Mj={startActiveSpan(e,t){return Aj?(jj||=Aj.trace.getTracer(`drizzle-orm`,kj),mj((n,r)=>r.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:`Unknown error`}),t}finally{e.end()}}),Aj,jj)):t()}},Nj=Symbol.for(`drizzle:ViewBaseConfig`),Pj=Symbol.for(`drizzle:Schema`),Fj=Symbol.for(`drizzle:Columns`),Ij=Symbol.for(`drizzle:ExtraConfigColumns`),Lj=Symbol.for(`drizzle:OriginalName`),Rj=Symbol.for(`drizzle:BaseName`),zj=Symbol.for(`drizzle:IsAlias`),Bj=Symbol.for(`drizzle:ExtraConfigBuilder`),Vj=Symbol.for(`drizzle:IsDrizzleTable`);var Q=class{static[X]=`Table`;static Symbol={Name:dj,Schema:Pj,OriginalName:Lj,Columns:Fj,ExtraConfigColumns:Ij,BaseName:Rj,IsAlias:zj,ExtraConfigBuilder:Bj};[dj];[Lj];[Pj];[Fj];[Ij];[Rj];[zj]=!1;[Vj]=!0;[Bj]=void 0;constructor(e,t,n){this[dj]=this[Lj]=e,this[Pj]=t,this[Rj]=n}};function Hj(e){return e[dj]}function Uj(e){return`${e[Pj]??`public`}.${e[dj]}`}function Wj(e){return e!=null&&typeof e.getSQL==`function`}function Gj(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||=[],t.typings.push(...n.typings));return t}var Kj=class{static[X]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new qj([this])}},qj=class e{constructor(e){this.queryChunks=e;for(let t of e)if(Z(t,Q)){let e=t[Q.Symbol.Schema];this.usedTables.push(e===void 0?t[Q.Symbol.Name]:e+`.`+t[Q.Symbol.Name])}}static[X]=`SQL`;decoder=Xj;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return Mj.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return Gj(t.map(t=>{if(Z(t,Kj))return{sql:t.value.join(``),params:[]};if(Z(t,Jj))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new Kj(`(`)];for(let[n,r]of t.entries())e.push(r),ne},Zj={mapToDriverValue:e=>e};({...Xj,...Zj});var Qj=class{constructor(e,t=Zj){this.value=e,this.encoder=t}static[X]=`Param`;brand;getSQL(){return new qj([this])}};function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new Kj(e[0]));for(let[r,i]of t.entries())n.push(i,new Kj(e[r+1]));return new qj(n)}(e=>{function t(){return new qj([])}e.empty=t;function n(e){return new qj(e)}e.fromList=n;function r(e){return new qj([new Kj(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new qj(n)}e.join=i;function a(e){return new Jj(e)}e.identifier=a;function o(e){return new $j(e)}e.placeholder=o;function s(e,t){return new Qj(e,t)}e.param=s})($||={}),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static[X]=`SQL.Aliased`;isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(qj||={});var $j=class{constructor(e){this.name=e}static[X]=`Placeholder`;getSQL(){return new qj([this])}};function eM(e,t){return e.map(e=>{if(Z(e,$j)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(Z(e,Qj)&&Z(e.value,$j)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const tM=Symbol.for(`drizzle:IsDrizzleView`);var nM=class{static[X]=`View`;[Nj];[tM]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[Nj]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new qj([this])}};lj.prototype.getSQL=function(){return new qj([this])},Q.prototype.getSQL=function(){return new qj([this])},Dj.prototype.getSQL=function(){return new qj([this])};var rM=class{constructor(e){this.table=e}static[X]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},iM=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[X]=`TableAliasProxyHandler`;get(e,t){if(t===Q.Symbol.IsAlias)return!0;if(t===Q.Symbol.Name||this.replaceOriginalName&&t===Q.Symbol.OriginalName)return this.alias;if(t===Nj)return{...e[Nj],name:this.alias,isAlias:!0};if(t===Q.Symbol.Columns){let t=e[Q.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new rM(new Proxy(e,this)))}),n}let n=e[t];return Z(n,lj)?new Proxy(n,new rM(new Proxy(e,this))):n}};function aM(e,t){return new Proxy(e,new iM(t,!1))}function oM(e,t){return new Proxy(e,new rM(new Proxy(e.table,new iM(t,!1))))}function sM(e,t){return new qj.Aliased(cM(e.sql,t),e.fieldAlias)}function cM(e,t){return $.join(e.queryChunks.map(e=>Z(e,lj)?oM(e,t):Z(e,qj)?cM(e,t):Z(e,qj.Aliased)?sM(e,t):e))}var lM=class extends Error{static[X]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},uM=class e extends Error{constructor(t,n,r){super(`Failed query: ${t} -params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},dM=class extends lM{static[X]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},fM=class{static[X]=`ConsoleLogWriter`;write(e){console.log(e)}},pM=class{static[X]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new fM}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},mM=class{static[X]=`NoopLogger`;logQuery(){}},hM=class{static[X]=`QueryPromise`;[Symbol.toStringTag]=`QueryPromise`;catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}};function gM(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return Z(r,lj)||Z(r,qj)||Z(r,qj.Aliased)?e.push({path:i,field:r}):Z(r,Q)?e.push(...gM(r[Q.Symbol.Columns],i)):e.push(...gM(r,i)),e},[])}function _M(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function vM(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>Z(n,qj)||Z(n,lj)?[t,n]:[t,new Qj(n,e[Q.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function yM(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype)){if(t===`constructor`)continue;Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}}function bM(e){return e[Q.Symbol.Columns]}function xM(e){return Z(e,Dj)?e._.alias:Z(e,nM)?e[Nj].name:Z(e,qj)?void 0:e[Q.Symbol.IsAlias]?e[Q.Symbol.Name]:e[Q.Symbol.BaseName]}function SM(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return!(t!==`boolean`&&(t!==`object`||typeof e.logger.logQuery!=`function`)&&t!==`undefined`)}if(`schema`in e){let t=typeof e.schema;return!(t!==`object`&&t!==`undefined`)}if(`casing`in e){let t=typeof e.casing;return!(t!==`string`&&t!==`undefined`)}if(`mode`in e)return!(e.mode!==`default`||e.mode!==`planetscale`||e.mode!==void 0);if(`connection`in e){let t=typeof e.connection;return!(t!==`string`&&t!==`object`&&t!==`undefined`)}if(`client`in e){let t=typeof e.client;return!(t!==`object`&&t!==`function`&&t!==`undefined`)}return Object.keys(e).length===0}var CM=class extends xj{static[X]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},wM=class extends xj{static[X]=`PgDateString`;getSQLType(){return`date`}},TM=class extends xj{static[X]=`PgJson`;constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},EM=class extends xj{static[X]=`PgJsonb`;constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},DM=class extends xj{static[X]=`PgNumeric`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`string`?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},OM=class extends xj{static[X]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`time${e}${this.withTimezone?` with time zone`:``}`}},kM=class extends xj{static[X]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:` (${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue=e=>new Date(this.withTimezone?e:e+`+0000`);mapToDriverValue=e=>e.toISOString()},AM=class extends xj{static[X]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},jM=class extends xj{static[X]=`PgUUID`;getSQLType(){return`uuid`}};const MM=Symbol.for(`drizzle:PgInlineForeignKeys`),NM=Symbol.for(`drizzle:EnableRLS`);var PM=class extends Q{static[X]=`PgTable`;static Symbol=Object.assign({},Q.Symbol,{InlineForeignKeys:MM,EnableRLS:NM});[MM]=[];[NM]=!1;[Q.Symbol.ExtraConfigBuilder]=void 0;[Q.Symbol.ExtraConfigColumns]={}},FM=class{static[X]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new IM(e,this.columns,this.name)}},IM=class{constructor(e,t,n){this.table=e,this.columns=t,this.name=n}static[X]=`PgPrimaryKey`;columns;name;getName(){return this.name??`${this.table[PM.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function LM(e,t){return Yj(t)&&!Wj(e)&&!Z(e,Qj)&&!Z(e,$j)&&!Z(e,lj)&&!Z(e,Q)&&!Z(e,nM)?new Qj(e,t):e}const RM=(e,t)=>$`${e} = ${LM(t,e)}`,zM=(e,t)=>$`${e} <> ${LM(t,e)}`;function BM(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new qj(t):new qj([new Kj(`(`),$.join(t,new Kj(` and `)),new Kj(`)`)])}function VM(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new qj(t):new qj([new Kj(`(`),$.join(t,new Kj(` or `)),new Kj(`)`)])}function HM(e){return $`not ${e}`}const UM=(e,t)=>$`${e} > ${LM(t,e)}`,WM=(e,t)=>$`${e} >= ${LM(t,e)}`,GM=(e,t)=>$`${e} < ${LM(t,e)}`,KM=(e,t)=>$`${e} <= ${LM(t,e)}`;function qM(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>LM(t,e))}`:$`${e} in ${LM(t,e)}`}function JM(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>LM(t,e))}`:$`${e} not in ${LM(t,e)}`}function YM(e){return $`${e} is null`}function XM(e){return $`${e} is not null`}function ZM(e){return $`exists ${e}`}function QM(e){return $`not exists ${e}`}function $M(e,t,n){return $`${e} between ${LM(t,e)} and ${LM(n,e)}`}function eN(e,t,n){return $`${e} not between ${LM(t,e)} and ${LM(n,e)}`}function tN(e,t){return $`${e} like ${t}`}function nN(e,t){return $`${e} not like ${t}`}function rN(e,t){return $`${e} ilike ${t}`}function iN(e,t){return $`${e} not ilike ${t}`}function aN(e){return $`${e} asc`}function oN(e){return $`${e} desc`}var sN=class{constructor(e,t,n){this.sourceTable=e,this.referencedTable=t,this.relationName=n,this.referencedTableName=t[Q.Symbol.Name]}static[X]=`Relation`;referencedTableName;fieldName},cN=class{constructor(e,t){this.table=e,this.config=t}static[X]=`Relations`},lN=class e extends sN{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}static[X]=`One`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},uN=class e extends sN{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}static[X]=`Many`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}};function dN(){return{and:BM,between:$M,eq:RM,exists:ZM,gt:UM,gte:WM,ilike:rN,inArray:qM,isNull:YM,isNotNull:XM,like:tN,lt:GM,lte:KM,ne:zM,not:HM,notBetween:eN,notExists:QM,notLike:nN,notIlike:iN,notInArray:JM,or:VM,sql:$}}function fN(){return{sql:$,asc:aN,desc:oN}}function pN(e,t){Object.keys(e).length===1&&`default`in e&&!Z(e.default,Q)&&(e=e.default);let n={},r={},i={};for(let[a,o]of Object.entries(e))if(Z(o,Q)){let e=Uj(o),t=r[e];n[e]=a,i[a]={tsName:a,dbName:o[Q.Symbol.Name],schema:o[Q.Symbol.Schema],columns:o[Q.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(o[Q.Symbol.Columns]))e.primary&&i[a].primaryKey.push(e);let s=o[Q.Symbol.ExtraConfigBuilder]?.(o[Q.Symbol.ExtraConfigColumns]);if(s)for(let e of Object.values(s))Z(e,FM)&&i[a].primaryKey.push(...e.columns)}else if(Z(o,cN)){let e=Uj(o.table),a=n[e],s=o.config(t(o.table)),c;for(let[t,n]of Object.entries(s))if(a){let e=i[a];e.relations[t]=n,c&&e.primaryKey.push(...c)}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function mN(e){return function(t,n){return new lN(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function hN(e){return function(t,n){return new uN(e,t,n)}}function gN(e,t,n){if(Z(n,lN)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[Uj(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[Q.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[Uj(a)];if(!o)throw Error(`Table "${a[Q.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[Q.Symbol.Name]}". Please specify relation name`);if(s[0]&&Z(s[0],lN)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function _N(e){return{one:mN(e),many:hN(e)}}function vN(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=Z(r,lN)?l&&vN(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>vN(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=Z(t,lj)?t:Z(t,qj)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var yN=class e{static[X]=`SelectionProxyHandler`;config;constructor(e){this.config={...e}}get(t,n){if(n===`_`)return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===Nj)return{...t[Nj],selectedFields:new Proxy(t[Nj].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=Z(t,Dj)?t._.selectedFields:Z(t,nM)?t[Nj].selectedFields:t,i=r[n];if(Z(i,qj.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(Z(i,qj)){if(this.config.sqlBehavior===`sql`)return i;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return Z(i,lj)?this.config.alias?new Proxy(i,new rM(new Proxy(i.table,new iM(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new e(this.config))}};function bN(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.map(e=>e.toLowerCase()).join(`_`)}function xN(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.reduce((e,t,n)=>{let r=n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`;return e+r},``)}function SN(e){return e}var CN=class{static[X]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?bN:e===`camelCase`?xN:SN}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[Q.Symbol.Schema]??`public`,n=e.table[Q.Symbol.OriginalName],r=`${t}.${n}.${e.name}`;return this.cache[r]||this.cacheTable(e.table),this.cache[r]}cacheTable(e){let t=e[Q.Symbol.Schema]??`public`,n=e[Q.Symbol.OriginalName],r=`${t}.${n}`;if(!this.cachedTables[r]){for(let t of Object.values(e[Q.Symbol.Columns])){let e=`${r}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}},wN=class extends nM{static[X]=`PgViewBase`},TN=class{static[X]=`PgDialect`;casing;constructor(e){this.casing=new CN(e?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=$` +(function(n){typeof exports==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof Be==`function`&&Be;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof Be==`function`&&Be,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,ee=0;E&&(A|=16),o===`UNIX`?(ee=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(ee=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var j=``;return j+=` +\0`,j+=r(k,2),j+=m.magic,j+=r(d,2),j+=r(f,2),j+=r(O.crc32,4),j+=r(O.compressedSize,4),j+=r(O.uncompressedSize,4),j+=r(g.length,2),j+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+j+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(ee,2)+j+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{var e=function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,ee=4;function j(e,t){return e.msg=c[t],t}function te(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function N(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,M(e.strm)}function P(e,t){e.pending_buf[e.pending++]=t}function re(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function ae(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ae(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,N(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(N(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(N(e,!0),e.strm.avail_out===0?A:ee):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),O)}),new ce(4,4,8,4,oe),new ce(4,5,16,8,oe),new ce(4,6,32,32,oe),new ce(4,4,16,16,se),new ce(8,16,32,32,se),new ce(8,16,128,128,se),new ce(8,32,128,256,se),new ce(32,128,258,1024,se),new ce(32,258,258,4096,se)],n.deflateInit=function(e,t){return fe(e,t,g,15,8,0)},n.deflateInit2=fe,n.deflateReset=de,n.deflateResetKeep=ue,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),P(i,i.gzhead.time>>16&255),P(i,i.gzhead.time>>24&255),P(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),P(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(P(i,255&i.gzhead.extra.length),P(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(P(i,0),P(i,0),P(i,0),P(i,0),P(i,0),P(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),P(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,re(i,p),i.strstart!==0&&(re(i,e.adler>>>16),re(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),M(e),o=i.pending,i.pending!==i.pending_buf_size));)P(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),M(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),M(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&M(e),i.pending+2<=i.pending_buf_size&&(P(i,255&e.adler),P(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(M(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&te(t)<=te(n)&&t!==u)return j(e,-5);if(i.status===666&&e.avail_in!==0)return j(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(ae(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(N(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(N(e,!0),e.strm.avail_out===0?A:ee):e.last_lit&&(N(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(ae(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(N(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(N(e,!0),e.strm.avail_out===0?A:ee):e.last_lit&&(N(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==ee||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(ne(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),M(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(P(i,255&e.adler),P(i,e.adler>>8&255),P(i,e.adler>>16&255),P(i,e.adler>>24&255),P(i,255&e.total_in),P(i,e.total_in>>8&255),P(i,e.total_in>>16&255),P(i,e.total_in>>24&255)):(re(i,e.adler>>>16),re(i,65535&e.adler)),M(e),0=n.w_size&&(s===0&&(ne(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,ae(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,ae,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,M=8+(15&(b>>>=4)),n.wbits===0)n.wbits=M;else if(M>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(ae[0]=255&b,ae[1]=b>>>8&255,n.check=a(n.check,ae,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,ae[2]=b>>>16&255,ae[3]=b>>>24&255,n.check=a(n.check,ae,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(ae[0]=255&b,ae[1]=b>>>8&255,n.check=a(n.check,ae,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,ae,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(M=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,M)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;M=p[g+ E++],n.head&&M&&n.length<65536&&(n.head.name+=String.fromCharCode(M)),M&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[oe[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},N=s(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,N){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,ee=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=ee;else{if(ee===16){for(re=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}M=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(ee===17){for(re=k+3;x>>=k)),b>>>=3,x-=3}else{for(re=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=M}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,P={bits:n.lenbits},N=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,N){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},N=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,N){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(ie=n.lencode[b&(1<>>16&255,ee=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>j)])>>>16&255,ee=65535&ie,!(j+(k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=j,x-=j,n.back+=j}if(b>>>=k,x-=k,n.back+=k,n.length=ee,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(re=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(ie=n.distcode[b&(1<>>16&255,ee=65535&ie,!((k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>j)])>>>16&255,ee=65535&ie,!(j+(k=ie>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=j,x-=j,n.back+=j}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=ee,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(re=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=P[re+d[w]],te[ne+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?j=0:(j&=p-1,j+=p),w++,--M[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function P(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function re(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function oe(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=ae(a[s]++,s))}}function se(e){var t;for(t=0;t>1;1<=n;n--)ue(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ue(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ue(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?ge(e,t,n,r):e.strategy===4||s===o?(re(e,2+(r?1:0),3),de(e,T,E)):(re(e,4+(r?1:0),3),function(e,t,n,r){var i;for(re(e,t-257,5),re(e,n-1,5),re(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){re(e,2,3),ie(e,_,T),function(e){e.bi_valid===16?(P(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){"use strict";if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})})),Mf=He(jf());Tl.zipReader=(e,t)=>Mf.default.loadAsync(e);const Nf=Tl.createSettings;Tl.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>Pf(e))?Nf(e):Lf(t)};function Pf(e){return e.endsWith(`model3.json`)}function Ff(e){return e.endsWith(`.moc3`)}function If(e){return e.split(/[\\/]/).pop()}function Lf(e){let t=e.filter(e=>Ff(e));if(t.length!==1){let e=t.length?`(${t.map(e=>`"${e}"`).join(`,`)})`:``;throw Error(`Expected exactly one moc file, got ${t.length} ${e}`)}let n=t[0],r=If(n).replace(/\.moc3?/,``),i=e.filter(e=>e.endsWith(`.png`));if(!i.length)throw Error(`Textures not found`);let a=e.filter(e=>e.endsWith(`.mtn`)||e.endsWith(`.motion3.json`)),o=e.find(e=>e.includes(`physics`)),s=e.find(e=>e.includes(`pose`)),c=new Dl({url:`${r}.model3.json`,Version:3,FileReferences:{Moc:n,Textures:i,Physics:o,Pose:s,Motions:a.length?{"":a.map(e=>({File:e}))}:void 0}});return c.name=r,c._objectURL=`example://${c.url}`,c}Tl.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},Tl.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},Tl.getFiles=(e,t)=>Promise.all(t.map(async t=>{let n=t.slice(t.lastIndexOf(`/`)+1),r=await e.file(t).async(`blob`);return new File([r],n)}));var Rf=S({__name:`Live2D`,props:{modelSrc:{},modelFile:{},paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},disableFocusAt:{type:Boolean},xOffset:{},yOffset:{},scale:{default:1}},setup(e){return(e,t)=>(ke(),se(_,{relative:``},{default:Me(({width:t,height:n})=>[ue(Ll,{width:t,height:n,resolution:2,"max-h":`100dvh`},{default:Me(({app:r})=>[ue(Af,{"model-src":e.modelSrc,"model-file":e.modelFile,app:r,"mouth-open-size":e.mouthOpenSize,width:t,height:n,paused:e.paused,"focus-at":e.focusAt,"x-offset":e.xOffset,"y-offset":e.yOffset,scale:e.scale,"disable-focus-at":e.disableFocusAt},null,8,[`model-src`,`model-file`,`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`,`disable-focus-at`])]),_:2},1032,[`width`,`height`])]),_:1}))}}),zf=Rf;function Bf(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Vf(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Hf(e){return this instanceof Hf?(this.v=e,this):new Hf(e)}function Uf(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof Hf?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Wf(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:Hf(e[r](t)),done:!1}:i?i(t):t}:i}}function Gf(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Vf==`function`?Vf(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const Kf=new TextDecoder(`utf-8`),qf=e=>Kf.decode(e),Jf=new TextEncoder,Yf=e=>Jf.encode(e),Xf=e=>typeof e==`number`,Zf=e=>typeof e==`boolean`,Qf=e=>typeof e==`function`,$f=e=>e!=null&&Object(e)===e,ep=e=>$f(e)&&Qf(e.then),tp=e=>$f(e)&&Qf(e[Symbol.iterator]),np=e=>$f(e)&&Qf(e[Symbol.asyncIterator]),rp=e=>$f(e)&&$f(e.schema),ip=e=>$f(e)&&`done`in e&&`value`in e,ap=e=>$f(e)&&Qf(e.stat)&&Xf(e.fd),op=e=>$f(e)&&lp(e.body),sp=e=>`_getDOMStream`in e&&`_getNodeStream`in e,cp=e=>$f(e)&&Qf(e.abort)&&Qf(e.getWriter)&&!sp(e),lp=e=>$f(e)&&Qf(e.cancel)&&Qf(e.getReader)&&!sp(e),up=e=>$f(e)&&Qf(e.end)&&Qf(e.write)&&Zf(e.writable)&&!sp(e),dp=e=>$f(e)&&Qf(e.read)&&Qf(e.pipe)&&Zf(e.readable)&&!sp(e),fp=e=>$f(e)&&Qf(e.clear)&&Qf(e.bytes)&&Qf(e.position)&&Qf(e.setPosition)&&Qf(e.capacity)&&Qf(e.getBufferIdentifier)&&Qf(e.createLong),pp=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function mp(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++c_p(Int32Array,e),yp=e=>_p(BigInt64Array,e),bp=e=>_p(Uint8Array,e),xp=e=>(e.next(),e);function*Sp(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof pp?n(t):tp(t)?t:n(t);return yield*xp((function*(t){let n=null;do n=t.next(yield _p(e,n));while(!n.done)})(r[Symbol.iterator]())),new e}const Cp=e=>Sp(Uint8Array,e);function wp(e,t){return Uf(this,arguments,function*(){if(ep(t))return yield Hf(yield Hf(yield*Wf(Gf(wp(e,yield Hf(t))))));let n=function(e){return Uf(this,arguments,function*(){yield yield Hf(yield Hf(e))})},r=function(e){return Uf(this,arguments,function*(){yield Hf(yield*Wf(Gf(xp((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof pp?n(t):tp(t)?r(t):np(t)?t:n(t);return yield Hf(yield*Wf(Gf(xp((function(t){return Uf(this,arguments,function*(){let n=null;do n=yield Hf(t.next(yield yield Hf(_p(e,n))));while(!n.done)})})(i[Symbol.asyncIterator]()))))),yield Hf(new e)})}const Tp=e=>wp(Uint8Array,e);function Ep(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*Ap(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?gp(r,o)[0]:([i,r,s]=gp(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=Cp(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?l.next():l.next(o-s),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield c());while(onull)()))||{cmd:`read`,size:0});let l=Tp(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield Hf(l.next()):yield Hf(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield Hf(c()));while(onull)()))||{cmd:`read`,size:0});let l=new Np(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield Hf(l.read()):yield Hf(l.read(o-s)),!t&&i.byteLength>0&&(r.push(bp(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield Hf(c()));while(o{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return Bf(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return Bf(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array};let t=yield this.reader.read();return!t.done&&(t.value=bp(t)),t})}};const Pp=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Fp(e){return Uf(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?gp(c,o)[0]:([l,c,s]=gp(c,o),l)}if({cmd:a,size:o}=(yield yield Hf((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield Hf(new Uint8Array),yield Hf(null);try{t[0]=Pp(e,`end`),t[1]=Pp(e,`error`);do{if(t[2]=Pp(e,`readable`),[n,i]=yield Hf(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=bp(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield Hf(u()));while(o{for(let[n,r]of t)e.off(n,r);try{let t=e.destroy;t&&t.call(e,n),n=void 0}catch(e){n=e||n}finally{n==null?r():i(n)}})}})}var Ip;(function(e){e[e.V1=0]=`V1`,e[e.V2=1]=`V2`,e[e.V3=2]=`V3`,e[e.V4=3]=`V4`,e[e.V5=4]=`V5`})(Ip||={});var Lp;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(Lp||={});var Rp;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(Rp||={});var zp;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(zp||={});var Bp;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(Bp||={});var Vp;(function(e){e[e.YEAR_MONTH=0]=`YEAR_MONTH`,e[e.DAY_TIME=1]=`DAY_TIME`,e[e.MONTH_DAY_NANO=2]=`MONTH_DAY_NANO`})(Vp||={});const Hp=2,Up=4,Wp=4,Gp=4,Kp=new Int32Array(2),qp=new Float32Array(Kp.buffer),Jp=new Float64Array(Kp.buffer),Yp=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Xp;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(Xp||={});var Zp=class e{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){qp[0]=t,this.writeInt32(e,Kp[0])}writeFloat64(e,t){Jp[0]=t,this.writeInt32(e,Kp[Yp?0:1]),this.writeInt32(e+4,Kp[Yp?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]==0?0:e-this.vtable[t]);let r=2;this.addInt16(e-this.object_start);let i=(n+r)*Hp;this.addInt16(i);let a=0,o=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,Up+r),this.addOffset(e),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),i=t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){let t=e.endObject();return t}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},km=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+Gp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){let t=e.endObject();return t}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},Am;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.FloatingPoint=3]=`FloatingPoint`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct_=13]=`Struct_`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.LargeList=21]=`LargeList`,e[e.RunEndEncoded=22]=`RunEndEncoded`})(Am||={});var jm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+Gp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Am.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new lm).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new um).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,Am.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){let t=e.endObject();return t}},Mm=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+Gp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):om.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new jm).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new um).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,om.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){let t=e.endObject();return t}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(t,n,r,i,a){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,a),e.endSchema(t)}},Nm;(function(e){e[e.NONE=0]=`NONE`,e[e.Schema=1]=`Schema`,e[e.DictionaryBatch=2]=`DictionaryBatch`,e[e.RecordBatch=3]=`RecordBatch`,e[e.Tensor=4]=`Tensor`,e[e.SparseTensor=5]=`SparseTensor`})(Nm||={});var L;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.Float=3]=`Float`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct=13]=`Struct`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.Dictionary=-1]=`Dictionary`,e[e.Int8=-2]=`Int8`,e[e.Int16=-3]=`Int16`,e[e.Int32=-4]=`Int32`,e[e.Int64=-5]=`Int64`,e[e.Uint8=-6]=`Uint8`,e[e.Uint16=-7]=`Uint16`,e[e.Uint32=-8]=`Uint32`,e[e.Uint64=-9]=`Uint64`,e[e.Float16=-10]=`Float16`,e[e.Float32=-11]=`Float32`,e[e.Float64=-12]=`Float64`,e[e.DateDay=-13]=`DateDay`,e[e.DateMillisecond=-14]=`DateMillisecond`,e[e.TimestampSecond=-15]=`TimestampSecond`,e[e.TimestampMillisecond=-16]=`TimestampMillisecond`,e[e.TimestampMicrosecond=-17]=`TimestampMicrosecond`,e[e.TimestampNanosecond=-18]=`TimestampNanosecond`,e[e.TimeSecond=-19]=`TimeSecond`,e[e.TimeMillisecond=-20]=`TimeMillisecond`,e[e.TimeMicrosecond=-21]=`TimeMicrosecond`,e[e.TimeNanosecond=-22]=`TimeNanosecond`,e[e.DenseUnion=-23]=`DenseUnion`,e[e.SparseUnion=-24]=`SparseUnion`,e[e.IntervalDayTime=-25]=`IntervalDayTime`,e[e.IntervalYearMonth=-26]=`IntervalYearMonth`,e[e.DurationSecond=-27]=`DurationSecond`,e[e.DurationMillisecond=-28]=`DurationMillisecond`,e[e.DurationMicrosecond=-29]=`DurationMicrosecond`,e[e.DurationNanosecond=-30]=`DurationNanosecond`})(L||={});var Pm;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(Pm||={});const Fm=void 0;function Im(e){if(e===null)return`null`;if(e===Fm)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>Im(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function Lm(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function Rm(e,t){return Lm(e/t)+Lm(e%t)/Lm(t)}const zm=Symbol.for(`isArrowBigNum`);function Bm(e,...t){return t.length===0?Object.setPrototypeOf(_p(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Bm.prototype[zm]=!0,Bm.prototype.toJSON=function(){return`"${qm(this)}"`},Bm.prototype.valueOf=function(e){return Km(this,e)},Bm.prototype.toString=function(){return qm(this)},Bm.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return Km(this);case`string`:return qm(this);case`default`:return Jm(this)}return qm(this)};function Vm(...e){return Bm.apply(this,e)}function Hm(...e){return Bm.apply(this,e)}function Um(...e){return Bm.apply(this,e)}Object.setPrototypeOf(Vm.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Hm.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(Um.prototype,Object.create(Uint32Array.prototype)),Object.assign(Vm.prototype,Bm.prototype,{constructor:Vm,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Hm.prototype,Bm.prototype,{constructor:Hm,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(Um.prototype,Bm.prototype,{constructor:Um,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const Wm=BigInt(4294967296)*BigInt(4294967296),Gm=Wm-BigInt(1);function Km(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<=0)return Ym(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(R.prototype);var yh=class extends R{constructor(){super(L.Null)}toString(){return`Null`}};Qm=Symbol.toStringTag,yh[Qm]=(e=>e[Symbol.toStringTag]=`Null`)(yh.prototype);var bh=class extends R{constructor(e,t){super(L.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};$m=Symbol.toStringTag,bh[$m]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(bh.prototype);var xh=class extends bh{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Sh=class extends bh{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Ch=class extends bh{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},wh=class extends bh{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Th=class extends bh{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Eh=class extends bh{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Dh=class extends bh{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Oh=class extends bh{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(xh.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(Sh.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(Ch.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(wh.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(Th.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(Eh.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(Dh.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(Oh.prototype,`ArrayType`,{value:BigUint64Array});var kh=class extends R{constructor(e){super(L.Float),this.precision=e}get ArrayType(){switch(this.precision){case Rp.HALF:return Uint16Array;case Rp.SINGLE:return Float32Array;case Rp.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};eh=Symbol.toStringTag,kh[eh]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(kh.prototype);var Ah=class extends kh{constructor(){super(Rp.HALF)}},jh=class extends kh{constructor(){super(Rp.SINGLE)}},Mh=class extends kh{constructor(){super(Rp.DOUBLE)}};Object.defineProperty(Ah.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(jh.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(Mh.prototype,`ArrayType`,{value:Float64Array});var Nh=class extends R{constructor(){super(L.Binary)}toString(){return`Binary`}};th=Symbol.toStringTag,Nh[th]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(Nh.prototype);var Ph=class extends R{constructor(){super(L.LargeBinary)}toString(){return`LargeBinary`}};nh=Symbol.toStringTag,Ph[nh]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(Ph.prototype);var Fh=class extends R{constructor(){super(L.Utf8)}toString(){return`Utf8`}};rh=Symbol.toStringTag,Fh[rh]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(Fh.prototype);var Ih=class extends R{constructor(){super(L.LargeUtf8)}toString(){return`LargeUtf8`}};ih=Symbol.toStringTag,Ih[ih]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(Ih.prototype);var Lh=class extends R{constructor(){super(L.Bool)}toString(){return`Bool`}};ah=Symbol.toStringTag,Lh[ah]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(Lh.prototype);var Rh=class extends R{constructor(e,t,n=128){super(L.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};oh=Symbol.toStringTag,Rh[oh]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(Rh.prototype);var zh=class extends R{constructor(e){super(L.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${zp[this.unit]}>`}get ArrayType(){return this.unit===zp.DAY?Int32Array:BigInt64Array}};sh=Symbol.toStringTag,zh[sh]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(zh.prototype);var Bh=class extends R{constructor(e,t){super(L.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${Bp[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};ch=Symbol.toStringTag,Bh[ch]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(Bh.prototype);var Vh=class extends R{constructor(e,t){super(L.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${Bp[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};lh=Symbol.toStringTag,Vh[lh]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(Vh.prototype);var Hh=class extends R{constructor(e){super(L.Interval),this.unit=e}toString(){return`Interval<${Vp[this.unit]}>`}};uh=Symbol.toStringTag,Hh[uh]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(Hh.prototype);var Uh=class extends R{constructor(e){super(L.Duration),this.unit=e}toString(){return`Duration<${Bp[this.unit]}>`}};dh=Symbol.toStringTag,Uh[dh]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Uh.prototype);var Wh=class extends R{constructor(e){super(L.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};fh=Symbol.toStringTag,Wh[fh]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Wh.prototype);var Gh=class extends R{constructor(e){super(L.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};ph=Symbol.toStringTag,Gh[ph]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Gh.prototype);var Kh=class extends R{constructor(e,t,n){super(L.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};mh=Symbol.toStringTag,Kh[mh]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(Kh.prototype);var qh=class extends R{constructor(e){super(L.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};hh=Symbol.toStringTag,qh[hh]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(qh.prototype);var Jh=class extends R{constructor(e,t){super(L.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};gh=Symbol.toStringTag,Jh[gh]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Jh.prototype);var Yh=class extends R{constructor(e,t=!1){var n,r,i;if(super(L.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};_h=Symbol.toStringTag,Yh[_h]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(Yh.prototype);const Xh=(e=>()=>++e)(-1);var Zh=class extends R{constructor(e,t,n,r){super(L.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Xh():Lm(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};vh=Symbol.toStringTag,Zh[vh]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(Zh.prototype);function Qh(e){let t=e;switch(e.typeId){case L.Decimal:return e.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}var $h=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return eg(this,e,t)}getVisitFnByTypeId(e,t=!0){return tg(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function eg(e,t,n=!0){return typeof t==`number`?tg(e,t,n):typeof t==`string`&&t in L?tg(e,L[t],n):t&&t instanceof R?tg(e,ng(t),n):t?.type&&t.type instanceof R?tg(e,ng(t.type),n):tg(e,L.NONE,n)}function tg(e,t,n=!0){let r=null;switch(t){case L.Null:r=e.visitNull;break;case L.Bool:r=e.visitBool;break;case L.Int:r=e.visitInt;break;case L.Int8:r=e.visitInt8||e.visitInt;break;case L.Int16:r=e.visitInt16||e.visitInt;break;case L.Int32:r=e.visitInt32||e.visitInt;break;case L.Int64:r=e.visitInt64||e.visitInt;break;case L.Uint8:r=e.visitUint8||e.visitInt;break;case L.Uint16:r=e.visitUint16||e.visitInt;break;case L.Uint32:r=e.visitUint32||e.visitInt;break;case L.Uint64:r=e.visitUint64||e.visitInt;break;case L.Float:r=e.visitFloat;break;case L.Float16:r=e.visitFloat16||e.visitFloat;break;case L.Float32:r=e.visitFloat32||e.visitFloat;break;case L.Float64:r=e.visitFloat64||e.visitFloat;break;case L.Utf8:r=e.visitUtf8;break;case L.LargeUtf8:r=e.visitLargeUtf8;break;case L.Binary:r=e.visitBinary;break;case L.LargeBinary:r=e.visitLargeBinary;break;case L.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case L.Date:r=e.visitDate;break;case L.DateDay:r=e.visitDateDay||e.visitDate;break;case L.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case L.Timestamp:r=e.visitTimestamp;break;case L.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case L.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case L.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case L.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case L.Time:r=e.visitTime;break;case L.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case L.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case L.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case L.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case L.Decimal:r=e.visitDecimal;break;case L.List:r=e.visitList;break;case L.Struct:r=e.visitStruct;break;case L.Union:r=e.visitUnion;break;case L.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case L.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case L.Dictionary:r=e.visitDictionary;break;case L.Interval:r=e.visitInterval;break;case L.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case L.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case L.Duration:r=e.visitDuration;break;case L.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case L.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case L.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case L.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case L.FixedSizeList:r=e.visitFixedSizeList;break;case L.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${L[t]}'`)}function ng(e){switch(e.typeId){case L.Null:return L.Null;case L.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?L.Int8:L.Uint8;case 16:return n?L.Int16:L.Uint16;case 32:return n?L.Int32:L.Uint32;case 64:return n?L.Int64:L.Uint64}return L.Int}case L.Float:switch(e.precision){case Rp.HALF:return L.Float16;case Rp.SINGLE:return L.Float32;case Rp.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(e.unit){case Bp.SECOND:return L.TimeSecond;case Bp.MILLISECOND:return L.TimeMillisecond;case Bp.MICROSECOND:return L.TimeMicrosecond;case Bp.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(e.unit){case Bp.SECOND:return L.TimestampSecond;case Bp.MILLISECOND:return L.TimestampMillisecond;case Bp.MICROSECOND:return L.TimestampMicrosecond;case Bp.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(e.unit){case zp.DAY:return L.DateDay;case zp.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(e.unit){case Vp.DAY_TIME:return L.IntervalDayTime;case Vp.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(e.unit){case Bp.SECOND:return L.DurationSecond;case Bp.MILLISECOND:return L.DurationMillisecond;case Bp.MICROSECOND:return L.DurationMicrosecond;case Bp.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(e.mode){case Lp.Dense:return L.DenseUnion;case Lp.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw Error(`Unrecognized type '${L[e.typeId]}'`)}$h.prototype.visitInt8=null,$h.prototype.visitInt16=null,$h.prototype.visitInt32=null,$h.prototype.visitInt64=null,$h.prototype.visitUint8=null,$h.prototype.visitUint16=null,$h.prototype.visitUint32=null,$h.prototype.visitUint64=null,$h.prototype.visitFloat16=null,$h.prototype.visitFloat32=null,$h.prototype.visitFloat64=null,$h.prototype.visitDateDay=null,$h.prototype.visitDateMillisecond=null,$h.prototype.visitTimestampSecond=null,$h.prototype.visitTimestampMillisecond=null,$h.prototype.visitTimestampMicrosecond=null,$h.prototype.visitTimestampNanosecond=null,$h.prototype.visitTimeSecond=null,$h.prototype.visitTimeMillisecond=null,$h.prototype.visitTimeMicrosecond=null,$h.prototype.visitTimeNanosecond=null,$h.prototype.visitDenseUnion=null,$h.prototype.visitSparseUnion=null,$h.prototype.visitIntervalDayTime=null,$h.prototype.visitIntervalYearMonth=null,$h.prototype.visitDuration=null,$h.prototype.visitDurationSecond=null,$h.prototype.visitDurationMillisecond=null,$h.prototype.visitDurationMicrosecond=null,$h.prototype.visitDurationNanosecond=null;const rg=new Float64Array(1),ig=new Uint32Array(rg.buffer);function ag(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function og(e){if(e!==e)return 32256;rg[0]=e;let t=(ig[1]&2147483648)>>16&65535,n=ig[1]&2146435072,r=0;return n>=1089470464?ig[0]>0?n=31744:(n=(n&2080374784)>>16,r=(ig[1]&1048575)>>10):n<=1056964608?(r=1048576+(ig[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(ig[1]&1048575)+512>>10),t|n|r&65535}var sg=class extends $h{};function cg(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const lg=(e,t,n)=>{e[t]=Math.floor(n/864e5)},ug=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},pg=({values:e},t,n)=>{e[t]=n},mg=({values:e},t,n)=>{e[t]=og(n)},hg=(e,t,n)=>{switch(e.type.precision){case Rp.HALF:return mg(e,t,n);case Rp.SINGLE:case Rp.DOUBLE:return pg(e,t,n)}},gg=({values:e},t,n)=>{lg(e,t,n.valueOf())},_g=({values:e},t,n)=>{e[t]=BigInt(n)},vg=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},yg=({values:e,valueOffsets:t},n,r)=>ug(e,t,n,r),bg=({values:e,valueOffsets:t},n,r)=>ug(e,t,n,Yf(r)),xg=(e,t,n)=>{e.type.unit===zp.DAY?gg(e,t,n):_g(e,t,n)},Sg=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},Cg=({values:e},t,n)=>{e[t]=BigInt(n)},wg=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},Tg=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},Eg=(e,t,n)=>{switch(e.type.unit){case Bp.SECOND:return Sg(e,t,n);case Bp.MILLISECOND:return Cg(e,t,n);case Bp.MICROSECOND:return wg(e,t,n);case Bp.NANOSECOND:return Tg(e,t,n)}},Dg=({values:e},t,n)=>{e[t]=n},Og=({values:e},t,n)=>{e[t]=n},kg=({values:e},t,n)=>{e[t]=n},Ag=({values:e},t,n)=>{e[t]=n},jg=(e,t,n)=>{switch(e.type.unit){case Bp.SECOND:return Dg(e,t,n);case Bp.MILLISECOND:return Og(e,t,n);case Bp.MICROSECOND:return kg(e,t,n);case Bp.NANOSECOND:return Ag(e,t,n)}},Mg=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},Ng=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=$g.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=$g.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},Fg=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),Ig=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),Lg=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),Rg=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),zg=(e,t,n)=>{let r=e.type.children.map(e=>$g.getVisitFn(e.type)),i=n instanceof Map?Lg(t,n):n instanceof Yv?Ig(t,n):Array.isArray(n)?Fg(t,n):Rg(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},Bg=(e,t,n)=>{e.type.mode===Lp.Dense?Vg(e,t,n):Hg(e,t,n)},Vg=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];$g.visit(i,e.valueOffsets[t],n)},Hg=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];$g.visit(i,t,n)},Ug=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},Wg=(e,t,n)=>{e.type.unit===Vp.DAY_TIME?Gg(e,t,n):Kg(e,t,n)},Gg=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Kg=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},qg=({values:e},t,n)=>{e[t]=n},Jg=({values:e},t,n)=>{e[t]=n},Yg=({values:e},t,n)=>{e[t]=n},Xg=({values:e},t,n)=>{e[t]=n},Zg=(e,t,n)=>{switch(e.type.unit){case Bp.SECOND:return qg(e,t,n);case Bp.MILLISECOND:return Jg(e,t,n);case Bp.MICROSECOND:return Yg(e,t,n);case Bp.NANOSECOND:return Xg(e,t,n)}},Qg=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=$g.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${Im(e)}: ${Im(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new r_(this[e_],this[t_])}},r_=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[e_].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[e_].type.children.findIndex(e=>e.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[e_].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=J_.visit(e[e_].children[n],e[t_]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[e_].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:($g.visit(e[e_].children[r],e[t_],n),Reflect.set(e,t,n))}},z=class extends $h{};function a_(e){return(t,n)=>t.getValid(n)?e(t,n):null}const o_=(e,t)=>864e5*e[t],s_=(e,t)=>null,c_=(e,t,n)=>{if(n+1>=t.length)return null;let r=Lm(t[n]),i=Lm(t[n+1]);return e.subarray(r,i)},l_=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<o_(e,t),d_=({values:e},t)=>Lm(e[t]),f_=({stride:e,values:t},n)=>t[e*n],p_=({stride:e,values:t},n)=>ag(t[e*n]),m_=({values:e},t)=>e[t],h_=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),g_=({values:e,valueOffsets:t},n)=>c_(e,t,n),__=({values:e,valueOffsets:t},n)=>{let r=c_(e,t,n);return r===null?null:qf(r)},v_=({values:e},t)=>e[t],y_=({type:e,values:t},n)=>e.precision===Rp.HALF?ag(t[n]):t[n],b_=(e,t)=>e.type.unit===zp.DAY?u_(e,t):d_(e,t),x_=({values:e},t)=>1e3*Lm(e[t]),S_=({values:e},t)=>Lm(e[t]),C_=({values:e},t)=>Rm(e[t],BigInt(1e3)),w_=({values:e},t)=>Rm(e[t],BigInt(1e6)),T_=(e,t)=>{switch(e.type.unit){case Bp.SECOND:return x_(e,t);case Bp.MILLISECOND:return S_(e,t);case Bp.MICROSECOND:return C_(e,t);case Bp.NANOSECOND:return w_(e,t)}},E_=({values:e},t)=>e[t],D_=({values:e},t)=>e[t],O_=({values:e},t)=>e[t],k_=({values:e},t)=>e[t],A_=(e,t)=>{switch(e.type.unit){case Bp.SECOND:return E_(e,t);case Bp.MILLISECOND:return D_(e,t);case Bp.MICROSECOND:return O_(e,t);case Bp.NANOSECOND:return k_(e,t)}},j_=({values:e,stride:t},n)=>Xm.decimal(e.subarray(t*n,t*(n+1))),M_=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new Yv([c])},N_=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new $_(o.slice(i,a-i))},P_=(e,t)=>new n_(e,t),F_=(e,t)=>e.type.mode===Lp.Dense?I_(e,t):L_(e,t),I_=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return J_.visit(r,e.valueOffsets[t])},L_=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return J_.visit(r,t)},R_=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},z_=(e,t)=>e.type.unit===Vp.DAY_TIME?B_(e,t):V_(e,t),B_=({values:e},t)=>e.subarray(2*t,2*(t+1)),V_=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},H_=({values:e},t)=>e[t],U_=({values:e},t)=>e[t],W_=({values:e},t)=>e[t],G_=({values:e},t)=>e[t],K_=(e,t)=>{switch(e.type.unit){case Bp.SECOND:return H_(e,t);case Bp.MILLISECOND:return U_(e,t);case Bp.MICROSECOND:return W_(e,t);case Bp.NANOSECOND:return G_(e,t)}},q_=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new Yv([a])};z.prototype.visitNull=a_(s_),z.prototype.visitBool=a_(l_),z.prototype.visitInt=a_(v_),z.prototype.visitInt8=a_(f_),z.prototype.visitInt16=a_(f_),z.prototype.visitInt32=a_(f_),z.prototype.visitInt64=a_(m_),z.prototype.visitUint8=a_(f_),z.prototype.visitUint16=a_(f_),z.prototype.visitUint32=a_(f_),z.prototype.visitUint64=a_(m_),z.prototype.visitFloat=a_(y_),z.prototype.visitFloat16=a_(p_),z.prototype.visitFloat32=a_(f_),z.prototype.visitFloat64=a_(f_),z.prototype.visitUtf8=a_(__),z.prototype.visitLargeUtf8=a_(__),z.prototype.visitBinary=a_(g_),z.prototype.visitLargeBinary=a_(g_),z.prototype.visitFixedSizeBinary=a_(h_),z.prototype.visitDate=a_(b_),z.prototype.visitDateDay=a_(u_),z.prototype.visitDateMillisecond=a_(d_),z.prototype.visitTimestamp=a_(T_),z.prototype.visitTimestampSecond=a_(x_),z.prototype.visitTimestampMillisecond=a_(S_),z.prototype.visitTimestampMicrosecond=a_(C_),z.prototype.visitTimestampNanosecond=a_(w_),z.prototype.visitTime=a_(A_),z.prototype.visitTimeSecond=a_(E_),z.prototype.visitTimeMillisecond=a_(D_),z.prototype.visitTimeMicrosecond=a_(O_),z.prototype.visitTimeNanosecond=a_(k_),z.prototype.visitDecimal=a_(j_),z.prototype.visitList=a_(M_),z.prototype.visitStruct=a_(P_),z.prototype.visitUnion=a_(F_),z.prototype.visitDenseUnion=a_(I_),z.prototype.visitSparseUnion=a_(L_),z.prototype.visitDictionary=a_(R_),z.prototype.visitInterval=a_(z_),z.prototype.visitIntervalDayTime=a_(B_),z.prototype.visitIntervalYearMonth=a_(V_),z.prototype.visitDuration=a_(K_),z.prototype.visitDurationSecond=a_(H_),z.prototype.visitDurationMillisecond=a_(U_),z.prototype.visitDurationMicrosecond=a_(W_),z.prototype.visitDurationNanosecond=a_(G_),z.prototype.visitFixedSizeList=a_(q_),z.prototype.visitMap=a_(N_);const J_=new z,Y_=Symbol.for(`keys`),X_=Symbol.for(`vals`),Z_=Symbol.for(`kKeysAsStrings`),Q_=Symbol.for(`_kKeysAsStrings`);var $_=class{constructor(e){return this[Y_]=new Yv([e.children[0]]).memoize(),this[X_]=e.children[1],new Proxy(this,new tv)}get[Z_](){return this[Q_]||(this[Q_]=Array.from(this[Y_].toArray(),String))}[Symbol.iterator](){return new ev(this[Y_],this[X_])}get size(){return this[Y_].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Y_],t=this[X_],n={};for(let r=-1,i=e.length;++r`${Im(e)}: ${Im(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},ev=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),J_.visit(this.vals,e)]})}},tv=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Z_]}has(e,t){return e[Z_].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[Z_].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Z_].indexOf(t);if(n!==-1){let r=J_.visit(Reflect.get(e,X_),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Z_].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:($g.visit(Reflect.get(e,X_),r,n),Reflect.set(e,t,n))}};Object.defineProperties($_.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Y_]:{writable:!0,enumerable:!1,configurable:!1,value:null},[X_]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Q_]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let nv;function rv(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const iv=(e,t)=>e<0?t+e:e,av=e=>e!==e;function ov(e){let t=typeof e;if(t!==`object`||e===null)return av(e)?av:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?Dp(e,t):!1:e instanceof Map?cv(e):Array.isArray(e)?sv(e):e instanceof Yv?lv(e):uv(e,!0)}function sv(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return fv(e,n);case Map:return mv(e,n,n.keys());case $_:case n_:case Object:case void 0:return mv(e,n,t||Object.keys(n))}return n instanceof Yv?pv(e,n):!1}}function fv(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function _v(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):vv(new yv(n,e,t,null,hv)).subarray(0,r)),i}return n}function vv(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var yv=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return bv(e,t,i)+bv(e,r,n)+xv(e,i>>3,r-i>>3)}function xv(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=Sv(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=Sv(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=Sv(a.getUint8(i)),i+=1;return r}function Sv(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const Cv=-1;var wv=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return R.isSparseUnion(e)||R.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(R.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=Cv&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-bv(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=Qh(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(R.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===Lp.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(_v(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===L.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(_v(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[Pm.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[Pm.TYPE])&&(a[Pm.TYPE]=i.subarray(e,e+t)),(i=a[Pm.OFFSET])&&(a[Pm.OFFSET]=i.subarray(e,e+t+1))||(i=a[Pm.DATA])&&(a[Pm.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};wv.prototype.children=Object.freeze([]);var Tv=class e extends $h{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new wv(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=bp(e.data),i=bp(e.nullBitmap),a=vp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new wv(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=bp(e.data),i=bp(e.nullBitmap),a=yp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new wv(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=bp(e.data),i=bp(e.nullBitmap),a=vp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new wv(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=bp(e.data),i=bp(e.nullBitmap),a=yp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new wv(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length/Qh(t),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length/Qh(t),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length/Qh(t),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length/Qh(t),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length/Qh(t),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=bp(e.nullBitmap),a=vp(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new wv(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=bp(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=_p(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(R.isSparseUnion(t))return new wv(t,n,a,o,[void 0,void 0,void 0,i],r);let s=vp(e.valueOffsets);return new wv(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=bp(t.nullBitmap),a=_p(n.indices.ArrayType,t.data),{dictionary:o=new Yv([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new wv(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length/Qh(t),nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=bp(e.nullBitmap),i=_p(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new wv(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=bp(t.nullBitmap),{length:o=i.length/Qh(n),nullCount:s=t.nullBitmap?-1:0}=t;return new wv(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=bp(t.nullBitmap),o=vp(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new wv(n,r,s,c,[o,void 0,a],[i])}};const Ev=new Tv;function Dv(e){return Ev.visit(e)}var Ov=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function Av(e){return e.reduce((e,t)=>e+t.nullCount,0)}function jv(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function Mv(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function Nv(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function zv(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new yv(n,e.offset+(t||0),e.length,n,hv)){if(!i)return r;++r}return-1}function Bv(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case L.Union:break;case L.Dictionary:break;default:return zv(e,n)}let r=J_.getVisitFn(e),i=ov(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new Ov(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new Wv(a)})}var Wv=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof wv)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=qv[o.typeId],r=a[0];this.isValid=e=>Pv(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,Jv[o.typeId]),this._offsets=jv(a);break}this.data=a,this.type=o,this.stride=Qh(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return kv(this.data)}get nullCount(){return Av(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(iv(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Gv.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(rv(this,t,n,({data:e,_offsets:t},n,r)=>Mv(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return R.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(R.isDictionary(this.type)){let t=new Xv(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new Xv(this)}unmemoize(){if(R.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};Kv=Symbol.toStringTag,Yv[Kv]=(e=>{e.type=R.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(L).map(e=>L[e]).filter(e=>typeof e==`number`&&e!==L.NONE);for(let n of t){let t=J_.getVisitFnByTypeId(n),r=$g.getVisitFnByTypeId(n),i=Hv.getVisitFnByTypeId(n);qv[n]={get:t,set:r,indexOf:i},Jv[n]=Object.create(e,{isValid:{value:Fv(Pv)},get:{value:Fv(J_.getVisitFnByTypeId(n))},set:{value:Iv($g.getVisitFnByTypeId(n))},indexOf:{value:Lv(Hv.getVisitFnByTypeId(n))}})}return`Vector`})(Yv.prototype);var Xv=class e extends Yv{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new Yv(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},Zv=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,r){return e.prep(8,24),e.writeInt64(BigInt(r??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}},Qv=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+Gp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ip.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Mm).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Zv).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new Zv).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new um).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Ip.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){let t=e.endObject();return t}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},$v=class e{constructor(e=[],t,n,r=Ip.V5){this.fields=e||[],this.metadata=t||new Map,n||=ny(this.fields),this.dictionaries=n,this.metadataVersion=r}get[Symbol.toStringTag](){return`Schema`}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(`, `)} }>`}select(t){let n=new Set(t),r=this.fields.filter(e=>n.has(e.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(e=>this.fields[e]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=ty(ty(new Map,this.metadata),n.metadata),a=n.fields.filter(e=>{let t=r.findIndex(t=>t.name===e.name);return~t?(r[t]=e.clone({metadata:ty(ty(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=ny(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};$v.prototype.fields=null,$v.prototype.metadata=null,$v.prototype.dictionaries=null;var ey=class e{static new(...t){let[n,r,i,a]=t;return t[0]&&typeof t[0]==`object`&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),a===void 0&&(a=t[0].metadata)),new e(`${n}`,r,i,a)}constructor(e,t,n=!1,r){this.name=e,this.type=t,this.nullable=n,this.metadata=r||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return`Field`}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,a]=t;return!t[0]||typeof t[0]!=`object`?[n=this.name,r=this.type,i=this.nullable,a=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:a=this.metadata}=t[0],e.new(n,r,i,a)}};ey.prototype.type=null,ey.prototype.name=null,ey.prototype.nullable=null,ey.prototype.metadata=null;function ty(e,t){return new Map([...e||new Map,...t||new Map])}function ny(e,t=new Map){for(let n=-1,r=e.length;++n0&&ny(i.children,t)}return t}var ry=Qp,iy=Zp,ay=class{static decode(e){e=new iy(bp(e));let t=Qv.getRootAsFooter(e),n=$v.decode(t.schema(),new Map,t.version());return new oy(n,t)}static encode(e){let t=new ry,n=$v.encode(t,e.schema);Qv.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())sy.encode(t,n);let r=t.endVector();Qv.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())sy.encode(t,n);let i=t.endVector();return Qv.startFooter(t),Qv.addSchema(t,n),Qv.addVersion(t,Ip.V5),Qv.addRecordBatches(t,r),Qv.addDictionaries(t,i),Qv.finishFooterBuffer(t,Qv.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=Ip.V5,n,r){this.schema=e,this.version=t,n&&(this._recordBatches=n),r&&(this._dictionaryBatches=r)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return Bf(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(cy);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Op.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Op.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return Bf(this,void 0,void 0,function*(){return yield this.abort(e),cy})}return(e){return Bf(this,void 0,void 0,function*(){return yield this.close(),cy})}read(e){return Bf(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return Bf(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,t)=>{this.resolvers.push({resolve:e,reject:t})}):Promise.resolve(cy)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},fy=class extends dy{write(e){if((e=bp(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?qf(this.toUint8Array(!0)):this.toUint8Array(!1).then(qf)}toUint8Array(e=!1){return e?gp(this._values)[0]:(()=>Bf(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=Gf(this),c;c=yield s.next(),e=c.done,!e;o=!0){r=c.value,o=!1;let e=r;i.push(e),a+=e.byteLength}}catch(e){t={error:e}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}return gp(i,a)[0]}))()}},py=class{constructor(e){e&&(this.source=new hy(Op.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},my=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof fy?this.source=new gy(Op.fromAsyncIterable(t)):dp(t)?this.source=new gy(Op.fromNodeStream(t)):lp(t)?this.source=new gy(Op.fromDOMStream(t)):op(t)?this.source=new gy(Op.fromDOMStream(t.body)):tp(t)?this.source=new gy(Op.fromIterable(t)):(ep(t)||np(t))&&(this.source=new gy(Op.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},hy=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,`peek`).value}read(e){return this.next(e,`read`).value}next(e,t=`read`){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||cy)}return(e){return Object.create(this.source.return&&this.source.return(e)||cy)}},gy=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return Bf(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return Bf(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return Bf(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return Bf(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return Bf(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||cy;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return Bf(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||cy;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},_y=class extends py{constructor(e,t){super(),this.position=0,this.buffer=bp(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eBf(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return Bf(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return Bf(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${by(this.buffer[3])} ${by(this.buffer[2])} ${by(this.buffer[1])} ${by(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;n0&&this.readData(e,n)||new Uint8Array}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}},Oy=class extends Dy{constructor(e,t,n,r,i){super(new Uint8Array,t,n,r,i),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array:vv(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return _p(Uint8Array,_p(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return _p(Uint8Array,_p(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return R.isTimestamp(e)||(R.isInt(e)||R.isTime(e))&&e.bitWidth===64||R.isDuration(e)||R.isDate(e)&&e.unit===zp.MILLISECOND?_p(Uint8Array,Ty.convertArray(n[t])):R.isDecimal(e)?_p(Uint8Array,Ey.convertArray(n[t])):R.isBinary(e)||R.isLargeBinary(e)||R.isFixedSizeBinary(e)?ky(n[t]):R.isBool(e)?vv(n[t]):R.isUtf8(e)||R.isLargeUtf8(e)?Yf(n[t].join(``)):_p(Uint8Array,_p(e.ArrayType,n[t].map(e=>+e)))}};function ky(e){let t=e.join(``),n=new Uint8Array(t.length/2);for(let e=0;e>1]=Number.parseInt(t.slice(e,e+2),16);return n}var H=class extends $h{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function Ay(e,t){return t instanceof e.constructor}function jy(e,t){return e===t||Ay(e,t)}function My(e,t){return e===t||Ay(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Ny(e,t){return e===t||Ay(e,t)&&e.precision===t.precision}function Py(e,t){return e===t||Ay(e,t)&&e.byteWidth===t.byteWidth}function Fy(e,t){return e===t||Ay(e,t)&&e.unit===t.unit}function Iy(e,t){return e===t||Ay(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Ly(e,t){return e===t||Ay(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Ry(e,t){return e===t||Ay(e,t)&&e.children.length===t.children.length&&Ky.compareManyFields(e.children,t.children)}function zy(e,t){return e===t||Ay(e,t)&&e.children.length===t.children.length&&Ky.compareManyFields(e.children,t.children)}function By(e,t){return e===t||Ay(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Ky.compareManyFields(e.children,t.children)}function Vy(e,t){return e===t||Ay(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Ky.visit(e.indices,t.indices)&&Ky.visit(e.dictionary,t.dictionary)}function Hy(e,t){return e===t||Ay(e,t)&&e.unit===t.unit}function Uy(e,t){return e===t||Ay(e,t)&&e.unit===t.unit}function Wy(e,t){return e===t||Ay(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Ky.compareManyFields(e.children,t.children)}function Gy(e,t){return e===t||Ay(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Ky.compareManyFields(e.children,t.children)}H.prototype.visitNull=jy,H.prototype.visitBool=jy,H.prototype.visitInt=My,H.prototype.visitInt8=My,H.prototype.visitInt16=My,H.prototype.visitInt32=My,H.prototype.visitInt64=My,H.prototype.visitUint8=My,H.prototype.visitUint16=My,H.prototype.visitUint32=My,H.prototype.visitUint64=My,H.prototype.visitFloat=Ny,H.prototype.visitFloat16=Ny,H.prototype.visitFloat32=Ny,H.prototype.visitFloat64=Ny,H.prototype.visitUtf8=jy,H.prototype.visitLargeUtf8=jy,H.prototype.visitBinary=jy,H.prototype.visitLargeBinary=jy,H.prototype.visitFixedSizeBinary=Py,H.prototype.visitDate=Fy,H.prototype.visitDateDay=Fy,H.prototype.visitDateMillisecond=Fy,H.prototype.visitTimestamp=Iy,H.prototype.visitTimestampSecond=Iy,H.prototype.visitTimestampMillisecond=Iy,H.prototype.visitTimestampMicrosecond=Iy,H.prototype.visitTimestampNanosecond=Iy,H.prototype.visitTime=Ly,H.prototype.visitTimeSecond=Ly,H.prototype.visitTimeMillisecond=Ly,H.prototype.visitTimeMicrosecond=Ly,H.prototype.visitTimeNanosecond=Ly,H.prototype.visitDecimal=jy,H.prototype.visitList=Ry,H.prototype.visitStruct=zy,H.prototype.visitUnion=By,H.prototype.visitDenseUnion=By,H.prototype.visitSparseUnion=By,H.prototype.visitDictionary=Vy,H.prototype.visitInterval=Hy,H.prototype.visitIntervalDayTime=Hy,H.prototype.visitIntervalYearMonth=Hy,H.prototype.visitDuration=Uy,H.prototype.visitDurationSecond=Uy,H.prototype.visitDurationMillisecond=Uy,H.prototype.visitDurationMicrosecond=Uy,H.prototype.visitDurationNanosecond=Uy,H.prototype.visitFixedSizeList=Wy,H.prototype.visitMap=Gy;const Ky=new H;function qy(e,t){return Ky.compareSchemas(e,t)}function Jy(e,t){return Yy(e,t.map(e=>e.data.concat()))}function Yy(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((e,t)=>Math.max(e,t.length),0)},a=0,o=0,s=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(o=1/0,s=-1;++s0&&(r[a++]=Dv({type:new Gh(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new eb(e,t))]}function Xy(e,t,n,r,i){var a;let o=(t+63&-64)>>3;for(let s=-1,c=r.length;++s=t)l===t?n[s]=c:(n[s]=c.slice(0,t),i.numBatches=Math.max(i.numBatches,r[s].unshift(c.slice(t,l-t))));else{let r=e[s];e[s]=r.clone({nullable:!0}),n[s]=(a=c?._changeLengthAndBackfillNullBitmap(t))??Dv({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var Zy,Qy=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new $v([]),this._offsets=[0],this;let i,a;t[0]instanceof $v&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof eb)return[t];if(t instanceof e)return t.batches;if(t instanceof wv){if(t.type instanceof Gh)return[new eb(new $v(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>o(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>o(e));else if(typeof t==`object`){let e=Object.keys(t),n=e.map(e=>new Yv([t[e]])),r=i??new $v(e.map((e,t)=>new ey(String(e),n[t].type,n[t].nullable))),[,a]=Jy(r,n);return a.length===0?[new eb(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new $v([]),!(i instanceof $v))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof eb))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!qy(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??jv(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Av(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(iv(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Gv.visit(new Yv(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, + `)}\n]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:e})=>e));return new e(n,r.map(e=>new eb(n,e)))}slice(t,n){let r=this.schema;[t,n]=rv({length:this.numRows},t,n);let i=Mv(this.data,this._offsets,t,n);return new e(r,i.map(e=>new eb(r,e)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&et.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],r=Dv({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new Yv(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)?.findIndex(t=>t.name===e),t)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(t));[e[t],o[t]]=[a,n],[r,i]=Jy(r,o)}return new e(r,i)}select(e){let t=this.schema.fields.reduce((e,t,n)=>e.set(t.name,n),new Map);return this.selectAt(e.map(e=>t.get(e)).filter(e=>e>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(e=>e.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((e,t,r)=>{let[i,a]=e,o=n.findIndex(e=>e.name===t.name);return~o?a[o]=r:i.push(r),e},[[],[]]),a=this.schema.assign(t.schema),o=[...n.map((e,t)=>[t,i[t]]).map(([e,n])=>n===void 0?this.getChildAt(e):t.getChildAt(n)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new e(...Jy(a,o))}};Zy=Symbol.toStringTag,Qy[Zy]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=Fv(Pv),e.get=Fv(J_.getVisitFn(L.Struct)),e.set=Iv($g.getVisitFn(L.Struct)),e.indexOf=Lv(Hv.getVisitFn(L.Struct)),`Table`))(Qy.prototype);var $y,eb=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof $v)||([,this.data=Dv({nullCount:0,type:new Gh(this.schema.fields),children:this.schema.fields.map(e=>Dv({type:e.type,nullCount:0}))})]=e,!(this.data instanceof wv)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=tb(this.schema,this.data.children);break;case 1:{let[t]=e,{fields:n,children:r,length:i}=Object.keys(t).reduce((e,n,r)=>(e.children[r]=t[n],e.length=Math.max(e.length,t[n].length),e.fields[r]=ey.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new $v(n),o=Dv({type:new Gh(n),length:i,children:r,nullCount:0});[this.schema,this.data]=tb(a,o.children,i);break}default:throw TypeError(`RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.`)}}get dictionaries(){return this._dictionaries||=nb(this.schema.fields,this.data.children)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return J_.visit(this.data,e)}at(e){return this.get(iv(e,this.numRows))}set(e,t){return $g.visit(this.data,e,t)}indexOf(e,t){return Hv.visit(this.data,e,t)}[Symbol.iterator](){return Gv.visit(new Yv([this.data]))}toArray(){return[...this]}concat(...e){return new Qy(this.schema,[this,...e])}slice(t,n){let[r]=new Yv([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)?.findIndex(t=>t.name===e))}getChildAt(e){return e>-1&&et.name===e),t)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new e(n,Dv({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(e=>this.data.children[e]).filter(Boolean),i=Dv({type:new Gh(n.fields),length:this.numRows,children:r});return new e(n,i)}};$y=Symbol.toStringTag,eb[$y]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(eb.prototype);function tb(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){var r;let i=[...e.fields],a=[...t],o=(n+63&-64)>>3;for(let[s,c]of e.fields.entries()){let e=t[s];(!e||e.length!==n)&&(i[s]=c.clone({nullable:!0}),a[s]=(r=e?._changeLengthAndBackfillNullBitmap(n))??Dv({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),Dv({type:new Gh(i),length:n,children:a})]}function nb(e,t,n=new Map){var r,i;if(((r=e?.length)??0)>0&&e?.length===t?.length)for(let r=-1,a=e.length;++rDv({type:e.type})),n=Dv({type:new Gh(e.fields),nullCount:0,children:t});super(e,n)}},ib=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+Gp),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Ip.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):Nm.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt(`0`)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new um).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,Ip.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,Nm.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt(`0`))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){let t=e.endObject();return t}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(t,n,r,i,a,o){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,a),e.addCustomMetadata(t,o),e.endMessage(t)}},ab=class extends $h{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return wm.startNull(t),wm.endNull(t)}visitInt(e,t){return cm.startInt(t),cm.addBitWidth(t,e.bitWidth),cm.addIsSigned(t,e.isSigned),cm.endInt(t)}visitFloat(e,t){return vm.startFloatingPoint(t),vm.addPrecision(t,e.precision),vm.endFloatingPoint(t)}visitBinary(e,t){return dm.startBinary(t),dm.endBinary(t)}visitLargeBinary(e,t){return bm.startLargeBinary(t),bm.endLargeBinary(t)}visitBool(e,t){return fm.startBool(t),fm.endBool(t)}visitUtf8(e,t){return km.startUtf8(t),km.endUtf8(t)}visitLargeUtf8(e,t){return xm.startLargeUtf8(t),xm.endLargeUtf8(t)}visitDecimal(e,t){return mm.startDecimal(t),mm.addScale(t,e.scale),mm.addPrecision(t,e.precision),mm.addBitWidth(t,e.bitWidth),mm.endDecimal(t)}visitDate(e,t){return pm.startDate(t),pm.addUnit(t,e.unit),pm.endDate(t)}visitTime(e,t){return Em.startTime(t),Em.addUnit(t,e.unit),Em.addBitWidth(t,e.bitWidth),Em.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return Dm.startTimestamp(t),Dm.addUnit(t,e.unit),n!==void 0&&Dm.addTimezone(t,n),Dm.endTimestamp(t)}visitInterval(e,t){return ym.startInterval(t),ym.addUnit(t,e.unit),ym.endInterval(t)}visitDuration(e,t){return hm.startDuration(t),hm.addUnit(t,e.unit),hm.endDuration(t)}visitList(e,t){return Sm.startList(t),Sm.endList(t)}visitStruct(e,t){return Tm.startStruct_(t),Tm.endStruct_(t)}visitUnion(e,t){Om.startTypeIdsVector(t,e.typeIds.length);let n=Om.createTypeIdsVector(t,e.typeIds);return Om.startUnion(t),Om.addMode(t,e.mode),Om.addTypeIds(t,n),Om.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return lm.startDictionaryEncoding(t),lm.addId(t,BigInt(e.id)),lm.addIsOrdered(t,e.isOrdered),n!==void 0&&lm.addIndexType(t,n),lm.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return gm.startFixedSizeBinary(t),gm.addByteWidth(t,e.byteWidth),gm.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return _m.startFixedSizeList(t),_m.addListSize(t,e.listSize),_m.endFixedSizeList(t)}visitMap(e,t){return Cm.startMap(t),Cm.addKeysSorted(t,e.keysSorted),Cm.endMap(t)}};const ob=new ab;function sb(e,t=new Map){return new $v(ub(e,t),gb(e.metadata),t)}function cb(e){return new Sb(e.count,fb(e.columns),pb(e.columns))}function lb(e){return new Cb(cb(e.data),e.id,e.isDelta)}function ub(e,t){return(e.fields||[]).filter(Boolean).map(e=>ey.fromJSON(e,t))}function db(e,t){return(e.children||[]).filter(Boolean).map(e=>ey.fromJSON(e,t))}function fb(e){return(e||[]).reduce((e,t)=>[...e,new Tb(t.count,mb(t.VALIDITY)),...fb(t.children)],[])}function pb(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function hb(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=vb(e,db(e,t)),i=new ey(e.name,o,e.nullable,gb(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?_b(r):new Ch,s=new Zh(t.get(n),r,n,a.isOrdered),i=new ey(e.name,s,e.nullable,gb(e.metadata))):(r=(r=a.indexType)?_b(r):new Ch,t.set(n,o=vb(e,db(e,t))),s=new Zh(o,r,n,a.isOrdered),i=new ey(e.name,s,e.nullable,gb(e.metadata))),i||null}function gb(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function _b(e){return new bh(e.isSigned,e.bitWidth)}function vb(e,t){let n=e.type.name;switch(n){case`NONE`:return new yh;case`null`:return new yh;case`binary`:return new Nh;case`largebinary`:return new Ph;case`utf8`:return new Fh;case`largeutf8`:return new Ih;case`bool`:return new Lh;case`list`:return new Wh((t||[])[0]);case`struct`:return new Gh(t||[]);case`struct_`:return new Gh(t||[])}switch(n){case`int`:{let t=e.type;return new bh(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new kh(Rp[t.precision])}case`decimal`:{let t=e.type;return new Rh(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new zh(zp[t.unit])}case`time`:{let t=e.type;return new Bh(Bp[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new Vh(Bp[t.unit],t.timezone)}case`interval`:{let t=e.type;return new Hh(Vp[t.unit])}case`duration`:{let t=e.type;return new Uh(Bp[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new Kh(Lp[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new qh(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Jh(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new Yh((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var yb=Qp,bb=Zp,xb=class e{static fromJSON(t,n){let r=new e(0,Ip.V5,n);return r._createHeader=Eb(t,n),r}static decode(t){t=new bb(bp(t));let n=ib.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=Db(n,a),o}static encode(e){let t=new yb,n=-1;return e.isSchema()?n=$v.encode(t,e.header()):e.isRecordBatch()?n=Sb.encode(t,e.header()):e.isDictionaryBatch()&&(n=Cb.encode(t,e.header())),ib.startMessage(t),ib.addVersion(t,Ip.V5),ib.addHeader(t,n),ib.addHeaderType(t,e.headerType),ib.addBodyLength(t,BigInt(e.bodyLength)),ib.finishMessageBuffer(t,ib.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof $v)return new e(0,Ip.V5,Nm.Schema,t);if(t instanceof Sb)return new e(n,Ip.V5,Nm.RecordBatch,t);if(t instanceof Cb)return new e(n,Ip.V5,Nm.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===Nm.Schema}isRecordBatch(){return this.headerType===Nm.RecordBatch}isDictionaryBatch(){return this.headerType===Nm.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=Lm(e)}},Sb=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=Lm(e)}},Cb=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=Lm(t)}},wb=class{constructor(e,t){this.offset=Lm(e),this.length=Lm(t)}},Tb=class{constructor(e,t){this.length=Lm(e),this.nullCount=Lm(t)}};function Eb(e,t){return(()=>{switch(t){case Nm.Schema:return $v.fromJSON(e);case Nm.RecordBatch:return Sb.fromJSON(e);case Nm.DictionaryBatch:return Cb.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${Nm[t]}, type: ${t} }`)})}function Db(e,t){return(()=>{switch(t){case Nm.Schema:return $v.decode(e.header(new Mm),new Map,e.version());case Nm.RecordBatch:return Sb.decode(e.header(new im),e.version());case Nm.DictionaryBatch:return Cb.decode(e.header(new am),e.version())}throw Error(`Unrecognized Message type: { name: ${Nm[t]}, type: ${t} }`)})}ey.encode=Hb,ey.decode=Lb,ey.fromJSON=hb,$v.encode=Vb,$v.decode=Ob,$v.fromJSON=sb,Sb.encode=Ub,Sb.decode=kb,Sb.fromJSON=cb,Cb.encode=Wb,Cb.decode=Ab,Cb.fromJSON=lb,Tb.encode=Gb,Tb.decode=Mb,wb.encode=Kb,wb.decode=jb;function Ob(e,t=new Map,n=Ip.V5){let r=Fb(e,t);return new $v(r,Rb(e),t,n)}function kb(e,t=Ip.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new Sb(e.length(),Nb(e),Pb(e,t))}function Ab(e,t=Ip.V5){return new Cb(Sb.decode(e.data(),t),e.id(),e.isDelta())}function jb(e){return new wb(e.offset(),e.length())}function Mb(e){return new Tb(e.length(),e.nullCount())}function Nb(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rey.encode(e,t));Mm.startFieldsVector(e,n.length);let r=Mm.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?Mm.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return um.startKeyValue(e),um.addKey(e,r),um.addValue(e,i),um.endKeyValue(e)})):-1;return Mm.startSchema(e),Mm.addFields(e,r),Mm.addEndianness(e,qb?om.Little:om.Big),i!==-1&&Mm.addCustomMetadata(e,i),Mm.endSchema(e)}function Hb(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;R.isDictionary(a)?(o=a.dictionary.typeId,i=ob.visit(a,e),r=ob.visit(a.dictionary,e)):r=ob.visit(a,e);let s=(a.children||[]).map(t=>ey.encode(e,t)),c=jm.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?jm.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return um.startKeyValue(e),um.addKey(e,r),um.addValue(e,i),um.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),jm.startField(e),jm.addType(e,r),jm.addTypeType(e,o),jm.addChildren(e,c),jm.addNullable(e,!!t.nullable),n!==-1&&jm.addName(e,n),i!==-1&&jm.addDictionary(e,i),l!==-1&&jm.addCustomMetadata(e,l),jm.endField(e)}function Ub(e,t){let n=t.nodes||[],r=t.buffers||[];im.startNodesVector(e,n.length);for(let t of n.slice().reverse())Tb.encode(e,t);let i=e.endVector();im.startBuffersVector(e,r.length);for(let t of r.slice().reverse())wb.encode(e,t);let a=e.endVector();return im.startRecordBatch(e),im.addLength(e,BigInt(t.length)),im.addNodes(e,i),im.addBuffers(e,a),im.endRecordBatch(e)}function Wb(e,t){let n=Sb.encode(e,t.data);return am.startDictionaryBatch(e),am.addId(e,BigInt(t.id)),am.addIsDelta(e,t.isDelta),am.addData(e,n),am.endDictionaryBatch(e)}function Gb(e,t){return rm.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function Kb(e,t){return nm.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const qb=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),Jb=e=>`Expected ${Nm[e]} Message in stream, but was null or length 0.`,Yb=e=>`Header pointer of flatbuffer-encoded ${Nm[e]} Message is null or length 0.`,Xb=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Zb=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var Qb=class{constructor(e){this.source=e instanceof py?e:new py(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?cy:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Jb(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=bp(this.source.read(e));if(t.byteLength[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(Jb(e));return t.value}readSchema(){let e=Nm.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(Yb(e));return n}};const tx=4,nx=`ARROW1`,rx=new Uint8Array(6);for(let e=0;e<6;e+=1)rx[e]=nx.codePointAt(e);function ix(e,t=0){for(let n=-1,r=rx.length;++nthis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Op.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Op.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}static from(t){return t instanceof e?t:rp(t)?Sx(t):ap(t)?Tx(t):ep(t)?(()=>Bf(this,void 0,void 0,function*(){return yield e.from(yield t)}))():op(t)||lp(t)||dp(t)||np(t)?wx(new my(t)):Cx(new py(t))}static readAll(t){return t instanceof e?t.isSync()?bx(t):xx(t):rp(t)||ArrayBuffer.isView(t)||tp(t)||ip(t)?bx(t):xx(t)}},lx=class extends cx{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Uf(this,arguments,function*(){yield Hf(yield*Wf(Gf(this[Symbol.iterator]())))})}},ux=class extends cx{constructor(e){super(e),this._impl=e}readAll(){return Bf(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=Gf(this),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw Error(`AsyncRecordBatchStreamReader is not Iterable`)}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},dx=class extends lx{constructor(e){super(e),this._impl=e}},fx=class extends ux{constructor(e){super(e),this._impl=e}},px=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let n=this._loadVectors(e,t,this.schema.fields),r=Dv({type:new Gh(this.schema.fields),length:e.length,children:n});return new eb(this.schema,r)}_loadDictionaryBatch(e,t){let{id:n,isDelta:r}=e,{dictionaries:i,schema:a}=this,o=i.get(n),s=a.dictionaries.get(n),c=this._loadVectors(e.data,t,[s]);return(o&&r?o.concat(new Yv(c)):new Yv(c)).memoize()}_loadVectors(e,t,n){return new Dy(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},mx=class extends px{constructor(e,t){super(t),this._reader=rp(e)?new ex(this._handle=e):new Qb(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=yx(this,e),(this.schema||=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):cy}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):cy}next(){if(this.closed)return cy;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new rb(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},hx=class extends px{constructor(e,t){super(t),this._reader=new $b(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Bf(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return Bf(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=yx(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return Bf(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):cy})}return(e){return Bf(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):cy})}next(){return Bf(this,void 0,void 0,function*(){if(this.closed)return cy;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new rb(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return Bf(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},gx=class extends mx{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof _y?e:new _y(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)?.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(Nm.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(Nm.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}}_readFooter(){let{_handle:e}=this,t=e.size-ox,n=e.readInt32(t),r=e.readAt(t-n,n);return ay.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Bf(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return Bf(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)?.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(Nm.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null})}_readDictionaryBatch(e){return Bf(this,void 0,void 0,function*(){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(Nm.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}})}_readFooter(){return Bf(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-ox,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return ay.decode(r)})}_readNextMessageAndValidate(e){return Bf(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?ix(t)?new dx(new gx(e.read())):new lx(new mx(e)):new lx(new mx(function*(){}()))}function wx(e){return Bf(this,void 0,void 0,function*(){let t=yield e.peek(ax+7&-8);return t&&t.byteLength>=4?ix(t)?new dx(new gx(yield e.read())):new ux(new hx(e)):new ux(new hx(function(){return Uf(this,arguments,function*(){})}()))})}function Tx(e){return Bf(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new vy(e,t);return t>=sx&&ix(yield n.readAt(0,ax+7&-8))?new fx(new _x(n)):new ux(new hx(n))})}var Ex=class e extends $h{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof eb?e.data.children:e.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof Yv)return this.visitMany(e.data),this;let{type:t}=e;if(!R.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(R.isUnion(t))this.nodes.push(new Tb(n,0));else{let{nullCount:r}=e;R.isNull(t)||Dx.call(this,r<=0?new Uint8Array:_v(e.offset,n,e.nullBitmap)),this.nodes.push(new Tb(n,r))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function Dx(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new wb(this._byteLength,t)),this._byteLength+=t,this}function Ox(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(Dx.call(this,i),n.mode===Lp.Sparse)return Nx.call(this,e);if(n.mode===Lp.Dense){if(e.offset<=0)return Dx.call(this,a),Nx.call(this,e);{let o=new Int32Array(r),s=Object.create(null),c=Object.create(null);for(let e,n,l=-1;++l{let i=n.typeIds[t],a=s[i],o=c[i];return e.slice(a,Math.min(r,o))}))}}return this}function kx(e){let t;return e.nullCount>=e.length?Dx.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?Dx.call(this,_v(e.offset,e.length,t)):Dx.call(this,vv(e.values))}function Ax(e){return Dx.call(this,e.values.subarray(0,e.length*e.stride))}function jx(e){let{length:t,values:n,valueOffsets:r}=e,i=Lm(r[0]),a=Lm(r[t]),o=Math.min(a-i,n.byteLength-i);return Dx.call(this,Ep(-i,t+1,r)),Dx.call(this,n.subarray(i,i+o)),this}function Mx(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return Dx.call(this,Ep(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function Nx(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Ex.prototype.visitBool=kx,Ex.prototype.visitInt=Ax,Ex.prototype.visitFloat=Ax,Ex.prototype.visitUtf8=jx,Ex.prototype.visitLargeUtf8=jx,Ex.prototype.visitBinary=jx,Ex.prototype.visitLargeBinary=jx,Ex.prototype.visitFixedSizeBinary=Ax,Ex.prototype.visitDate=Ax,Ex.prototype.visitTimestamp=Ax,Ex.prototype.visitTime=Ax,Ex.prototype.visitDecimal=Ax,Ex.prototype.visitList=Mx,Ex.prototype.visitStruct=Nx,Ex.prototype.visitUnion=Ox,Ex.prototype.visitInterval=Ax,Ex.prototype.visitDuration=Ax,Ex.prototype.visitFixedSizeList=Mx,Ex.prototype.visitMap=Mx;var Px=class extends uy{static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}constructor(e){super(),this._position=0,this._started=!1,this._sink=new fy,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,$f(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy==`boolean`?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat==`boolean`?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return ep(e)?e.then(e=>this.writeAll(e)):np(e)?Rx(this,e):Lx(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof fy?this._sink=e:(this._sink=new fy,e&&cp(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&up(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!qy(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null||e instanceof Qy&&!(t=e.schema)||e instanceof eb&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!qy(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof eb?e instanceof rb||this._writeRecordBatch(e):e instanceof Qy?this.writeAll(e.batches):tp(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=xb.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===Nm.RecordBatch?this._recordBatchBlocks.push(new sy(o,e.bodyLength,this._position)):e.headerType===Nm.DictionaryBatch&&this._dictionaryBlocks.push(new sy(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),i>0&&this._write(r),this._writePadding(s)}_write(e){if(this._started){let t=bp(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(xb.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(rx)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=Ex.assemble(e),a=new Sb(e.numRows,n,r),o=xb.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(e,t,n=!1){let{byteLength:r,nodes:i,bufferRegions:a,buffers:o}=Ex.assemble(new Yv([e])),s=new Sb(e.length,i,a),c=new Cb(s,t,n),l=xb.from(c,r);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,r;for(let i=-1,a=e.length;++i0&&(this._write(t),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(e){var t,n;for(let[r,i]of e.dictionaries){let e=(t=i?.data)??[],a=this._seenDictionaries.get(r),o=(n=this._dictionaryDeltaOffsets.get(r))??0;if(!a||a.data[0]!==e[0])for(let[t,n]of e.entries())this._writeDictionaryBatch(n,r,t>0);else if(or.writeAll(e)):np(t)?Rx(r,t):Lx(r,t)}},Ix=class e extends Px{static writeAll(t){let n=new e;return ep(t)?t.then(e=>n.writeAll(e)):np(t)?Rx(n,t):Lx(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw Error(`The Arrow File format does not support replacement dictionaries. `);return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=ay.encode(new ay(e,Ip.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function Lx(e,t){let n=t;t instanceof Qy&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function Rx(e,t){return Bf(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=Gf(t);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;let t=c;e.write(t)}}catch(e){o={error:e}}finally{try{!n&&!a&&(s=r.return)&&(yield s.call(r))}finally{if(o)throw o.error}}return e.finish()})}function zx(e,t=`stream`){return(t===`stream`?Fx:Ix).writeAll(e).toUint8Array(!0)}var Bx=Object.create,Vx=Object.defineProperty,Hx=Object.getOwnPropertyDescriptor,Ux=Object.getOwnPropertyNames,Wx=Object.getPrototypeOf,Gx=Object.prototype.hasOwnProperty,Kx=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qx=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Ux(t))!Gx.call(e,i)&&i!==n&&Vx(e,i,{get:()=>t[i],enumerable:!(r=Hx(t,i))||r.enumerable});return e},Jx=(e,t,n)=>(n=e==null?{}:Bx(Wx(e)),qx(t||!e||!e.__esModule?Vx(n,`default`,{value:e,enumerable:!0}):n,e)),Yx=Kx((e,t)=>{t.exports=Worker}),Xx=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.AUTOMATIC=1]=`AUTOMATIC`,e[e.READ_ONLY=2]=`READ_ONLY`,e[e.READ_WRITE=3]=`READ_WRITE`,e))(Xx||{}),Zx=(e=>(e[e.IDENTIFIER=0]=`IDENTIFIER`,e[e.NUMERIC_CONSTANT=1]=`NUMERIC_CONSTANT`,e[e.STRING_CONSTANT=2]=`STRING_CONSTANT`,e[e.OPERATOR=3]=`OPERATOR`,e[e.KEYWORD=4]=`KEYWORD`,e[e.COMMENT=5]=`COMMENT`,e))(Zx||{}),Qx=(e=>(e[e.NONE=0]=`NONE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARNING=3]=`WARNING`,e[e.ERROR=4]=`ERROR`,e))(Qx||{}),$x=(e=>(e[e.NONE=0]=`NONE`,e[e.CONNECT=1]=`CONNECT`,e[e.DISCONNECT=2]=`DISCONNECT`,e[e.OPEN=3]=`OPEN`,e[e.QUERY=4]=`QUERY`,e[e.INSTANTIATE=5]=`INSTANTIATE`,e))($x||{}),eS=(e=>(e[e.NONE=0]=`NONE`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`,e[e.START=3]=`START`,e[e.RUN=4]=`RUN`,e[e.CAPTURE=5]=`CAPTURE`,e))(eS||{}),tS=(e=>(e[e.NONE=0]=`NONE`,e[e.WEB_WORKER=1]=`WEB_WORKER`,e[e.NODE_WORKER=2]=`NODE_WORKER`,e[e.BINDINGS=3]=`BINDINGS`,e[e.ASYNC_DUCKDB=4]=`ASYNC_DUCKDB`,e))(tS||{}),nS=class{log(e){}},rS=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},iS=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(iS||{}),aS=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=cx.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new Qy(n)}async send(e,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let n=await this._bindings.startPendingQuery(this._conn,e,t);for(;n==null;)n=await this._bindings.pollPendingQuery(this._conn);let r=new oS(this._bindings,this._conn,n),i=await cx.from(r);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new sS(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=zx(e,`stream`);await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},oS=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight==null?e=await this.db.fetchQueryResults(this.conn):(e=await this._inFlight,this._inFlight=null),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},sS=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=cx.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new Qy(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new oS(this.bindings,this.connectionId,t),r=await cx.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},cS=(e=>(e.CANCEL_PENDING_QUERY=`CANCEL_PENDING_QUERY`,e.CLOSE_PREPARED=`CLOSE_PREPARED`,e.COLLECT_FILE_STATISTICS=`COLLECT_FILE_STATISTICS`,e.REGISTER_OPFS_FILE_NAME=`REGISTER_OPFS_FILE_NAME`,e.CONNECT=`CONNECT`,e.COPY_FILE_TO_BUFFER=`COPY_FILE_TO_BUFFER`,e.COPY_FILE_TO_PATH=`COPY_FILE_TO_PATH`,e.CREATE_PREPARED=`CREATE_PREPARED`,e.DISCONNECT=`DISCONNECT`,e.DROP_FILE=`DROP_FILE`,e.DROP_FILES=`DROP_FILES`,e.EXPORT_FILE_STATISTICS=`EXPORT_FILE_STATISTICS`,e.FETCH_QUERY_RESULTS=`FETCH_QUERY_RESULTS`,e.FLUSH_FILES=`FLUSH_FILES`,e.GET_FEATURE_FLAGS=`GET_FEATURE_FLAGS`,e.GET_TABLE_NAMES=`GET_TABLE_NAMES`,e.GET_VERSION=`GET_VERSION`,e.GLOB_FILE_INFOS=`GLOB_FILE_INFOS`,e.INSERT_ARROW_FROM_IPC_STREAM=`INSERT_ARROW_FROM_IPC_STREAM`,e.INSERT_CSV_FROM_PATH=`IMPORT_CSV_FROM_PATH`,e.INSERT_JSON_FROM_PATH=`IMPORT_JSON_FROM_PATH`,e.INSTANTIATE=`INSTANTIATE`,e.OPEN=`OPEN`,e.PING=`PING`,e.POLL_PENDING_QUERY=`POLL_PENDING_QUERY`,e.REGISTER_FILE_BUFFER=`REGISTER_FILE_BUFFER`,e.REGISTER_FILE_HANDLE=`REGISTER_FILE_HANDLE`,e.REGISTER_FILE_URL=`REGISTER_FILE_URL`,e.RESET=`RESET`,e.RUN_PREPARED=`RUN_PREPARED`,e.RUN_QUERY=`RUN_QUERY`,e.SEND_PREPARED=`SEND_PREPARED`,e.START_PENDING_QUERY=`START_PENDING_QUERY`,e.TOKENIZE=`TOKENIZE`,e))(cS||{}),lS=(e=>(e.CONNECTION_INFO=`CONNECTION_INFO`,e.ERROR=`ERROR`,e.FEATURE_FLAGS=`FEATURE_FLAGS`,e.FILE_BUFFER=`FILE_BUFFER`,e.FILE_INFOS=`FILE_INFOS`,e.FILE_SIZE=`FILE_SIZE`,e.FILE_STATISTICS=`FILE_STATISTICS`,e.INSTANTIATE_PROGRESS=`INSTANTIATE_PROGRESS`,e.LOG=`LOG`,e.OK=`OK`,e.PREPARED_STATEMENT_ID=`PREPARED_STATEMENT_ID`,e.QUERY_PLAN=`QUERY_PLAN`,e.QUERY_RESULT=`QUERY_RESULT`,e.QUERY_RESULT_CHUNK=`QUERY_RESULT_CHUNK`,e.QUERY_RESULT_HEADER=`QUERY_RESULT_HEADER`,e.QUERY_RESULT_HEADER_OR_NULL=`QUERY_RESULT_HEADER_OR_NULL`,e.REGISTERED_FILE=`REGISTERED_FILE`,e.SCRIPT_TOKENS=`SCRIPT_TOKENS`,e.SUCCESS=`SUCCESS`,e.TABLE_NAMES=`TABLE_NAMES`,e.VERSION_STRING=`VERSION_STRING`,e))(lS||{}),uS=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((e,t)=>{this.promiseResolver=e,this.promiseRejecter=t})}};function dS(e){switch(e.typeId){case L.Binary:return{sqlType:`binary`};case L.Bool:return{sqlType:`bool`};case L.Date:return{sqlType:`date`};case L.DateDay:return{sqlType:`date32[d]`};case L.DateMillisecond:return{sqlType:`date64[ms]`};case L.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:`float`};case L.Float16:return{sqlType:`float16`};case L.Float32:return{sqlType:`float32`};case L.Float64:return{sqlType:`float64`};case L.Int:return{sqlType:`int32`};case L.Int16:return{sqlType:`int16`};case L.Int32:return{sqlType:`int32`};case L.Int64:return{sqlType:`int64`};case L.Uint16:return{sqlType:`uint16`};case L.Uint32:return{sqlType:`uint32`};case L.Uint64:return{sqlType:`uint64`};case L.Uint8:return{sqlType:`uint8`};case L.IntervalDayTime:return{sqlType:`interval[dt]`};case L.IntervalYearMonth:return{sqlType:`interval[m]`};case L.List:return{sqlType:`list`,valueType:dS(e.valueType)};case L.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case L.Null:return{sqlType:`null`};case L.Utf8:return{sqlType:`utf8`};case L.Struct:return{sqlType:`struct`,fields:e.children.map(e=>fS(e.name,e.type))};case L.Map:{let t=e;return{sqlType:`map`,keyType:dS(t.keyType),valueType:dS(t.valueType)}}case L.Time:return{sqlType:`time[s]`};case L.TimeMicrosecond:return{sqlType:`time[us]`};case L.TimeMillisecond:return{sqlType:`time[ms]`};case L.TimeNanosecond:return{sqlType:`time[ns]`};case L.TimeSecond:return{sqlType:`time[s]`};case L.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case L.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case L.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case L.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function fS(e,t){let n=dS(t);return n.name=e,n}var pS=new TextEncoder,mS=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener(`message`,this._onMessageHandler),this._worker.addEventListener(`error`,this._onErrorHandler),this._worker.addEventListener(`close`,this._onCloseHandler),this._workerShutdownPromise=new Promise((e,t)=>{this._workerShutdownResolver=e})}detach(){this._worker&&(this._worker.removeEventListener(`message`,this._onMessageHandler),this._worker.removeEventListener(`error`,this._onErrorHandler),this._worker.removeEventListener(`close`,this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error(`cannot send a message since the worker is not set!`);return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case`LOG`:this._logger.log(n.data);return;case`INSTANTIATE_PROGRESS`:for(let e of this._onInstantiationProgress)e(n.data);return}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn(`unassociated response: [${n.requestId}, ${n.type.toString()}]`);return}if(this._pendingRequests.delete(n.requestId),n.type==`ERROR`){let e=Error(n.data.message);e.name=n.data.name,(t=Object.getOwnPropertyDescriptor(e,`stack`))!=null&&t.writable&&(e.stack=n.data.stack),r.promiseRejecter(e);return}switch(r.type){case`CLOSE_PREPARED`:case`COLLECT_FILE_STATISTICS`:case`REGISTER_OPFS_FILE_NAME`:case`COPY_FILE_TO_PATH`:case`DISCONNECT`:case`DROP_FILE`:case`DROP_FILES`:case`FLUSH_FILES`:case`INSERT_ARROW_FROM_IPC_STREAM`:case`IMPORT_CSV_FROM_PATH`:case`IMPORT_JSON_FROM_PATH`:case`OPEN`:case`PING`:case`REGISTER_FILE_BUFFER`:case`REGISTER_FILE_HANDLE`:case`REGISTER_FILE_URL`:case`RESET`:if(n.type==`OK`){r.promiseResolver(n.data);return}break;case`INSTANTIATE`:if(this._onInstantiationProgress=[],n.type==`OK`){r.promiseResolver(n.data);return}break;case`GLOB_FILE_INFOS`:if(n.type==`FILE_INFOS`){r.promiseResolver(n.data);return}break;case`GET_VERSION`:if(n.type==`VERSION_STRING`){r.promiseResolver(n.data);return}break;case`GET_FEATURE_FLAGS`:if(n.type==`FEATURE_FLAGS`){r.promiseResolver(n.data);return}break;case`GET_TABLE_NAMES`:if(n.type==`TABLE_NAMES`){r.promiseResolver(n.data);return}break;case`TOKENIZE`:if(n.type==`SCRIPT_TOKENS`){r.promiseResolver(n.data);return}break;case`COPY_FILE_TO_BUFFER`:if(n.type==`FILE_BUFFER`){r.promiseResolver(n.data);return}break;case`EXPORT_FILE_STATISTICS`:if(n.type==`FILE_STATISTICS`){r.promiseResolver(n.data);return}break;case`CONNECT`:if(n.type==`CONNECTION_INFO`){r.promiseResolver(n.data);return}break;case`RUN_PREPARED`:case`RUN_QUERY`:if(n.type==`QUERY_RESULT`){r.promiseResolver(n.data);return}break;case`SEND_PREPARED`:if(n.type==`QUERY_RESULT_HEADER`){r.promiseResolver(n.data);return}break;case`START_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`POLL_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`CANCEL_PENDING_QUERY`:if(this._onInstantiationProgress=[],n.type==`SUCCESS`){r.promiseResolver(n.data);return}break;case`FETCH_QUERY_RESULTS`:if(n.type==`QUERY_RESULT_CHUNK`){r.promiseResolver(n.data);return}break;case`CREATE_PREPARED`:if(n.type==`PREPARED_STATEMENT_ID`){r.promiseResolver(n.data);return}break}r.promiseRejecter(Error(`unexpected response type: ${n.type.toString()}`))}onError(e){console.error(e),console.error(`error in duckdb worker: ${e.message}`),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn(`worker terminated with ${this._pendingRequests.size} pending requests`);return}this._pendingRequests.clear()}async reset(){let e=new uS(`RESET`,null);return await this.postTask(e)}async ping(){let e=new uS(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new uS(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new uS(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new uS(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new uS(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new uS(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new uS(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new uS(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new uS(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new uS(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new aS(this,e)}async disconnect(e){let t=new uS(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new uS(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new uS(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new uS(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new uS(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new uS(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new uS(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new uS(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new uS(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new uS(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new uS(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new uS(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=pS.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new uS(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new uS(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new uS(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new uS(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new uS(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new uS(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new uS(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new uS(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new uS(`INSERT_ARROW_FROM_IPC_STREAM`,[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(fS(t,r))}n.columnsFlat=e,delete n.columns}let r=new uS(`IMPORT_CSV_FROM_PATH`,[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(fS(t,r))}n.columnsFlat=e,delete n.columns}let r=new uS(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function hS(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}hS();var gS=(e=>(e[e.BUFFER=0]=`BUFFER`,e[e.NODE_FS=1]=`NODE_FS`,e[e.BROWSER_FILEREADER=2]=`BROWSER_FILEREADER`,e[e.BROWSER_FSACCESS=3]=`BROWSER_FSACCESS`,e[e.HTTP=4]=`HTTP`,e[e.S3=5]=`S3`,e))(gS||{}),_S=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),vS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),yS=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),bS=()=>(async e=>{try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),xS={name:`@duckdb/duckdb-wasm`,version:`1.29.1-dev68.0`,description:`DuckDB powered by WebAssembly`,license:`MIT`,repository:{type:`git`,url:`https://github.com/duckdb/duckdb-wasm.git`},keywords:[`sql`,`duckdb`,`relational`,`database`,`data`,`query`,`wasm`,`analytics`,`olap`,`arrow`,`parquet`,`json`,`csv`],dependencies:{"apache-arrow":`^17.0.0`},devDependencies:{"@types/emscripten":`^1.39.10`,"@types/jasmine":`^5.1.4`,"@typescript-eslint/eslint-plugin":`^6.21.0`,"@typescript-eslint/parser":`^6.21.0`,esbuild:`^0.20.2`,eslint:`^8.57.0`,"eslint-plugin-jasmine":`^4.1.3`,"eslint-plugin-react":`^7.34.0`,"fast-glob":`^3.3.2`,jasmine:`^5.1.0`,"jasmine-core":`^5.1.2`,"jasmine-spec-reporter":`^7.0.0`,"js-sha256":`^0.11.0`,karma:`^6.4.2`,"karma-chrome-launcher":`^3.2.0`,"karma-coverage":`^2.2.1`,"karma-firefox-launcher":`^2.1.3`,"karma-jasmine":`^5.1.0`,"karma-jasmine-html-reporter":`^2.1.0`,"karma-sourcemap-loader":`^0.4.0`,"karma-spec-reporter":`^0.0.36`,"make-dir":`^4.0.0`,nyc:`^15.1.0`,prettier:`^3.2.5`,puppeteer:`^22.8.0`,rimraf:`^5.0.5`,s3rver:`^3.7.1`,typedoc:`^0.25.13`,typescript:`^5.3.3`,"wasm-feature-detect":`^1.6.1`,"web-worker":`^1.2.0`},scripts:{"build:debug":`node bundle.mjs debug && tsc --emitDeclarationOnly`,"build:release":`node bundle.mjs release && tsc --emitDeclarationOnly`,docs:`typedoc`,report:`node ./coverage.mjs`,"test:node":`node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:debug":`node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:coverage":`nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:firefox":`karma start ./karma/tests-firefox.cjs`,"test:chrome":`karma start ./karma/tests-chrome.cjs`,"test:chrome:eh":`karma start ./karma/tests-chrome-eh.cjs`,"test:chrome:coverage":`karma start ./karma/tests-chrome-coverage.cjs`,"test:browser":`karma start ./karma/tests-all.cjs`,"test:browser:debug":`karma start ./karma/tests-debug.cjs`,test:`npm run test:chrome && npm run test:node`,"test:coverage":`npm run test:chrome:coverage && npm run test:node:coverage && npm run report`,lint:`eslint src test`},files:[`dist`,`!dist/tests-*`,`!dist/duckdb-browser-mvp.worker.js.map`,`!dist/types/test`],main:`dist/duckdb-browser.cjs`,module:`dist/duckdb-browser.mjs`,types:`dist/duckdb-browser.d.ts`,jsdelivr:`dist/duckdb-browser.cjs`,unpkg:`dist/duckdb-browser.mjs`,sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":`./dist/duckdb-mvp.wasm`,"./dist/duckdb-eh.wasm":`./dist/duckdb-eh.wasm`,"./dist/duckdb-coi.wasm":`./dist/duckdb-coi.wasm`,"./dist/duckdb-browser":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser.cjs":`./dist/duckdb-browser.cjs`,"./dist/duckdb-browser.mjs":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser-coi.pthread.worker.js":`./dist/duckdb-browser-coi.pthread.worker.js`,"./dist/duckdb-browser-coi.worker.js":`./dist/duckdb-browser-coi.worker.js`,"./dist/duckdb-browser-eh.worker.js":`./dist/duckdb-browser-eh.worker.js`,"./dist/duckdb-browser-mvp.worker.js":`./dist/duckdb-browser-mvp.worker.js`,"./dist/duckdb-node":`./dist/duckdb-node.cjs`,"./dist/duckdb-node.cjs":`./dist/duckdb-node.cjs`,"./dist/duckdb-node-blocking":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-blocking.cjs":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-eh.worker.cjs":`./dist/duckdb-node-eh.worker.cjs`,"./dist/duckdb-node-mvp.worker.cjs":`./dist/duckdb-node-mvp.worker.cjs`,"./blocking":{node:{types:`./dist/duckdb-node-blocking.d.ts`,require:`./dist/duckdb-node-blocking.cjs`,import:`./dist/duckdb-node-blocking.cjs`},types:`./dist/duckdb-node-blocking.d.ts`,import:`./dist/duckdb-node-blocking.mjs`,require:`./dist/duckdb-node-blocking.cjs`},".":{browser:{types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`},node:{types:`./dist/duckdb-node.d.ts`,import:`./dist/duckdb-node.cjs`,require:`./dist/duckdb-node.cjs`},types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`}}};xS.name,xS.version;var SS=xS.version.split(`.`);SS[0],SS[1],SS[2];var CS=()=>typeof navigator>`u`,wS=null,TS=null,ES=null,DS=null,OS=null;async function kS(){return wS??=typeof BigInt64Array<`u`,TS??=await vS(),ES??=await bS(),DS??=await yS(),OS??=await _S(),{bigInt64Array:wS,crossOriginIsolated:CS()||globalThis.crossOriginIsolated||!1,wasmExceptions:TS,wasmSIMD:DS,wasmThreads:ES,wasmBulkMemory:OS}}async function AS(e){let t=await kS();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}Jx(Yx()),Symbol.for(`constructDateFrom`);const jS={},MS={};function NS(e,t){try{let n=jS[e]||=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format,r=n(t).split(`GMT`)[1]||``;return r in MS?MS[r]:FS(r,r.split(`:`))}catch{if(e in MS)return MS[e];let t=e?.match(PS);return t?FS(e,t.slice(1)):NaN}}const PS=/([+-]\d\d):?(\d\d)?/;function FS(e,t){let n=+t[0],r=+(t[1]||0);return MS[e]=n>0?n*60+r:n*60-r}var IS=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(NS(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),BS(this,NaN),RS(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-NS(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),RS(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const LS=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!LS.test(e))return;let t=e.replace(LS,`$1UTC`);IS.prototype[t]&&(e.startsWith(`get`)?IS.prototype[e]=function(){return this.internal[t]()}:(IS.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),zS(this),+this},IS.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),RS(this),+this}))});function RS(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function zS(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),BS(e)}function BS(e){let t=NS(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=NS(e.timeZone,e),l=-new Date(+e).getTimezoneOffset(),u=l-c,d=c!==t,f=u-s;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=NS(e.timeZone,e),n=c-t;n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}(class e extends IS{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${VS(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=e>0?`-`:`+`,n=String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),r=String(Math.abs(e)%60).padStart(2,`0`);return[t,n,r]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}});function VS(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const HS=new TextDecoder(`utf-8`),US=e=>HS.decode(e),WS=new TextEncoder,GS=e=>WS.encode(e),KS=e=>typeof e==`function`,qS=e=>e!=null&&Object(e)===e,JS=e=>qS(e)&&KS(e.then),YS=e=>qS(e)&&KS(e[Symbol.iterator]),XS=e=>qS(e)&&KS(e[Symbol.asyncIterator]),ZS=e=>qS(e)&&`done`in e&&`value`in e,QS=e=>qS(e)&&KS(e.clear)&&KS(e.bytes)&&KS(e.position)&&KS(e.setPosition)&&KS(e.capacity)&&KS(e.getBufferIdentifier)&&KS(e.createLong);var $S={};ze($S,{compareArrayLike:()=>RC,joinUint8Arrays:()=>rC,memcpy:()=>nC,rebaseValueOffsets:()=>LC,toArrayBufferView:()=>iC,toArrayBufferViewAsyncIterator:()=>DC,toArrayBufferViewIterator:()=>_C,toBigInt64Array:()=>cC,toBigUint64Array:()=>fC,toFloat32Array:()=>pC,toFloat32ArrayAsyncIterator:()=>PC,toFloat32ArrayIterator:()=>wC,toFloat64Array:()=>mC,toFloat64ArrayAsyncIterator:()=>FC,toFloat64ArrayIterator:()=>TC,toInt16Array:()=>oC,toInt16ArrayAsyncIterator:()=>kC,toInt16ArrayIterator:()=>yC,toInt32Array:()=>sC,toInt32ArrayAsyncIterator:()=>AC,toInt32ArrayIterator:()=>bC,toInt8Array:()=>aC,toInt8ArrayAsyncIterator:()=>OC,toInt8ArrayIterator:()=>vC,toUint16Array:()=>uC,toUint16ArrayAsyncIterator:()=>MC,toUint16ArrayIterator:()=>SC,toUint32Array:()=>dC,toUint32ArrayAsyncIterator:()=>NC,toUint32ArrayIterator:()=>CC,toUint8Array:()=>lC,toUint8ArrayAsyncIterator:()=>jC,toUint8ArrayIterator:()=>xC,toUint8ClampedArray:()=>hC,toUint8ClampedArrayAsyncIterator:()=>IC,toUint8ClampedArrayIterator:()=>EC});const eC=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function tC(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++ciC(Int8Array,e),oC=e=>iC(Int16Array,e),sC=e=>iC(Int32Array,e),cC=e=>iC(BigInt64Array,e),lC=e=>iC(Uint8Array,e),uC=e=>iC(Uint16Array,e),dC=e=>iC(Uint32Array,e),fC=e=>iC(BigUint64Array,e),pC=e=>iC(Float32Array,e),mC=e=>iC(Float64Array,e),hC=e=>iC(Uint8ClampedArray,e),gC=e=>(e.next(),e);function*_C(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof eC?n(t):YS(t)?t:n(t);return yield*gC((function*(t){let n=null;do n=t.next(yield iC(e,n));while(!n.done)})(r[Symbol.iterator]())),new e}const vC=e=>_C(Int8Array,e),yC=e=>_C(Int16Array,e),bC=e=>_C(Int32Array,e),xC=e=>_C(Uint8Array,e),SC=e=>_C(Uint16Array,e),CC=e=>_C(Uint32Array,e),wC=e=>_C(Float32Array,e),TC=e=>_C(Float64Array,e),EC=e=>_C(Uint8ClampedArray,e);function DC(e,t){return Uf(this,arguments,function*(){if(JS(t))return yield Hf(yield Hf(yield*Wf(Gf(DC(e,yield Hf(t))))));let n=function(e){return Uf(this,arguments,function*(){yield yield Hf(yield Hf(e))})},r=function(e){return Uf(this,arguments,function*(){yield Hf(yield*Wf(Gf(gC((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof eC?n(t):YS(t)?r(t):XS(t)?t:n(t);return yield Hf(yield*Wf(Gf(gC((function(t){return Uf(this,arguments,function*(){let n=null;do n=yield Hf(t.next(yield yield Hf(iC(e,n))));while(!n.done)})})(i[Symbol.asyncIterator]()))))),yield Hf(new e)})}const OC=e=>DC(Int8Array,e),kC=e=>DC(Int16Array,e),AC=e=>DC(Int32Array,e),jC=e=>DC(Uint8Array,e),MC=e=>DC(Uint16Array,e),NC=e=>DC(Uint32Array,e),PC=e=>DC(Float32Array,e),FC=e=>DC(Float64Array,e),IC=e=>DC(Uint8ClampedArray,e);function LC(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++nqC});const KC=void 0;function qC(e){if(e===null)return`null`;if(e===KC)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>qC(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function JC(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function YC(e,t){return JC(e/t)+JC(e%t)/JC(t)}var XC={};ze(XC,{BN:()=>cw,bigNumToBigInt:()=>ow,bigNumToNumber:()=>iw,bigNumToString:()=>aw,isArrowBigNumSymbol:()=>ZC});const ZC=Symbol.for(`isArrowBigNum`);function QC(e,...t){return t.length===0?Object.setPrototypeOf(iC(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}QC.prototype[ZC]=!0,QC.prototype.toJSON=function(){return`"${aw(this)}"`},QC.prototype.valueOf=function(e){return iw(this,e)},QC.prototype.toString=function(){return aw(this)},QC.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return iw(this);case`string`:return aw(this);case`default`:return ow(this)}return aw(this)};function $C(...e){return QC.apply(this,e)}function ew(...e){return QC.apply(this,e)}function tw(...e){return QC.apply(this,e)}Object.setPrototypeOf($C.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(ew.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(tw.prototype,Object.create(Uint32Array.prototype)),Object.assign($C.prototype,QC.prototype,{constructor:$C,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(ew.prototype,QC.prototype,{constructor:ew,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(tw.prototype,QC.prototype,{constructor:tw,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const nw=BigInt(4294967296)*BigInt(4294967296),rw=nw-BigInt(1);function iw(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<0){let e=BigInt(`1`.padEnd(t+1,`0`)),n=c/e,r=s?-(c%e):c%e,i=JC(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return JC(c)}function aw(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return sw(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return sw(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(W.prototype);var jw=class extends W{constructor(){super(U.Null)}toString(){return`Null`}};uw=Symbol.toStringTag,jw[uw]=(e=>e[Symbol.toStringTag]=`Null`)(jw.prototype);var Mw=class extends W{constructor(e,t){super(U.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};dw=Symbol.toStringTag,Mw[dw]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(Mw.prototype);var Nw=class extends Mw{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Pw=class extends Mw{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Fw=class extends Mw{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Iw=class extends Mw{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Lw=class extends Mw{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Rw=class extends Mw{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},zw=class extends Mw{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Bw=class extends Mw{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Nw.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(Pw.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(Fw.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(Iw.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(Lw.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(Rw.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(zw.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(Bw.prototype,`ArrayType`,{value:BigUint64Array});var Vw=class extends W{constructor(e){super(U.Float),this.precision=e}get ArrayType(){switch(this.precision){case BC.HALF:return Uint16Array;case BC.SINGLE:return Float32Array;case BC.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};fw=Symbol.toStringTag,Vw[fw]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(Vw.prototype);var Hw=class extends Vw{constructor(){super(BC.HALF)}},Uw=class extends Vw{constructor(){super(BC.SINGLE)}},Ww=class extends Vw{constructor(){super(BC.DOUBLE)}};Object.defineProperty(Hw.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(Uw.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(Ww.prototype,`ArrayType`,{value:Float64Array});var Gw=class extends W{constructor(){super(U.Binary)}toString(){return`Binary`}};pw=Symbol.toStringTag,Gw[pw]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(Gw.prototype);var Kw=class extends W{constructor(){super(U.LargeBinary)}toString(){return`LargeBinary`}};mw=Symbol.toStringTag,Kw[mw]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(Kw.prototype);var qw=class extends W{constructor(){super(U.Utf8)}toString(){return`Utf8`}};hw=Symbol.toStringTag,qw[hw]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(qw.prototype);var Jw=class extends W{constructor(){super(U.LargeUtf8)}toString(){return`LargeUtf8`}};gw=Symbol.toStringTag,Jw[gw]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(Jw.prototype);var Yw=class extends W{constructor(){super(U.Bool)}toString(){return`Bool`}};_w=Symbol.toStringTag,Yw[_w]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(Yw.prototype);var Xw=class extends W{constructor(e,t,n=128){super(U.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};vw=Symbol.toStringTag,Xw[vw]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(Xw.prototype);var Zw=class extends W{constructor(e){super(U.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${VC[this.unit]}>`}get ArrayType(){return this.unit===VC.DAY?Int32Array:BigInt64Array}};yw=Symbol.toStringTag,Zw[yw]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(Zw.prototype);var Qw=class extends W{constructor(e,t){super(U.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${HC[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};bw=Symbol.toStringTag,Qw[bw]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(Qw.prototype);var $w=class extends W{constructor(e,t){super(U.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${HC[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};xw=Symbol.toStringTag,$w[xw]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))($w.prototype);var eT=class extends W{constructor(e){super(U.Interval),this.unit=e}toString(){return`Interval<${UC[this.unit]}>`}};Sw=Symbol.toStringTag,eT[Sw]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(eT.prototype);var tT=class extends W{constructor(e){super(U.Duration),this.unit=e}toString(){return`Duration<${HC[this.unit]}>`}};Cw=Symbol.toStringTag,tT[Cw]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(tT.prototype);var nT=class extends W{constructor(e){super(U.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ww=Symbol.toStringTag,nT[ww]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(nT.prototype);var rT=class extends W{constructor(e){super(U.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Tw=Symbol.toStringTag,rT[Tw]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(rT.prototype);var iT=class extends W{constructor(e,t,n){super(U.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};Ew=Symbol.toStringTag,iT[Ew]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(iT.prototype);var aT=class extends W{constructor(e){super(U.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Dw=Symbol.toStringTag,aT[Dw]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(aT.prototype);var oT=class extends W{constructor(e,t){super(U.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Ow=Symbol.toStringTag,oT[Ow]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(oT.prototype);var sT=class extends W{constructor(e,t=!1){var n,r,i;if(super(U.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};kw=Symbol.toStringTag,sT[kw]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(sT.prototype);const cT=(e=>()=>++e)(-1);var lT=class extends W{constructor(e,t,n,r){super(U.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?cT():JC(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Aw=Symbol.toStringTag,lT[Aw]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(lT.prototype);function uT(e){let t=e;switch(e.typeId){case U.Decimal:return e.bitWidth/32;case U.Interval:return t.unit===UC.MONTH_DAY_NANO?4:1+t.unit;case U.FixedSizeList:return t.listSize;case U.FixedSizeBinary:return t.byteWidth;default:return 1}}var dT=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return fT(this,e,t)}getVisitFnByTypeId(e,t=!0){return pT(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function fT(e,t,n=!0){return typeof t==`number`?pT(e,t,n):typeof t==`string`&&t in U?pT(e,U[t],n):t&&t instanceof W?pT(e,mT(t),n):t?.type&&t.type instanceof W?pT(e,mT(t.type),n):pT(e,U.NONE,n)}function pT(e,t,n=!0){let r=null;switch(t){case U.Null:r=e.visitNull;break;case U.Bool:r=e.visitBool;break;case U.Int:r=e.visitInt;break;case U.Int8:r=e.visitInt8||e.visitInt;break;case U.Int16:r=e.visitInt16||e.visitInt;break;case U.Int32:r=e.visitInt32||e.visitInt;break;case U.Int64:r=e.visitInt64||e.visitInt;break;case U.Uint8:r=e.visitUint8||e.visitInt;break;case U.Uint16:r=e.visitUint16||e.visitInt;break;case U.Uint32:r=e.visitUint32||e.visitInt;break;case U.Uint64:r=e.visitUint64||e.visitInt;break;case U.Float:r=e.visitFloat;break;case U.Float16:r=e.visitFloat16||e.visitFloat;break;case U.Float32:r=e.visitFloat32||e.visitFloat;break;case U.Float64:r=e.visitFloat64||e.visitFloat;break;case U.Utf8:r=e.visitUtf8;break;case U.LargeUtf8:r=e.visitLargeUtf8;break;case U.Binary:r=e.visitBinary;break;case U.LargeBinary:r=e.visitLargeBinary;break;case U.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case U.Date:r=e.visitDate;break;case U.DateDay:r=e.visitDateDay||e.visitDate;break;case U.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case U.Timestamp:r=e.visitTimestamp;break;case U.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case U.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case U.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case U.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case U.Time:r=e.visitTime;break;case U.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case U.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case U.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case U.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case U.Decimal:r=e.visitDecimal;break;case U.List:r=e.visitList;break;case U.Struct:r=e.visitStruct;break;case U.Union:r=e.visitUnion;break;case U.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case U.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case U.Dictionary:r=e.visitDictionary;break;case U.Interval:r=e.visitInterval;break;case U.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case U.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case U.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case U.Duration:r=e.visitDuration;break;case U.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case U.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case U.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case U.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case U.FixedSizeList:r=e.visitFixedSizeList;break;case U.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${U[t]}'`)}function mT(e){switch(e.typeId){case U.Null:return U.Null;case U.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?U.Int8:U.Uint8;case 16:return n?U.Int16:U.Uint16;case 32:return n?U.Int32:U.Uint32;case 64:return n?U.Int64:U.Uint64}return U.Int}case U.Float:switch(e.precision){case BC.HALF:return U.Float16;case BC.SINGLE:return U.Float32;case BC.DOUBLE:return U.Float64}return U.Float;case U.Binary:return U.Binary;case U.LargeBinary:return U.LargeBinary;case U.Utf8:return U.Utf8;case U.LargeUtf8:return U.LargeUtf8;case U.Bool:return U.Bool;case U.Decimal:return U.Decimal;case U.Time:switch(e.unit){case HC.SECOND:return U.TimeSecond;case HC.MILLISECOND:return U.TimeMillisecond;case HC.MICROSECOND:return U.TimeMicrosecond;case HC.NANOSECOND:return U.TimeNanosecond}return U.Time;case U.Timestamp:switch(e.unit){case HC.SECOND:return U.TimestampSecond;case HC.MILLISECOND:return U.TimestampMillisecond;case HC.MICROSECOND:return U.TimestampMicrosecond;case HC.NANOSECOND:return U.TimestampNanosecond}return U.Timestamp;case U.Date:switch(e.unit){case VC.DAY:return U.DateDay;case VC.MILLISECOND:return U.DateMillisecond}return U.Date;case U.Interval:switch(e.unit){case UC.DAY_TIME:return U.IntervalDayTime;case UC.YEAR_MONTH:return U.IntervalYearMonth;case UC.MONTH_DAY_NANO:return U.IntervalMonthDayNano}return U.Interval;case U.Duration:switch(e.unit){case HC.SECOND:return U.DurationSecond;case HC.MILLISECOND:return U.DurationMillisecond;case HC.MICROSECOND:return U.DurationMicrosecond;case HC.NANOSECOND:return U.DurationNanosecond}return U.Duration;case U.Map:return U.Map;case U.List:return U.List;case U.Struct:return U.Struct;case U.Union:switch(e.mode){case zC.Dense:return U.DenseUnion;case zC.Sparse:return U.SparseUnion}return U.Union;case U.FixedSizeBinary:return U.FixedSizeBinary;case U.FixedSizeList:return U.FixedSizeList;case U.Dictionary:return U.Dictionary}throw Error(`Unrecognized type '${U[e.typeId]}'`)}dT.prototype.visitInt8=null,dT.prototype.visitInt16=null,dT.prototype.visitInt32=null,dT.prototype.visitInt64=null,dT.prototype.visitUint8=null,dT.prototype.visitUint16=null,dT.prototype.visitUint32=null,dT.prototype.visitUint64=null,dT.prototype.visitFloat16=null,dT.prototype.visitFloat32=null,dT.prototype.visitFloat64=null,dT.prototype.visitDateDay=null,dT.prototype.visitDateMillisecond=null,dT.prototype.visitTimestampSecond=null,dT.prototype.visitTimestampMillisecond=null,dT.prototype.visitTimestampMicrosecond=null,dT.prototype.visitTimestampNanosecond=null,dT.prototype.visitTimeSecond=null,dT.prototype.visitTimeMillisecond=null,dT.prototype.visitTimeMicrosecond=null,dT.prototype.visitTimeNanosecond=null,dT.prototype.visitDenseUnion=null,dT.prototype.visitSparseUnion=null,dT.prototype.visitIntervalDayTime=null,dT.prototype.visitIntervalYearMonth=null,dT.prototype.visitIntervalMonthDayNano=null,dT.prototype.visitDuration=null,dT.prototype.visitDurationSecond=null,dT.prototype.visitDurationMillisecond=null,dT.prototype.visitDurationMicrosecond=null,dT.prototype.visitDurationNanosecond=null;var hT={};ze(hT,{float64ToUint16:()=>yT,uint16ToFloat64:()=>vT});const gT=new Float64Array(1),_T=new Uint32Array(gT.buffer);function vT(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function yT(e){if(e!==e)return 32256;gT[0]=e;let t=(_T[1]&2147483648)>>16&65535,n=_T[1]&2146435072,r=0;return n>=1089470464?_T[0]>0?n=31744:(n=(n&2080374784)>>16,r=(_T[1]&1048575)>>10):n<=1056964608?(r=1048576+(_T[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(_T[1]&1048575)+512>>10),t|n|r&65535}var G=class extends dT{};function bT(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const xT=(e,t,n)=>{e[t]=Math.floor(n/864e5)},ST=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},TT=({values:e},t,n)=>{e[t]=n},ET=({values:e},t,n)=>{e[t]=yT(n)},DT=(e,t,n)=>{switch(e.type.precision){case BC.HALF:return ET(e,t,n);case BC.SINGLE:case BC.DOUBLE:return TT(e,t,n)}},OT=({values:e},t,n)=>{xT(e,t,n.valueOf())},kT=({values:e},t,n)=>{e[t]=BigInt(n)},AT=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},jT=({values:e,valueOffsets:t},n,r)=>ST(e,t,n,r),MT=({values:e,valueOffsets:t},n,r)=>ST(e,t,n,GS(r)),NT=(e,t,n)=>{e.type.unit===VC.DAY?OT(e,t,n):kT(e,t,n)},PT=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},FT=({values:e},t,n)=>{e[t]=BigInt(n)},IT=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},LT=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},RT=(e,t,n)=>{switch(e.type.unit){case HC.SECOND:return PT(e,t,n);case HC.MILLISECOND:return FT(e,t,n);case HC.MICROSECOND:return IT(e,t,n);case HC.NANOSECOND:return LT(e,t,n)}},zT=({values:e},t,n)=>{e[t]=n},BT=({values:e},t,n)=>{e[t]=n},VT=({values:e},t,n)=>{e[t]=n},HT=({values:e},t,n)=>{e[t]=n},UT=(e,t,n)=>{switch(e.type.unit){case HC.SECOND:return zT(e,t,n);case HC.MILLISECOND:return BT(e,t,n);case HC.MICROSECOND:return VT(e,t,n);case HC.NANOSECOND:return HT(e,t,n)}},WT=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},GT=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=fE.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=fE.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},qT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),JT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),YT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),XT=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),ZT=(e,t,n)=>{let r=e.type.children.map(e=>fE.getVisitFn(e.type)),i=n instanceof Map?YT(t,n):n instanceof dO?JT(t,n):Array.isArray(n)?qT(t,n):XT(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},QT=(e,t,n)=>{e.type.mode===zC.Dense?$T(e,t,n):eE(e,t,n)},$T=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];fE.visit(i,e.valueOffsets[t],n)},eE=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];fE.visit(i,t,n)},tE=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},nE=(e,t,n)=>{switch(e.type.unit){case UC.YEAR_MONTH:return iE(e,t,n);case UC.DAY_TIME:return rE(e,t,n);case UC.MONTH_DAY_NANO:return aE(e,t,n)}},rE=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},iE=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},aE=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},oE=({values:e},t,n)=>{e[t]=n},sE=({values:e},t,n)=>{e[t]=n},cE=({values:e},t,n)=>{e[t]=n},lE=({values:e},t,n)=>{e[t]=n},uE=(e,t,n)=>{switch(e.type.unit){case HC.SECOND:return oE(e,t,n);case HC.MILLISECOND:return sE(e,t,n);case HC.MICROSECOND:return cE(e,t,n);case HC.NANOSECOND:return lE(e,t,n)}},dE=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=fE.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${qC(e)}: ${qC(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new gE(this[pE],this[mE])}},gE=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[pE].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[pE].type.children.some(e=>e.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[pE].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=lD.visit(e[pE].children[n],e[mE]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[pE].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(fE.visit(e[pE].children[r],e[mE],n),Reflect.set(e,t,n))}};const vE=new _E;var K=class extends dT{};function yE(e){return(t,n)=>t.getValid(n)?e(t,n):null}const bE=(e,t)=>864e5*e[t],xE=(e,t)=>null,SE=(e,t,n)=>{if(n+1>=t.length)return null;let r=JC(t[n]),i=JC(t[n+1]);return e.subarray(r,i)},CE=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<bE(e,t),TE=({values:e},t)=>JC(e[t]),EE=({stride:e,values:t},n)=>t[e*n],DE=({stride:e,values:t},n)=>vT(t[e*n]),OE=({values:e},t)=>e[t],kE=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),AE=({values:e,valueOffsets:t},n)=>SE(e,t,n),jE=({values:e,valueOffsets:t},n)=>{let r=SE(e,t,n);return r===null?null:US(r)},ME=({values:e},t)=>e[t],NE=({type:e,values:t},n)=>e.precision===BC.HALF?vT(t[n]):t[n],PE=(e,t)=>e.type.unit===VC.DAY?wE(e,t):TE(e,t),FE=({values:e},t)=>1e3*JC(e[t]),IE=({values:e},t)=>JC(e[t]),LE=({values:e},t)=>YC(e[t],BigInt(1e3)),RE=({values:e},t)=>YC(e[t],BigInt(1e6)),zE=(e,t)=>{switch(e.type.unit){case HC.SECOND:return FE(e,t);case HC.MILLISECOND:return IE(e,t);case HC.MICROSECOND:return LE(e,t);case HC.NANOSECOND:return RE(e,t)}},BE=({values:e},t)=>e[t],VE=({values:e},t)=>e[t],HE=({values:e},t)=>e[t],UE=({values:e},t)=>e[t],WE=(e,t)=>{switch(e.type.unit){case HC.SECOND:return BE(e,t);case HC.MILLISECOND:return VE(e,t);case HC.MICROSECOND:return HE(e,t);case HC.NANOSECOND:return UE(e,t)}},GE=({values:e,stride:t},n)=>cw.decimal(e.subarray(t*n,t*(n+1))),KE=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new dO([c])},qE=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new mD(o.slice(i,a-i))},JE=(e,t)=>new hE(e,t),YE=(e,t)=>e.type.mode===zC.Dense?XE(e,t):ZE(e,t),XE=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return lD.visit(r,e.valueOffsets[t])},ZE=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return lD.visit(r,t)},QE=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},$E=(e,t)=>e.type.unit===UC.MONTH_DAY_NANO?nD(e,t):e.type.unit===UC.DAY_TIME?eD(e,t):tD(e,t),eD=({values:e},t)=>e.subarray(2*t,2*(t+1)),tD=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},nD=({values:e},t)=>e.subarray(4*t,4*(t+1)),rD=({values:e},t)=>e[t],iD=({values:e},t)=>e[t],aD=({values:e},t)=>e[t],oD=({values:e},t)=>e[t],sD=(e,t)=>{switch(e.type.unit){case HC.SECOND:return rD(e,t);case HC.MILLISECOND:return iD(e,t);case HC.MICROSECOND:return aD(e,t);case HC.NANOSECOND:return oD(e,t)}},cD=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new dO([a])};K.prototype.visitNull=yE(xE),K.prototype.visitBool=yE(CE),K.prototype.visitInt=yE(ME),K.prototype.visitInt8=yE(EE),K.prototype.visitInt16=yE(EE),K.prototype.visitInt32=yE(EE),K.prototype.visitInt64=yE(OE),K.prototype.visitUint8=yE(EE),K.prototype.visitUint16=yE(EE),K.prototype.visitUint32=yE(EE),K.prototype.visitUint64=yE(OE),K.prototype.visitFloat=yE(NE),K.prototype.visitFloat16=yE(DE),K.prototype.visitFloat32=yE(EE),K.prototype.visitFloat64=yE(EE),K.prototype.visitUtf8=yE(jE),K.prototype.visitLargeUtf8=yE(jE),K.prototype.visitBinary=yE(AE),K.prototype.visitLargeBinary=yE(AE),K.prototype.visitFixedSizeBinary=yE(kE),K.prototype.visitDate=yE(PE),K.prototype.visitDateDay=yE(wE),K.prototype.visitDateMillisecond=yE(TE),K.prototype.visitTimestamp=yE(zE),K.prototype.visitTimestampSecond=yE(FE),K.prototype.visitTimestampMillisecond=yE(IE),K.prototype.visitTimestampMicrosecond=yE(LE),K.prototype.visitTimestampNanosecond=yE(RE),K.prototype.visitTime=yE(WE),K.prototype.visitTimeSecond=yE(BE),K.prototype.visitTimeMillisecond=yE(VE),K.prototype.visitTimeMicrosecond=yE(HE),K.prototype.visitTimeNanosecond=yE(UE),K.prototype.visitDecimal=yE(GE),K.prototype.visitList=yE(KE),K.prototype.visitStruct=yE(JE),K.prototype.visitUnion=yE(YE),K.prototype.visitDenseUnion=yE(XE),K.prototype.visitSparseUnion=yE(ZE),K.prototype.visitDictionary=yE(QE),K.prototype.visitInterval=yE($E),K.prototype.visitIntervalDayTime=yE(eD),K.prototype.visitIntervalYearMonth=yE(tD),K.prototype.visitIntervalMonthDayNano=yE(nD),K.prototype.visitDuration=yE(sD),K.prototype.visitDurationSecond=yE(rD),K.prototype.visitDurationMillisecond=yE(iD),K.prototype.visitDurationMicrosecond=yE(aD),K.prototype.visitDurationNanosecond=yE(oD),K.prototype.visitFixedSizeList=yE(cD),K.prototype.visitMap=yE(qE);const lD=new K,uD=Symbol.for(`keys`),dD=Symbol.for(`vals`),fD=Symbol.for(`kKeysAsStrings`),pD=Symbol.for(`_kKeysAsStrings`);var mD=class{constructor(e){return this[uD]=new dO([e.children[0]]).memoize(),this[dD]=e.children[1],new Proxy(this,new gD)}get[fD](){return this[pD]||(this[pD]=Array.from(this[uD].toArray(),String))}[Symbol.iterator](){return new hD(this[uD],this[dD])}get size(){return this[uD].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[uD],t=this[dD],n={};for(let r=-1,i=e.length;++r`${qC(e)}: ${qC(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},hD=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),lD.visit(this.vals,e)]})}},gD=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[fD]}has(e,t){return e[fD].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[fD].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[fD].indexOf(t);if(n!==-1){let r=lD.visit(Reflect.get(e,dD),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[fD].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(fE.visit(Reflect.get(e,dD),r,n),Reflect.set(e,t,n))}};Object.defineProperties(mD.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[uD]:{writable:!0,enumerable:!1,configurable:!1,value:null},[dD]:{writable:!0,enumerable:!1,configurable:!1,value:null},[pD]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var _D={};ze(_D,{clampRange:()=>yD,createElementComparator:()=>SD,wrapIndex:()=>bD});let vD;function yD(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const bD=(e,t)=>e<0?t+e:e,xD=e=>e!==e;function SD(e){let t=typeof e;if(t!==`object`||e===null)return xD(e)?xD:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?RC(e,t):!1:e instanceof Map?wD(e):Array.isArray(e)?CD(e):e instanceof dO?TD(e):ED(e,!0)}function CD(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return OD(e,n);case Map:return AD(e,n,n.keys());case mD:case hE:case Object:case void 0:return AD(e,n,t||Object.keys(n))}return n instanceof dO?kD(e,n):!1}}function OD(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rLD,getBit:()=>ND,getBool:()=>MD,packBools:()=>ID,popcnt_array:()=>zD,popcnt_bit_range:()=>RD,popcnt_uint32:()=>BD,setBool:()=>PD,truncateBitmap:()=>FD});function MD(e,t,n,r){return(n&1<>r}function PD(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):ID(new LD(n,e,t,null,MD)).subarray(0,r)),i}return n}function ID(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var LD=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return RD(e,t,i)+RD(e,r,n)+zD(e,i>>3,r-i>>3)}function zD(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=BD(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=BD(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=BD(a.getUint8(i)),i+=1;return r}function BD(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const VD=-1;var HD=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return W.isSparseUnion(e)||W.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(W.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=VD&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-RD(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=uT(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(W.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===zC.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(FD(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===U.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(FD(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[WC.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[WC.TYPE])&&(a[WC.TYPE]=i.subarray(e,e+t)),(i=a[WC.OFFSET])&&(a[WC.OFFSET]=i.subarray(e,e+t+1))||(i=a[WC.DATA])&&(a[WC.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};HD.prototype.children=Object.freeze([]);var UD=class e extends dT{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new HD(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=lC(e.data),i=lC(e.nullBitmap),a=sC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=lC(e.data),i=lC(e.nullBitmap),a=cC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=lC(e.data),i=lC(e.nullBitmap),a=sC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=lC(e.data),i=lC(e.nullBitmap),a=cC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length/uT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length/uT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length/uT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length/uT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length/uT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=lC(e.nullBitmap),a=sC(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new HD(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=lC(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=iC(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(W.isSparseUnion(t))return new HD(t,n,a,o,[void 0,void 0,void 0,i],r);let s=sC(e.valueOffsets);return new HD(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=lC(t.nullBitmap),a=iC(n.indices.ArrayType,t.data),{dictionary:o=new dO([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new HD(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length/uT(t),nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=lC(e.nullBitmap),i=iC(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new HD(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=lC(t.nullBitmap),{length:o=i.length/uT(n),nullCount:s=t.nullBitmap?-1:0}=t;return new HD(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=lC(t.nullBitmap),o=sC(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new HD(n,r,s,c,[o,void 0,a],[i])}};new UD;var WD=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function KD(e){return e.reduce((e,t)=>e+t.nullCount,0)}function qD(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function JD(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function YD(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function tO(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new LD(n,e.offset+(t||0),e.length,n,MD)){if(!i)return r;++r}return-1}function nO(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case U.Union:break;case U.Dictionary:break;default:return tO(e,n)}let r=lD.getVisitFn(e),i=SD(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new WD(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new oO(a)})}var oO=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof HD)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=lO[o.typeId],r=a[0];this.isValid=e=>XD(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,uO[o.typeId]),this._offsets=qD(a);break}this.data=a,this.type=o,this.stride=uT(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return GD(this.data)}get nullCount(){return KD(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${U[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(bD(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return sO.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(yD(this,t,n,({data:e,_offsets:t},n,r)=>JD(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case U.Int:case U.Float:case U.Decimal:case U.Time:case U.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return W.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(W.isDictionary(this.type)){let t=new fO(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new fO(this)}unmemoize(){if(W.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};cO=Symbol.toStringTag,dO[cO]=(e=>{e.type=W.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(U).map(e=>U[e]).filter(e=>typeof e==`number`&&e!==U.NONE);for(let n of t){let t=lD.getVisitFnByTypeId(n),r=fE.getVisitFnByTypeId(n),i=iO.getVisitFnByTypeId(n);lO[n]={get:t,set:r,indexOf:i},uO[n]=Object.create(e,{isValid:{value:ZD(XD)},get:{value:ZD(lD.getVisitFnByTypeId(n))},set:{value:QD(fE.getVisitFnByTypeId(n))},indexOf:{value:$D(iO.getVisitFnByTypeId(n))}})}return`Vector`})(dO.prototype);var fO=class e extends dO{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new dO(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},pO={};ze(pO,{BaseInt64:()=>vO,Int128:()=>xO,Int64:()=>bO,Uint64:()=>yO});const mO=65536;function hO(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const gO=8,_O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var vO=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${hO(this.buffer[3])} ${hO(this.buffer[2])} ${hO(this.buffer[1])} ${hO(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;nCO,toIntervalDayTimeObjects:()=>TO,toIntervalMonthDayNanoInt32Array:()=>wO,toIntervalMonthDayNanoObjects:()=>EO});function CO(e){var t,n;let r=e.length,i=new Int32Array(r*2);for(let a=0,o=0;a>BigInt(32))):o+=2}return i}function TO(e){let t=e.length,n=Array(t/2);for(let r=0,i=0;r>>0);r[a++]={months:e[i],days:e[i+1],nanoseconds:t?`${n}`:n}}return r}var Y=class extends dT{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function DO(e,t){return t instanceof e.constructor}function OO(e,t){return e===t||DO(e,t)}function kO(e,t){return e===t||DO(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function AO(e,t){return e===t||DO(e,t)&&e.precision===t.precision}function jO(e,t){return e===t||DO(e,t)&&e.byteWidth===t.byteWidth}function MO(e,t){return e===t||DO(e,t)&&e.unit===t.unit}function NO(e,t){return e===t||DO(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function PO(e,t){return e===t||DO(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function FO(e,t){return e===t||DO(e,t)&&e.children.length===t.children.length&&UO.compareManyFields(e.children,t.children)}function IO(e,t){return e===t||DO(e,t)&&e.children.length===t.children.length&&UO.compareManyFields(e.children,t.children)}function LO(e,t){return e===t||DO(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&UO.compareManyFields(e.children,t.children)}function RO(e,t){return e===t||DO(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&UO.visit(e.indices,t.indices)&&UO.visit(e.dictionary,t.dictionary)}function zO(e,t){return e===t||DO(e,t)&&e.unit===t.unit}function BO(e,t){return e===t||DO(e,t)&&e.unit===t.unit}function VO(e,t){return e===t||DO(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&UO.compareManyFields(e.children,t.children)}function HO(e,t){return e===t||DO(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&UO.compareManyFields(e.children,t.children)}Y.prototype.visitNull=OO,Y.prototype.visitBool=OO,Y.prototype.visitInt=kO,Y.prototype.visitInt8=kO,Y.prototype.visitInt16=kO,Y.prototype.visitInt32=kO,Y.prototype.visitInt64=kO,Y.prototype.visitUint8=kO,Y.prototype.visitUint16=kO,Y.prototype.visitUint32=kO,Y.prototype.visitUint64=kO,Y.prototype.visitFloat=AO,Y.prototype.visitFloat16=AO,Y.prototype.visitFloat32=AO,Y.prototype.visitFloat64=AO,Y.prototype.visitUtf8=OO,Y.prototype.visitLargeUtf8=OO,Y.prototype.visitBinary=OO,Y.prototype.visitLargeBinary=OO,Y.prototype.visitFixedSizeBinary=jO,Y.prototype.visitDate=MO,Y.prototype.visitDateDay=MO,Y.prototype.visitDateMillisecond=MO,Y.prototype.visitTimestamp=NO,Y.prototype.visitTimestampSecond=NO,Y.prototype.visitTimestampMillisecond=NO,Y.prototype.visitTimestampMicrosecond=NO,Y.prototype.visitTimestampNanosecond=NO,Y.prototype.visitTime=PO,Y.prototype.visitTimeSecond=PO,Y.prototype.visitTimeMillisecond=PO,Y.prototype.visitTimeMicrosecond=PO,Y.prototype.visitTimeNanosecond=PO,Y.prototype.visitDecimal=OO,Y.prototype.visitList=FO,Y.prototype.visitStruct=IO,Y.prototype.visitUnion=LO,Y.prototype.visitDenseUnion=LO,Y.prototype.visitSparseUnion=LO,Y.prototype.visitDictionary=RO,Y.prototype.visitInterval=zO,Y.prototype.visitIntervalDayTime=zO,Y.prototype.visitIntervalYearMonth=zO,Y.prototype.visitIntervalMonthDayNano=zO,Y.prototype.visitDuration=BO,Y.prototype.visitDurationSecond=BO,Y.prototype.visitDurationMillisecond=BO,Y.prototype.visitDurationMicrosecond=BO,Y.prototype.visitDurationNanosecond=BO,Y.prototype.visitFixedSizeList=VO,Y.prototype.visitMap=HO;const UO=new Y;function WO(e,t){return UO.compareSchemas(e,t)}function GO(e,t){return UO.compareFields(e,t)}function KO(e,t){return UO.visit(e,t)}const qO=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},XC),pO),jD),hT),$S),_D),GC),SO),{compareSchemas:WO,compareFields:GO,compareTypes:KO}),JO=365.2425,YO=6048e5,XO=864e5,ZO=3600,QO=ZO*24;QO*7;const $O=QO*JO,ek=$O/12;ek*3;const tk=Symbol.for(`constructDateFrom`);function nk(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&tk in e?e[tk](t):e instanceof Date?new e.constructor(t):new Date(t)}function rk(e,t){return nk(t||e,e)}let ik={};function ak(){return ik}function ok(e,t){let n=ak(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=rk(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function lk(e){let t=rk(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function uk(e,...t){let n=nk.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function dk(e,t){let n=rk(e,t?.in);return n.setHours(0,0,0,0),n}function fk(e,t,n){let[r,i]=uk(n?.in,e,t),a=dk(r),o=dk(i),s=+a-lk(a),c=+o-lk(o);return Math.round((s-c)/XO)}function pk(e,t){let n=ck(e,t),r=nk(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),sk(r)}function mk(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function hk(e){return!(!mk(e)&&typeof e!=`number`||isNaN(+rk(e)))}function gk(e,t){let n=rk(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const _k={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},vk=(e,t,n)=>{let r,i=_k[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function yk(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const bk={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},xk={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},Sk={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},Ck={date:yk({formats:bk,defaultWidth:`full`}),time:yk({formats:xk,defaultWidth:`full`}),dateTime:yk({formats:Sk,defaultWidth:`full`})},wk={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Tk=(e,t,n,r)=>wk[e];function Ek(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const Dk={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},Ok={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},kk={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},Ak={narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},jk={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},Mk={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},Nk=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},Pk={ordinalNumber:Nk,era:Ek({values:Dk,defaultWidth:`wide`}),quarter:Ek({values:Ok,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Ek({values:kk,defaultWidth:`wide`}),day:Ek({values:Ak,defaultWidth:`wide`}),dayPeriod:Ek({values:jk,defaultWidth:`wide`,formattingValues:Mk,defaultFormattingWidth:`wide`})};function Fk(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Lk(s,e=>e.test(o)):Ik(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Ik(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Lk(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const zk=/^(\d+)(th|st|nd|rd)?/i,Bk=/\d+/i,Vk={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Hk={any:[/^b/i,/^(a|c)/i]},Uk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wk={any:[/1/i,/2/i,/3/i,/4/i]},Gk={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kk={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qk={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jk={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Yk={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Xk={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Zk={ordinalNumber:Rk({matchPattern:zk,parsePattern:Bk,valueCallback:e=>parseInt(e,10)}),era:Fk({matchPatterns:Vk,defaultMatchWidth:`wide`,parsePatterns:Hk,defaultParseWidth:`any`}),quarter:Fk({matchPatterns:Uk,defaultMatchWidth:`wide`,parsePatterns:Wk,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Fk({matchPatterns:Gk,defaultMatchWidth:`wide`,parsePatterns:Kk,defaultParseWidth:`any`}),day:Fk({matchPatterns:qk,defaultMatchWidth:`wide`,parsePatterns:Jk,defaultParseWidth:`any`}),dayPeriod:Fk({matchPatterns:Yk,defaultMatchWidth:`any`,parsePatterns:Xk,defaultParseWidth:`any`})},Qk={code:`en-US`,formatDistance:vk,formatLong:Ck,formatRelative:Tk,localize:Pk,match:Zk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $k(e,t){let n=rk(e,t?.in),r=fk(n,gk(n)),i=r+1;return i}function eA(e,t){let n=rk(e,t?.in),r=sk(n)-+pk(n);return Math.round(r/YO)+1}function tA(e,t){let n=rk(e,t?.in),r=n.getFullYear(),i=ak(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=nk(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=ok(o,t),c=nk(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=ok(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function nA(e,t){let n=ak(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=tA(e,t),a=nk(t?.in||e,0);a.setFullYear(i,0,r),a.setHours(0,0,0,0);let o=ok(a,t);return o}function rA(e,t){let n=rk(e,t?.in),r=ok(n,t)-+nA(n,t);return Math.round(r/YO)+1}function iA(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const aA={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return iA(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):iA(n+1,2)},d(e,t){return iA(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return iA(e.getHours()%12||12,t.length)},H(e,t){return iA(e.getHours(),t.length)},m(e,t){return iA(e.getMinutes(),t.length)},s(e,t){return iA(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return iA(i,t.length)}},oA={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},sA={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return aA.y(e,t)},Y:function(e,t,n,r){let i=tA(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return iA(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):iA(a,t.length)},R:function(e,t){let n=ck(e);return iA(n,t.length)},u:function(e,t){let n=e.getFullYear();return iA(n,t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return iA(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return iA(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return aA.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return iA(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=rA(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):iA(i,t.length)},I:function(e,t,n){let r=eA(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):iA(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):aA.d(e,t)},D:function(e,t,n){let r=$k(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):iA(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return iA(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return iA(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return iA(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours(),i=r/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?oA.noon:r===0?oA.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?oA.evening:r>=12?oA.afternoon:r>=4?oA.morning:oA.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return aA.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):aA.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):iA(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):iA(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):aA.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):aA.s(e,t)},S:function(e,t){return aA.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return lA(r);case`XXXX`:case`XX`:return uA(r);case`XXXXX`:case`XXX`:default:return uA(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return lA(r);case`xxxx`:case`xx`:return uA(r);case`xxxxx`:case`xxx`:default:return uA(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+cA(r,`:`);case`OOOO`:default:return`GMT`+uA(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+cA(r,`:`);case`zzzz`:default:return`GMT`+uA(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return iA(r,t.length)},T:function(e,t,n){return iA(+e,t.length)}};function cA(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+iA(a,2)}function lA(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+iA(Math.abs(e)/60,2)}return uA(e,t)}function uA(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=iA(Math.trunc(r/60),2),a=iA(r%60,2);return n+i+t+a}const dA=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},fA=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}},pA=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return dA(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,dA(r,t)).replace(`{{time}}`,fA(i,t))},mA={p:fA,P:pA},hA=/^D+$/,gA=/^Y+$/,_A=[`D`,`DD`,`YY`,`YYYY`];function vA(e){return hA.test(e)}function yA(e){return gA.test(e)}function bA(e,t,n){let r=xA(e,t,n);if(console.warn(r),_A.includes(e))throw RangeError(r)}function xA(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const SA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wA=/^'([^]*?)'?$/,TA=/''/g,EA=/[a-zA-Z]/;function DA(e,t,n){let r=ak(),i=n?.locale??r.locale??Qk,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=rk(e,n?.in);if(!hk(s))throw RangeError(`Invalid time value`);let c=t.match(CA).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=mA[t];return n(e,i.formatLong)}return e}).join(``).match(SA).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:OA(e)};if(sA[t])return{isToken:!0,value:e};if(t.match(EA))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&yA(a)||!n?.useAdditionalDayOfYearTokens&&vA(a))&&bA(a,t,String(e));let o=sA[a[0]];return o(s,a,i.localize,l)}).join(``)}function OA(e){let t=e.match(wA);return t?t[1].replace(TA,`'`):e}function kA(e,t){return rk(e*1e3,t?.in)}function AA(e,t){let n=jA(t)?new t(0):nk(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function jA(e){return typeof e==`function`&&e.prototype?.constructor===e}function MA(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function NA(e){return e==null}function PA(e){return e!=null}async function FA(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await C(()=>import(`./__vite-browser-external-Cp7ZP3Cb.js`).then(Ve(1)),__vite__mapDeps([0,1,2]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function IA(e){return NA(e)?!1:W.isInt(e.type)&&!HA(e)||LA(e)}function LA(e){return NA(e)?!1:W.isInt(e.type)&&e.type.isSigned===!1}function RA(e){return NA(e)?!1:W.isFloat(e.type)??!1}function zA(e){return NA(e)?!1:W.isDecimal(e.type)}function BA(e){return NA(e)?!1:W.isBool(e.type)}function VA(e){return NA(e)?!1:W.isDuration(e.type)}function HA(e){return NA(e)?!1:W.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function UA(e){return NA(e)?!1:W.isTimestamp(e.type)}function WA(e){return NA(e)?!1:W.isDate(e.type)}function GA(e){return NA(e)?!1:W.isTime(e.type)}function KA(e){return NA(e)?!1:W.isList(e.type)||W.isFixedSizeList(e.type)}function qA(e){return NA(e)?!1:W.isStruct(e.type)||W.isMap(e.type)}function JA(e){return NA(e)?!1:W.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||W.isInterval(e.type)}new Date(1970,0,1);function YA(e,t){let n;if(t===HC.MILLISECOND)n=1e3;else if(t===HC.MICROSECOND)n=1e3*1e3;else if(t===HC.NANOSECOND)n=1e3*1e3*1e3;else return Number(e);return typeof e==`bigint`&&!Number.isSafeInteger(Number(e))?Number(e/BigInt(n)):Number(e)/n}function XA(e,t){let n=YA(e,t?.type?.unit??HC.SECOND);return kA(n)}function ZA(e,t){let n=XA(e,t);return DA(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function QA(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?DA(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function $A(e,t){if(!(e instanceof Date||typeof e==`number`&&Number.isFinite(e)))return console.warn(`Unsupported datetime value: ${e}`),null;let n,r=t?.type?.timezone;return n=r?new IS(e,r):new IS(e),AA(n,Date)}function ej(e,t){let n=t?.type?.scale||0,r=qO.bigNumToString(new qO.BN(e)).padStart(n,`0`);if(n===0)return r;let i=``;r.startsWith(`-`)&&(i=`-`,r=r.slice(1));let a=r.slice(0,-n)||`0`,o=MA(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function tj(e){let t=e[0],n=e[1],r=[];return t!==0&&r.push(`${t} year${t>1?`s`:``}`),n!==0&&r.push(`${n} month${n>1?`s`:``}`),r.length?r.join(` `):`0 months`}function nj(e,t){if(W.isInterval(t?.type))return tj(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){let n=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),{closed:r}=n,i=e.toJSON(),a=r===`both`||r===`left`?`[`:`(`,o=r===`both`||r===`right`?`]`:`)`,s=ij(i.left,t.type?.children?.[0]),c=ij(i.right,t.type?.children?.[1]);return`${a+s}, ${c+o}`}return String(e)}function rj(e,t){return t?.type instanceof rT?JSON.parse(JSON.stringify(e,(e,t)=>{if(PA(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function ij(e,t){if(NA(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&WA(t))return QA(e);if(typeof e==`bigint`&&GA(t))return ZA(Number(e),t);if(n&&UA(t))return $A(e,t);if(HA(t))throw Error(`Period type is not supported yet`);if(JA(t))return nj(e,t);if(VA(t))throw Error(`Duration type is not supported yet`);return zA(t)?ej(e,t):RA(t)&&Number.isFinite(e)||IA(t)?e:qA(t)||KA(t)?rj(e,t):BA(t)?!!e:String(e)}function aj(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=ij(t[e.name],e)),t));return n}let oj=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function sj(e){let t=ye(e,{logger:!1}),n,r,i=await FA();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await C(async()=>{let{getBundles:e}=await import(`./default-browser-ZWdN_TIR.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await AS(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await C(async()=>{let{getBundles:e}=await import(`./default-node-whATspOv.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));t.bundles=await e()}r=await AS(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await C(()=>import(`./browser-DPkKpj_5.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new rS:t.logger===!1?new nS:t.logger;let o=new mS(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case oj.ORIGIN_PRIVATE_FS:try{let e=t.storage.path;e.startsWith(`/`)&&(e=e.slice(1)),await o.open({path:`opfs://${e}`,accessMode:t.storage.accessMode})}catch(e){throw await o.terminate(),await n.terminate(),e}break;case oj.NODE_FS:try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(e){throw await o.terminate(),await n.terminate(),e}break}let s=await o.connect();async function c(e,t=[]){if(!t||t.length===0){let t=await s.query(e);return{_results:t,_schema:t.schema,columns:t.schema.fields,rows:aj(t)}}let n=await s.prepare(e),r=await n.query(...t);return n.close(),{_results:r,_schema:r.schema,columns:r.schema.fields,rows:aj(r)}}return{worker:n,db:o,conn:s,query:async(e,t=[])=>c(e,t).then(e=>e.rows),queryWithColumns:async(e,t=[])=>c(e,t),close:async()=>{await s.close(),await o.terminate(),await n.terminate()}}}async function cj(e,t){await(await e).conn.send(`BEGIN TRANSACTION`);try{let n=await t(e);return await(await e).conn.send(`COMMIT`),n}catch(t){throw await(await e).conn.send(`ROLLBACK`),t}}async function lj(e,t,n){await(await e).conn.send(`SAVEPOINT ${t}`);try{let r=await n(e);return await(await e).conn.send(`RELEASE SAVEPOINT ${t}`),r}catch(n){throw await(await e).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const X=Symbol.for(`drizzle:entityKind`);Symbol.for(`drizzle:hasOwnEntityKind`);function Z(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,X))throw Error(`Class "${t.name??``}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(X in n&&n[X]===t[X])return!0;n=Object.getPrototypeOf(n)}return!1}var uj=class{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[X]=`Column`;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},dj=class{static[X]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}};const fj=Symbol.for(`drizzle:Name`);var pj=class{static[X]=`PgForeignKeyBuilder`;reference;_onUpdate=`no action`;_onDelete=`no action`;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new mj(e,this)}},mj=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[X]=`PgForeignKey`;reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[fj],...r,n[0].table[fj],...i];return e??`${a.join(`_`)}_fk`}};function hj(e,...t){return e(...t)}function gj(e,t){return`${e[fj]}_${t.join(`_`)}_unique`}function _j(e,t,n){for(let r=t;rArray.isArray(e)?bj(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var xj=class extends dj{foreignKeyConfigs=[];static[X]=`PgColumnBuilder`;array(e){return new wj(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>hj((n,r)=>{let i=new pj(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new Cj(e,this.config)}},Sj=class extends uj{constructor(e,t){t.uniqueName||=gj(e,[t.name]),super(e,t),this.table=e}static[X]=`PgColumn`},Cj=class extends Sj{static[X]=`ExtraConfigColumn`;getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass};defaultConfig={order:`asc`,nulls:`last`,opClass:void 0};asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},wj=class extends xj{static[X]=`PgArrayBuilder`;constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new Tj(e,this.config,t)}},Tj=class e extends Sj{constructor(e,t,n,r){super(e,t),this.baseColumn=n,this.range=r,this.size=t.size}size;static[X]=`PgArray`;getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=yj(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(t,n=!1){let r=t.map(t=>t===null?null:Z(this.baseColumn,e)?this.baseColumn.mapToDriverValue(t,!0):this.baseColumn.mapToDriverValue(t));return n?r:bj(r)}};const Ej=Symbol.for(`drizzle:isPgEnum`);function Dj(e){return!!e&&typeof e==`function`&&Ej in e&&e[Ej]===!0}var Oj=class{static[X]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},kj=class extends Oj{static[X]=`WithSubquery`},Aj=`0.44.4`;let jj,Mj;const Nj={startActiveSpan(e,t){return jj?(Mj||=jj.trace.getTracer(`drizzle-orm`,Aj),hj((n,r)=>r.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:`Unknown error`}),t}finally{e.end()}}),jj,Mj)):t()}},Pj=Symbol.for(`drizzle:ViewBaseConfig`),Fj=Symbol.for(`drizzle:Schema`),Ij=Symbol.for(`drizzle:Columns`),Lj=Symbol.for(`drizzle:ExtraConfigColumns`),Rj=Symbol.for(`drizzle:OriginalName`),zj=Symbol.for(`drizzle:BaseName`),Bj=Symbol.for(`drizzle:IsAlias`),Vj=Symbol.for(`drizzle:ExtraConfigBuilder`),Hj=Symbol.for(`drizzle:IsDrizzleTable`);var Q=class{static[X]=`Table`;static Symbol={Name:fj,Schema:Fj,OriginalName:Rj,Columns:Ij,ExtraConfigColumns:Lj,BaseName:zj,IsAlias:Bj,ExtraConfigBuilder:Vj};[fj];[Rj];[Fj];[Ij];[Lj];[zj];[Bj]=!1;[Hj]=!0;[Vj]=void 0;constructor(e,t,n){this[fj]=this[Rj]=e,this[Fj]=t,this[zj]=n}};function Uj(e){return e[fj]}function Wj(e){return`${e[Fj]??`public`}.${e[fj]}`}function Gj(e){return e!=null&&typeof e.getSQL==`function`}function Kj(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||=[],t.typings.push(...n.typings));return t}var qj=class{static[X]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new Jj([this])}},Jj=class e{constructor(e){this.queryChunks=e;for(let t of e)if(Z(t,Q)){let e=t[Q.Symbol.Schema];this.usedTables.push(e===void 0?t[Q.Symbol.Name]:e+`.`+t[Q.Symbol.Name])}}static[X]=`SQL`;decoder=Zj;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return Nj.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return Kj(t.map(t=>{if(Z(t,qj))return{sql:t.value.join(``),params:[]};if(Z(t,Yj))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new qj(`(`)];for(let[n,r]of t.entries())e.push(r),ne},Qj={mapToDriverValue:e=>e};({...Zj,...Qj});var $j=class{constructor(e,t=Qj){this.value=e,this.encoder=t}static[X]=`Param`;brand;getSQL(){return new Jj([this])}};function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new qj(e[0]));for(let[r,i]of t.entries())n.push(i,new qj(e[r+1]));return new Jj(n)}(e=>{function t(){return new Jj([])}e.empty=t;function n(e){return new Jj(e)}e.fromList=n;function r(e){return new Jj([new qj(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new Jj(n)}e.join=i;function a(e){return new Yj(e)}e.identifier=a;function o(e){return new eM(e)}e.placeholder=o;function s(e,t){return new $j(e,t)}e.param=s})($||={}),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static[X]=`SQL.Aliased`;isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(Jj||={});var eM=class{constructor(e){this.name=e}static[X]=`Placeholder`;getSQL(){return new Jj([this])}};function tM(e,t){return e.map(e=>{if(Z(e,eM)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(Z(e,$j)&&Z(e.value,eM)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const nM=Symbol.for(`drizzle:IsDrizzleView`);var rM=class{static[X]=`View`;[Pj];[nM]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[Pj]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new Jj([this])}};uj.prototype.getSQL=function(){return new Jj([this])},Q.prototype.getSQL=function(){return new Jj([this])},Oj.prototype.getSQL=function(){return new Jj([this])};var iM=class{constructor(e){this.table=e}static[X]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},aM=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[X]=`TableAliasProxyHandler`;get(e,t){if(t===Q.Symbol.IsAlias)return!0;if(t===Q.Symbol.Name||this.replaceOriginalName&&t===Q.Symbol.OriginalName)return this.alias;if(t===Pj)return{...e[Pj],name:this.alias,isAlias:!0};if(t===Q.Symbol.Columns){let t=e[Q.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new iM(new Proxy(e,this)))}),n}let n=e[t];return Z(n,uj)?new Proxy(n,new iM(new Proxy(e,this))):n}};function oM(e,t){return new Proxy(e,new aM(t,!1))}function sM(e,t){return new Proxy(e,new iM(new Proxy(e.table,new aM(t,!1))))}function cM(e,t){return new Jj.Aliased(lM(e.sql,t),e.fieldAlias)}function lM(e,t){return $.join(e.queryChunks.map(e=>Z(e,uj)?sM(e,t):Z(e,Jj)?lM(e,t):Z(e,Jj.Aliased)?cM(e,t):e))}var uM=class extends Error{static[X]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},dM=class e extends Error{constructor(t,n,r){super(`Failed query: ${t} +params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},fM=class extends uM{static[X]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},pM=class{static[X]=`ConsoleLogWriter`;write(e){console.log(e)}},mM=class{static[X]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new pM}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},hM=class{static[X]=`NoopLogger`;logQuery(){}},gM=class{static[X]=`QueryPromise`;[Symbol.toStringTag]=`QueryPromise`;catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}};function _M(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return Z(r,uj)||Z(r,Jj)||Z(r,Jj.Aliased)?e.push({path:i,field:r}):Z(r,Q)?e.push(..._M(r[Q.Symbol.Columns],i)):e.push(..._M(r,i)),e},[])}function vM(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function yM(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>Z(n,Jj)||Z(n,uj)?[t,n]:[t,new $j(n,e[Q.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function bM(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype)){if(t===`constructor`)continue;Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}}function xM(e){return e[Q.Symbol.Columns]}function SM(e){return Z(e,Oj)?e._.alias:Z(e,rM)?e[Pj].name:Z(e,Jj)?void 0:e[Q.Symbol.IsAlias]?e[Q.Symbol.Name]:e[Q.Symbol.BaseName]}function CM(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return!(t!==`boolean`&&(t!==`object`||typeof e.logger.logQuery!=`function`)&&t!==`undefined`)}if(`schema`in e){let t=typeof e.schema;return!(t!==`object`&&t!==`undefined`)}if(`casing`in e){let t=typeof e.casing;return!(t!==`string`&&t!==`undefined`)}if(`mode`in e)return!(e.mode!==`default`||e.mode!==`planetscale`||e.mode!==void 0);if(`connection`in e){let t=typeof e.connection;return!(t!==`string`&&t!==`object`&&t!==`undefined`)}if(`client`in e){let t=typeof e.client;return!(t!==`object`&&t!==`function`&&t!==`undefined`)}return Object.keys(e).length===0}var wM=class extends Sj{static[X]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},TM=class extends Sj{static[X]=`PgDateString`;getSQLType(){return`date`}},EM=class extends Sj{static[X]=`PgJson`;constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},DM=class extends Sj{static[X]=`PgJsonb`;constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},OM=class extends Sj{static[X]=`PgNumeric`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`string`?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},kM=class extends Sj{static[X]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`time${e}${this.withTimezone?` with time zone`:``}`}},AM=class extends Sj{static[X]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:` (${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue=e=>new Date(this.withTimezone?e:e+`+0000`);mapToDriverValue=e=>e.toISOString()},jM=class extends Sj{static[X]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},MM=class extends Sj{static[X]=`PgUUID`;getSQLType(){return`uuid`}};const NM=Symbol.for(`drizzle:PgInlineForeignKeys`),PM=Symbol.for(`drizzle:EnableRLS`);var FM=class extends Q{static[X]=`PgTable`;static Symbol=Object.assign({},Q.Symbol,{InlineForeignKeys:NM,EnableRLS:PM});[NM]=[];[PM]=!1;[Q.Symbol.ExtraConfigBuilder]=void 0;[Q.Symbol.ExtraConfigColumns]={}},IM=class{static[X]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new LM(e,this.columns,this.name)}},LM=class{constructor(e,t,n){this.table=e,this.columns=t,this.name=n}static[X]=`PgPrimaryKey`;columns;name;getName(){return this.name??`${this.table[FM.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function RM(e,t){return Xj(t)&&!Gj(e)&&!Z(e,$j)&&!Z(e,eM)&&!Z(e,uj)&&!Z(e,Q)&&!Z(e,rM)?new $j(e,t):e}const zM=(e,t)=>$`${e} = ${RM(t,e)}`,BM=(e,t)=>$`${e} <> ${RM(t,e)}`;function VM(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Jj(t):new Jj([new qj(`(`),$.join(t,new qj(` and `)),new qj(`)`)])}function HM(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Jj(t):new Jj([new qj(`(`),$.join(t,new qj(` or `)),new qj(`)`)])}function UM(e){return $`not ${e}`}const WM=(e,t)=>$`${e} > ${RM(t,e)}`,GM=(e,t)=>$`${e} >= ${RM(t,e)}`,KM=(e,t)=>$`${e} < ${RM(t,e)}`,qM=(e,t)=>$`${e} <= ${RM(t,e)}`;function JM(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>RM(t,e))}`:$`${e} in ${RM(t,e)}`}function YM(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>RM(t,e))}`:$`${e} not in ${RM(t,e)}`}function XM(e){return $`${e} is null`}function ZM(e){return $`${e} is not null`}function QM(e){return $`exists ${e}`}function $M(e){return $`not exists ${e}`}function eN(e,t,n){return $`${e} between ${RM(t,e)} and ${RM(n,e)}`}function tN(e,t,n){return $`${e} not between ${RM(t,e)} and ${RM(n,e)}`}function nN(e,t){return $`${e} like ${t}`}function rN(e,t){return $`${e} not like ${t}`}function iN(e,t){return $`${e} ilike ${t}`}function aN(e,t){return $`${e} not ilike ${t}`}function oN(e){return $`${e} asc`}function sN(e){return $`${e} desc`}var cN=class{constructor(e,t,n){this.sourceTable=e,this.referencedTable=t,this.relationName=n,this.referencedTableName=t[Q.Symbol.Name]}static[X]=`Relation`;referencedTableName;fieldName},lN=class{constructor(e,t){this.table=e,this.config=t}static[X]=`Relations`},uN=class e extends cN{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}static[X]=`One`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},dN=class e extends cN{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}static[X]=`Many`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}};function fN(){return{and:VM,between:eN,eq:zM,exists:QM,gt:WM,gte:GM,ilike:iN,inArray:JM,isNull:XM,isNotNull:ZM,like:nN,lt:KM,lte:qM,ne:BM,not:UM,notBetween:tN,notExists:$M,notLike:rN,notIlike:aN,notInArray:YM,or:HM,sql:$}}function pN(){return{sql:$,asc:oN,desc:sN}}function mN(e,t){Object.keys(e).length===1&&`default`in e&&!Z(e.default,Q)&&(e=e.default);let n={},r={},i={};for(let[a,o]of Object.entries(e))if(Z(o,Q)){let e=Wj(o),t=r[e];n[e]=a,i[a]={tsName:a,dbName:o[Q.Symbol.Name],schema:o[Q.Symbol.Schema],columns:o[Q.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(o[Q.Symbol.Columns]))e.primary&&i[a].primaryKey.push(e);let s=o[Q.Symbol.ExtraConfigBuilder]?.(o[Q.Symbol.ExtraConfigColumns]);if(s)for(let e of Object.values(s))Z(e,IM)&&i[a].primaryKey.push(...e.columns)}else if(Z(o,lN)){let e=Wj(o.table),a=n[e],s=o.config(t(o.table)),c;for(let[t,n]of Object.entries(s))if(a){let e=i[a];e.relations[t]=n,c&&e.primaryKey.push(...c)}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function hN(e){return function(t,n){return new uN(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function gN(e){return function(t,n){return new dN(e,t,n)}}function _N(e,t,n){if(Z(n,uN)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[Wj(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[Q.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[Wj(a)];if(!o)throw Error(`Table "${a[Q.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[Q.Symbol.Name]}". Please specify relation name`);if(s[0]&&Z(s[0],uN)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function vN(e){return{one:hN(e),many:gN(e)}}function yN(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=Z(r,uN)?l&&yN(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>yN(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=Z(t,uj)?t:Z(t,Jj)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var bN=class e{static[X]=`SelectionProxyHandler`;config;constructor(e){this.config={...e}}get(t,n){if(n===`_`)return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===Pj)return{...t[Pj],selectedFields:new Proxy(t[Pj].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=Z(t,Oj)?t._.selectedFields:Z(t,rM)?t[Pj].selectedFields:t,i=r[n];if(Z(i,Jj.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(Z(i,Jj)){if(this.config.sqlBehavior===`sql`)return i;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return Z(i,uj)?this.config.alias?new Proxy(i,new iM(new Proxy(i.table,new aM(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new e(this.config))}};function xN(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.map(e=>e.toLowerCase()).join(`_`)}function SN(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.reduce((e,t,n)=>{let r=n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`;return e+r},``)}function CN(e){return e}var wN=class{static[X]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?xN:e===`camelCase`?SN:CN}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[Q.Symbol.Schema]??`public`,n=e.table[Q.Symbol.OriginalName],r=`${t}.${n}.${e.name}`;return this.cache[r]||this.cacheTable(e.table),this.cache[r]}cacheTable(e){let t=e[Q.Symbol.Schema]??`public`,n=e[Q.Symbol.OriginalName],r=`${t}.${n}`;if(!this.cachedTables[r]){for(let t of Object.values(e[Q.Symbol.Columns])){let e=`${r}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}},TN=class extends rM{static[X]=`PgViewBase`},EN=class{static[X]=`PgDialect`;casing;constructor(e){this.casing=new wN(e?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=$` CREATE TABLE IF NOT EXISTS ${$.identifier(i)}.${$.identifier(r)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) - `;await t.execute($`CREATE SCHEMA IF NOT EXISTS ${$.identifier(i)}`),await t.execute(a);let o=await t.all($`select id, hash, created_at from ${$.identifier(i)}.${$.identifier(r)} order by created_at desc limit 1`),s=o[0];await t.transaction(async t=>{for await(let n of e)if(!s||Number(s.created_at)t[e]!==void 0||n[e]?.onUpdateFn!==void 0),i=r.length;return $.join(r.flatMap((e,r)=>{let a=n[e],o=t[e]??$.param(a.onUpdateFn(),a),s=$`${$.identifier(this.casing.getColumnCasing(a))} = ${o}`;return r{let i=[];if(Z(e,qj.Aliased)&&e.isSelectionField)i.push($.identifier(e.fieldAlias));else if(Z(e,qj.Aliased)||Z(e,qj)){let n=Z(e,qj.Aliased)?e.sql:e;t?i.push(new qj(n.queryChunks.map(e=>Z(e,xj)?$.identifier(this.casing.getColumnCasing(e)):e))):i.push(n),Z(e,qj.Aliased)&&i.push($` as ${$.identifier(e.fieldAlias)}`)}else Z(e,lj)&&(t?i.push($.identifier(this.casing.getColumnCasing(e))):i.push(e));return ro?.some(({alias:t})=>t===(e[Q.Symbol.IsAlias]?Hj(e):e[Q.Symbol.BaseName])))(e.field.table)){let t=Hj(e.field.table);throw Error(`Your "${e.path.join(`->`)}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}let h=!o||o.length===0,g=this.buildWithCTE(e),_;f&&(_=f===!0?$` distinct`:$` distinct on (${$.join(f.on,$`, `)})`);let v=this.buildSelection(m,{isSingleTable:h}),y=this.buildFromTable(a),b=this.buildJoins(o),x=r?$` where ${r}`:void 0,S=i?$` having ${i}`:void 0,C;s&&s.length>0&&(C=$` order by ${$.join(s,$`, `)}`);let w;c&&c.length>0&&(w=$` group by ${$.join(c,$`, `)}`);let T=typeof l==`object`||typeof l==`number`&&l>=0?$` limit ${l}`:void 0,E=u?$` offset ${u}`:void 0,D=$.empty();if(d){let e=$` for ${$.raw(d.strength)}`;d.config.of&&e.append($` of ${$.join(Array.isArray(d.config.of)?d.config.of:[d.config.of],$`, `)}`),d.config.noWait?e.append($` nowait`):d.config.skipLocked&&e.append($` skip locked`),D.append(e)}let O=$`${g}select${_} ${v} from ${y}${b}${x}${w}${S}${C}${T}${E}${D}`;return p.length>0?this.buildSetOperations(O,p):O}buildSetOperations(e,t){let[n,...r]=t;if(!n)throw Error(`Cannot pass undefined values to any set operator`);return r.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),r)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:r,limit:i,orderBy:a,offset:o}}){let s=$`(${e.getSQL()}) `,c=$`(${r.getSQL()})`,l;if(a&&a.length>0){let e=[];for(let t of a)if(Z(t,xj))e.push($.identifier(t.name));else if(Z(t,qj)){for(let e=0;e=0?$` limit ${i}`:void 0,d=$.raw(`${t} ${n?`all `:``}`),f=o?$` offset ${o}`:void 0;return $`${s}${d}${c}${l}${u}${f}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:r,withList:i,select:a,overridingSystemValue_:o}){let s=[],c=e[Q.Symbol.Columns],l=Object.entries(c).filter(([e,t])=>!t.shouldDisableInsert()),u=l.map(([,e])=>$.identifier(this.casing.getColumnCasing(e)));if(a){let e=t;Z(e,qj)?s.push(e):s.push(e.getSQL())}else{let e=t;s.push($.raw(`values `));for(let[t,n]of e.entries()){let r=[];for(let[e,t]of l){let i=n[e];if(i===void 0||Z(i,Qj)&&i.value===void 0)if(t.defaultFn!==void 0){let e=t.defaultFn(),n=Z(e,qj)?e:$.param(e,t);r.push(n)}else if(!t.default&&t.onUpdateFn!==void 0){let e=t.onUpdateFn(),n=Z(e,qj)?e:$.param(e,t);r.push(n)}else r.push($`default`);else r.push(i)}s.push(r),t({dbKey:t.name,tsKey:e,field:oM(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}))}else{let r=Object.fromEntries(Object.entries(i.columns).map(([e,t])=>[e,oM(t,o)]));if(a.where){let e=typeof a.where==`function`?a.where(r,dN()):a.where;p=e&&cM(e,o)}let s=[],c=[];if(a.columns){let e=!1;for(let[t,n]of Object.entries(a.columns)){if(n===void 0)continue;t in i.columns&&(!e&&n===!0&&(e=!0),c.push(t))}c.length>0&&(c=e?c.filter(e=>a.columns?.[e]===!0):Object.keys(i.columns).filter(e=>!c.includes(e)))}else c=Object.keys(i.columns);for(let e of c){let t=i.columns[e];s.push({tsKey:e,value:t})}let h=[];a.with&&(h=Object.entries(a.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:i.relations[e]})));let g;if(a.extras){g=typeof a.extras==`function`?a.extras(r,{sql:$}):a.extras;for(let[e,t]of Object.entries(g))s.push({tsKey:e,value:sM(t,o)})}for(let{tsKey:e,value:t}of s)l.push({dbKey:Z(t,qj.Aliased)?t.fieldAlias:i.columns[e].name,tsKey:e,field:Z(t,lj)?oM(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let _=typeof a.orderBy==`function`?a.orderBy(r,fN()):a.orderBy??[];Array.isArray(_)||(_=[_]),f=_.map(e=>Z(e,lj)?oM(e,o):cM(e,o)),u=a.limit,d=a.offset;for(let{tsKey:r,queryConfig:i,relation:a}of h){let s=gN(t,n,a),c=Uj(a.referencedTable),u=n[c],d=`${o}_${r}`,f=BM(...s.fields.map((e,t)=>RM(oM(s.references[t],d),oM(e,o)))),p=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:e[u],tableConfig:t[u],queryConfig:Z(a,lN)?i===!0?{limit:1}:{...i,limit:1}:i,tableAlias:d,joinOn:f,nestedQueryRelation:a}),h=$`${$.identifier(d)}.${$.identifier(`data`)}`.as(r);m.push({on:$`true`,table:new Dj(p.sql,{},d),alias:d,joinType:`left`,lateral:!0}),l.push({dbKey:r,tsKey:r,field:h,relationTableTsKey:u,isJson:!0,selection:p.selection})}}if(l.length===0)throw new lM({message:`No fields selected for table "${i.tsName}" ("${o}")`});let h;if(p=BM(c,p),s){let e=$`json_build_array(${$.join(l.map(({field:e,tsKey:t,isJson:n})=>n?$`${$.identifier(`${o}_${t}`)}.${$.identifier(`data`)}`:Z(e,qj.Aliased)?e.sql:e),$`, `)})`;Z(s,uN)&&(e=$`coalesce(json_agg(${e}${f.length>0?$` order by ${$.join(f,$`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:`data`,tsKey:`data`,field:e.as(`data`),isJson:!0,relationTableTsKey:i.tsName,selection:l}],n=u!==void 0||d!==void 0||f.length>0;n?(h=this.buildSelectQuery({table:aM(r,o),fields:{},fieldsFlat:[{path:[],field:$.raw(`*`)}],where:p,limit:u,offset:d,orderBy:f,setOperators:[]}),p=void 0,u=void 0,d=void 0,f=[]):h=aM(r,o),h=this.buildSelectQuery({table:Z(h,PM)?h:new Dj(h,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:Z(e,lj)?oM(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]})}else h=this.buildSelectQuery({table:aM(r,o),fields:{},fieldsFlat:l.map(({field:e})=>({path:[],field:Z(e,lj)?oM(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]});return{tableTsKey:i.tsName,sql:h,selection:l}}},EN=class{static[X]=`TypedQueryBuilder`;getSelectedFields(){return this._.selectedFields}},DN=class{static[X]=`PgSelectBuilder`;fields;session;dialect;withList=[];distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}authToken;setToken(e){return this.authToken=e,this}from(e){let t=!!this.fields,n=e,r;return r=this.fields?this.fields:Z(n,Dj)?Object.fromEntries(Object.keys(n._.selectedFields).map(e=>[e,n[e]])):Z(n,wN)?n[Nj].selectedFields:Z(n,qj)?{}:bM(n),new kN({table:n,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},ON=class extends EN{static[X]=`PgSelectQueryBuilder`;_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:n,session:r,dialect:i,withList:a,distinct:o}){super(),this.config={withList:a,table:e,fields:{...t},distinct:o,setOperators:[]},this.isPartialSelect=n,this.session=r,this.dialect=i,this._={selectedFields:t,config:this.config},this.tableName=xM(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let t of zN(e))this.usedTables.add(t)}getUsedTables(){return[...this.usedTables]}createJoin(e,t){return(n,r)=>{let i=this.tableName,a=xM(n);for(let e of zN(n))this.usedTables.add(e);if(typeof a==`string`&&this.config.joins?.some(e=>e.alias===a))throw Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof i==`string`&&(this.config.fields={[i]:this.config.fields}),typeof a==`string`&&!Z(n,qj))){let e=Z(n,Dj)?n._.selectedFields:Z(n,nM)?n[Nj].selectedFields:n[Q.Symbol.Columns];this.config.fields[a]=e}if(typeof r==`function`&&(r=r(new Proxy(this.config.fields,new yN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:n,joinType:e,alias:a,lateral:t}),typeof a==`string`)switch(e){case`left`:this.joinsNotNullableMap[a]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!0;break;case`cross`:case`inner`:this.joinsNotNullableMap[a]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!1;break}return this}}leftJoin=this.createJoin(`left`,!1);leftJoinLateral=this.createJoin(`left`,!0);rightJoin=this.createJoin(`right`,!1);innerJoin=this.createJoin(`inner`,!1);innerJoinLateral=this.createJoin(`inner`,!0);fullJoin=this.createJoin(`full`,!1);crossJoin=this.createJoin(`cross`,!1);crossJoinLateral=this.createJoin(`cross`,!0);createSetOperator(e,t){return n=>{let r=typeof n==`function`?n(jN()):n;if(!_M(this.getSelectedFields(),r.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator(`union`,!1);unionAll=this.createSetOperator(`union`,!0);intersect=this.createSetOperator(`intersect`,!1);intersectAll=this.createSetOperator(`intersect`,!0);except=this.createSetOperator(`except`,!1);exceptAll=this.createSetOperator(`except`,!0);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new yN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new yN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new yN({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new yN({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`}))),n=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{let t=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=t:this.config.orderBy=t}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...zN(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...zN(e.table));return new Proxy(new Dj(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new yN({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new yN({alias:this.tableName,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}},kN=class extends ON{static[X]=`PgSelect`;_prepare(e){let{session:t,config:n,dialect:r,joinsNotNullableMap:i,authToken:a,cacheConfig:o,usedTables:s}=this;if(!t)throw Error(`Cannot execute a query on a query builder. Please use a database instance instead.`);let{fields:c}=n;return Mj.startActiveSpan(`drizzle.prepareQuery`,()=>{let n=gM(c),l=t.prepareQuery(r.sqlToQuery(this.getSQL()),n,e,!0,void 0,{type:`select`,tables:[...s]},o);return l.joinsNotNullableMap=i,l.setToken(a)})}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Mj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))};yM(kN,[hM]);function AN(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!_M(n.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return n.addSetOperators(a)}}const jN=()=>({union:MN,unionAll:NN,intersect:PN,intersectAll:FN,except:IN,exceptAll:LN}),MN=AN(`union`,!1),NN=AN(`union`,!0),PN=AN(`intersect`,!1),FN=AN(`intersect`,!0),IN=AN(`except`,!1),LN=AN(`except`,!0);var RN=class{static[X]=`PgQueryBuilder`;dialect;dialectConfig;constructor(e){this.dialect=Z(e,TN)?e:void 0,this.dialectConfig=Z(e,TN)?void 0:e}$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(n)),new Proxy(new Oj(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new yN({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};with(...e){let t=this;function n(n){return new DN({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(e){return new DN({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})}function i(e,n){return new DN({fields:n??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}return{select:n,selectDistinct:r,selectDistinctOn:i}}select(e){return new DN({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new DN({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new DN({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||=new TN(this.dialectConfig),this.dialect}};function zN(e){return Z(e,PM)?[e[Pj]?`${e[Pj]}.${e[Q.Symbol.BaseName]}`:e[Q.Symbol.BaseName]]:Z(e,Dj)?e._.usedTables??[]:Z(e,qj)?e.usedTables??[]:[]}var BN=class extends hM{constructor(e,t,n,r){super(),this.session=t,this.dialect=n,this.config={table:e,withList:r}}static[X]=`PgDelete`;config;cacheConfig;where(e){return this.config.where=e,this}returning(e=this.config.table[Q.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=gM(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return Mj.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`delete`,tables:zN(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Mj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new yN({alias:Hj(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},VN=class{constructor(e,t,n,r,i){this.table=e,this.session=t,this.dialect=n,this.withList=r,this.overridingSystemValue_=i}static[X]=`PgInsertBuilder`;authToken;setToken(e){return this.authToken=e,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw Error(`values() must be called with at least one value`);let t=e.map(e=>{let t={},n=this.table[Q.Symbol.Columns];for(let r of Object.keys(e)){let i=e[r];t[r]=Z(i,qj)?i:new Qj(i,n[r])}return t});return new HN(this.table,t,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let t=typeof e==`function`?e(new RN):e;if(!Z(t,qj)&&!_M(this.table[Fj],t._.selectedFields))throw Error(`Insert select error: selected fields are not the same or are in a different order compared to the table definition`);return new HN(this.table,t,this.session,this.dialect,this.withList,!0)}},HN=class extends hM{constructor(e,t,n,r,i,a,o){super(),this.session=n,this.dialect=r,this.config={table:e,values:t,withList:i,select:a,overridingSystemValue_:o}}static[X]=`PgInsert`;config;cacheConfig;returning(e=this.config.table[Q.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=gM(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=$`do nothing`;else{let t=``;t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));let n=e.where?$` where ${e.where}`:void 0;this.config.onConflict=$`(${$.raw(t)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error(`You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.`);let t=e.where?$` where ${e.where}`:void 0,n=e.targetWhere?$` where ${e.targetWhere}`:void 0,r=e.setWhere?$` where ${e.setWhere}`:void 0,i=this.dialect.buildUpdateSet(this.config.table,vM(this.config.table,e.set)),a=``;return a=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=$`(${$.raw(a)})${n} do update set ${i}${t}${r}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return Mj.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:zN(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Mj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new yN({alias:Hj(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},UN=class extends hM{constructor(e,t,n){super(),this.session=t,this.dialect=n,this.config={view:e}}static[X]=`PgRefreshMaterializedView`;config;concurrently(){if(this.config.withNoData!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return Mj.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Mj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))},WN=class{constructor(e,t,n,r){this.table=e,this.session=t,this.dialect=n,this.withList=r}static[X]=`PgUpdateBuilder`;authToken;setToken(e){return this.authToken=e,this}set(e){return new GN(this.table,vM(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},GN=class extends hM{constructor(e,t,n,r,i){super(),this.session=n,this.dialect=r,this.config={set:t,table:e,withList:i,joins:[]},this.tableName=xM(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{}}static[X]=`PgUpdate`;config;tableName;joinsNotNullableMap;cacheConfig;from(e){let t=e,n=xM(t);return typeof n==`string`&&(this.joinsNotNullableMap[n]=!0),this.config.from=t,this}getTableLikeFields(e){return Z(e,PM)?e[Q.Symbol.Columns]:Z(e,Dj)?e._.selectedFields:e[Nj].selectedFields}createJoin(e){return(t,n)=>{let r=xM(t);if(typeof r==`string`&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if(typeof n==`function`){let e=this.config.from&&!Z(this.config.from,qj)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Q.Symbol.Columns],new yN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})),e&&new Proxy(e,new yN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))}if(this.config.joins.push({on:n,table:t,joinType:e,alias:r}),typeof r==`string`)switch(e){case`left`:this.joinsNotNullableMap[r]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!0;break;case`inner`:this.joinsNotNullableMap[r]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!1;break}return this}}leftJoin=this.createJoin(`left`);rightJoin=this.createJoin(`right`);innerJoin=this.createJoin(`inner`);fullJoin=this.createJoin(`full`);where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[Q.Symbol.Columns]),this.config.from)){let t=xM(this.config.from);if(typeof t==`string`&&this.config.from&&!Z(this.config.from,qj)){let n=this.getTableLikeFields(this.config.from);e[t]=n}for(let t of this.config.joins){let n=xM(t.table);if(typeof n==`string`&&!Z(t.table,qj)){let r=this.getTableLikeFields(t.table);e[n]=r}}}return this.config.returningFields=e,this.config.returning=gM(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){let t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:zN(this.config.table)},this.cacheConfig);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>this._prepare().execute(e,this.authToken);getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new yN({alias:Hj(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},KN=class e extends qj{constructor(t){super(e.buildEmbeddedCount(t.source,t.filters).queryChunks),this.params=t,this.mapWith(Number),this.session=t.session,this.sql=e.buildCount(t.source,t.filters)}sql;token;static[X]=`PgCountBuilder`;[Symbol.toStringTag]=`PgCountBuilder`;session;static buildEmbeddedCount(e,t){return $`(select count(*) from ${e}${$.raw(` where `).if(t)}${t})`}static buildCount(e,t){return $`select count(*) as count from ${e}${$.raw(` where `).if(t)}${t};`}setToken(e){return this.token=e,this}then(e,t){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}},qN=class{constructor(e,t,n,r,i,a,o){this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o}static[X]=`PgRelationalQueryBuilder`;findMany(e){return new JN(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},`many`)}findFirst(e){return new JN(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},`first`)}},JN=class extends hM{constructor(e,t,n,r,i,a,o,s,c){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o,this.config=s,this.mode=c}static[X]=`PgRelationalQuery`;_prepare(e){return Mj.startActiveSpan(`drizzle.prepareQuery`,()=>{let{query:t,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(e,n)=>{let r=e.map(e=>vN(this.schema,this.tableConfig,e,t.selection,n));return this.mode===`first`?r[0]:r})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(e){return this.authToken=e,this}execute(){return Mj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(void 0,this.authToken))}},YN=class extends hM{constructor(e,t,n,r){super(),this.execute=e,this.sql=t,this.query=n,this.mapBatchResult=r}static[X]=`PgRaw`;getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}},XN=class{constructor(e,t,n){if(this.dialect=e,this.session=t,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:t}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:t},this.query={},this._.schema)for(let[r,i]of Object.entries(this._.schema))this.query[r]=new qN(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[r],i,e,t);this.$cache={invalidate:async e=>{}}}static[X]=`PgDatabase`;query;$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(new RN(n.dialect))),new Proxy(new Oj(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new yN({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};$count(e,t){return new KN({source:e,filters:t,session:this.session})}$cache;with(...e){let t=this;function n(n){return new DN({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e})}function r(n){return new DN({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function i(n,r){return new DN({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:{on:n}})}function a(n){return new WN(n,t.session,t.dialect,e)}function o(n){return new VN(n,t.session,t.dialect,e)}function s(n){return new BN(n,t.session,t.dialect,e)}return{select:n,selectDistinct:r,selectDistinctOn:i,update:a,insert:o,delete:s}}select(e){return new DN({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new DN({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new DN({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new WN(e,this.session,this.dialect)}insert(e){return new VN(e,this.session,this.dialect)}delete(e){return new BN(e,this.session,this.dialect)}refreshMaterializedView(e){return new UN(e,this.session,this.dialect)}authToken;execute(e){let t=typeof e==`string`?$.raw(e):e.getSQL(),n=this.dialect.sqlToQuery(t),r=this.session.prepareQuery(n,void 0,void 0,!1);return new YN(()=>r.execute(void 0,this.authToken),t,n,e=>r.mapResult(e,!0))}transaction(e,t){return this.session.transaction(e,t)}},ZN=class{static[X]=`Cache`},QN=class extends ZN{strategy(){return`all`}static[X]=`NoopCache`;async get(e){}async put(e,t,n,r){}async onMutate(e){}};async function $N(e,t){let n=`${e}-${JSON.stringify(t)}`,r=new TextEncoder,i=r.encode(n),a=await crypto.subtle.digest(`SHA-256`,i),o=[...new Uint8Array(a)],s=o.map(e=>e.toString(16).padStart(2,`0`)).join(``);return s}var eP=class{constructor(e,t,n,r){this.query=e,this.cache=t,this.queryMetadata=n,this.cacheConfig=r,t&&t.strategy()===`all`&&r===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}authToken;getQuery(){return this.query}mapResult(e,t){return e}setToken(e){return this.authToken=e,this}static[X]=`PgPreparedQuery`;joinsNotNullableMap;async queryWithCache(e,t,n){if(this.cache===void 0||Z(this.cache,QN)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new uM(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new uM(e,t,n)}if((this.queryMetadata.type===`insert`||this.queryMetadata.type===`update`||this.queryMetadata.type===`delete`)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new uM(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new uM(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await $N(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new uM(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await $N(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new uM(e,t,n)}}},tP=class{constructor(e){this.dialect=e}static[X]=`PgSession`;execute(e,t){return Mj.startActiveSpan(`drizzle.operation`,()=>{let n=Mj.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1));return n.setToken(t).execute(void 0,t)})}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},nP=class extends XN{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[X]=`PgTransaction`;rollback(){throw new dM}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),$.raw(t.join(` `))}setTransaction(e){return this.session.execute($`set transaction ${this.getTransactionConfigSQL(e)}`)}};function rP(e){return typeof e==`string`&&/^true$/i.test(e)}function iP(e){let t={scheme:`duckdb-wasm:`},n=new URL(e);if(!n.protocol.startsWith(`duckdb-wasm:`))throw Error(`Expected scheme to be "duckdb-wasm:" but got "${n.protocol}"`);n.searchParams.get(`bundles`)===`import-url`&&(t.bundles=`import-url`);let r=n.searchParams.get(`logger`);r&&rP(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case aj.ORIGIN_PRIVATE_FS:{n.host.length>0&&console.warn(`Host "${n.host}" will be ignored while using Origin Private FS`);let e=n.searchParams.get(`write`);t.storage={type:aj.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&rP(e)&&{accessMode:Zx.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var aP=class extends eP{static[X]=`DuckDBWasmPreparedQuery`;constructor(e,t,n,r,i,a){super({sql:t,params:n}),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=i,this.customResultMapper=a}async execute(e={}){let t=eM(this.params,e);this.logger.logQuery(this.queryString,t);let{fields:n,queryString:r,client:i,customResultMapper:a}=this,o=await i;return o.query(r,t)}async all(e={}){let t=eM(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},oP=class e extends tP{static[X]=`DuckDBWasmSession`;logger;constructor(e,t,n,r={}){super(t),this.client=e,this.schema=n,this.options=r,this.logger=r.logger??new mM}prepareQuery(e,t,n,r,i){return new aP(this.client,e.sql,e.params,this.logger,t,i)}async query(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}async queryObjects(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}transaction(t,n){return sj(this.client,async r=>{let i=new e(r,this.dialect,this.schema,this.options),a=new sP(this.dialect,i,this.schema);return n&&await a.setTransaction(n),t(a)})}},sP=class e extends nP{static[X]=`DuckDBWasmTransaction`;dialect;session;constructor(e,t,n,r=0){super(e,t,n,r),this.dialect=e,this.session=t}async transaction(t){return cj(this.session.client,``,async n=>{let r=new oP(n,this.dialect,this.schema,this.session.options),i=new e(this.dialect,r,this.schema);return t(i)})}},cP=class extends XN{static[X]=`DuckDBWasmDatabase`};function lP(e,t={}){let n=new TN({casing:t.casing}),r;t.logger===!0?r=new pM:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=pN(t.schema,_N);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new oP(e,n,i,{logger:r}),o=new cP(n,a,i);return o.$client=e,o}function uP(e,t){let n=iP(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await PA();switch(e){case`browser`:return(await S(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-DIrMeXJ_.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await S(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-Dl605kiZ.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await PA();switch(e){case`browser`:return(await S(async()=>{let{getBundles:e}=await import(`./default-browser-ZWdN_TIR.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await S(async()=>{let{getBundles:e}=await import(`./default-node-D0HoLEZS.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return lP(oj({bundles:r,logger:n.logger?new iS:void 0,storage:n.storage}),t)}function dP(...e){if(typeof e[0]==`string`)return uP(e[0],e[1]);if(SM(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return lP(n,r);if(typeof t==`string`)return uP(t,r);if(t===void 0)throw Error(`connection option is required`);return lP(oj({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return lP(e[0],e[1])}(function(e){function t(e){return lP({options:{parsers:{},serializers:{}}},e)}e.mock=t})(dP||={});var fP=de({__name:`VRM`,props:{modelSrc:{},modelFile:{}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:n}){let r=e,i=n,{x:a,y:o}=he(),s=Fe(),{width:c,height:l}=me(s),{cameraFOV:u,cameraPosition:d,cameraDistance:f,modelOrigin:p,trackingMode:m,lookAtTarget:h,eyeHeight:g}=C(We()),_=Fe(),v=Ie(new E),y=Fe(),b=!0,x=Fe(!1),S=Fe(!1),w=Fe(!1),T=new ee,O=new te;Me(u,e=>{v.value&&(v.value.fov=e,v.value.updateProjectionMatrix())}),Me(()=>y.value?.controls,e=>{if(e&&v.value){x.value=!0;let t=()=>{if(b)return;b=!0;let e=v.value.position,t=y.value.controls.getDistance(),n=Math.abs(d.value.x-e.x)>1e-6||Math.abs(d.value.y-e.y)>1e-6||Math.abs(d.value.z-e.z)>1e-6,r=Math.abs(f.value-t)>1e-6;(n||r)&&(d.value={x:e.x,y:e.y,z:e.z},f.value=t),b=!1};e.addEventListener(`change`,t),ke(()=>{e.removeEventListener(`change`,t)})}});function k(){S.value=!0}Me([x,S],([e,t])=>{if(e&&t&&v.value&&y.value&&y.value.controls){b=!0;try{v.value.aspect=c.value/l.value,v.value.fov=u.value,y.value.setTarget(p.value),v.value.position.set(d.value.x,d.value.y,d.value.z),v.value.updateProjectionMatrix(),y.value.controls.update(),f.value=y.value.controls.getDistance()}finally{b=!1,w.value=!0}}}),Me(f,e=>{if(!b&&v.value&&y.value&&y.value.controls){b=!0;let t=new ne,n=y.value.controls.target,r=new ne().subVectors(v.value.position,n).normalize();t.copy(n).addScaledVector(r,e),v.value.position.set(t.x,t.y,t.z),y.value.update(),d.value={x:t.x,y:t.y,z:t.z}}b=!1});function A(e){_.value?.lookAtUpdate(e),h.value=e}function j(e,t){O.x=e/window.innerWidth*2-1,O.y=-(t/window.innerHeight)*2+1,T.setFromCamera(O,v.value);let n=new ne;v.value.getWorldDirection(n);let r=new D;r.setFromNormalAndCoplanarPoint(n,v.value.position.clone().add(n.multiplyScalar(1)));let i=new ne;T.ray.intersectPlane(r,i),h.value={x:i.x,y:i.y,z:i.z},_.value?.lookAtUpdate(h.value)}return Me(d,e=>{!w.value||!_.value||m.value===`camera`&&A(e)},{deep:!0}),Me([a,o],()=>{!w.value||!_.value||m.value===`mouse`&&j(a.value,o.value)}),Me(m,e=>{!w.value||!_.value||(e===`camera`?A(d.value):e===`mouse`?j(a.value,o.value):h.value={x:0,y:g.value,z:-1e3})}),t({setExpression:e=>{_.value?.setExpression(e)}}),(e,t)=>(Ae(),le(`div`,{ref_key:`vrmContainerRef`,ref:s,w:`100%`,h:`100%`},[v.value?Pe((Ae(),se(Re(Se),{key:0,camera:v.value,antialias:!0,width:Re(c),height:Re(l)},{default:Ne(()=>[ue(Re(WP),{ref_key:`controlsRef`,ref:y},null,512),t[2]||=oe(`TresDirectionalLight`,{color:16777215,intensity:1.8,position:[1,1,-10]},null,-1),t[3]||=oe(`TresAmbientLight`,{color:16777215,intensity:1.2},null,-1),ue(Re(yP),{ref_key:`modelRef`,ref:_,"model-src":r.modelSrc,"model-file":r.modelFile,"idle-animation":`/assets/vrm/animations/idle_loop.vrma`,paused:!1,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onModelReady:k,onError:t[1]||=e=>i(`error`,e)},null,8,[`model-src`,`model-file`]),t[4]||=oe(`TresAxesHelper`,{size:1},null,-1)]),_:1,__:[2,3,4]},8,[`camera`,`width`,`height`])),[[ie,w.value]]):ce(``,!0)],512))}}),pP=fP;const mP={relative:``},hP={"h-full":``,"w-full":``};var gP=de({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:{},xOffset:{},yOffset:{},scale:{default:1}},setup(e){let t=Fe(),n=Fe(),{stageView:r,stageViewControlsEnabled:i,live2dDisableFocus:a}=C(Ge()),{mouthOpenSize:o}=C(g()),{audioContext:s,calculateVolume:c}=h(),{onBeforeMessageComposed:l,onBeforeSend:m,onTokenLiteral:_,onTokenSpecial:S,onStreamEnd:w,onAssistantResponseEnd:T}=Je(),E=Ze(),{modelFile:D,modelUrl:O}=C(Ke()),{modelFile:k,modelUrl:ee}=C(We()),A=Fe(),j=Fe(!1),te=Fe(!1),ne=p({handlers:[e=>new Promise(t=>{let n=s.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(s.destination),n.connect(A.value),j.value=!0,n.start(0),n.onended=()=>{j.value=!1,t()}})]}),re=Ye(),{ssmlEnabled:ie,activeSpeechProvider:M,activeSpeechModel:ae,activeSpeechVoice:ue,pitch:de}=C(re);async function fe(e){try{if(!M.value){console.warn(`No active speech provider configured`);return}if(!ue.value){console.warn(`No active speech voice configured`);return}let t=await E.getProviderInstance(M.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=E.getProviderConfig(M.value),r=ie.value?re.generateSSML(e.data,ue.value,{...n,pitch:de.value}):e.data,i=await Xe({...t.speech(ae.value,n),input:r,voice:ue.value.id}),a=await s.decodeAudioData(i);await ne.add({audioBuffer:a,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let pe=p({handlers:[fe]});pe.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let me=f(pe),{currentMotion:he}=C(Ke()),ge=p({handlers:[async e=>{if(r.value===`3d`){let t=b[e.data];if(!t)return;await n.value.setExpression(t)}else r.value===`2d`&&(he.value={group:y[e.data]})}]}),_e=d(ge);_e.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let ve=u();ve.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function ye(){requestAnimationFrame(ye),j.value&&(o.value=c(A.value,`linear`))}function be(){te.value||(ye(),s.resume(),te.value=!0)}function xe(){A.value||=s.createAnalyser()}return l(async()=>{xe(),be()}),m(async()=>{he.value={group:x}}),_(async e=>{await me.add(e)}),S(async e=>{await ve.add(e),await _e.add(e)}),w(async()=>{await ve.add(v)}),T(async e=>{}),ke(()=>{te.value=!1}),Oe(async()=>{t.value=dP({connection:{bundles:Qe()}}),await t.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(e,t)=>(Ae(),le(`div`,mP,[oe(`div`,hP,[Re(r)===`2d`?(Ae(),se(Bf,{key:0,"min-w":`50% u.modelSrc),h=Le(()=>u.modelFile),g=ge(h),_=ae(()=>g.value?g.value:m.value?m.value:``),v=Fe(),y=Fe(),{scene:b}=we(),{onBeforeRender:x}=Ce(),S=a(),w=Fe(),E=We(),{modelOffset:D,modelOrigin:k,modelSize:ee,cameraPosition:A,modelRotationY:j,lookAtTarget:te,eyeHeight:ie,trackingMode:M}=C(E),oe=Fe(),se=o();async function ce(){await _e(p).not.toBeTruthy(),p.value=!0;try{if(!b.value){console.warn(`Scene is not ready, cannot load VRM model.`);return}v.value&&de();try{let e=await n(_.value,{scene:b.value,lookAt:!0,positionOffset:[D.value.x,D.value.y,D.value.z],onProgress:e=>d(`loadModelProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!e||!e._vrm){console.warn(`No VRM model loaded`);return}let{_vrm:a,_vrmGroup:o,modelCenter:s,modelSize:c,initialCameraOffset:l}=e;oe.value=o,A.value={x:s.x+l.x,y:s.y+l.y,z:s.z+l.z},k.value={x:s.x,y:s.y,z:s.z},ee.value={x:c.x,y:c.y,z:c.z};let p=new ne(0,0,-1),m=a.lookAt,h=new O;if(m){let e=m.faceFront;h.setFromUnitVectors(e.normalize(),p.normalize()),o.quaternion.premultiply(h),o.updateMatrixWorld(!0)}else console.warn(`No look-at target found in VRM model`);j.value=0;function g(e){let t=a.humanoid?.getNormalizedBoneNode(`hips`);if(!t){console.warn(`No hips node found in VRM model.`);return}t.updateMatrixWorld(!0);let n=new ne;t.getWorldPosition(n);let r=e.tracks.find(e=>e.name.endsWith(`Hips.position`));if(!(r instanceof re)){console.warn(`No Hips.position track of type VectorKeyframeTrack found in animation.`);return}let i=new ne(r.values[0],r.values[1],r.values[2]),o=new ne().subVectors(i,n);e.tracks.forEach(e=>{if(e.name.endsWith(`.position`)&&e instanceof re)for(let t=0;t{y.value?.update(e),v.value?.update(e),v.value?.lookAt?.update?.(e),S.update(v.value,e),se.update(v.value,te,e),w.value?.update(e)}).off}catch(e){d(`error`,e)}}catch(e){console.error(e)}finally{p.value=!1}}Me(D,()=>{oe.value&&oe.value.position.set(D.value.x,D.value.y,D.value.z)},{deep:!0}),Me(j,e=>{v.value&&oe.value&&(oe.value.rotation.y=T.degToRad(e))}),Me(_,e=>{e&&ce()});let{pause:le,resume:ue}=Ce();Me(()=>u.paused,e=>e?le():ue());function de(){f?.(),v.value&&(v.value.scene.removeFromParent(),s.deepDispose(v.value.scene))}return Oe(async()=>await ce()),ke(()=>de()),c({setExpression(e){w.value?.setEmotionWithResetAfter(e,1e3)},scene:ae(()=>v.value?.scene),lookAtUpdate(e){se.instantUpdate(v.value,e)}}),(e,t)=>je(e.$slots,`default`)}}),yP=vP;const bP={type:`change`},xP={type:`start`},SP={type:`end`},CP=new k,wP=new D,TP=Math.cos(70*T.DEG2RAD),EP=new ne,DP=2*Math.PI,OP={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},kP=1e-6;var AP=class extends Ee{constructor(e,t=null){super(e,t),this.state=OP.NONE,this.target=new ne,this.cursor=new ne,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:De.ROTATE,MIDDLE:De.DOLLY,RIGHT:De.PAN},this.touches={ONE:j.ROTATE,TWO:j.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new ne,this._lastQuaternion=new O,this._lastTargetPosition=new ne,this._quat=new O().setFromUnitVectors(e.up,new ne(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new A,this._sphericalDelta=new A,this._scale=1,this._panOffset=new ne,this._rotateStart=new te,this._rotateEnd=new te,this._rotateDelta=new te,this._panStart=new te,this._panEnd=new te,this._panDelta=new te,this._dollyStart=new te,this._dollyEnd=new te,this._dollyDelta=new te,this._dollyDirection=new ne,this._mouse=new te,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=MP.bind(this),this._onPointerDown=jP.bind(this),this._onPointerUp=NP.bind(this),this._onContextMenu=BP.bind(this),this._onMouseWheel=IP.bind(this),this._onKeyDown=LP.bind(this),this._onTouchStart=RP.bind(this),this._onTouchMove=zP.bind(this),this._onMouseDown=PP.bind(this),this._onMouseMove=FP.bind(this),this._interceptControlDown=VP.bind(this),this._interceptControlUp=HP.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1});let t=this.domElement.getRootNode();t.addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents();let e=this.domElement.getRootNode();e.removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(bP),this.update(),this.state=OP.NONE}update(e=null){let t=this.object.position;EP.copy(t).sub(this.target),EP.applyQuaternion(this._quat),this._spherical.setFromVector3(EP),this.autoRotate&&this.state===OP.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=DP:n>Math.PI&&(n-=DP),r<-Math.PI?r+=DP:r>Math.PI&&(r-=DP),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(EP.setFromSpherical(this._spherical),EP.applyQuaternion(this._quatInverse),t.copy(this.target).add(EP),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=EP.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new ne(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new ne(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=EP.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(CP.origin.copy(this.object.position),CP.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(CP.direction))kP||8*(1-this._lastQuaternion.dot(this.object.quaternion))>kP||this._lastTargetPosition.distanceToSquared(this.target)>kP?(this.dispatchEvent(bP),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?DP/60/60*this.autoRotateSpeed:DP/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){EP.setFromMatrixColumn(t,0),EP.multiplyScalar(-e),this._panOffset.add(EP)}_panUp(e,t){this.screenSpacePanning===!0?EP.setFromMatrixColumn(t,1):(EP.setFromMatrixColumn(t,0),EP.crossVectors(this.object.up,EP)),EP.multiplyScalar(e),this._panOffset.add(EP)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;EP.copy(r).sub(this.target);let i=EP.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(DP*this._rotateDelta.x/t.clientHeight),this._rotateUp(DP*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(DP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-DP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(DP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-DP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(DP*this._rotateDelta.x/t.clientHeight),this._rotateUp(DP*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t{n.value&&r.value?.domElement&&(i.value=new AP(n.value,r.value.domElement),i.value.enableDamping=!0,i.value.dampingFactor=.5,i.value.mouseButtons={LEFT:De.ROTATE,MIDDLE:De.DOLLY,RIGHT:De.PAN},i.value.touches={ONE:j.ROTATE,TWO:j.DOLLY_PAN},i.value.enablePan=!1,i.value.minDistance=a.value.z,i.value.maxDistance=a.value.z*20,i.value.update(),o.value=i.value.getDistance())}),t({controls:i,getDistance:()=>i.value?.getDistance(),update:()=>i.value?.update(),setTarget:e=>{i.value&&(i.value.target.set(e.x,e.y,e.z),i.value.update())}}),(e,t)=>je(e.$slots,`default`)}}),WP=UP;export{_P as b,pP as c,rA as d,mk as e,nk as f,Bf as g,Mf as h,jf as i,Rl as j}; \ No newline at end of file + `;await t.execute($`CREATE SCHEMA IF NOT EXISTS ${$.identifier(i)}`),await t.execute(a);let o=await t.all($`select id, hash, created_at from ${$.identifier(i)}.${$.identifier(r)} order by created_at desc limit 1`),s=o[0];await t.transaction(async t=>{for await(let n of e)if(!s||Number(s.created_at)t[e]!==void 0||n[e]?.onUpdateFn!==void 0),i=r.length;return $.join(r.flatMap((e,r)=>{let a=n[e],o=t[e]??$.param(a.onUpdateFn(),a),s=$`${$.identifier(this.casing.getColumnCasing(a))} = ${o}`;return r{let i=[];if(Z(e,Jj.Aliased)&&e.isSelectionField)i.push($.identifier(e.fieldAlias));else if(Z(e,Jj.Aliased)||Z(e,Jj)){let n=Z(e,Jj.Aliased)?e.sql:e;t?i.push(new Jj(n.queryChunks.map(e=>Z(e,Sj)?$.identifier(this.casing.getColumnCasing(e)):e))):i.push(n),Z(e,Jj.Aliased)&&i.push($` as ${$.identifier(e.fieldAlias)}`)}else Z(e,uj)&&(t?i.push($.identifier(this.casing.getColumnCasing(e))):i.push(e));return ro?.some(({alias:t})=>t===(e[Q.Symbol.IsAlias]?Uj(e):e[Q.Symbol.BaseName])))(e.field.table)){let t=Uj(e.field.table);throw Error(`Your "${e.path.join(`->`)}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}let h=!o||o.length===0,g=this.buildWithCTE(e),_;f&&(_=f===!0?$` distinct`:$` distinct on (${$.join(f.on,$`, `)})`);let v=this.buildSelection(m,{isSingleTable:h}),y=this.buildFromTable(a),b=this.buildJoins(o),x=r?$` where ${r}`:void 0,S=i?$` having ${i}`:void 0,C;s&&s.length>0&&(C=$` order by ${$.join(s,$`, `)}`);let w;c&&c.length>0&&(w=$` group by ${$.join(c,$`, `)}`);let T=typeof l==`object`||typeof l==`number`&&l>=0?$` limit ${l}`:void 0,E=u?$` offset ${u}`:void 0,D=$.empty();if(d){let e=$` for ${$.raw(d.strength)}`;d.config.of&&e.append($` of ${$.join(Array.isArray(d.config.of)?d.config.of:[d.config.of],$`, `)}`),d.config.noWait?e.append($` nowait`):d.config.skipLocked&&e.append($` skip locked`),D.append(e)}let O=$`${g}select${_} ${v} from ${y}${b}${x}${w}${S}${C}${T}${E}${D}`;return p.length>0?this.buildSetOperations(O,p):O}buildSetOperations(e,t){let[n,...r]=t;if(!n)throw Error(`Cannot pass undefined values to any set operator`);return r.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),r)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:r,limit:i,orderBy:a,offset:o}}){let s=$`(${e.getSQL()}) `,c=$`(${r.getSQL()})`,l;if(a&&a.length>0){let e=[];for(let t of a)if(Z(t,Sj))e.push($.identifier(t.name));else if(Z(t,Jj)){for(let e=0;e=0?$` limit ${i}`:void 0,d=$.raw(`${t} ${n?`all `:``}`),f=o?$` offset ${o}`:void 0;return $`${s}${d}${c}${l}${u}${f}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:r,withList:i,select:a,overridingSystemValue_:o}){let s=[],c=e[Q.Symbol.Columns],l=Object.entries(c).filter(([e,t])=>!t.shouldDisableInsert()),u=l.map(([,e])=>$.identifier(this.casing.getColumnCasing(e)));if(a){let e=t;Z(e,Jj)?s.push(e):s.push(e.getSQL())}else{let e=t;s.push($.raw(`values `));for(let[t,n]of e.entries()){let r=[];for(let[e,t]of l){let i=n[e];if(i===void 0||Z(i,$j)&&i.value===void 0)if(t.defaultFn!==void 0){let e=t.defaultFn(),n=Z(e,Jj)?e:$.param(e,t);r.push(n)}else if(!t.default&&t.onUpdateFn!==void 0){let e=t.onUpdateFn(),n=Z(e,Jj)?e:$.param(e,t);r.push(n)}else r.push($`default`);else r.push(i)}s.push(r),t({dbKey:t.name,tsKey:e,field:sM(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}))}else{let r=Object.fromEntries(Object.entries(i.columns).map(([e,t])=>[e,sM(t,o)]));if(a.where){let e=typeof a.where==`function`?a.where(r,fN()):a.where;p=e&&lM(e,o)}let s=[],c=[];if(a.columns){let e=!1;for(let[t,n]of Object.entries(a.columns)){if(n===void 0)continue;t in i.columns&&(!e&&n===!0&&(e=!0),c.push(t))}c.length>0&&(c=e?c.filter(e=>a.columns?.[e]===!0):Object.keys(i.columns).filter(e=>!c.includes(e)))}else c=Object.keys(i.columns);for(let e of c){let t=i.columns[e];s.push({tsKey:e,value:t})}let h=[];a.with&&(h=Object.entries(a.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:i.relations[e]})));let g;if(a.extras){g=typeof a.extras==`function`?a.extras(r,{sql:$}):a.extras;for(let[e,t]of Object.entries(g))s.push({tsKey:e,value:cM(t,o)})}for(let{tsKey:e,value:t}of s)l.push({dbKey:Z(t,Jj.Aliased)?t.fieldAlias:i.columns[e].name,tsKey:e,field:Z(t,uj)?sM(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let _=typeof a.orderBy==`function`?a.orderBy(r,pN()):a.orderBy??[];Array.isArray(_)||(_=[_]),f=_.map(e=>Z(e,uj)?sM(e,o):lM(e,o)),u=a.limit,d=a.offset;for(let{tsKey:r,queryConfig:i,relation:a}of h){let s=_N(t,n,a),c=Wj(a.referencedTable),u=n[c],d=`${o}_${r}`,f=VM(...s.fields.map((e,t)=>zM(sM(s.references[t],d),sM(e,o)))),p=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:e[u],tableConfig:t[u],queryConfig:Z(a,uN)?i===!0?{limit:1}:{...i,limit:1}:i,tableAlias:d,joinOn:f,nestedQueryRelation:a}),h=$`${$.identifier(d)}.${$.identifier(`data`)}`.as(r);m.push({on:$`true`,table:new Oj(p.sql,{},d),alias:d,joinType:`left`,lateral:!0}),l.push({dbKey:r,tsKey:r,field:h,relationTableTsKey:u,isJson:!0,selection:p.selection})}}if(l.length===0)throw new uM({message:`No fields selected for table "${i.tsName}" ("${o}")`});let h;if(p=VM(c,p),s){let e=$`json_build_array(${$.join(l.map(({field:e,tsKey:t,isJson:n})=>n?$`${$.identifier(`${o}_${t}`)}.${$.identifier(`data`)}`:Z(e,Jj.Aliased)?e.sql:e),$`, `)})`;Z(s,dN)&&(e=$`coalesce(json_agg(${e}${f.length>0?$` order by ${$.join(f,$`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:`data`,tsKey:`data`,field:e.as(`data`),isJson:!0,relationTableTsKey:i.tsName,selection:l}],n=u!==void 0||d!==void 0||f.length>0;n?(h=this.buildSelectQuery({table:oM(r,o),fields:{},fieldsFlat:[{path:[],field:$.raw(`*`)}],where:p,limit:u,offset:d,orderBy:f,setOperators:[]}),p=void 0,u=void 0,d=void 0,f=[]):h=oM(r,o),h=this.buildSelectQuery({table:Z(h,FM)?h:new Oj(h,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:Z(e,uj)?sM(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]})}else h=this.buildSelectQuery({table:oM(r,o),fields:{},fieldsFlat:l.map(({field:e})=>({path:[],field:Z(e,uj)?sM(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]});return{tableTsKey:i.tsName,sql:h,selection:l}}},DN=class{static[X]=`TypedQueryBuilder`;getSelectedFields(){return this._.selectedFields}},ON=class{static[X]=`PgSelectBuilder`;fields;session;dialect;withList=[];distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}authToken;setToken(e){return this.authToken=e,this}from(e){let t=!!this.fields,n=e,r;return r=this.fields?this.fields:Z(n,Oj)?Object.fromEntries(Object.keys(n._.selectedFields).map(e=>[e,n[e]])):Z(n,TN)?n[Pj].selectedFields:Z(n,Jj)?{}:xM(n),new AN({table:n,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},kN=class extends DN{static[X]=`PgSelectQueryBuilder`;_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:n,session:r,dialect:i,withList:a,distinct:o}){super(),this.config={withList:a,table:e,fields:{...t},distinct:o,setOperators:[]},this.isPartialSelect=n,this.session=r,this.dialect=i,this._={selectedFields:t,config:this.config},this.tableName=SM(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let t of BN(e))this.usedTables.add(t)}getUsedTables(){return[...this.usedTables]}createJoin(e,t){return(n,r)=>{let i=this.tableName,a=SM(n);for(let e of BN(n))this.usedTables.add(e);if(typeof a==`string`&&this.config.joins?.some(e=>e.alias===a))throw Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof i==`string`&&(this.config.fields={[i]:this.config.fields}),typeof a==`string`&&!Z(n,Jj))){let e=Z(n,Oj)?n._.selectedFields:Z(n,rM)?n[Pj].selectedFields:n[Q.Symbol.Columns];this.config.fields[a]=e}if(typeof r==`function`&&(r=r(new Proxy(this.config.fields,new bN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:n,joinType:e,alias:a,lateral:t}),typeof a==`string`)switch(e){case`left`:this.joinsNotNullableMap[a]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!0;break;case`cross`:case`inner`:this.joinsNotNullableMap[a]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!1;break}return this}}leftJoin=this.createJoin(`left`,!1);leftJoinLateral=this.createJoin(`left`,!0);rightJoin=this.createJoin(`right`,!1);innerJoin=this.createJoin(`inner`,!1);innerJoinLateral=this.createJoin(`inner`,!0);fullJoin=this.createJoin(`full`,!1);crossJoin=this.createJoin(`cross`,!1);crossJoinLateral=this.createJoin(`cross`,!0);createSetOperator(e,t){return n=>{let r=typeof n==`function`?n(MN()):n;if(!vM(this.getSelectedFields(),r.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator(`union`,!1);unionAll=this.createSetOperator(`union`,!0);intersect=this.createSetOperator(`intersect`,!1);intersectAll=this.createSetOperator(`intersect`,!0);except=this.createSetOperator(`except`,!1);exceptAll=this.createSetOperator(`except`,!0);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new bN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new bN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new bN({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new bN({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`}))),n=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{let t=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=t:this.config.orderBy=t}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...BN(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...BN(e.table));return new Proxy(new Oj(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new bN({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new bN({alias:this.tableName,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}},AN=class extends kN{static[X]=`PgSelect`;_prepare(e){let{session:t,config:n,dialect:r,joinsNotNullableMap:i,authToken:a,cacheConfig:o,usedTables:s}=this;if(!t)throw Error(`Cannot execute a query on a query builder. Please use a database instance instead.`);let{fields:c}=n;return Nj.startActiveSpan(`drizzle.prepareQuery`,()=>{let n=_M(c),l=t.prepareQuery(r.sqlToQuery(this.getSQL()),n,e,!0,void 0,{type:`select`,tables:[...s]},o);return l.joinsNotNullableMap=i,l.setToken(a)})}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Nj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))};bM(AN,[gM]);function jN(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!vM(n.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return n.addSetOperators(a)}}const MN=()=>({union:NN,unionAll:PN,intersect:FN,intersectAll:IN,except:LN,exceptAll:RN}),NN=jN(`union`,!1),PN=jN(`union`,!0),FN=jN(`intersect`,!1),IN=jN(`intersect`,!0),LN=jN(`except`,!1),RN=jN(`except`,!0);var zN=class{static[X]=`PgQueryBuilder`;dialect;dialectConfig;constructor(e){this.dialect=Z(e,EN)?e:void 0,this.dialectConfig=Z(e,EN)?void 0:e}$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(n)),new Proxy(new kj(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new bN({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};with(...e){let t=this;function n(n){return new ON({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(e){return new ON({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})}function i(e,n){return new ON({fields:n??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}return{select:n,selectDistinct:r,selectDistinctOn:i}}select(e){return new ON({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new ON({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new ON({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||=new EN(this.dialectConfig),this.dialect}};function BN(e){return Z(e,FM)?[e[Fj]?`${e[Fj]}.${e[Q.Symbol.BaseName]}`:e[Q.Symbol.BaseName]]:Z(e,Oj)?e._.usedTables??[]:Z(e,Jj)?e.usedTables??[]:[]}var VN=class extends gM{constructor(e,t,n,r){super(),this.session=t,this.dialect=n,this.config={table:e,withList:r}}static[X]=`PgDelete`;config;cacheConfig;where(e){return this.config.where=e,this}returning(e=this.config.table[Q.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=_M(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return Nj.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`delete`,tables:BN(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Nj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new bN({alias:Uj(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},HN=class{constructor(e,t,n,r,i){this.table=e,this.session=t,this.dialect=n,this.withList=r,this.overridingSystemValue_=i}static[X]=`PgInsertBuilder`;authToken;setToken(e){return this.authToken=e,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw Error(`values() must be called with at least one value`);let t=e.map(e=>{let t={},n=this.table[Q.Symbol.Columns];for(let r of Object.keys(e)){let i=e[r];t[r]=Z(i,Jj)?i:new $j(i,n[r])}return t});return new UN(this.table,t,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let t=typeof e==`function`?e(new zN):e;if(!Z(t,Jj)&&!vM(this.table[Ij],t._.selectedFields))throw Error(`Insert select error: selected fields are not the same or are in a different order compared to the table definition`);return new UN(this.table,t,this.session,this.dialect,this.withList,!0)}},UN=class extends gM{constructor(e,t,n,r,i,a,o){super(),this.session=n,this.dialect=r,this.config={table:e,values:t,withList:i,select:a,overridingSystemValue_:o}}static[X]=`PgInsert`;config;cacheConfig;returning(e=this.config.table[Q.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=_M(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=$`do nothing`;else{let t=``;t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));let n=e.where?$` where ${e.where}`:void 0;this.config.onConflict=$`(${$.raw(t)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error(`You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.`);let t=e.where?$` where ${e.where}`:void 0,n=e.targetWhere?$` where ${e.targetWhere}`:void 0,r=e.setWhere?$` where ${e.setWhere}`:void 0,i=this.dialect.buildUpdateSet(this.config.table,yM(this.config.table,e.set)),a=``;return a=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=$`(${$.raw(a)})${n} do update set ${i}${t}${r}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return Nj.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:BN(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Nj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new bN({alias:Uj(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},WN=class extends gM{constructor(e,t,n){super(),this.session=t,this.dialect=n,this.config={view:e}}static[X]=`PgRefreshMaterializedView`;config;concurrently(){if(this.config.withNoData!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return Nj.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>Nj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))},GN=class{constructor(e,t,n,r){this.table=e,this.session=t,this.dialect=n,this.withList=r}static[X]=`PgUpdateBuilder`;authToken;setToken(e){return this.authToken=e,this}set(e){return new KN(this.table,yM(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},KN=class extends gM{constructor(e,t,n,r,i){super(),this.session=n,this.dialect=r,this.config={set:t,table:e,withList:i,joins:[]},this.tableName=SM(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{}}static[X]=`PgUpdate`;config;tableName;joinsNotNullableMap;cacheConfig;from(e){let t=e,n=SM(t);return typeof n==`string`&&(this.joinsNotNullableMap[n]=!0),this.config.from=t,this}getTableLikeFields(e){return Z(e,FM)?e[Q.Symbol.Columns]:Z(e,Oj)?e._.selectedFields:e[Pj].selectedFields}createJoin(e){return(t,n)=>{let r=SM(t);if(typeof r==`string`&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if(typeof n==`function`){let e=this.config.from&&!Z(this.config.from,Jj)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Q.Symbol.Columns],new bN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})),e&&new Proxy(e,new bN({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))}if(this.config.joins.push({on:n,table:t,joinType:e,alias:r}),typeof r==`string`)switch(e){case`left`:this.joinsNotNullableMap[r]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!0;break;case`inner`:this.joinsNotNullableMap[r]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!1;break}return this}}leftJoin=this.createJoin(`left`);rightJoin=this.createJoin(`right`);innerJoin=this.createJoin(`inner`);fullJoin=this.createJoin(`full`);where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[Q.Symbol.Columns]),this.config.from)){let t=SM(this.config.from);if(typeof t==`string`&&this.config.from&&!Z(this.config.from,Jj)){let n=this.getTableLikeFields(this.config.from);e[t]=n}for(let t of this.config.joins){let n=SM(t.table);if(typeof n==`string`&&!Z(t.table,Jj)){let r=this.getTableLikeFields(t.table);e[n]=r}}}return this.config.returningFields=e,this.config.returning=_M(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){let t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:BN(this.config.table)},this.cacheConfig);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>this._prepare().execute(e,this.authToken);getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new bN({alias:Uj(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},qN=class e extends Jj{constructor(t){super(e.buildEmbeddedCount(t.source,t.filters).queryChunks),this.params=t,this.mapWith(Number),this.session=t.session,this.sql=e.buildCount(t.source,t.filters)}sql;token;static[X]=`PgCountBuilder`;[Symbol.toStringTag]=`PgCountBuilder`;session;static buildEmbeddedCount(e,t){return $`(select count(*) from ${e}${$.raw(` where `).if(t)}${t})`}static buildCount(e,t){return $`select count(*) as count from ${e}${$.raw(` where `).if(t)}${t};`}setToken(e){return this.token=e,this}then(e,t){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}},JN=class{constructor(e,t,n,r,i,a,o){this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o}static[X]=`PgRelationalQueryBuilder`;findMany(e){return new YN(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},`many`)}findFirst(e){return new YN(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},`first`)}},YN=class extends gM{constructor(e,t,n,r,i,a,o,s,c){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o,this.config=s,this.mode=c}static[X]=`PgRelationalQuery`;_prepare(e){return Nj.startActiveSpan(`drizzle.prepareQuery`,()=>{let{query:t,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(e,n)=>{let r=e.map(e=>yN(this.schema,this.tableConfig,e,t.selection,n));return this.mode===`first`?r[0]:r})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(e){return this.authToken=e,this}execute(){return Nj.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(void 0,this.authToken))}},XN=class extends gM{constructor(e,t,n,r){super(),this.execute=e,this.sql=t,this.query=n,this.mapBatchResult=r}static[X]=`PgRaw`;getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}},ZN=class{constructor(e,t,n){if(this.dialect=e,this.session=t,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:t}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:t},this.query={},this._.schema)for(let[r,i]of Object.entries(this._.schema))this.query[r]=new JN(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[r],i,e,t);this.$cache={invalidate:async e=>{}}}static[X]=`PgDatabase`;query;$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(new zN(n.dialect))),new Proxy(new kj(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new bN({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};$count(e,t){return new qN({source:e,filters:t,session:this.session})}$cache;with(...e){let t=this;function n(n){return new ON({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e})}function r(n){return new ON({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function i(n,r){return new ON({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:{on:n}})}function a(n){return new GN(n,t.session,t.dialect,e)}function o(n){return new HN(n,t.session,t.dialect,e)}function s(n){return new VN(n,t.session,t.dialect,e)}return{select:n,selectDistinct:r,selectDistinctOn:i,update:a,insert:o,delete:s}}select(e){return new ON({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new ON({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new ON({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new GN(e,this.session,this.dialect)}insert(e){return new HN(e,this.session,this.dialect)}delete(e){return new VN(e,this.session,this.dialect)}refreshMaterializedView(e){return new WN(e,this.session,this.dialect)}authToken;execute(e){let t=typeof e==`string`?$.raw(e):e.getSQL(),n=this.dialect.sqlToQuery(t),r=this.session.prepareQuery(n,void 0,void 0,!1);return new XN(()=>r.execute(void 0,this.authToken),t,n,e=>r.mapResult(e,!0))}transaction(e,t){return this.session.transaction(e,t)}},QN=class{static[X]=`Cache`},$N=class extends QN{strategy(){return`all`}static[X]=`NoopCache`;async get(e){}async put(e,t,n,r){}async onMutate(e){}};async function eP(e,t){let n=`${e}-${JSON.stringify(t)}`,r=new TextEncoder,i=r.encode(n),a=await crypto.subtle.digest(`SHA-256`,i),o=[...new Uint8Array(a)],s=o.map(e=>e.toString(16).padStart(2,`0`)).join(``);return s}var tP=class{constructor(e,t,n,r){this.query=e,this.cache=t,this.queryMetadata=n,this.cacheConfig=r,t&&t.strategy()===`all`&&r===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}authToken;getQuery(){return this.query}mapResult(e,t){return e}setToken(e){return this.authToken=e,this}static[X]=`PgPreparedQuery`;joinsNotNullableMap;async queryWithCache(e,t,n){if(this.cache===void 0||Z(this.cache,$N)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new dM(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new dM(e,t,n)}if((this.queryMetadata.type===`insert`||this.queryMetadata.type===`update`||this.queryMetadata.type===`delete`)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new dM(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new dM(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await eP(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new dM(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await eP(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new dM(e,t,n)}}},nP=class{constructor(e){this.dialect=e}static[X]=`PgSession`;execute(e,t){return Nj.startActiveSpan(`drizzle.operation`,()=>{let n=Nj.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1));return n.setToken(t).execute(void 0,t)})}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},rP=class extends ZN{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[X]=`PgTransaction`;rollback(){throw new fM}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),$.raw(t.join(` `))}setTransaction(e){return this.session.execute($`set transaction ${this.getTransactionConfigSQL(e)}`)}};function iP(e){return typeof e==`string`&&/^true$/i.test(e)}function aP(e){let t={scheme:`duckdb-wasm:`},n=new URL(e);if(!n.protocol.startsWith(`duckdb-wasm:`))throw Error(`Expected scheme to be "duckdb-wasm:" but got "${n.protocol}"`);n.searchParams.get(`bundles`)===`import-url`&&(t.bundles=`import-url`);let r=n.searchParams.get(`logger`);r&&iP(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case oj.ORIGIN_PRIVATE_FS:{n.host.length>0&&console.warn(`Host "${n.host}" will be ignored while using Origin Private FS`);let e=n.searchParams.get(`write`);t.storage={type:oj.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&iP(e)&&{accessMode:Xx.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var oP=class extends tP{static[X]=`DuckDBWasmPreparedQuery`;constructor(e,t,n,r,i,a){super({sql:t,params:n}),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=i,this.customResultMapper=a}async execute(e={}){let t=tM(this.params,e);this.logger.logQuery(this.queryString,t);let{fields:n,queryString:r,client:i,customResultMapper:a}=this,o=await i;return o.query(r,t)}async all(e={}){let t=tM(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},sP=class e extends nP{static[X]=`DuckDBWasmSession`;logger;constructor(e,t,n,r={}){super(t),this.client=e,this.schema=n,this.options=r,this.logger=r.logger??new hM}prepareQuery(e,t,n,r,i){return new oP(this.client,e.sql,e.params,this.logger,t,i)}async query(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}async queryObjects(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}transaction(t,n){return cj(this.client,async r=>{let i=new e(r,this.dialect,this.schema,this.options),a=new cP(this.dialect,i,this.schema);return n&&await a.setTransaction(n),t(a)})}},cP=class e extends rP{static[X]=`DuckDBWasmTransaction`;dialect;session;constructor(e,t,n,r=0){super(e,t,n,r),this.dialect=e,this.session=t}async transaction(t){return lj(this.session.client,``,async n=>{let r=new sP(n,this.dialect,this.schema,this.session.options),i=new e(this.dialect,r,this.schema);return t(i)})}},lP=class extends ZN{static[X]=`DuckDBWasmDatabase`};function uP(e,t={}){let n=new EN({casing:t.casing}),r;t.logger===!0?r=new mM:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=mN(t.schema,vN);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new sP(e,n,i,{logger:r}),o=new lP(n,a,i);return o.$client=e,o}function dP(e,t){let n=aP(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await FA();switch(e){case`browser`:return(await C(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-DIrMeXJ_.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await C(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-Dl605kiZ.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await FA();switch(e){case`browser`:return(await C(async()=>{let{getBundles:e}=await import(`./default-browser-ZWdN_TIR.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await C(async()=>{let{getBundles:e}=await import(`./default-node-whATspOv.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return uP(sj({bundles:r,logger:n.logger?new rS:void 0,storage:n.storage}),t)}function fP(...e){if(typeof e[0]==`string`)return dP(e[0],e[1]);if(CM(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return uP(n,r);if(typeof t==`string`)return dP(t,r);if(t===void 0)throw Error(`connection option is required`);return uP(sj({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return uP(e[0],e[1])}(function(e){function t(e){return uP({options:{parsers:{},serializers:{}}},e)}e.mock=t})(fP||={});var pP=S({__name:`DirectionalLightHelper`,props:{directionalLight:{}},setup(e){let t=e,{scene:n}=Ce(),r=Ie(()=>t.directionalLight);return De(async()=>{await ge(r).toBeTruthy(),n.value.add(new Ee(t.directionalLight,1))}),(e,t)=>Ae(e.$slots,`default`)}}),mP=pP;const hP=[`position`,`intensity`],gP=[`position`,`rotation`,`intensity`],_P=[`intensity`];var vP=S({__name:`VRM`,props:{modelSrc:{},modelFile:{}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:n}){let r=e,i=n,{x:a,y:o}=me(),s=Pe(),{width:c,height:l}=pe(s),{cameraFOV:u,cameraPosition:d,cameraDistance:f,modelOrigin:p,trackingMode:m,lookAtTarget:h,eyeHeight:g,directionalLightPosition:_,directionalLightRotation:v,directionalLightIntensity:y,ambientLightIntensity:b,hemisphereLightPosition:x,hemisphereLightIntensity:S}=w(Ue()),C=Pe(),T=Fe(new O),E=Fe(),D=Fe(),A=!0,ee=Pe(!1),te=Pe(!1),ne=Pe(!1),P=new j,ie=new M;je(u,e=>{T.value&&(T.value.fov=e,T.value.updateProjectionMatrix())}),je(()=>E.value?.controls,e=>{if(e&&T.value){ee.value=!0;let t=()=>{if(A)return;A=!0;let e=T.value.position,t=E.value.controls.getDistance(),n=Math.abs(d.value.x-e.x)>1e-6||Math.abs(d.value.y-e.y)>1e-6||Math.abs(d.value.z-e.z)>1e-6,r=Math.abs(f.value-t)>1e-6;(n||r)&&(d.value={x:e.x,y:e.y,z:e.z},f.value=t),A=!1};e.addEventListener(`change`,t),Oe(()=>{e.removeEventListener(`change`,t)})}});function ae(){te.value=!0}je([ee,te],([e,t])=>{if(e&&t&&T.value&&E.value&&E.value.controls){A=!0;try{T.value.aspect=c.value/l.value,T.value.fov=u.value,E.value.setTarget(p.value),T.value.position.set(d.value.x,d.value.y,d.value.z),T.value.updateProjectionMatrix(),E.value.controls.update(),f.value=E.value.controls.getDistance()}finally{A=!1,ne.value=!0}}}),je(f,e=>{if(!A&&T.value&&E.value&&E.value.controls){A=!0;let t=new N,n=E.value.controls.target,r=new N().subVectors(T.value.position,n).normalize();t.copy(n).addScaledVector(r,e),T.value.position.set(t.x,t.y,t.z),E.value.update(),d.value={x:t.x,y:t.y,z:t.z}}A=!1});function de(e){C.value?.lookAtUpdate(e),h.value=e}function fe(e,t){ie.x=e/window.innerWidth*2-1,ie.y=-(t/window.innerHeight)*2+1,P.setFromCamera(ie,T.value);let n=new N;T.value.getWorldDirection(n);let r=new k;r.setFromNormalAndCoplanarPoint(n,T.value.position.clone().add(n.multiplyScalar(1)));let i=new N;P.ray.intersectPlane(r,i),h.value={x:i.x,y:i.y,z:i.z},C.value?.lookAtUpdate(h.value)}return je(d,e=>{!ne.value||!C.value||m.value===`camera`&&de(e)},{deep:!0}),je([a,o],()=>{!ne.value||!C.value||m.value===`mouse`&&fe(a.value,o.value)}),je(m,e=>{!ne.value||!C.value||(e===`camera`?de(d.value):e===`mouse`?fe(a.value,o.value):h.value={x:0,y:g.value,z:-1e3})}),t({setExpression:e=>{C.value?.setExpression(e)}}),(e,t)=>(ke(),le(`div`,{ref_key:`vrmContainerRef`,ref:s,w:`100%`,h:`100%`},[T.value?Ne((ke(),se(Le(xe),{key:0,camera:T.value,antialias:!0,width:Le(c),height:Le(l)},{default:Me(()=>[ue(Le(XP),{ref_key:`controlsRef`,ref:E},null,512),oe(`TresHemisphereLight`,{color:16777215,position:[Le(x).x,Le(x).y,Le(x).z],intensity:Le(S),"cast-shadow":``},null,8,hP),oe(`TresDirectionalLight`,{ref_key:`directionalLightRef`,ref:D,color:16777215,position:[Le(_).x,Le(_).y,Le(_).z],rotation:[Le(v).x,Le(v).y,Le(v).z],intensity:Le(y),"cast-shadow":``},null,8,gP),ue(mP,{"directional-light":D.value},null,8,[`directional-light`]),oe(`TresAmbientLight`,{color:16777215,intensity:Le(b),"cast-shadow":``},null,8,_P),ue(Le(TP),{ref_key:`modelRef`,ref:C,"model-src":r.modelSrc,"model-file":r.modelFile,"idle-animation":`/assets/vrm/animations/idle_loop.vrma`,paused:!1,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onModelReady:ae,onError:t[1]||=e=>i(`error`,e)},null,8,[`model-src`,`model-file`]),t[2]||=oe(`TresAxesHelper`,{size:1},null,-1)]),_:1,__:[2]},8,[`camera`,`width`,`height`])),[[re,ne.value]]):ce(``,!0)],512))}}),yP=vP;const bP={relative:``},xP={"h-full":``,"w-full":``};var SP=S({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:{},xOffset:{},yOffset:{},scale:{default:1}},setup(e){let t=Pe(),n=Pe(),{stageView:r,stageViewControlsEnabled:i,live2dDisableFocus:a}=w(We()),{mouthOpenSize:o}=w(g()),{audioContext:s,calculateVolume:c}=h(),{onBeforeMessageComposed:l,onBeforeSend:m,onTokenLiteral:_,onTokenSpecial:S,onStreamEnd:C,onAssistantResponseEnd:T}=qe(),E=Xe(),{modelFile:D,modelUrl:O}=w(Ge()),{modelFile:k,modelUrl:A}=w(Ue()),ee=Pe(),j=Pe(!1),te=Pe(!1),ne=p({handlers:[e=>new Promise(t=>{let n=s.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(s.destination),n.connect(ee.value),j.value=!0,n.start(0),n.onended=()=>{j.value=!1,t()}})]}),M=Je(),{ssmlEnabled:N,activeSpeechProvider:P,activeSpeechModel:re,activeSpeechVoice:ie,pitch:ae}=w(M);async function ue(e){try{if(!P.value){console.warn(`No active speech provider configured`);return}if(!ie.value){console.warn(`No active speech voice configured`);return}let t=await E.getProviderInstance(P.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=E.getProviderConfig(P.value),r=N.value?M.generateSSML(e.data,ie.value,{...n,pitch:ae.value}):e.data,i=await Ye({...t.speech(re.value,n),input:r,voice:ie.value.id}),a=await s.decodeAudioData(i);await ne.add({audioBuffer:a,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let de=p({handlers:[ue]});de.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let fe=f(de),{currentMotion:pe}=w(Ge()),me=p({handlers:[async e=>{if(r.value===`3d`){let t=b[e.data];if(!t)return;await n.value.setExpression(t)}else r.value===`2d`&&(pe.value={group:y[e.data]})}]}),he=d(me);he.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let ge=u();ge.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function _e(){requestAnimationFrame(_e),j.value&&(o.value=c(ee.value,`linear`))}function ve(){te.value||(_e(),s.resume(),te.value=!0)}function ye(){ee.value||=s.createAnalyser()}return l(async()=>{ye(),ve()}),m(async()=>{pe.value={group:x}}),_(async e=>{await fe.add(e)}),S(async e=>{await ge.add(e),await he.add(e)}),C(async()=>{await ge.add(v)}),T(async e=>{}),Oe(()=>{te.value=!1}),De(async()=>{t.value=fP({connection:{bundles:Ze()}}),await t.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(e,t)=>(ke(),le(`div`,bP,[oe(`div`,xP,[Le(r)===`2d`?(ke(),se(zf,{key:0,"min-w":`50% u.modelSrc),h=Ie(()=>u.modelFile),g=he(h),_=ae(()=>g.value?g.value:m.value?m.value:``),v=Pe(),y=Pe(),{scene:b}=Ce(),{onBeforeRender:x}=Se(),S=a(),C=Pe(),T=Ue(),{modelOffset:E,modelOrigin:O,modelSize:k,cameraPosition:ee,modelRotationY:j,lookAtTarget:te,eyeHeight:ne,trackingMode:M}=w(T),re=Pe(),ie=o();async function oe(){await ge(p).not.toBeTruthy(),p.value=!0;try{if(!b.value){console.warn(`Scene is not ready, cannot load VRM model.`);return}v.value&&le();try{let e=await n(_.value,{scene:b.value,lookAt:!0,positionOffset:[E.value.x,E.value.y,E.value.z],onProgress:e=>d(`loadModelProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!e||!e._vrm){console.warn(`No VRM model loaded`);return}let{_vrm:a,_vrmGroup:o,modelCenter:s,modelSize:c,initialCameraOffset:l}=e;re.value=o,ee.value={x:s.x+l.x,y:s.y+l.y,z:s.z+l.z},O.value={x:s.x,y:s.y,z:s.z},k.value={x:c.x,y:c.y,z:c.z};let p=new N(0,0,-1),m=a.lookAt,h=new A;if(m){let e=m.faceFront;h.setFromUnitVectors(e.normalize(),p.normalize()),o.quaternion.premultiply(h),o.updateMatrixWorld(!0)}else console.warn(`No look-at target found in VRM model`);j.value=0;function g(e){let t=a.humanoid?.getNormalizedBoneNode(`hips`);if(!t){console.warn(`No hips node found in VRM model.`);return}t.updateMatrixWorld(!0);let n=new N;t.getWorldPosition(n);let r=e.tracks.find(e=>e.name.endsWith(`Hips.position`));if(!(r instanceof P)){console.warn(`No Hips.position track of type VectorKeyframeTrack found in animation.`);return}let i=new N(r.values[0],r.values[1],r.values[2]),o=new N().subVectors(i,n);e.tracks.forEach(e=>{if(e.name.endsWith(`.position`)&&e instanceof P)for(let t=0;t{y.value?.update(e),v.value?.update(e),v.value?.lookAt?.update?.(e),S.update(v.value,e),ie.update(v.value,te,e),C.value?.update(e)}).off}catch(e){d(`error`,e)}}catch(e){console.error(e)}finally{p.value=!1}}je(E,()=>{re.value&&re.value.position.set(E.value.x,E.value.y,E.value.z)},{deep:!0}),je(j,e=>{v.value&&re.value&&(re.value.rotation.y=D.degToRad(e))}),je(_,e=>{e&&oe()});let{pause:se,resume:ce}=Se();je(()=>u.paused,e=>e?se():ce());function le(){f?.(),v.value&&(v.value.scene.removeFromParent(),s.deepDispose(v.value.scene))}return De(async()=>await oe()),Oe(()=>le()),c({setExpression(e){C.value?.setEmotionWithResetAfter(e,1e3)},scene:ae(()=>v.value?.scene),lookAtUpdate(e){ie.instantUpdate(v.value,e)}}),(e,t)=>Ae(e.$slots,`default`)}}),TP=wP;const EP={type:`change`},DP={type:`start`},OP={type:`end`},kP=new ee,AP=new k,jP=Math.cos(70*D.DEG2RAD),MP=new N,NP=2*Math.PI,PP={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},FP=1e-6;var IP=class extends Te{constructor(e,t=null){super(e,t),this.state=PP.NONE,this.target=new N,this.cursor=new N,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:E.ROTATE,MIDDLE:E.DOLLY,RIGHT:E.PAN},this.touches={ONE:ne.ROTATE,TWO:ne.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new N,this._lastQuaternion=new A,this._lastTargetPosition=new N,this._quat=new A().setFromUnitVectors(e.up,new N(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new te,this._sphericalDelta=new te,this._scale=1,this._panOffset=new N,this._rotateStart=new M,this._rotateEnd=new M,this._rotateDelta=new M,this._panStart=new M,this._panEnd=new M,this._panDelta=new M,this._dollyStart=new M,this._dollyEnd=new M,this._dollyDelta=new M,this._dollyDirection=new N,this._mouse=new M,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=RP.bind(this),this._onPointerDown=LP.bind(this),this._onPointerUp=zP.bind(this),this._onContextMenu=KP.bind(this),this._onMouseWheel=HP.bind(this),this._onKeyDown=UP.bind(this),this._onTouchStart=WP.bind(this),this._onTouchMove=GP.bind(this),this._onMouseDown=BP.bind(this),this._onMouseMove=VP.bind(this),this._interceptControlDown=qP.bind(this),this._interceptControlUp=JP.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1});let t=this.domElement.getRootNode();t.addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents();let e=this.domElement.getRootNode();e.removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(EP),this.update(),this.state=PP.NONE}update(e=null){let t=this.object.position;MP.copy(t).sub(this.target),MP.applyQuaternion(this._quat),this._spherical.setFromVector3(MP),this.autoRotate&&this.state===PP.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=NP:n>Math.PI&&(n-=NP),r<-Math.PI?r+=NP:r>Math.PI&&(r-=NP),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(MP.setFromSpherical(this._spherical),MP.applyQuaternion(this._quatInverse),t.copy(this.target).add(MP),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=MP.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new N(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new N(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=MP.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(kP.origin.copy(this.object.position),kP.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(kP.direction))FP||8*(1-this._lastQuaternion.dot(this.object.quaternion))>FP||this._lastTargetPosition.distanceToSquared(this.target)>FP?(this.dispatchEvent(EP),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?NP/60/60*this.autoRotateSpeed:NP/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){MP.setFromMatrixColumn(t,0),MP.multiplyScalar(-e),this._panOffset.add(MP)}_panUp(e,t){this.screenSpacePanning===!0?MP.setFromMatrixColumn(t,1):(MP.setFromMatrixColumn(t,0),MP.crossVectors(this.object.up,MP)),MP.multiplyScalar(e),this._panOffset.add(MP)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;MP.copy(r).sub(this.target);let i=MP.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(NP*this._rotateDelta.x/t.clientHeight),this._rotateUp(NP*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(NP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-NP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(NP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-NP*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(NP*this._rotateDelta.x/t.clientHeight),this._rotateUp(NP*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t{n.value&&r.value?.domElement&&(i.value=new IP(n.value,r.value.domElement),i.value.enableDamping=!0,i.value.dampingFactor=.5,i.value.mouseButtons={LEFT:E.ROTATE,MIDDLE:E.DOLLY,RIGHT:E.PAN},i.value.touches={ONE:ne.ROTATE,TWO:ne.DOLLY_PAN},i.value.enablePan=!1,i.value.minDistance=a.value.z,i.value.maxDistance=a.value.z*20,i.value.update(),o.value=i.value.getDistance())}),t({controls:i,getDistance:()=>i.value?.getDistance(),update:()=>i.value?.update(),setTarget:e=>{i.value&&(i.value.target.set(e.x,e.y,e.z),i.value.update())}}),(e,t)=>Ae(e.$slots,`default`)}}),XP=YP;export{CP as b,yP as c,iA as d,hk as e,rk as f,zf as g,jf as h,Af as i,Ll as j}; \ No newline at end of file diff --git a/assets/Textarea-BXmK5gJR.js b/assets/Textarea-DjE71tF2.js similarity index 66% rename from assets/Textarea-BXmK5gJR.js rename to assets/Textarea-DjE71tF2.js index b8118c4c252ee288498d292bfd6ba634b7bb5de6..a45af3cd1560a0dc467cc194d0cead202890b5e1 100644 --- a/assets/Textarea-BXmK5gJR.js +++ b/assets/Textarea-DjE71tF2.js @@ -1 +1 @@ -import{b as e}from"./Basic-DOfBA0ws.js";import{dV as t,d_ as n,e6 as r,eb as i}from"./index-DEpwtsc8.js";var a=n({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(n){let a=i(n,`modelValue`);return(n,i)=>(r(),t(e,{modelValue:a.value,"onUpdate:modelValue":i[0]||=e=>a.value=e,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,[`modelValue`]))}}),o=a;export{o as b}; \ No newline at end of file +import{b as e}from"./Basic-kTOabOY_.js";import{d$ as t,dW as n,e7 as r,ec as i}from"./index-BF1-WNuF.js";var a=t({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(t){let a=i(t,`modelValue`);return(t,i)=>(r(),n(e,{modelValue:a.value,"onUpdate:modelValue":i[0]||=e=>a.value=e,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,[`modelValue`]))}}),o=a;export{o as b}; \ No newline at end of file diff --git a/assets/_...all_-Czwo4IOt.js b/assets/_...all_-Czwo4IOt.js deleted file mode 100644 index 8a4349e3b34b48eee53805be01c6b634324c32c2..0000000000000000000000000000000000000000 --- a/assets/_...all_-Czwo4IOt.js +++ /dev/null @@ -1 +0,0 @@ -import{cj as e,d6 as t,dU as n,dX as r,dY as i,dZ as a,d_ as o,e6 as s,ee as c,el as l}from"./index-DEpwtsc8.js";const u={"h-full":``,"w-full":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``,"gap-4":``};var d=o({__name:`[...all]`,setup(o){let d=t();return(t,o)=>(s(),r(`div`,u,[o[2]||=n(`div`,{"text-3xl":``},` Where are we? `,-1),n(`div`,null,[a(l(e),{onClick:o[0]||=e=>l(d).go(-1)},{default:c(()=>o[1]||=[i(` Go Back `,-1)]),_:1,__:[1]})])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/_...all_-DNDgokJ1.js b/assets/_...all_-DNDgokJ1.js new file mode 100644 index 0000000000000000000000000000000000000000..bf2ad8383ff28949bb13ff4d2f1bb45b3d13787d --- /dev/null +++ b/assets/_...all_-DNDgokJ1.js @@ -0,0 +1 @@ +import{cj as e,d$ as t,d6 as n,dV as r,dY as i,dZ as a,d_ as o,e7 as s,ef as c,em as l}from"./index-BF1-WNuF.js";const u={"h-full":``,"w-full":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``,"gap-4":``};var d=t({__name:`[...all]`,setup(t){let d=n();return(t,n)=>(s(),i(`div`,u,[n[2]||=r(`div`,{"text-3xl":``},` Where are we? `,-1),r(`div`,null,[o(l(e),{onClick:n[0]||=e=>l(d).go(-1)},{default:c(()=>n[1]||=[a(` Go Back `,-1)]),_:1,__:[1]})])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/__vite-browser-external-Cp7ZP3Cb.js b/assets/__vite-browser-external-Cp7ZP3Cb.js new file mode 100644 index 0000000000000000000000000000000000000000..a4093337eead027f13097e306cfdd634d55be5f6 --- /dev/null +++ b/assets/__vite-browser-external-Cp7ZP3Cb.js @@ -0,0 +1 @@ +import{er as e}from"./index-BF1-WNuF.js";var t=e(((exports,t)=>{t.exports={}}));export default t(); \ No newline at end of file diff --git a/assets/__vite-browser-external-DFqcVPwo.js b/assets/__vite-browser-external-DFqcVPwo.js deleted file mode 100644 index 087b7f1c984396dc8e753d9cbf0265eb184ba713..0000000000000000000000000000000000000000 --- a/assets/__vite-browser-external-DFqcVPwo.js +++ /dev/null @@ -1 +0,0 @@ -import{eq as e}from"./index-DEpwtsc8.js";var t=e(((exports,t)=>{t.exports={}}));export default t(); \ No newline at end of file diff --git a/assets/airi-card-BaqHfUxO.js b/assets/airi-card-BaqHfUxO.js new file mode 100644 index 0000000000000000000000000000000000000000..df878278b504b5c651d71f22ca5e5748c827456c --- /dev/null +++ b/assets/airi-card-BaqHfUxO.js @@ -0,0 +1 @@ +import{b as e}from"./DeleteCardDialog-CAFkJEuJ.js";import"./DialogTitle-DeExZXr0.js";import{b as t}from"./InputFile-CWezcrJG.js";import{A as n,cI as r,cn as ee,d$ as i,d8 as a,dP as o,dS as s,dU as c,dV as l,dW as u,dX as d,dY as f,dZ as p,d_ as m,e7 as h,e8 as g,eb as _,ee as v,ef as y,eg as b,ei as x,em as S,en as C,eq as w,u as T}from"./index-BF1-WNuF.js";import{b as E}from"./route-block-gWR0cCIm.js";import{b as D}from"./CardCreate-CVfo1sY1.js";import{b as O}from"./CardCreationDialog-Ccy00rjA.js";import{b as te}from"./CardDetailDialog-Cz1N4FQk.js";import{b as ne}from"./CardListItem-oFjJO8yD.js";const re={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},ie={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},ae={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},oe=[`placeholder`],k={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},A={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},j={key:0,flex:``,"flex-col":``,"items-center":``},M={"font-medium":``,text:`neutral-600 dark:neutral-300`},N={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},P={key:1,flex:``,"flex-col":``,"items-center":``},F={"font-medium":``,text:`primary-600 dark:primary-300`},I={key:1,class:`col-span-full rounded-xl p-8 text-center`,border:`~ neutral-200/50 dark:neutral-700/30`,bg:`neutral-50/50 dark:neutral-900/50`},L={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var R=i({__name:`index`,setup(i){let{t:E}=n(),R=T(),{addCard:z,removeCard:B}=R,{cards:V,activeCardId:H}=a(R),U=x(``),W=x(!1),G=x(!1),K=x(``),q=x(`nameAsc`),J=x([]);v(J,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);U.value=z(n),W.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let Y=c(()=>Array.from(V.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),se=c(()=>{if(!K.value)return Y.value;let e=K.value.toLowerCase();return Y.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),X=c(()=>{let e=[...se.value];return q.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):q.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):q.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),Z=x(!1),Q=x(null);function ce(){Q.value&&(B(Q.value),Q.value=null,Z.value=!1)}function le(e){Q.value=e,Z.value=!0}function ue(e){U.value=e,W.value=!0}function de(){G.value=!0}function fe(e){H.value=e}function pe(e){let t=V.value.get(e);return t?.version||`1.0.0`}function $(e,t){let n=V.value.get(e);if(!n||!n.extensions?.airi?.modules)return`default`;let r=n.extensions.airi.modules;return t===`consciousness`?r.consciousness?.model&&r.consciousness.model.split(`-`).pop()||`default`:t===`voice`&&r.speech?.voice_id||`default`}return(n,i)=>{let a=_(`motion`);return h(),f(s,null,[l(`div`,re,[l(`div`,ie,[l(`div`,ae,[i[7]||=l(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[l(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),b(l(`input`,{"onUpdate:modelValue":i[0]||=e=>K.value=e,type:`search`,class:`w-full rounded-xl p-2.5 pl-10 text-sm outline-none`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,bg:`white dark:neutral-900`,placeholder:S(E)(`settings.pages.card.search`)},null,8,oe),[[o,K.value]])]),l(`div`,k,[l(`div`,A,w(S(E)(`settings.pages.card.sort_by`))+`: `,1),m(S(r),{modelValue:q.value,"onUpdate:modelValue":i[1]||=e=>q.value=e,options:[{value:`nameAsc`,label:S(E)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:S(E)(`settings.pages.card.name_desc`)},{value:`recent`,label:S(E)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),l(`div`,{class:C([`mt-4`,{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":S(V).size>0}])},[m(S(t),{modelValue:J.value,"onUpdate:modelValue":i[2]||=e=>J.value=e,accept:`*.json`},{default:y(({isDragging:e})=>[e?(h(),f(`div`,P,[i[9]||=l(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),l(`p`,F,w(S(E)(`settings.pages.card.drop_here`)),1)])):(h(),f(`div`,j,[i[8]||=l(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),l(`p`,M,w(S(E)(`settings.pages.card.upload`)),1),l(`p`,N,w(S(E)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),m(D,{onClick:de}),S(V).size>0?(h(!0),f(s,{key:0},g(X.value,e=>(h(),u(ne,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===S(H),"is-selected":e.id===U.value&&W.value,version:pe(e.id),"consciousness-model":$(e.id,`consciousness`),"voice-model":$(e.id,`voice`),onSelect:t=>ue(e.id),onActivate:t=>fe(e.id),onDelete:t=>le(e.id)},null,8,[`id`,`name`,`description`,`is-active`,`is-selected`,`version`,`consciousness-model`,`voice-model`,`onSelect`,`onActivate`,`onDelete`]))),128)):d(``,!0),S(V).size===0?(h(),f(`div`,I,[i[10]||=l(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),l(`p`,null,w(S(E)(`settings.pages.card.no_cards`)),1)])):d(``,!0),K.value&&X.value.length===0?(h(),u(S(ee),{key:2,type:`warning`},{title:y(()=>[p(w(S(E)(`settings.pages.card.no_results`)),1)]),content:y(()=>[p(w(S(E)(`settings.pages.card.try_different_search`)),1)]),_:1})):d(``,!0)],2)]),m(e,{modelValue:Z.value,"onUpdate:modelValue":i[3]||=e=>Z.value=e,"card-name":Q.value?S(R).getCard(Q.value)?.name:``,onConfirm:ce,onCancel:i[4]||=e=>Q.value=null},null,8,[`modelValue`,`card-name`]),m(te,{modelValue:W.value,"onUpdate:modelValue":i[5]||=e=>W.value=e,"card-id":U.value},null,8,[`modelValue`,`card-id`]),m(O,{modelValue:G.value,"onUpdate:modelValue":i[6]||=e=>G.value=e},null,8,[`modelValue`]),b((h(),f(`div`,L,i[11]||=[l(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[a]])],64)}}});typeof E==`function`&&E(R);var z=R;export{z as default}; \ No newline at end of file diff --git a/assets/airi-card-Dt8lnkmS.js b/assets/airi-card-Dt8lnkmS.js deleted file mode 100644 index 329c32d09f1146add4c2fe5e926ea4054f97d85b..0000000000000000000000000000000000000000 --- a/assets/airi-card-Dt8lnkmS.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./DeleteCardDialog-D4etY9xD.js";import"./DialogTitle-D3E9wBQi.js";import{b as t}from"./InputFile-BfCkG18J.js";import{A as n,cI as r,cn as i,d8 as a,dO as o,dR as s,dT as c,dU as l,dV as u,dW as d,dX as f,dY as p,dZ as m,d_ as ee,e6 as h,e7 as g,ea as _,ed as v,ee as y,ef as b,eh as x,el as S,em as te,ep as C,u as ne}from"./index-DEpwtsc8.js";import{b as w}from"./route-block-gWR0cCIm.js";import{b as T}from"./CardCreate-DO-bH_p3.js";import{b as E}from"./CardCreationDialog-CxSxad_k.js";import{b as D}from"./CardDetailDialog-CTtvzxCu.js";import{b as O}from"./CardListItem-Dl6W0_Rh.js";const k={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},re={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},ie={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},ae=[`placeholder`],oe={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},A={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},j={key:0,flex:``,"flex-col":``,"items-center":``},M={"font-medium":``,text:`neutral-600 dark:neutral-300`},N={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},P={key:1,flex:``,"flex-col":``,"items-center":``},F={"font-medium":``,text:`primary-600 dark:primary-300`},I={key:1,class:`col-span-full rounded-xl p-8 text-center`,border:`~ neutral-200/50 dark:neutral-700/30`,bg:`neutral-50/50 dark:neutral-900/50`},L={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var R=ee({__name:`index`,setup(ee){let{t:w}=n(),R=ne(),{addCard:z,removeCard:B}=R,{cards:V,activeCardId:H}=a(R),U=x(``),W=x(!1),G=x(!1),K=x(``),q=x(`nameAsc`),J=x([]);v(J,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);U.value=z(n),W.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let Y=c(()=>Array.from(V.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),se=c(()=>{if(!K.value)return Y.value;let e=K.value.toLowerCase();return Y.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),X=c(()=>{let e=[...se.value];return q.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):q.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):q.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),Z=x(!1),Q=x(null);function ce(){Q.value&&(B(Q.value),Q.value=null,Z.value=!1)}function le(e){Q.value=e,Z.value=!0}function ue(e){U.value=e,W.value=!0}function de(){G.value=!0}function fe(e){H.value=e}function pe(e){let t=V.value.get(e);return t?.version||`1.0.0`}function $(e,t){let n=V.value.get(e);if(!n||!n.extensions?.airi?.modules)return`default`;let r=n.extensions.airi.modules;return t===`consciousness`?r.consciousness?.model&&r.consciousness.model.split(`-`).pop()||`default`:t===`voice`&&r.speech?.voice_id||`default`}return(n,a)=>{let c=_(`motion`);return h(),f(s,null,[l(`div`,k,[l(`div`,re,[l(`div`,ie,[a[7]||=l(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[l(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),b(l(`input`,{"onUpdate:modelValue":a[0]||=e=>K.value=e,type:`search`,class:`w-full rounded-xl p-2.5 pl-10 text-sm outline-none`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,bg:`white dark:neutral-900`,placeholder:S(w)(`settings.pages.card.search`)},null,8,ae),[[o,K.value]])]),l(`div`,oe,[l(`div`,A,C(S(w)(`settings.pages.card.sort_by`))+`: `,1),m(S(r),{modelValue:q.value,"onUpdate:modelValue":a[1]||=e=>q.value=e,options:[{value:`nameAsc`,label:S(w)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:S(w)(`settings.pages.card.name_desc`)},{value:`recent`,label:S(w)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),l(`div`,{class:te([`mt-4`,{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":S(V).size>0}])},[m(S(t),{modelValue:J.value,"onUpdate:modelValue":a[2]||=e=>J.value=e,accept:`*.json`},{default:y(({isDragging:e})=>[e?(h(),f(`div`,P,[a[9]||=l(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),l(`p`,F,C(S(w)(`settings.pages.card.drop_here`)),1)])):(h(),f(`div`,j,[a[8]||=l(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),l(`p`,M,C(S(w)(`settings.pages.card.upload`)),1),l(`p`,N,C(S(w)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),m(T,{onClick:de}),S(V).size>0?(h(!0),f(s,{key:0},g(X.value,e=>(h(),u(O,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===S(H),"is-selected":e.id===U.value&&W.value,version:pe(e.id),"consciousness-model":$(e.id,`consciousness`),"voice-model":$(e.id,`voice`),onSelect:t=>ue(e.id),onActivate:t=>fe(e.id),onDelete:t=>le(e.id)},null,8,[`id`,`name`,`description`,`is-active`,`is-selected`,`version`,`consciousness-model`,`voice-model`,`onSelect`,`onActivate`,`onDelete`]))),128)):d(``,!0),S(V).size===0?(h(),f(`div`,I,[a[10]||=l(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),l(`p`,null,C(S(w)(`settings.pages.card.no_cards`)),1)])):d(``,!0),K.value&&X.value.length===0?(h(),u(S(i),{key:2,type:`warning`},{title:y(()=>[p(C(S(w)(`settings.pages.card.no_results`)),1)]),content:y(()=>[p(C(S(w)(`settings.pages.card.try_different_search`)),1)]),_:1})):d(``,!0)],2)]),m(e,{modelValue:Z.value,"onUpdate:modelValue":a[3]||=e=>Z.value=e,"card-name":Q.value?S(R).getCard(Q.value)?.name:``,onConfirm:ce,onCancel:a[4]||=e=>Q.value=null},null,8,[`modelValue`,`card-name`]),m(D,{modelValue:W.value,"onUpdate:modelValue":a[5]||=e=>W.value=e,"card-id":U.value},null,8,[`modelValue`,`card-id`]),m(E,{modelValue:G.value,"onUpdate:modelValue":a[6]||=e=>G.value=e},null,8,[`modelValue`]),b((h(),f(`div`,L,a[11]||=[l(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[c]])],64)}}});typeof w==`function`&&w(R);var z=R;export{z as default}; \ No newline at end of file diff --git a/assets/alibaba-cloud-model-studio-CQtjyEa_.js b/assets/alibaba-cloud-model-studio-u_KMUc3I.js similarity index 71% rename from assets/alibaba-cloud-model-studio-CQtjyEa_.js rename to assets/alibaba-cloud-model-studio-u_KMUc3I.js index d9ea78847820afc0b115ab3049bcd56553c8782d..d733d4f9ae3dd3cb8b2803ac37f8bb4424eb84fc 100644 --- a/assets/alibaba-cloud-model-studio-CQtjyEa_.js +++ b/assets/alibaba-cloud-model-studio-u_KMUc3I.js @@ -1 +1 @@ -import{A as e,cN as t,d8 as n,dT as r,dU as i,dV as a,dZ as o,d_ as s,e as c,e4 as l,e6 as u,ed as d,ee as f,eh as p,el as m,f as h,v as g,y as _}from"./index-DEpwtsc8.js";import{b as v}from"./route-block-gWR0cCIm.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=s({__name:`alibaba-cloud-model-studio`,setup(s){let v={speed:1},S=p(0),C=p(1),w=p(0),T=g(),E=_(),{providers:D}=n(E),{t:O}=e(),k=r(()=>!!D.value[b]?.apiKey),A=r(()=>T.availableVoices[b]||[]);async function j(e,t,n){let r=await E.getProviderInstance(b);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(b),a=i.model||x;return await T.speech(r,a,e,t,{...i,...v})}return l(async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),d(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),d(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),d(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),d(D,async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(u(),a(m(c),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":f(()=>[i(`div`,y,[o(m(t),{modelValue:S.value,"onUpdate:modelValue":n[0]||=e=>S.value=e,label:m(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:m(O)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),o(m(t),{modelValue:C.value,"onUpdate:modelValue":n[1]||=e=>C.value=e,label:m(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:m(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),o(m(t),{modelValue:w.value,"onUpdate:modelValue":n[2]||=e=>w.value=e,label:m(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:m(O)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:f(()=>[o(m(h),{"available-voices":A.value,"generate-speech":j,"api-key-configured":k.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof v==`function`&&v(S);var C=S;export{C as default}; \ No newline at end of file +import{A as e,cN as t,d$ as n,d8 as r,dU as i,dV as a,dW as o,d_ as s,e as c,e5 as l,e7 as u,ee as d,ef as f,ei as p,em as m,f as h,v as g,y as _}from"./index-BF1-WNuF.js";import{b as v}from"./route-block-gWR0cCIm.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=n({__name:`alibaba-cloud-model-studio`,setup(n){let v={speed:1},S=p(0),C=p(1),w=p(0),T=g(),E=_(),{providers:D}=r(E),{t:O}=e(),k=i(()=>!!D.value[b]?.apiKey),A=i(()=>T.availableVoices[b]||[]);async function j(e,t,n){let r=await E.getProviderInstance(b);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(b),a=i.model||x;return await T.speech(r,a,e,t,{...i,...v})}return l(async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),d(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),d(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),d(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),d(D,async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(u(),o(m(c),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":f(()=>[a(`div`,y,[s(m(t),{modelValue:S.value,"onUpdate:modelValue":n[0]||=e=>S.value=e,label:m(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:m(O)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),s(m(t),{modelValue:C.value,"onUpdate:modelValue":n[1]||=e=>C.value=e,label:m(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:m(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),s(m(t),{modelValue:w.value,"onUpdate:modelValue":n[2]||=e=>w.value=e,label:m(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:m(O)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:f(()=>[s(m(h),{"available-voices":A.value,"generate-speech":j,"api-key-configured":k.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof v==`function`&&v(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/anthropic-B5Rr8xN4.js b/assets/anthropic-BljXHKAw.js similarity index 50% rename from assets/anthropic-B5Rr8xN4.js rename to assets/anthropic-BljXHKAw.js index 8752dc9885f911b6ebcdbb1600dfe1545c4493fc..66eda87e834040ebef64dae686d9b80f42840a53 100644 --- a/assets/anthropic-B5Rr8xN4.js +++ b/assets/anthropic-BljXHKAw.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dU as i,dV as a,dY as o,dZ as s,d_ as c,e4 as l,e6 as u,ed as d,ee as f,el as p,ep as m,g as h,h as g,i as _,j as v,k as y,l as b,y as x}from"./index-DEpwtsc8.js";import{b as S}from"./route-block-gWR0cCIm.js";const C={bg:`orange-50 dark:orange-900/20`,"rounded-xl":``,"p-4":``,flex:`~ col gap-3`},w={"text-xl":``,"font-semibold":``,text:`orange-700 dark:orange-500`},T={underline:``,href:`https://docs.anthropic.com/en/api/openai-sdk`},E=`anthropic`;var D=c({__name:`anthropic`,setup(c){let{t:S}=e(),D=t(),O=x(),{providers:k}=n(O),A=r(()=>O.getProviderMetadata(E)),j=r({get:()=>k.value[E]?.apiKey||``,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].apiKey=e}}),M=r({get:()=>k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].baseUrl=e}});l(()=>{k.value[E]||(k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}),j.value=k.value[E]?.apiKey||``,M.value=k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`}),d([j,M],()=>{k.value[E]={...k.value[E],apiKey:j.value,baseUrl:M.value||`https://api.anthropic.com/v1/`}});function N(){k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}}return(e,t)=>(u(),a(p(h),{"provider-name":A.value?.localizedName||`Anthropic | Claude`,"provider-icon":A.value?.icon,"on-back":()=>p(D).back()},{default:f(()=>[i(`div`,C,[i(`h2`,w,m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.title`)),1),i(`p`,null,[o(m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part1`))+` `,1),i(`a`,T,m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part2`)),1),o(`, `+m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part3`))+` `,1),t[2]||=i(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`,-1),o(` `+m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part4`)),1)]),i(`p`,null,[o(m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part5`))+` `,1),t[3]||=i(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`,-1),o(` `+m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part6`)),1)])]),s(p(g),null,{default:f(()=>[s(p(_),{title:p(S)(`settings.pages.providers.common.section.basic.title`),description:p(S)(`settings.pages.providers.common.section.basic.description`),"on-reset":N},{default:f(()=>[s(p(y),{modelValue:j.value,"onUpdate:modelValue":t[0]||=e=>j.value=e,"provider-name":A.value?.localizedName||`Anthropic`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),s(p(b),{title:p(S)(`settings.pages.providers.common.section.advanced.title`)},{default:f(()=>[s(p(v),{modelValue:M.value,"onUpdate:modelValue":t[1]||=e=>M.value=e,placeholder:`https://api.anthropic.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof S==`function`&&S(D);var O=D;export{O as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dV as a,dW as o,dZ as s,d_ as c,e5 as l,e7 as u,ee as d,ef as f,em as p,eq as m,g as h,h as g,i as _,j as v,k as y,l as b,y as x}from"./index-BF1-WNuF.js";import{b as S}from"./route-block-gWR0cCIm.js";const C={bg:`orange-50 dark:orange-900/20`,"rounded-xl":``,"p-4":``,flex:`~ col gap-3`},w={"text-xl":``,"font-semibold":``,text:`orange-700 dark:orange-500`},T={underline:``,href:`https://docs.anthropic.com/en/api/openai-sdk`},E=`anthropic`;var D=t({__name:`anthropic`,setup(t){let{t:S}=e(),D=n(),O=x(),{providers:k}=r(O),A=i(()=>O.getProviderMetadata(E)),j=i({get:()=>k.value[E]?.apiKey||``,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].apiKey=e}}),M=i({get:()=>k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].baseUrl=e}});l(()=>{k.value[E]||(k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}),j.value=k.value[E]?.apiKey||``,M.value=k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`}),d([j,M],()=>{k.value[E]={...k.value[E],apiKey:j.value,baseUrl:M.value||`https://api.anthropic.com/v1/`}});function N(){k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}}return(e,t)=>(u(),o(p(h),{"provider-name":A.value?.localizedName||`Anthropic | Claude`,"provider-icon":A.value?.icon,"on-back":()=>p(D).back()},{default:f(()=>[a(`div`,C,[a(`h2`,w,m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.title`)),1),a(`p`,null,[s(m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part1`))+` `,1),a(`a`,T,m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part2`)),1),s(`, `+m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part3`))+` `,1),t[2]||=a(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`,-1),s(` `+m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part4`)),1)]),a(`p`,null,[s(m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part5`))+` `,1),t[3]||=a(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`,-1),s(` `+m(p(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part6`)),1)])]),c(p(g),null,{default:f(()=>[c(p(_),{title:p(S)(`settings.pages.providers.common.section.basic.title`),description:p(S)(`settings.pages.providers.common.section.basic.description`),"on-reset":N},{default:f(()=>[c(p(y),{modelValue:j.value,"onUpdate:modelValue":t[0]||=e=>j.value=e,"provider-name":A.value?.localizedName||`Anthropic`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),c(p(b),{title:p(S)(`settings.pages.providers.common.section.advanced.title`)},{default:f(()=>[c(p(v),{modelValue:M.value,"onUpdate:modelValue":t[1]||=e=>M.value=e,placeholder:`https://api.anthropic.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof S==`function`&&S(D);var O=D;export{O as default}; \ No newline at end of file diff --git a/assets/appearance--O06LEpn.js b/assets/appearance-Bqk97F-6.js similarity index 62% rename from assets/appearance--O06LEpn.js rename to assets/appearance-Bqk97F-6.js index e6a53f4d888de7ef227e5cbd1fa4602fc500a0f3..1134fe5a9cc8a99baba205fa968434f6dcf2fac5 100644 --- a/assets/appearance--O06LEpn.js +++ b/assets/appearance-Bqk97F-6.js @@ -1 +1 @@ -import{A as e,cp as t,dR as n,dT as r,dU as i,dV as a,dX as o,d_ as s,e6 as c,e7 as l,ea as u,ef as d,el as f,eo as p}from"./index-DEpwtsc8.js";import{b as m}from"./route-block-gWR0cCIm.js";const h={flex:`~ col gap-4`,"font-normal":``},g={flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},v={text:`60`,"i-solar:settings-bold-duotone":``};var y=s({__name:`index`,setup(s){let{t:m}=e(),y=r(()=>[{title:m(`settings.pages.themes.general.title`),description:m(`settings.pages.themes.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/appearance/general`},{title:m(`settings.pages.themes.color-scheme.title`),description:m(`settings.pages.themes.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/appearance/color-scheme`},{title:m(`settings.pages.themes.developer.title`),description:m(`settings.pages.themes.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/appearance/developer`}]);return(e,r)=>{let s=u(`motion`);return c(),o(`div`,h,[r[0]||=i(`div`,null,null,-1),i(`div`,g,[(c(!0),o(n,null,l(y.value,(e,n)=>d((c(),a(f(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:p({transitionDelay:`${n*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[s]])),128))]),d((c(),o(`div`,_,[d(i(`div`,v,null,512),[[s]])])),[[s]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file +import{A as e,cp as t,d$ as n,dS as r,dU as i,dV as a,dW as o,dY as s,e7 as c,e8 as l,eb as u,eg as d,em as f,ep as p}from"./index-BF1-WNuF.js";import{b as m}from"./route-block-gWR0cCIm.js";const h={flex:`~ col gap-4`,"font-normal":``},g={flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},v={text:`60`,"i-solar:settings-bold-duotone":``};var y=n({__name:`index`,setup(n){let{t:m}=e(),y=i(()=>[{title:m(`settings.pages.themes.general.title`),description:m(`settings.pages.themes.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/appearance/general`},{title:m(`settings.pages.themes.color-scheme.title`),description:m(`settings.pages.themes.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/appearance/color-scheme`},{title:m(`settings.pages.themes.developer.title`),description:m(`settings.pages.themes.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/appearance/developer`}]);return(e,n)=>{let i=u(`motion`);return c(),s(`div`,h,[n[0]||=a(`div`,null,null,-1),a(`div`,g,[(c(!0),s(r,null,l(y.value,(e,n)=>d((c(),o(f(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:p({transitionDelay:`${n*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[i]])),128))]),d((c(),s(`div`,_,[d(a(`div`,v,null,512),[[i]])])),[[i]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/audio-C2yPudG-.js b/assets/audio-C2yPudG-.js new file mode 100644 index 0000000000000000000000000000000000000000..71144224fa781cf7f5dfe002619b7945cada1745 --- /dev/null +++ b/assets/audio-C2yPudG-.js @@ -0,0 +1 @@ +import{d$ as e,dV as t,dY as n,e7 as r,ei as i}from"./index-BF1-WNuF.js";var a=e({__name:`audio`,setup(e){let a=i(),o=i();function s(e){if(!e)return;let t=o.value?.files?.[0];if(!t)return;let n=document.createElement(`audio`);a.value?.appendChild(n),n.src=URL.createObjectURL(t),n.controls=!0,n.load(),n.play()}return(e,i)=>(r(),n(`div`,null,[t(`div`,null,[t(`div`,{ref_key:`containerRef`,ref:a},null,512),t(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default}; \ No newline at end of file diff --git a/assets/audio-DFFpt6Vn.js b/assets/audio-DFFpt6Vn.js deleted file mode 100644 index 61c4af9c0fd368883a53996eb1fd573fb060f4fe..0000000000000000000000000000000000000000 --- a/assets/audio-DFFpt6Vn.js +++ /dev/null @@ -1 +0,0 @@ -import{dU as e,dX as t,d_ as n,e6 as r,eh as i}from"./index-DEpwtsc8.js";var a=n({__name:`audio`,setup(n){let a=i(),o=i();function s(e){if(!e)return;let t=o.value?.files?.[0];if(!t)return;let n=document.createElement(`audio`);a.value?.appendChild(n),n.src=URL.createObjectURL(t),n.controls=!0,n.load(),n.play()}return(n,i)=>(r(),t(`div`,null,[e(`div`,null,[e(`div`,{ref_key:`containerRef`,ref:a},null,512),e(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default}; \ No newline at end of file diff --git a/assets/audio-record-OOMepqWr.js b/assets/audio-record-DlZD02-W.js similarity index 54% rename from assets/audio-record-OOMepqWr.js rename to assets/audio-record-DlZD02-W.js index e1de953182df44261bc40ed64a9c434da865a75a..94b658bed658bec9cbb9e5605059af4828290881 100644 --- a/assets/audio-record-OOMepqWr.js +++ b/assets/audio-record-DlZD02-W.js @@ -1 +1 @@ -import{cI as e,cj as t,dR as n,dT as r,dU as i,dV as a,dX as o,dY as s,dZ as c,d_ as l,dd as u,dm as d,dp as f,e0 as p,e2 as m,e4 as h,e5 as g,e6 as _,e7 as v,e8 as y,ed as b,ee as x,eg as S,eh as C,ek as w,el as T,ep as E}from"./index-DEpwtsc8.js";var D=l({__name:`Option`,props:{value:{},label:{},active:{type:Boolean}},setup(e){let t=e,n=p(`selectOption`),r=p(`hide`);return(e,i)=>(_(),o(`div`,m({...e.$attrs,class:null,style:null},{class:[`cursor-pointer rounded px-2 py-1 text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800`,{"bg-neutral-100 dark:bg-neutral-800":t.active}],"line-clamp-1":``,"overflow-hidden":``,"text-ellipsis":``,"whitespace-pre-wrap":``,text:`xs sm:sm`,"transition-colors":``,"duration-150":``,"ease-in-out":``,"will-change-background-color":``,"will-change-color":``,onClick:i[0]||=()=>{T(n)(t.value),T(r)()}}),[y(e.$slots,`default`,{},()=>[s(E(t.label),1)])],16))}}),O=D;function k(){let e=u({constraints:{audio:!0},requestPermissions:!1}),t=C(e.audioInputs.value[0]?.deviceId||``),n=C(),i=r(()=>e.audioInputs.value),a=C({audio:!0}),o=d({constraints:a,autoSwitch:!0,enabled:!1});async function s(){e.permissionGranted.value||e.isSupported.value&&await e.ensurePermissions()}b(t,()=>{t.value&&(a.value={audio:{deviceId:{exact:t.value}}})},{immediate:!0}),b(e.audioInputs,()=>{n.value=i.value.find(e=>e.deviceId===t.value)},{immediate:!0}),b([e.permissionGranted,i,t],async()=>{await s(),e.permissionGranted.value&&i.value.length!==0&&(n.value||=i.value[0])},{immediate:!0});async function c(){await s(),e.permissionGranted.value&&n.value&&(o.enabled.value&&o.restart(),o.start())}function l(){o.stop()}return{selectedAudioInputId:t,selectedAudioInput:n,audioInputs:i,start:c,stop:l,request:s,media:o}}function A(e,t=()=>Promise.resolve()){let n=C(),r=w(e);async function i(){if(await t(),await f(r).toBeTruthy(),!r.value){console.error(`No media media available`);return}n.value=new MediaRecorder(r.value),n.value.start()}function a(){n.value&&(n.value.stop(),n.value.ondataavailable=e=>{let t=e.data,n=URL.createObjectURL(t),r=new Audio(n);r.play()})}return{startRecord:i,stopRecord:a}}const j={class:`mt-4 w-full flex justify-center gap-2`};var M=l({__name:`audio-record`,setup(r){let{audioInputs:l,selectedAudioInputId:u,start:d,stop:f,media:p,request:m}=k(),{startRecord:y,stopRecord:b}=A(p.stream,d);return h(()=>m()),g(()=>f()),(r,f)=>(_(),o(`div`,null,[c(T(e),{modelValue:T(u),"onUpdate:modelValue":f[0]||=e=>S(u)?u.value=e:null,onChange:f[1]||=()=>T(d)()},{default:x(({value:e})=>[i(`div`,null,E(e?T(l).find(t=>t.deviceId===e)?.label:`Select Audio Input`),1)]),options:x(({hide:e})=>[(_(!0),o(n,null,v(T(l),t=>(_(),a(T(O),{key:t.deviceId,value:t.deviceId,active:t.deviceId===T(u),onClick:t=>e()},{default:x(()=>[s(E(t.label),1)]),_:2},1032,[`value`,`active`,`onClick`]))),128))]),_:1},8,[`modelValue`]),i(`div`,j,[c(T(t),{onClick:T(y)},{default:x(()=>f[2]||=[s(` Start Recording `,-1)]),_:1,__:[2]},8,[`onClick`]),c(T(t),{onClick:T(b)},{default:x(()=>f[3]||=[s(` Stop Recording `,-1)]),_:1,__:[3]},8,[`onClick`])])]))}}),N=M;export{N as default}; \ No newline at end of file +import{cI as e,cj as t,d$ as n,dS as r,dU as i,dV as a,dW as o,dY as s,dZ as c,d_ as l,dd as u,dm as d,dp as f,e1 as p,e3 as m,e5 as h,e6 as g,e7 as _,e8 as v,e9 as y,ee as b,ef as x,eh as S,ei as C,el as w,em as T,eq as E}from"./index-BF1-WNuF.js";var D=n({__name:`Option`,props:{value:{},label:{},active:{type:Boolean}},setup(e){let t=e,n=p(`selectOption`),r=p(`hide`);return(e,i)=>(_(),s(`div`,m({...e.$attrs,class:null,style:null},{class:[`cursor-pointer rounded px-2 py-1 text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800`,{"bg-neutral-100 dark:bg-neutral-800":t.active}],"line-clamp-1":``,"overflow-hidden":``,"text-ellipsis":``,"whitespace-pre-wrap":``,text:`xs sm:sm`,"transition-colors":``,"duration-150":``,"ease-in-out":``,"will-change-background-color":``,"will-change-color":``,onClick:i[0]||=()=>{T(n)(t.value),T(r)()}}),[y(e.$slots,`default`,{},()=>[c(E(t.label),1)])],16))}}),O=D;function k(){let e=u({constraints:{audio:!0},requestPermissions:!1}),t=C(e.audioInputs.value[0]?.deviceId||``),n=C(),r=i(()=>e.audioInputs.value),a=C({audio:!0}),o=d({constraints:a,autoSwitch:!0,enabled:!1});async function s(){e.permissionGranted.value||e.isSupported.value&&await e.ensurePermissions()}b(t,()=>{t.value&&(a.value={audio:{deviceId:{exact:t.value}}})},{immediate:!0}),b(e.audioInputs,()=>{n.value=r.value.find(e=>e.deviceId===t.value)},{immediate:!0}),b([e.permissionGranted,r,t],async()=>{await s(),e.permissionGranted.value&&r.value.length!==0&&(n.value||=r.value[0])},{immediate:!0});async function c(){await s(),e.permissionGranted.value&&n.value&&(o.enabled.value&&o.restart(),o.start())}function l(){o.stop()}return{selectedAudioInputId:t,selectedAudioInput:n,audioInputs:r,start:c,stop:l,request:s,media:o}}function A(e,t=()=>Promise.resolve()){let n=C(),r=w(e);async function i(){if(await t(),await f(r).toBeTruthy(),!r.value){console.error(`No media media available`);return}n.value=new MediaRecorder(r.value),n.value.start()}function a(){n.value&&(n.value.stop(),n.value.ondataavailable=e=>{let t=e.data,n=URL.createObjectURL(t),r=new Audio(n);r.play()})}return{startRecord:i,stopRecord:a}}const j={class:`mt-4 w-full flex justify-center gap-2`};var M=n({__name:`audio-record`,setup(n){let{audioInputs:i,selectedAudioInputId:u,start:d,stop:f,media:p,request:m}=k(),{startRecord:y,stopRecord:b}=A(p.stream,d);return h(()=>m()),g(()=>f()),(n,f)=>(_(),s(`div`,null,[l(T(e),{modelValue:T(u),"onUpdate:modelValue":f[0]||=e=>S(u)?u.value=e:null,onChange:f[1]||=()=>T(d)()},{default:x(({value:e})=>[a(`div`,null,E(e?T(i).find(t=>t.deviceId===e)?.label:`Select Audio Input`),1)]),options:x(({hide:e})=>[(_(!0),s(r,null,v(T(i),t=>(_(),o(T(O),{key:t.deviceId,value:t.deviceId,active:t.deviceId===T(u),onClick:t=>e()},{default:x(()=>[c(E(t.label),1)]),_:2},1032,[`value`,`active`,`onClick`]))),128))]),_:1},8,[`modelValue`]),a(`div`,j,[l(T(t),{onClick:T(y)},{default:x(()=>f[2]||=[c(` Start Recording `,-1)]),_:1,__:[2]},8,[`onClick`]),l(T(t),{onClick:T(b)},{default:x(()=>f[3]||=[c(` Stop Recording `,-1)]),_:1,__:[3]},8,[`onClick`])])]))}}),N=M;export{N as default}; \ No newline at end of file diff --git a/assets/azure-ai-foundry-BUeB-9vc.js b/assets/azure-ai-foundry-CmnN_e4a.js similarity index 61% rename from assets/azure-ai-foundry-BUeB-9vc.js rename to assets/azure-ai-foundry-CmnN_e4a.js index 4e963223da8bfa1333e3c88f882ae2def401b7d3..2324efe4af7be4c99b599e9692d3f95ed4a3db36 100644 --- a/assets/azure-ai-foundry-BUeB-9vc.js +++ b/assets/azure-ai-foundry-CmnN_e4a.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,k as h,l as g,m as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`azure-ai-foundry`;var x=o({__name:`azure-ai-foundry`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.resourceName||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].resourceName=e}}),D=r({get:()=>C.value[b]?.apiVersion||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiVersion=e}}),O=r({get:()=>C.value[b]?.modelId||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].modelId=e}});s(()=>{C.value[b]||(C.value[b]={}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.resourceName||``,D.value=C.value[b]?.apiVersion||``,O.value=C.value[b]?.modelId||``}),l([T,E,D,O],()=>{C.value[b]={...C.value[b],apiKey:T.value,resourceName:E.value,apiVersion:D.value,modelId:O.value}});function k(){C.value[b]={}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName||`Azure OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:u(()=>[a(d(h),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Azure OpenAI`,placeholder:`...`,required:``},null,8,[`modelValue`,`provider-name`]),a(d(_),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,label:`Resouce name`,placeholder:`...`,description:`Prefix used in https://.services.ai.azure.com`,required:``},null,8,[`modelValue`]),a(d(_),{modelValue:O.value,"onUpdate:modelValue":t[2]||=e=>O.value=e,label:`Model id`,placeholder:`...`,description:`Model ID on Azure AI Foundry`,required:``},null,8,[`modelValue`])]),_:1},8,[`title`,`description`]),a(d(g),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(_),{modelValue:D.value,"onUpdate:modelValue":t[3]||=e=>D.value=e,label:`API version`,placeholder:`e.g. 2025-04-01-preview`,description:`API version for snapshot of the models`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,k as h,l as g,m as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`azure-ai-foundry`;var x=t({__name:`azure-ai-foundry`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.resourceName||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].resourceName=e}}),D=i({get:()=>C.value[b]?.apiVersion||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiVersion=e}}),O=i({get:()=>C.value[b]?.modelId||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].modelId=e}});s(()=>{C.value[b]||(C.value[b]={}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.resourceName||``,D.value=C.value[b]?.apiVersion||``,O.value=C.value[b]?.modelId||``}),l([T,E,D,O],()=>{C.value[b]={...C.value[b],apiKey:T.value,resourceName:E.value,apiVersion:D.value,modelId:O.value}});function k(){C.value[b]={}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName||`Azure OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:u(()=>[o(d(h),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Azure OpenAI`,placeholder:`...`,required:``},null,8,[`modelValue`,`provider-name`]),o(d(_),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,label:`Resouce name`,placeholder:`...`,description:`Prefix used in https://.services.ai.azure.com`,required:``},null,8,[`modelValue`]),o(d(_),{modelValue:O.value,"onUpdate:modelValue":t[2]||=e=>O.value=e,label:`Model id`,placeholder:`...`,description:`Model ID on Azure AI Foundry`,required:``},null,8,[`modelValue`])]),_:1},8,[`title`,`description`]),o(d(g),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(_),{modelValue:D.value,"onUpdate:modelValue":t[3]||=e=>D.value=e,label:`API version`,placeholder:`e.g. 2025-04-01-preview`,description:`API version for snapshot of the models`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/background-gradient-blending-BBSUXTlB.js b/assets/background-gradient-blending-CykJ-DB6.js similarity index 98% rename from assets/background-gradient-blending-BBSUXTlB.js rename to assets/background-gradient-blending-CykJ-DB6.js index c362db002f75b24901d13c9175f3dd627dcce567..5bc980cd9675f273e7ee0f027cba25a934cc42fb 100644 --- a/assets/background-gradient-blending-BBSUXTlB.js +++ b/assets/background-gradient-blending-CykJ-DB6.js @@ -1,5 +1,5 @@ -import{d as e}from"./theme-color-B02Jz7A8.js";import{cB as t,cO as n,dR as r,dT as i,dU as a,dX as o,dY as s,dZ as c,d_ as l,dn as u,e1 as d,e3 as f,e4 as p,e5 as m,e6 as h,e7 as g,e8 as _,eb as v,ec as y,ed as b,ee as x,eh as S,el as C,em as w,eo as T,ep as E}from"./index-DEpwtsc8.js";import{b as ee}from"./browser-bFm1l1qg.js";const D=[`accept`,`multiple`];var te=l({__name:`BasicInputFile`,props:d({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=v(e,`modelValue`),n=S(),r=S(!1),i=u(r,150);function s(e){let i=e.target;i.files&&i.files.length>0&&(n.value=i.files[0]),t.value=Array.from(i.files||[]),r.value=!1}return(e,c)=>(h(),o(`label`,{relative:``,"cursor-pointer":``,onDragover:c[0]||=e=>r.value=!0,onDragleave:c[1]||=e=>r.value=!1},[a(`input`,{type:`file`,accept:e.accept,multiple:e.multiple,class:`absolute inset-0 h-full w-full opacity-0`,onChange:s},null,40,D),_(e.$slots,`default`,{isDragging:C(i),firstFile:n.value,files:t.value})],32))}}),ne=te,O=function(e,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},O(e,t)};function k(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);O(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var re=function(){return re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]=55296&&i<=56319&&n>10)+55296,o%1024+56320)),(i+1===n||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},ce=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,le=typeof Uint8Array>`u`?[]:new Uint8Array(256),ue=0;ue`u`?[]:new Uint8Array(256),pe=0;pe>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},he=function(e){for(var t=e.length,n=[],r=0;r>_e,Se=1<<_e,Ce=Se-1,we=1024>>_e,Te=xe+we,Ee=Te,De=32,Oe=Ee+De,ke=65536>>ve,Ae=1<=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>_e],t=(t<>_e)],t=(t<>ve),t=this.index[t],t+=e>>_e&je,t=this.index[t],t=(t<`u`?[]:new Uint8Array(256),Re=0;ReBe?(i.push(!0),o-=Be):i.push(!1),[`normal`,`auto`,`loose`].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(e)!==-1)return r.push(a),n.push(tt);if(o===We||o===Xe){if(a===0)return r.push(a),n.push(mt);var s=n[a-1];return It.indexOf(s)===-1?(r.push(r[a-1]),n.push(s)):(r.push(a),n.push(mt))}if(r.push(a),o===ht)return n.push(t===`strict`?ot:xt);if(o===Et||o===pt)return n.push(mt);if(o===Dt)return e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(xt):n.push(mt);n.push(o)}),[r,n,i]},Bt=function(e,t,n,r){var i=r[n];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var a=n;a<=r.length;){a++;var o=r[a];if(o===t)return!0;if(o!==Ye)break}if(i===Ye)for(var a=n;a>0;){a--;var s=r[a];if(Array.isArray(e)?e.indexOf(s)!==-1:e===s)for(var c=n;c<=r.length;){c++;var o=r[c];if(o===t)return!0;if(o!==Ye)break}if(s!==Ye)break}return!1},Vt=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r===Ye)n--;else return r}return 0},Ht=function(e,t,n,r,i){if(n[r]===0)return F;var a=r-1;if(Array.isArray(i)&&i[a]===!0)return F;var o=a-1,s=a+1,c=t[a],l=o>=0?t[o]:0,u=t[s];if(c===He&&u===Ue)return F;if(Nt.indexOf(c)!==-1)return kt;if(Nt.indexOf(u)!==-1||Pt.indexOf(u)!==-1)return F;if(Vt(a,t)===qe)return At;if(jt.get(e[a])===Xe||(c===gt||c===_t)&&jt.get(e[s])===Xe||c===Ke||u===Ke||c===Je||[Ye,Qe,et].indexOf(c)===-1&&u===Je||[nt,rt,it,lt,ft].indexOf(u)!==-1||Vt(a,t)===st||Bt(ct,st,a,t)||Bt([nt,rt],ot,a,t)||Bt(Ze,Ze,a,t))return F;if(c===Ye)return At;if(c===ct||u===ct)return F;if(u===tt||c===tt)return At;if([Qe,et,ot].indexOf(u)!==-1||c===$e||l===bt&&Rt.indexOf(c)!==-1||c===ft&&u===bt||u===at||Mt.indexOf(u)!==-1&&c===P||Mt.indexOf(c)!==-1&&u===P||c===dt&&[xt,gt,_t].indexOf(u)!==-1||[xt,gt,_t].indexOf(c)!==-1&&u===ut||Mt.indexOf(c)!==-1&&Ft.indexOf(u)!==-1||Ft.indexOf(c)!==-1&&Mt.indexOf(u)!==-1||[dt,ut].indexOf(c)!==-1&&(u===P||[st,et].indexOf(u)!==-1&&t[s+1]===P)||[st,et].indexOf(c)!==-1&&u===P||c===P&&[P,ft,lt].indexOf(u)!==-1)return F;if([P,ft,lt,nt,rt].indexOf(u)!==-1)for(var d=a;d>=0;){var f=t[d];if(f===P)return F;if([ft,lt].indexOf(f)!==-1)d--;else break}if([dt,ut].indexOf(u)!==-1)for(var d=[nt,rt].indexOf(c)===-1?a:o;d>=0;){var f=t[d];if(f===P)return F;if([ft,lt].indexOf(f)!==-1)d--;else break}if(St===c&&[St,Ct,vt,yt].indexOf(u)!==-1||[Ct,vt].indexOf(c)!==-1&&[Ct,wt].indexOf(u)!==-1||[wt,yt].indexOf(c)!==-1&&u===wt||Lt.indexOf(c)!==-1&&[at,ut].indexOf(u)!==-1||Lt.indexOf(u)!==-1&&c===dt||Mt.indexOf(c)!==-1&&Mt.indexOf(u)!==-1||c===lt&&Mt.indexOf(u)!==-1||Mt.concat(P).indexOf(c)!==-1&&u===st&&Ot.indexOf(e[s])===-1||Mt.concat(P).indexOf(u)!==-1&&c===rt)return F;if(c===Tt&&u===Tt){for(var p=n[a],m=1;p>0&&(p--,t[p]===Tt);)m++;if(m%2!=0)return F}return c===gt&&u===_t?F:At},Ut=function(e,t){t||={lineBreak:`normal`,wordBreak:`normal`};var n=zt(e,t.lineBreak),r=n[0],i=n[1],a=n[2];(t.wordBreak===`break-all`||t.wordBreak===`break-word`)&&(i=i.map(function(e){return[P,mt,Et].indexOf(e)===-1?e:xt}));var o=t.wordBreak===`keep-all`?a.map(function(t,n){return t&&e[n]>=19968&&e[n]<=40959}):void 0;return[r,i,o]},Wt=function(){function e(e,t,n,r){this.codePoints=e,this.required=t===kt,this.start=n,this.end=r}return e.prototype.slice=function(){return N.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),Gt=function(e,t){var n=se(e),r=Ut(n,t),i=r[0],a=r[1],o=r[2],s=n.length,c=0,l=0;return{next:function(){if(l>=s)return{done:!0,value:null};for(var e=F;l=Rn&&e<=57},Yn=function(e){return e>=55296&&e<=57343},Xn=function(e){return L(e)||e>=Wn&&e<=Kn||e>=zn&&e<=Vn},Zn=function(e){return e>=zn&&e<=Un},Qn=function(e){return e>=Wn&&e<=Jn},$n=function(e){return Zn(e)||Qn(e)},er=function(e){return e>=Cn},tr=function(e){return e===Xt||e===$t||e===en},nr=function(e){return $n(e)||er(e)||e===un},rr=function(e){return nr(e)||L(e)||e===I},ir=function(e){return e>=jn&&e<=Mn||e===Nn||e>=Pn&&e<=Fn||e===In},ar=function(e,t){return e===Qt?t!==Xt:!1},or=function(e,t,n){return e===I?nr(t)||ar(t,n):nr(e)?!0:!!(e===Qt&&ar(e,t))},sr=function(e,t,n){return e===En||e===I?L(t)?!0:t===An&&L(n):L(e===An?t:e)},cr=function(e){var t=0,n=1;(e[t]===En||e[t]===I)&&(e[t]===I&&(n=-1),t++);for(var r=[];L(e[t]);)r.push(e[t++]);var i=r.length?parseInt(N.apply(void 0,r),10):0;e[t]===An&&t++;for(var a=[];L(e[t]);)a.push(e[t++]);var o=a.length,s=o?parseInt(N.apply(void 0,a),10):0;(e[t]===Gn||e[t]===Bn)&&t++;var c=1;(e[t]===En||e[t]===I)&&(e[t]===I&&(c=-1),t++);for(var l=[];L(e[t]);)l.push(e[t++]);var u=l.length?parseInt(N.apply(void 0,l),10):0;return n*(i+s*10**-o)*10**(c*u)},lr={type:2},ur={type:3},dr={type:4},fr={type:13},pr={type:8},mr={type:21},hr={type:9},gr={type:10},_r={type:11},vr={type:12},yr={type:14},br={type:23},xr={type:1},Sr={type:25},Cr={type:24},wr={type:26},Tr={type:27},Er={type:28},Dr={type:29},Or={type:31},kr={type:32},Ar=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(se(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==kr;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case tn:return this.consumeStringToken(tn);case rn:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(rr(t)||ar(n,r)){var i=or(t,n,r)?qt:Kt,a=this.consumeName();return{type:5,value:a,flags:i}}break;case an:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),fr;break;case sn:return this.consumeStringToken(sn);case cn:return lr;case ln:return ur;case Tn:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),yr;break;case En:if(sr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Dn:return dr;case I:var o=e,s=this.peekCodePoint(0),c=this.peekCodePoint(1);if(sr(o,s,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(or(o,s,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===I&&c===pn)return this.consumeCodePoint(),this.consumeCodePoint(),Cr;break;case An:if(sr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Zt:if(this.peekCodePoint(0)===Tn)for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(l===Tn&&(l=this.consumeCodePoint(),l===Zt)||l===Ln)return this.consumeToken()}break;case On:return wr;case kn:return Tr;case fn:if(this.peekCodePoint(0)===dn&&this.peekCodePoint(1)===I&&this.peekCodePoint(2)===I)return this.consumeCodePoint(),this.consumeCodePoint(),Sr;break;case mn:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),f=this.peekCodePoint(2);if(or(u,d,f)){var a=this.consumeName();return{type:7,value:a}}break;case hn:return Er;case Qt:if(ar(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case gn:return Dr;case _n:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),pr;break;case vn:return _r;case bn:return vr;case Hn:case qn:var p=this.peekCodePoint(0),m=this.peekCodePoint(1);return p===En&&(Xn(m)||m===yn)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case xn:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),hr;if(this.peekCodePoint(0)===xn)return this.consumeCodePoint(),mr;break;case Sn:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),gr;break;case Ln:return kr}return tr(e)?(this.consumeWhiteSpace(),Or):L(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):nr(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:N(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return e===void 0?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Xn(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;t===yn&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var r=parseInt(N.apply(void 0,e.map(function(e){return e===yn?Rn:e})),16),i=parseInt(N.apply(void 0,e.map(function(e){return e===yn?Kn:e})),16);return{type:30,start:r,end:i}}var a=parseInt(N.apply(void 0,e),16);if(this.peekCodePoint(0)===I&&Xn(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];Xn(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var i=parseInt(N.apply(void 0,o),16);return{type:30,start:a,end:i}}else return{type:30,start:a,end:a}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()===`url`&&this.peekCodePoint(0)===cn?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===cn?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ln)return{type:22,value:``};var t=this.peekCodePoint(0);if(t===sn||t===tn){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ln||this.peekCodePoint(0)===ln)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),br)}for(;;){var r=this.consumeCodePoint();if(r===Ln||r===ln)return{type:22,value:N.apply(void 0,e)};if(tr(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Ln||this.peekCodePoint(0)===ln?(this.consumeCodePoint(),{type:22,value:N.apply(void 0,e)}):(this.consumeBadUrlRemnants(),br);if(r===tn||r===sn||r===cn||ir(r))return this.consumeBadUrlRemnants(),br;if(r===Qt)if(ar(r,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),br;else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;tr(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===ln||e===Ln)return;ar(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,n=``;e>0;){var r=Math.min(t,e);n+=N.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),n},e.prototype.consumeStringToken=function(e){var t=``,n=0;do{var r=this._value[n];if(r===Ln||r===void 0||r===e)return t+=this.consumeStringSlice(n),{type:0,value:t};if(r===Xt)return this._value.splice(0,n),xr;if(r===Qt){var i=this._value[n+1];i!==Ln&&i!==void 0&&(i===Xt?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):ar(r,i)&&(t+=this.consumeStringSlice(n),t+=N(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},e.prototype.consumeNumber=function(){var e=[],t=Jt,n=this.peekCodePoint(0);for((n===En||n===I)&&e.push(this.consumeCodePoint());L(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(n===An&&L(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Yt;L(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((n===Gn||n===Bn)&&((r===En||r===I)&&L(i)||L(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Yt;L(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[cr(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),a=this.peekCodePoint(2);if(or(r,i,a)){var o=this.consumeName();return{type:15,number:t,flags:n,unit:o}}return r===on?(this.consumeCodePoint(),{type:16,number:t,flags:n}):{type:17,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Xn(e)){for(var t=N(e);Xn(this.peekCodePoint(0))&&t.length<6;)t+=N(this.consumeCodePoint());tr(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return n===0||Yn(n)||n>1114111?wn:n}return e===Ln?wn:e},e.prototype.consumeName=function(){for(var e=``;;){var t=this.consumeCodePoint();if(rr(t))e+=N(t);else if(ar(t,this.peekCodePoint(0)))e+=N(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},e}(),jr=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new Ar;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw SyntaxError(`Error parsing CSS component value, unexpected EOF`);this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw SyntaxError(`Error parsing CSS component value, multiple values found when expecting only one`)},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===32||zr(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return e===void 0?kr:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),Mr=function(e){return e.type===15},Nr=function(e){return e.type===17},R=function(e){return e.type===20},Pr=function(e){return e.type===0},Fr=function(e,t){return R(e)&&e.value===t},Ir=function(e){return e.type!==31},Lr=function(e){return e.type!==31&&e.type!==4},Rr=function(e){var t=[],n=[];return e.forEach(function(e){if(e.type===4){if(n.length===0)throw Error(`Error parsing function args, zero tokens for arg`);t.push(n),n=[];return}e.type!==31&&n.push(e)}),n.length&&t.push(n),t},zr=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Br=function(e){return e.type===17||e.type===15},z=function(e){return e.type===16||Br(e)},Vr=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},B={type:17,number:0,flags:Jt},Hr={type:16,number:50,flags:Jt},Ur={type:16,number:100,flags:Jt},Wr=function(e,t,n){var r=e[0],i=e[1];return[V(r,t),V(i===void 0?r:i,n)]},V=function(e,t){if(e.type===16)return e.number/100*t;if(Mr(e))switch(e.unit){case`rem`:case`em`:return 16*e.number;case`px`:default:return e.number}return e.number},Gr=`deg`,Kr=`grad`,qr=`rad`,Jr=`turn`,Yr={name:`angle`,parse:function(e,t){if(t.type===15)switch(t.unit){case Gr:return Math.PI*t.number/180;case Kr:return Math.PI/200*t.number;case qr:return t.number;case Jr:return Math.PI*2*t.number}throw Error(`Unsupported angle type`)}},Xr=function(e){return e.type===15&&(e.unit===Gr||e.unit===Kr||e.unit===qr||e.unit===Jr)},Zr=function(e){var t=e.filter(R).map(function(e){return e.value}).join(` `);switch(t){case`to bottom right`:case`to right bottom`:case`left top`:case`top left`:return[B,B];case`to top`:case`bottom`:return H(0);case`to bottom left`:case`to left bottom`:case`right top`:case`top right`:return[B,Ur];case`to right`:case`left`:return H(90);case`to top left`:case`to left top`:case`right bottom`:case`bottom right`:return[Ur,Ur];case`to bottom`:case`top`:return H(180);case`to top right`:case`to right top`:case`left bottom`:case`bottom left`:return[Ur,B];case`to left`:case`right`:return H(270)}return 0},H=function(e){return Math.PI*e/180},Qr={name:`color`,parse:function(e,t){if(t.type===18){var n=ai[t.name];if(n===void 0)throw Error(`Attempting to parse an unsupported color function "`+t.name+`"`);return n(e,t.values)}if(t.type===5){if(t.value.length===3){var r=t.value.substring(0,1),i=t.value.substring(1,2),a=t.value.substring(2,3);return ei(parseInt(r+r,16),parseInt(i+i,16),parseInt(a+a,16),1)}if(t.value.length===4){var r=t.value.substring(0,1),i=t.value.substring(1,2),a=t.value.substring(2,3),o=t.value.substring(3,4);return ei(parseInt(r+r,16),parseInt(i+i,16),parseInt(a+a,16),parseInt(o+o,16)/255)}if(t.value.length===6){var r=t.value.substring(0,2),i=t.value.substring(2,4),a=t.value.substring(4,6);return ei(parseInt(r,16),parseInt(i,16),parseInt(a,16),1)}if(t.value.length===8){var r=t.value.substring(0,2),i=t.value.substring(2,4),a=t.value.substring(4,6),o=t.value.substring(6,8);return ei(parseInt(r,16),parseInt(i,16),parseInt(a,16),parseInt(o,16)/255)}}if(t.type===20){var s=si[t.value.toUpperCase()];if(s!==void 0)return s}return si.TRANSPARENT}},$r=function(e){return(255&e)==0},U=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?`rgba(`+i+`,`+r+`,`+n+`,`+t/255+`)`:`rgb(`+i+`,`+r+`,`+n+`)`},ei=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(r*255)<<0)>>>0},ti=function(e,t){if(e.type===17)return e.number;if(e.type===16){var n=t===3?1:255;return t===3?e.number/100*n:Math.round(e.number/100*n)}return 0},ni=function(e,t){var n=t.filter(Lr);if(n.length===3){var r=n.map(ti),i=r[0],a=r[1],o=r[2];return ei(i,a,o,1)}if(n.length===4){var s=n.map(ti),i=s[0],a=s[1],o=s[2],c=s[3];return ei(i,a,o,c)}return 0};function ri(e,t,n){return n<0&&(n+=1),n>=1&&--n,n<1/6?(t-e)*n*6+e:n<1/2?t:n<2/3?(t-e)*6*(2/3-n)+e:e}var ii=function(e,t){var n=t.filter(Lr),r=n[0],i=n[1],a=n[2],o=n[3],s=(r.type===17?H(r.number):Yr.parse(e,r))/(Math.PI*2),c=z(i)?i.number/100:0,l=z(a)?a.number/100:0,u=o!==void 0&&z(o)?V(o,1):1;if(c===0)return ei(l*255,l*255,l*255,1);var d=l<=.5?l*(c+1):l+c-l*c,f=l*2-d,p=ri(f,d,s+1/3),m=ri(f,d,s),h=ri(f,d,s-1/3);return ei(p*255,m*255,h*255,u)},ai={hsl:ii,hsla:ii,rgb:ni,rgba:ni},oi=function(e,t){return Qr.parse(e,jr.create(t).parseComponentValue())},si={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},ci={name:`background-clip`,initialValue:`border-box`,prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(R(e))switch(e.value){case`padding-box`:return 1;case`content-box`:return 2}return 0})}},li={name:`background-color`,initialValue:`transparent`,prefix:!1,type:3,format:`color`},ui=function(e,t){var n=Qr.parse(e,t[0]),r=t[1];return r&&z(r)?{color:n,stop:r}:{color:n,stop:null}},di=function(e,t){var n=e[0],r=e[e.length-1];n.stop===null&&(n.stop=B),r.stop===null&&(r.stop=Ur);for(var i=[],a=0,o=0;oa?i.push(c):i.push(a),a=c}else i.push(null)}for(var l=null,o=0;oe.optimumDistance)?{optimumCorner:t,optimumDistance:s}:e},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},hi=function(e,t,n,r,i){var a=0,o=0;switch(e.size){case 0:e.shape===0?a=o=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(a=Math.min(Math.abs(t),Math.abs(t-r)),o=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(e.shape===0)a=o=Math.min(W(t,n),W(t,n-i),W(t-r,n),W(t-r,n-i));else if(e.shape===1){var s=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),c=mi(r,i,t,n,!0),l=c[0],u=c[1];a=W(l-t,(u-n)/s),o=s*a}break;case 1:e.shape===0?a=o=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(a=Math.max(Math.abs(t),Math.abs(t-r)),o=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(e.shape===0)a=o=Math.max(W(t,n),W(t,n-i),W(t-r,n),W(t-r,n-i));else if(e.shape===1){var s=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r)),d=mi(r,i,t,n,!1),l=d[0],u=d[1];a=W(l-t,(u-n)/s),o=s*a}break}return Array.isArray(e.size)&&(a=V(e.size[0],r),o=e.size.length===2?V(e.size[1],i):a),[a,o]},gi=function(e,t){var n=H(180),r=[];return Rr(t).forEach(function(t,i){if(i===0){var a=t[0];if(a.type===20&&a.value===`to`){n=Zr(t);return}else if(Xr(a)){n=Yr.parse(e,a);return}}var o=ui(e,t);r.push(o)}),{angle:n,stops:r,type:1}},_i=function(e,t){var n=H(180),r=[];return Rr(t).forEach(function(t,i){if(i===0){var a=t[0];if(a.type===20&&[`top`,`left`,`right`,`bottom`].indexOf(a.value)!==-1){n=Zr(t);return}else if(Xr(a)){n=(Yr.parse(e,a)+H(270))%H(360);return}}var o=ui(e,t);r.push(o)}),{angle:n,stops:r,type:1}},vi=function(e,t){var n=H(180),r=[],i=1,a=0,o=3,s=[];return Rr(t).forEach(function(t,n){var a=t[0];if(n===0){if(R(a)&&a.value===`linear`){i=1;return}else if(R(a)&&a.value===`radial`){i=2;return}}if(a.type===18){if(a.name===`from`){var o=Qr.parse(e,a.values[0]);r.push({stop:B,color:o})}else if(a.name===`to`){var o=Qr.parse(e,a.values[0]);r.push({stop:Ur,color:o})}else if(a.name===`color-stop`){var s=a.values.filter(Lr);if(s.length===2){var o=Qr.parse(e,s[1]),c=s[0];Nr(c)&&r.push({stop:{type:16,number:c.number*100,flags:c.flags},color:o})}}}}),i===1?{angle:(n+H(180))%H(360),stops:r,type:i}:{size:o,shape:a,stops:r,position:s,type:i}},yi=`closest-side`,bi=`farthest-side`,xi=`closest-corner`,Si=`farthest-corner`,Ci=`circle`,wi=`ellipse`,Ti=`cover`,Ei=`contain`,Di=function(e,t){var n=0,r=3,i=[],a=[];return Rr(t).forEach(function(t,o){var s=!0;if(o===0){var c=!1;s=t.reduce(function(e,t){if(c)if(R(t))switch(t.value){case`center`:return a.push(Hr),e;case`top`:case`left`:return a.push(B),e;case`right`:case`bottom`:return a.push(Ur),e}else (z(t)||Br(t))&&a.push(t);else if(R(t))switch(t.value){case Ci:return n=0,!1;case wi:return n=1,!1;case`at`:return c=!0,!1;case yi:return r=0,!1;case Ti:case bi:return r=1,!1;case Ei:case xi:return r=2,!1;case Si:return r=3,!1}else if(Br(t)||z(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},s)}if(s){var l=ui(e,t);i.push(l)}}),{size:r,shape:n,stops:i,position:a,type:2}},Oi=function(e,t){var n=0,r=3,i=[],a=[];return Rr(t).forEach(function(t,o){var s=!0;if(o===0?s=t.reduce(function(e,t){if(R(t))switch(t.value){case`center`:return a.push(Hr),!1;case`top`:case`left`:return a.push(B),!1;case`right`:case`bottom`:return a.push(Ur),!1}else if(z(t)||Br(t))return a.push(t),!1;return e},s):o===1&&(s=t.reduce(function(e,t){if(R(t))switch(t.value){case Ci:return n=0,!1;case wi:return n=1,!1;case Ei:case yi:return r=0,!1;case bi:return r=1,!1;case xi:return r=2,!1;case Ti:case Si:return r=3,!1}else if(Br(t)||z(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},s)),s){var c=ui(e,t);i.push(c)}}),{size:r,shape:n,stops:i,position:a,type:2}},ki=function(e){return e.type===1},Ai=function(e){return e.type===2},ji={name:`image`,parse:function(e,t){if(t.type===22){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(t.type===18){var r=Ni[t.name];if(r===void 0)throw Error(`Attempting to parse an unsupported image function "`+t.name+`"`);return r(e,t.values)}throw Error(`Unsupported image type `+t.type)}};function Mi(e){return!(e.type===20&&e.value===`none`)&&(e.type!==18||!!Ni[e.name])}var Ni={"linear-gradient":gi,"-moz-linear-gradient":_i,"-ms-linear-gradient":_i,"-o-linear-gradient":_i,"-webkit-linear-gradient":_i,"radial-gradient":Di,"-moz-radial-gradient":Oi,"-ms-radial-gradient":Oi,"-o-radial-gradient":Oi,"-webkit-radial-gradient":Oi,"-webkit-gradient":vi},Pi={name:`background-image`,initialValue:`none`,type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var n=t[0];return n.type===20&&n.value===`none`?[]:t.filter(function(e){return Lr(e)&&Mi(e)}).map(function(t){return ji.parse(e,t)})}},Fi={name:`background-origin`,initialValue:`border-box`,prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(R(e))switch(e.value){case`padding-box`:return 1;case`content-box`:return 2}return 0})}},Ii={name:`background-position`,initialValue:`0% 0%`,type:1,prefix:!1,parse:function(e,t){return Rr(t).map(function(e){return e.filter(z)}).map(Vr)}},Li={name:`background-repeat`,initialValue:`repeat`,prefix:!1,type:1,parse:function(e,t){return Rr(t).map(function(e){return e.filter(R).map(function(e){return e.value}).join(` `)}).map(Ri)}},Ri=function(e){switch(e){case`no-repeat`:return 1;case`repeat-x`:case`repeat no-repeat`:return 2;case`repeat-y`:case`no-repeat repeat`:return 3;case`repeat`:default:return 0}},zi;(function(e){e.AUTO=`auto`,e.CONTAIN=`contain`,e.COVER=`cover`})(zi||={});var Bi={name:`background-size`,initialValue:`0`,prefix:!1,type:1,parse:function(e,t){return Rr(t).map(function(e){return e.filter(Vi)})}},Vi=function(e){return R(e)||z(e)},Hi=function(e){return{name:`border-`+e+`-color`,initialValue:`transparent`,prefix:!1,type:3,format:`color`}},Ui=Hi(`top`),Wi=Hi(`right`),Gi=Hi(`bottom`),Ki=Hi(`left`),qi=function(e){return{name:`border-radius-`+e,initialValue:`0 0`,prefix:!1,type:1,parse:function(e,t){return Vr(t.filter(z))}}},Ji=qi(`top-left`),Yi=qi(`top-right`),Xi=qi(`bottom-right`),Zi=qi(`bottom-left`),Qi=function(e){return{name:`border-`+e+`-style`,initialValue:`solid`,prefix:!1,type:2,parse:function(e,t){switch(t){case`none`:return 0;case`dashed`:return 2;case`dotted`:return 3;case`double`:return 4}return 1}}},$i=Qi(`top`),ea=Qi(`right`),ta=Qi(`bottom`),na=Qi(`left`),ra=function(e){return{name:`border-`+e+`-width`,initialValue:`0`,type:0,prefix:!1,parse:function(e,t){return Mr(t)?t.number:0}}},ia=ra(`top`),aa=ra(`right`),oa=ra(`bottom`),sa=ra(`left`),ca={name:`color`,initialValue:`transparent`,prefix:!1,type:3,format:`color`},la={name:`direction`,initialValue:`ltr`,prefix:!1,type:2,parse:function(e,t){switch(t){case`rtl`:return 1;case`ltr`:default:return 0}}},ua={name:`display`,initialValue:`inline-block`,prefix:!1,type:1,parse:function(e,t){return t.filter(R).reduce(function(e,t){return e|da(t.value)},0)}},da=function(e){switch(e){case`block`:case`-webkit-box`:return 2;case`inline`:return 4;case`run-in`:return 8;case`flow`:return 16;case`flow-root`:return 32;case`table`:return 64;case`flex`:case`-webkit-flex`:return 128;case`grid`:case`-ms-grid`:return 256;case`ruby`:return 512;case`subgrid`:return 1024;case`list-item`:return 2048;case`table-row-group`:return 4096;case`table-header-group`:return 8192;case`table-footer-group`:return 16384;case`table-row`:return 32768;case`table-cell`:return 65536;case`table-column-group`:return 131072;case`table-column`:return 262144;case`table-caption`:return 524288;case`ruby-base`:return 1048576;case`ruby-text`:return 2097152;case`ruby-base-container`:return 4194304;case`ruby-text-container`:return 8388608;case`contents`:return 16777216;case`inline-block`:return 33554432;case`inline-list-item`:return 67108864;case`inline-table`:return 134217728;case`inline-flex`:return 268435456;case`inline-grid`:return 536870912}return 0},fa={name:`float`,initialValue:`none`,prefix:!1,type:2,parse:function(e,t){switch(t){case`left`:return 1;case`right`:return 2;case`inline-start`:return 3;case`inline-end`:return 4}return 0}},pa={name:`letter-spacing`,initialValue:`0`,prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value===`normal`?0:t.type===17||t.type===15?t.number:0}},ma;(function(e){e.NORMAL=`normal`,e.STRICT=`strict`})(ma||={});var ha={name:`line-break`,initialValue:`normal`,prefix:!1,type:2,parse:function(e,t){switch(t){case`strict`:return ma.STRICT;case`normal`:default:return ma.NORMAL}}},ga={name:`line-height`,initialValue:`normal`,prefix:!1,type:4},_a=function(e,t){return R(e)&&e.value===`normal`?1.2*t:e.type===17?t*e.number:z(e)?V(e,t):t},va={name:`list-style-image`,initialValue:`none`,type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value===`none`?null:ji.parse(e,t)}},ya={name:`list-style-position`,initialValue:`outside`,prefix:!1,type:2,parse:function(e,t){switch(t){case`inside`:return 0;case`outside`:default:return 1}}},ba={name:`list-style-type`,initialValue:`none`,prefix:!1,type:2,parse:function(e,t){switch(t){case`disc`:return 0;case`circle`:return 1;case`square`:return 2;case`decimal`:return 3;case`cjk-decimal`:return 4;case`decimal-leading-zero`:return 5;case`lower-roman`:return 6;case`upper-roman`:return 7;case`lower-greek`:return 8;case`lower-alpha`:return 9;case`upper-alpha`:return 10;case`arabic-indic`:return 11;case`armenian`:return 12;case`bengali`:return 13;case`cambodian`:return 14;case`cjk-earthly-branch`:return 15;case`cjk-heavenly-stem`:return 16;case`cjk-ideographic`:return 17;case`devanagari`:return 18;case`ethiopic-numeric`:return 19;case`georgian`:return 20;case`gujarati`:return 21;case`gurmukhi`:return 22;case`hebrew`:return 22;case`hiragana`:return 23;case`hiragana-iroha`:return 24;case`japanese-formal`:return 25;case`japanese-informal`:return 26;case`kannada`:return 27;case`katakana`:return 28;case`katakana-iroha`:return 29;case`khmer`:return 30;case`korean-hangul-formal`:return 31;case`korean-hanja-formal`:return 32;case`korean-hanja-informal`:return 33;case`lao`:return 34;case`lower-armenian`:return 35;case`malayalam`:return 36;case`mongolian`:return 37;case`myanmar`:return 38;case`oriya`:return 39;case`persian`:return 40;case`simp-chinese-formal`:return 41;case`simp-chinese-informal`:return 42;case`tamil`:return 43;case`telugu`:return 44;case`thai`:return 45;case`tibetan`:return 46;case`trad-chinese-formal`:return 47;case`trad-chinese-informal`:return 48;case`upper-armenian`:return 49;case`disclosure-open`:return 50;case`disclosure-closed`:return 51;case`none`:default:return-1}}},xa=function(e){return{name:`margin-`+e,initialValue:`0`,prefix:!1,type:4}},Sa=xa(`top`),Ca=xa(`right`),wa=xa(`bottom`),Ta=xa(`left`),Ea={name:`overflow`,initialValue:`visible`,prefix:!1,type:1,parse:function(e,t){return t.filter(R).map(function(e){switch(e.value){case`hidden`:return 1;case`scroll`:return 2;case`clip`:return 3;case`auto`:return 4;case`visible`:default:return 0}})}},Da={name:`overflow-wrap`,initialValue:`normal`,prefix:!1,type:2,parse:function(e,t){switch(t){case`break-word`:return`break-word`;case`normal`:default:return`normal`}}},Oa=function(e){return{name:`padding-`+e,initialValue:`0`,prefix:!1,type:3,format:`length-percentage`}},ka=Oa(`top`),Aa=Oa(`right`),ja=Oa(`bottom`),Ma=Oa(`left`),Na={name:`text-align`,initialValue:`left`,prefix:!1,type:2,parse:function(e,t){switch(t){case`right`:return 2;case`center`:case`justify`:return 1;case`left`:default:return 0}}},Pa={name:`position`,initialValue:`static`,prefix:!1,type:2,parse:function(e,t){switch(t){case`relative`:return 1;case`absolute`:return 2;case`fixed`:return 3;case`sticky`:return 4}return 0}},Fa={name:`text-shadow`,initialValue:`none`,type:1,prefix:!1,parse:function(e,t){return t.length===1&&Fr(t[0],`none`)?[]:Rr(t).map(function(t){for(var n={color:si.TRANSPARENT,offsetX:B,offsetY:B,blur:B},r=0,i=0;i1?1:0],this.overflowWrap=K(e,Da,t.overflowWrap),this.paddingTop=K(e,ka,t.paddingTop),this.paddingRight=K(e,Aa,t.paddingRight),this.paddingBottom=K(e,ja,t.paddingBottom),this.paddingLeft=K(e,Ma,t.paddingLeft),this.paintOrder=K(e,uo,t.paintOrder),this.position=K(e,Pa,t.position),this.textAlign=K(e,Na,t.textAlign),this.textDecorationColor=K(e,Xa,(n=t.textDecorationColor)??t.color),this.textDecorationLine=K(e,Za,(r=t.textDecorationLine)??t.textDecoration),this.textShadow=K(e,Fa,t.textShadow),this.textTransform=K(e,Ia,t.textTransform),this.transform=K(e,La,t.transform),this.transformOrigin=K(e,Ua,t.transformOrigin),this.visibility=K(e,Wa,t.visibility),this.webkitTextStrokeColor=K(e,fo,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=K(e,po,t.webkitTextStrokeWidth),this.wordBreak=K(e,Ka,t.wordBreak),this.zIndex=K(e,qa,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return $r(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return G(this.display,4)||G(this.display,33554432)||G(this.display,268435456)||G(this.display,536870912)||G(this.display,67108864)||G(this.display,134217728)},e}(),ho=function(){function e(e,t){this.content=K(e,ro,t.content),this.quotes=K(e,so,t.quotes)}return e}(),go=function(){function e(e,t){this.counterIncrement=K(e,io,t.counterIncrement),this.counterReset=K(e,ao,t.counterReset)}return e}(),K=function(e,t,n){var r=new Ar,i=n==null?t.initialValue:n.toString();r.write(i);var a=new jr(r.read());switch(t.type){case 2:var o=a.parseComponentValue();return t.parse(e,R(o)?o.value:t.initialValue);case 0:return t.parse(e,a.parseComponentValue());case 1:return t.parse(e,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(t.format){case`angle`:return Yr.parse(e,a.parseComponentValue());case`color`:return Qr.parse(e,a.parseComponentValue());case`image`:return ji.parse(e,a.parseComponentValue());case`length`:var s=a.parseComponentValue();return Br(s)?s:B;case`length-percentage`:var c=a.parseComponentValue();return z(c)?c:B;case`time`:return Ja.parse(e,a.parseComponentValue())}break}},_o=`data-html2canvas-debug`,vo=function(e){var t=e.getAttribute(_o);switch(t){case`all`:return 1;case`clone`:return 2;case`parse`:return 3;case`render`:return 4;default:return 0}},yo=function(e,t){var n=vo(e);return n===1||t===n},bo=function(){function e(e,t){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,yo(t,3))debugger;this.styles=new mo(e,window.getComputedStyle(t,null)),mc(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration=`0s`),this.styles.transform!==null&&(t.style.transform=`none`)),this.bounds=ae(this.context,t),yo(t,4)&&(this.flags|=16)}return e}(),xo=`AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=`,So=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Co=typeof Uint8Array>`u`?[]:new Uint8Array(256),wo=0;wo>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Eo=function(e){for(var t=e.length,n=[],r=0;r>Oo,No=1<>Oo,Io=Mo+Fo,Lo=Io,Ro=32,zo=Lo+Ro,Bo=65536>>ko,Vo=1<=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Oo],t=(t<>Oo)],t=(t<>ko),t=this.index[t],t+=e>>Oo&Ho,t=this.index[t],t=(t<`u`?[]:new Uint8Array(256),Yo=0;Yo=55296&&i<=56319&&n>10)+55296,o%1024+56320)),(i+1===n||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},ms=Go(xo),hs=`×`,gs=`÷`,_s=function(e){return ms.get(e)},vs=function(e,t,n){var r=n-2,i=t[r],a=t[n-1],o=t[n];if(a===Zo&&o===Qo)return hs;if(a===Zo||a===Qo||a===$o||o===Zo||o===Qo||o===$o)return gs;if(a===ns&&[ns,rs,ss,cs].indexOf(o)!==-1||(a===ss||a===rs)&&(o===rs||o===os)||(a===cs||a===os)&&o===os||o===ls||o===es||o===ts||a===Xo)return hs;if(a===ls&&o===us){for(;i===es;)i=t[--r];if(i===us)return hs}if(a===ds&&o===ds){for(var s=0;i===ds;)s++,i=t[--r];if(s%2==0)return hs}return gs},ys=function(e){var t=fs(e),n=t.length,r=0,i=0,a=t.map(_s);return{next:function(){if(r>=n)return{done:!0,value:null};for(var e=hs;ro.x||i.y>o.y;return o=i,t===0?!0:s});return e.body.removeChild(t),s},Cs=function(){return new Image().crossOrigin!==void 0},ws=function(){return typeof new XMLHttpRequest().responseType==`string`},Ts=function(e){var t=new Image,n=e.createElement(`canvas`),r=n.getContext(`2d`);if(!r)return!1;t.src=`data:image/svg+xml,`;try{r.drawImage(t,0,0),n.toDataURL()}catch{return!1}return!0},Es=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},Ds=function(e){var t=e.createElement(`canvas`),n=100;t.width=n,t.height=n;var r=t.getContext(`2d`);if(!r)return Promise.reject(!1);r.fillStyle=`rgb(0, 255, 0)`,r.fillRect(0,0,n,n);var i=new Image,a=t.toDataURL();i.src=a;var o=Os(n,n,0,0,i);return r.fillStyle=`red`,r.fillRect(0,0,n,n),ks(o).then(function(t){r.drawImage(t,0,0);var i=r.getImageData(0,0,n,n).data;r.fillStyle=`red`,r.fillRect(0,0,n,n);var o=e.createElement(`div`);return o.style.backgroundImage=`url(`+a+`)`,o.style.height=n+`px`,Es(i)?ks(Os(n,n,0,0,o)):Promise.reject(!1)}).then(function(e){return r.drawImage(e,0,0),Es(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})},Os=function(e,t,n,r,i){var a=`http://www.w3.org/2000/svg`,o=document.createElementNS(a,`svg`),s=document.createElementNS(a,`foreignObject`);return o.setAttributeNS(null,`width`,e.toString()),o.setAttributeNS(null,`height`,t.toString()),s.setAttributeNS(null,`width`,`100%`),s.setAttributeNS(null,`height`,`100%`),s.setAttributeNS(null,`x`,n.toString()),s.setAttributeNS(null,`y`,r.toString()),s.setAttributeNS(null,`externalResourcesRequired`,`true`),o.appendChild(s),s.appendChild(i),o},ks=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(new XMLSerializer().serializeToString(e))})},q={get SUPPORT_RANGE_BOUNDS(){var e=xs(document);return Object.defineProperty(q,`SUPPORT_RANGE_BOUNDS`,{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=q.SUPPORT_RANGE_BOUNDS&&Ss(document);return Object.defineProperty(q,`SUPPORT_WORD_BREAKING`,{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=Ts(document);return Object.defineProperty(q,`SUPPORT_SVG_DRAWING`,{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from==`function`&&typeof window.fetch==`function`?Ds(document):Promise.resolve(!1);return Object.defineProperty(q,`SUPPORT_FOREIGNOBJECT_DRAWING`,{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=Cs();return Object.defineProperty(q,`SUPPORT_CORS_IMAGES`,{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=ws();return Object.defineProperty(q,`SUPPORT_RESPONSE_TYPE`,{value:e}),e},get SUPPORT_CORS_XHR(){var e=`withCredentials`in new XMLHttpRequest;return Object.defineProperty(q,`SUPPORT_CORS_XHR`,{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<`u`&&Intl.Segmenter);return Object.defineProperty(q,`SUPPORT_NATIVE_TEXT_SEGMENTATION`,{value:e}),e}},As=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),js=function(e,t,n,r){var i=Is(t,n),a=[],o=0;return i.forEach(function(t){if(n.textDecorationLine.length||t.trim().length>0)if(q.SUPPORT_RANGE_BOUNDS){var i=Ns(r,o,t.length).getClientRects();if(i.length>1){var s=Ps(t),c=0;s.forEach(function(t){a.push(new As(t,M.fromDOMRectList(e,Ns(r,c+o,t.length).getClientRects()))),c+=t.length})}else a.push(new As(t,M.fromDOMRectList(e,i)))}else{var l=r.splitText(t.length);a.push(new As(t,Ms(e,r))),r=l}else q.SUPPORT_RANGE_BOUNDS||(r=r.splitText(t.length));o+=t.length}),a},Ms=function(e,t){var n=t.ownerDocument;if(n){var r=n.createElement(`html2canvaswrapper`);r.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(r,t);var a=ae(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),a}}return M.EMPTY},Ns=function(e,t,n){var r=e.ownerDocument;if(!r)throw Error(`Node has no owner document`);var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),i},Ps=function(e){if(q.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:`grapheme`});return Array.from(t.segment(e)).map(function(e){return e.segment})}return bs(e)},Fs=function(e,t){if(q.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:`word`});return Array.from(n.segment(e)).map(function(e){return e.segment})}return Rs(e,t)},Is=function(e,t){return t.letterSpacing===0?Fs(e,t):Ps(e)},Ls=[32,160,4961,65792,65793,4153,4241],Rs=function(e,t){for(var n=Gt(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap===`break-word`?`break-word`:t.wordBreak}),r=[],i,a=function(){if(i.value){var e=i.value.slice(),t=se(e),n=``;t.forEach(function(e){Ls.indexOf(e)===-1?n+=N(e):(n.length&&r.push(n),r.push(N(e)),n=``)}),n.length&&r.push(n)}};!(i=n.next()).done;)a();return r},zs=function(){function e(e,t,n){this.text=Bs(t.data,n.textTransform),this.textBounds=js(e,this.text,n,t)}return e}(),Bs=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(Vs,Hs);case 2:return e.toUpperCase();default:return e}},Vs=/(^|\s|:|-|\(|\))([a-z])/g,Hs=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Us=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.src=n.currentSrc||n.src,r.intrinsicWidth=n.naturalWidth,r.intrinsicHeight=n.naturalHeight,r.context.cache.addImage(r.src),r}return t}(bo),Ws=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.canvas=n,r.intrinsicWidth=n.width,r.intrinsicHeight=n.height,r}return t}(bo),Gs=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=new XMLSerializer,a=ae(t,n);return n.setAttribute(`width`,a.width+`px`),n.setAttribute(`height`,a.height+`px`),r.svg=`data:image/svg+xml,`+encodeURIComponent(i.serializeToString(n)),r.intrinsicWidth=n.width.baseVal.value,r.intrinsicHeight=n.height.baseVal.value,r.context.cache.addImage(r.svg),r}return t}(bo),Ks=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.value=n.value,r}return t}(bo),qs=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.start=n.start,r.reversed=typeof n.reversed==`boolean`&&n.reversed===!0,r}return t}(bo),Js=[{type:15,flags:0,unit:`px`,number:3}],Ys=[{type:16,flags:0,number:50}],Xs=function(e){return e.width>e.height?new M(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width0)n.textNodes.push(new zs(e,i,n.styles));else if(pc(i))if(Ac(i)&&i.assignedNodes)i.assignedNodes().forEach(function(t){return sc(e,t,n,r)});else{var o=cc(e,i);o.styles.isVisible()&&(uc(i,o,r)?o.flags|=4:dc(o.styles)&&(o.flags|=2),oc.indexOf(i.tagName)!==-1&&(o.flags|=8),n.elements.push(o),i.slot,i.shadowRoot?sc(e,i.shadowRoot,o,r):!Oc(i)&&!bc(i)&&!kc(i)&&sc(e,i,o,r))}},cc=function(e,t){return wc(t)?new Us(e,t):Sc(t)?new Ws(e,t):bc(t)?new Gs(e,t):gc(t)?new Ks(e,t):_c(t)?new qs(e,t):vc(t)?new nc(e,t):kc(t)?new rc(e,t):Oc(t)?new ic(e,t):Tc(t)?new ac(e,t):new bo(e,t)},lc=function(e,t){var n=cc(e,t);return n.flags|=4,sc(e,t,n,n),n},uc=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||xc(e)&&n.styles.isTransparent()},dc=function(e){return e.isPositioned()||e.isFloating()},fc=function(e){return e.nodeType===Node.TEXT_NODE},pc=function(e){return e.nodeType===Node.ELEMENT_NODE},mc=function(e){return pc(e)&&e.style!==void 0&&!hc(e)},hc=function(e){return typeof e.className==`object`},gc=function(e){return e.tagName===`LI`},_c=function(e){return e.tagName===`OL`},vc=function(e){return e.tagName===`INPUT`},yc=function(e){return e.tagName===`HTML`},bc=function(e){return e.tagName===`svg`},xc=function(e){return e.tagName===`BODY`},Sc=function(e){return e.tagName===`CANVAS`},Cc=function(e){return e.tagName===`VIDEO`},wc=function(e){return e.tagName===`IMG`},Tc=function(e){return e.tagName===`IFRAME`},Ec=function(e){return e.tagName===`STYLE`},Dc=function(e){return e.tagName===`SCRIPT`},Oc=function(e){return e.tagName===`TEXTAREA`},kc=function(e){return e.tagName===`SELECT`},Ac=function(e){return e.tagName===`SLOT`},jc=function(e){return e.tagName.indexOf(`-`)>0},Mc=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;n!==null&&n.forEach(function(e){var n=t.counters[e.counter];n&&e.increment!==0&&(i=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=e.increment)});var a=[];return i&&r.forEach(function(e){var n=t.counters[e.counter];a.push(e.counter),n||=t.counters[e.counter]=[],n.push(e.reset)}),a},e}(),Nc={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:[`M`,`CM`,`D`,`CD`,`C`,`XC`,`L`,`XL`,`X`,`IX`,`V`,`IV`,`I`]},Pc={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:`Ք.Փ.Ւ.Ց.Ր.Տ.Վ.Ս.Ռ.Ջ.Պ.Չ.Ո.Շ.Ն.Յ.Մ.Ճ.Ղ.Ձ.Հ.Կ.Ծ.Խ.Լ.Ի.Ժ.Թ.Ը.Է.Զ.Ե.Դ.Գ.Բ.Ա`.split(`.`)},Fc={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:`י׳.ט׳.ח׳.ז׳.ו׳.ה׳.ד׳.ג׳.ב׳.א׳.ת.ש.ר.ק.צ.פ.ע.ס.נ.מ.ל.כ.יט.יח.יז.טז.טו.י.ט.ח.ז.ו.ה.ד.ג.ב.א`.split(`.`)},Ic={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:`ჵ.ჰ.ჯ.ჴ.ხ.ჭ.წ.ძ.ც.ჩ.შ.ყ.ღ.ქ.ფ.ჳ.ტ.ს.რ.ჟ.პ.ო.ჲ.ნ.მ.ლ.კ.ი.თ.ჱ.ზ.ვ.ე.დ.გ.ბ.ა`.split(`.`)},Lc=function(e,t,n,r,i,a){return en?Yc(e,i,a.length>0):r.integers.reduce(function(t,n,i){for(;e>=n;)e-=n,t+=r.values[i];return t},``)+a},Rc=function(e,t,n,r){var i=``;do n||e--,i=r(e)+i,e/=t;while(e*t>=t);return i},J=function(e,t,n,r,i){var a=n-t+1;return(e<0?`-`:``)+(Rc(Math.abs(e),a,r,function(e){return N(Math.floor(e%a)+t)})+i)},zc=function(e,t,n){n===void 0&&(n=`. `);var r=t.length;return Rc(Math.abs(e),r,!1,function(e){return t[Math.floor(e%r)]})+n},Bc=1,Vc=2,Hc=4,Uc=8,Wc=function(e,t,n,r,i,a){if(e<-9999||e>9999)return Yc(e,4,i.length>0);var o=Math.abs(e),s=i;if(o===0)return t[0]+s;for(var c=0;o>0&&c<=4;c++){var l=o%10;l===0&&G(a,Bc)&&s!==``?s=t[l]+s:l>1||l===1&&c===0||l===1&&c===1&&G(a,Vc)||l===1&&c===1&&G(a,Hc)&&e>100||l===1&&c>1&&G(a,Uc)?s=t[l]+(c>0?n[c-1]:``)+s:l===1&&c>0&&(s=n[c-1]+s),o=Math.floor(o/10)}return(e<0?r:``)+s},Gc=`十百千萬`,Kc=`拾佰仟萬`,qc=`マイナス`,Jc=`마이너스`,Yc=function(e,t,n){var r=n?`. `:``,i=n?`、`:``,a=n?`, `:``,o=n?` `:``;switch(t){case 0:return`•`+o;case 1:return`◦`+o;case 2:return`◾`+o;case 5:var s=J(e,48,57,!0,r);return s.length<4?`0`+s:s;case 4:return zc(e,`〇一二三四五六七八九`,i);case 6:return Lc(e,1,3999,Nc,3,r).toLowerCase();case 7:return Lc(e,1,3999,Nc,3,r);case 8:return J(e,945,969,!1,r);case 9:return J(e,97,122,!1,r);case 10:return J(e,65,90,!1,r);case 11:return J(e,1632,1641,!0,r);case 12:case 49:return Lc(e,1,9999,Pc,3,r);case 35:return Lc(e,1,9999,Pc,3,r).toLowerCase();case 13:return J(e,2534,2543,!0,r);case 14:case 30:return J(e,6112,6121,!0,r);case 15:return zc(e,`子丑寅卯辰巳午未申酉戌亥`,i);case 16:return zc(e,`甲乙丙丁戊己庚辛壬癸`,i);case 17:case 48:return Wc(e,`零一二三四五六七八九`,Gc,`負`,i,Vc|Hc|Uc);case 47:return Wc(e,`零壹貳參肆伍陸柒捌玖`,Kc,`負`,i,Bc|Vc|Hc|Uc);case 42:return Wc(e,`零一二三四五六七八九`,Gc,`负`,i,Vc|Hc|Uc);case 41:return Wc(e,`零壹贰叁肆伍陆柒捌玖`,Kc,`负`,i,Bc|Vc|Hc|Uc);case 26:return Wc(e,`〇一二三四五六七八九`,`十百千万`,qc,i,0);case 25:return Wc(e,`零壱弐参四伍六七八九`,`拾百千万`,qc,i,Bc|Vc|Hc);case 31:return Wc(e,`영일이삼사오육칠팔구`,`십백천만`,Jc,a,Bc|Vc|Hc);case 33:return Wc(e,`零一二三四五六七八九`,`十百千萬`,Jc,a,0);case 32:return Wc(e,`零壹貳參四五六七八九`,`拾百千`,Jc,a,Bc|Vc|Hc);case 18:return J(e,2406,2415,!0,r);case 20:return Lc(e,1,19999,Ic,3,r);case 21:return J(e,2790,2799,!0,r);case 22:return J(e,2662,2671,!0,r);case 22:return Lc(e,1,10999,Fc,3,r);case 23:return zc(e,`あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん`);case 24:return zc(e,`いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす`);case 27:return J(e,3302,3311,!0,r);case 28:return zc(e,`アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン`,i);case 29:return zc(e,`イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス`,i);case 34:return J(e,3792,3801,!0,r);case 37:return J(e,6160,6169,!0,r);case 38:return J(e,4160,4169,!0,r);case 39:return J(e,2918,2927,!0,r);case 40:return J(e,1776,1785,!0,r);case 43:return J(e,3046,3055,!0,r);case 44:return J(e,3174,3183,!0,r);case 45:return J(e,3664,3673,!0,r);case 46:return J(e,3872,3881,!0,r);case 3:default:return J(e,48,57,!0,r)}},Xc=`data-html2canvas-ignore`,Zc=function(){function e(e,t,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=t,this.counters=new Mc,this.quoteDepth=0,!t.ownerDocument)throw Error(`Cloned element does not have an owner document`);this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var n=this,r=$c(e,t);if(!r.contentWindow)return Promise.reject(`Unable to find iframe window`);var i=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,o=r.contentWindow,s=o.document,c=nl(r).then(function(){return A(n,void 0,void 0,function(){var e,n;return j(this,function(i){switch(i.label){case 0:return this.scrolledElements.forEach(sl),o&&(o.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==t.top||o.scrollX!==t.left)&&(this.context.logger.warn(`Unable to restore scroll position for cloned document`),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),e=this.options.onclone,n=this.clonedReferenceElement,n===void 0?[2,Promise.reject(`Error finding the `+this.referenceElement.nodeName+` in the cloned document`)]:s.fonts&&s.fonts.ready?[4,s.fonts.ready]:[3,2];case 1:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,tl(s)]:[3,4];case 3:i.sent(),i.label=4;case 4:return typeof e==`function`?[2,Promise.resolve().then(function(){return e(s,n)}).then(function(){return r})]:[2,r]}})})});return s.open(),s.write(al(document.doctype)+``),ol(this.referenceElement.ownerDocument,i,a),s.replaceChild(s.adoptNode(this.documentElement),s.documentElement),s.close(),c},e.prototype.createElementClone=function(e){if(yo(e,2))debugger;if(Sc(e))return this.createCanvasClone(e);if(Cc(e))return this.createVideoClone(e);if(Ec(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return wc(t)&&(wc(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`)),jc(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement(`html2canvascustomelement`);return il(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&typeof t.cssText==`string`?e+t.cssText:e},``),r=e.cloneNode(!1);return r.textContent=n,r}}catch(e){if(this.context.logger.error(`Unable to access cssRules property`,e),e.name!==`SecurityError`)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement(`img`);try{return n.src=e.toDataURL(),n}catch{this.context.logger.info(`Unable to inline canvas contents, canvas is tainted`,e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var i=e.getContext(`2d`),a=r.getContext(`2d`);if(a)if(!this.options.allowTaint&&i)a.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var o=(t=e.getContext(`webgl2`))??e.getContext(`webgl`);if(o){var s=o.getContextAttributes();s?.preserveDrawingBuffer===!1&&this.context.logger.warn(`Unable to clone WebGL context as it has preserveDrawingBuffer=false`,e)}a.drawImage(e,0,0)}return r}catch{this.context.logger.info(`Unable to clone canvas as it is tainted`,e)}return r},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement(`canvas`);t.width=e.offsetWidth,t.height=e.offsetHeight;var n=t.getContext(`2d`);try{return n&&(n.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||n.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info(`Unable to clone video as it is tainted`,e)}var r=e.ownerDocument.createElement(`canvas`);return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,t,n){(!pc(t)||!Dc(t)&&!t.hasAttribute(Xc)&&(typeof this.options.ignoreElements!=`function`||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!pc(t)||!Ec(t))&&e.appendChild(this.cloneNode(t,n))},e.prototype.cloneChildNodes=function(e,t,n){for(var r=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(pc(i)&&Ac(i)&&typeof i.assignedNodes==`function`){var a=i.assignedNodes();a.length&&a.forEach(function(e){return r.appendChildNode(t,e,n)})}else this.appendChildNode(t,i,n)},e.prototype.cloneNode=function(e,t){if(fc(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&pc(e)&&(mc(e)||hc(e))){var r=this.createElementClone(e);r.style.transitionProperty=`none`;var i=n.getComputedStyle(e),a=n.getComputedStyle(e,`:before`),o=n.getComputedStyle(e,`:after`);this.referenceElement===e&&mc(r)&&(this.clonedReferenceElement=r),xc(r)&&pl(r);var s=this.counters.parse(new go(this.context,i)),c=this.resolvePseudoContent(e,r,a,Qc.BEFORE);jc(e)&&(t=!0),Cc(e)||this.cloneChildNodes(e,r,t),c&&r.insertBefore(c,r.firstChild);var l=this.resolvePseudoContent(e,r,o,Qc.AFTER);return l&&r.appendChild(l),this.counters.pop(s),(i&&(this.options.copyStyles||hc(e))&&!Tc(e)||t)&&il(i,r),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(Oc(e)||kc(e))&&(Oc(r)||kc(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var a=n.content,o=t.ownerDocument;if(!(!o||!a||a===`none`||a===`-moz-alt-content`||n.display===`none`)){this.counters.parse(new go(this.context,n));var s=new ho(this.context,n),c=o.createElement(`html2canvaspseudoelement`);il(n,c),s.content.forEach(function(t){if(t.type===0)c.appendChild(o.createTextNode(t.value));else if(t.type===22){var n=o.createElement(`img`);n.src=t.value,n.style.opacity=`1`,c.appendChild(n)}else if(t.type===18){if(t.name===`attr`){var r=t.values.filter(R);r.length&&c.appendChild(o.createTextNode(e.getAttribute(r[0].value)||``))}else if(t.name===`counter`){var a=t.values.filter(Lr),l=a[0],u=a[1];if(l&&R(l)){var d=i.counters.getCounterValue(l.value),f=u&&R(u)?ba.parse(i.context,u.value):3;c.appendChild(o.createTextNode(Yc(d,f,!1)))}}else if(t.name===`counters`){var p=t.values.filter(Lr),l=p[0],m=p[1],u=p[2];if(l&&R(l)){var h=i.counters.getCounterValues(l.value),g=u&&R(u)?ba.parse(i.context,u.value):3,_=m&&m.type===0?m.value:``,v=h.map(function(e){return Yc(e,g,!1)}).join(_);c.appendChild(o.createTextNode(v))}}}else if(t.type===20)switch(t.value){case`open-quote`:c.appendChild(o.createTextNode(co(s.quotes,i.quoteDepth++,!0)));break;case`close-quote`:c.appendChild(o.createTextNode(co(s.quotes,--i.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(t.value))}}),c.className=ul+` `+dl;var l=r===Qc.BEFORE?` `+ul:` `+dl;return hc(t)?t.className.baseValue+=l:t.className+=l,c}}},e.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},e}(),Qc;(function(e){e[e.BEFORE=0]=`BEFORE`,e[e.AFTER=1]=`AFTER`})(Qc||={});var $c=function(e,t){var n=e.createElement(`iframe`);return n.className=`html2canvas-container`,n.style.visibility=`hidden`,n.style.position=`fixed`,n.style.left=`-10000px`,n.style.top=`0px`,n.style.border=`0`,n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling=`no`,n.setAttribute(Xc,`true`),e.body.appendChild(n),n},el=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},tl=function(e){return Promise.all([].slice.call(e.images,0).map(el))},nl=function(e){return new Promise(function(t,n){var r=e.contentWindow;if(!r)return n(`No window assigned for iframe`);var i=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var n=setInterval(function(){i.body.childNodes.length>0&&i.readyState===`complete`&&(clearInterval(n),t(e))},50)}})},rl=[`all`,`d`,`content`],il=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);rl.indexOf(r)===-1&&t.style.setProperty(r,e.getPropertyValue(r))}return t},al=function(e){var t=``;return e&&(t+=``),t},ol=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},sl=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},cl=`:before`,ll=`:after`,ul=`___html2canvas___pseudoelement_before`,dl=`___html2canvas___pseudoelement_after`,fl=`{ +import{d as e}from"./theme-color-DY2bNlFZ.js";import{cB as t,cO as n,d$ as r,dS as i,dU as a,dV as o,dY as s,dZ as c,d_ as l,dn as u,e2 as d,e4 as f,e5 as p,e6 as m,e7 as h,e8 as g,e9 as _,ec as v,ed as y,ee as b,ef as x,ei as S,em as C,en as w,ep as T,eq as E}from"./index-BF1-WNuF.js";import{b as ee}from"./browser-bFm1l1qg.js";const D=[`accept`,`multiple`];var te=r({__name:`BasicInputFile`,props:d({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=v(e,`modelValue`),n=S(),r=S(!1),i=u(r,150);function a(e){let i=e.target;i.files&&i.files.length>0&&(n.value=i.files[0]),t.value=Array.from(i.files||[]),r.value=!1}return(e,c)=>(h(),s(`label`,{relative:``,"cursor-pointer":``,onDragover:c[0]||=e=>r.value=!0,onDragleave:c[1]||=e=>r.value=!1},[o(`input`,{type:`file`,accept:e.accept,multiple:e.multiple,class:`absolute inset-0 h-full w-full opacity-0`,onChange:a},null,40,D),_(e.$slots,`default`,{isDragging:C(i),firstFile:n.value,files:t.value})],32))}}),ne=te,O=function(e,t){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},O(e,t)};function k(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);O(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var re=function(){return re=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]=55296&&i<=56319&&n>10)+55296,o%1024+56320)),(i+1===n||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},ce=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,le=typeof Uint8Array>`u`?[]:new Uint8Array(256),ue=0;ue`u`?[]:new Uint8Array(256),pe=0;pe>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},he=function(e){for(var t=e.length,n=[],r=0;r>_e,Se=1<<_e,Ce=Se-1,we=1024>>_e,Te=xe+we,Ee=Te,De=32,Oe=Ee+De,ke=65536>>ve,Ae=1<=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>_e],t=(t<>_e)],t=(t<>ve),t=this.index[t],t+=e>>_e&je,t=this.index[t],t=(t<`u`?[]:new Uint8Array(256),Re=0;ReBe?(i.push(!0),o-=Be):i.push(!1),[`normal`,`auto`,`loose`].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(e)!==-1)return r.push(a),n.push(tt);if(o===We||o===Xe){if(a===0)return r.push(a),n.push(mt);var s=n[a-1];return It.indexOf(s)===-1?(r.push(r[a-1]),n.push(s)):(r.push(a),n.push(mt))}if(r.push(a),o===ht)return n.push(t===`strict`?ot:xt);if(o===Et||o===pt)return n.push(mt);if(o===Dt)return e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(xt):n.push(mt);n.push(o)}),[r,n,i]},Bt=function(e,t,n,r){var i=r[n];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var a=n;a<=r.length;){a++;var o=r[a];if(o===t)return!0;if(o!==Ye)break}if(i===Ye)for(var a=n;a>0;){a--;var s=r[a];if(Array.isArray(e)?e.indexOf(s)!==-1:e===s)for(var c=n;c<=r.length;){c++;var o=r[c];if(o===t)return!0;if(o!==Ye)break}if(s!==Ye)break}return!1},Vt=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r===Ye)n--;else return r}return 0},Ht=function(e,t,n,r,i){if(n[r]===0)return F;var a=r-1;if(Array.isArray(i)&&i[a]===!0)return F;var o=a-1,s=a+1,c=t[a],l=o>=0?t[o]:0,u=t[s];if(c===He&&u===Ue)return F;if(Nt.indexOf(c)!==-1)return kt;if(Nt.indexOf(u)!==-1||Pt.indexOf(u)!==-1)return F;if(Vt(a,t)===qe)return At;if(jt.get(e[a])===Xe||(c===gt||c===_t)&&jt.get(e[s])===Xe||c===Ke||u===Ke||c===Je||[Ye,Qe,et].indexOf(c)===-1&&u===Je||[nt,rt,it,lt,ft].indexOf(u)!==-1||Vt(a,t)===st||Bt(ct,st,a,t)||Bt([nt,rt],ot,a,t)||Bt(Ze,Ze,a,t))return F;if(c===Ye)return At;if(c===ct||u===ct)return F;if(u===tt||c===tt)return At;if([Qe,et,ot].indexOf(u)!==-1||c===$e||l===bt&&Rt.indexOf(c)!==-1||c===ft&&u===bt||u===at||Mt.indexOf(u)!==-1&&c===P||Mt.indexOf(c)!==-1&&u===P||c===dt&&[xt,gt,_t].indexOf(u)!==-1||[xt,gt,_t].indexOf(c)!==-1&&u===ut||Mt.indexOf(c)!==-1&&Ft.indexOf(u)!==-1||Ft.indexOf(c)!==-1&&Mt.indexOf(u)!==-1||[dt,ut].indexOf(c)!==-1&&(u===P||[st,et].indexOf(u)!==-1&&t[s+1]===P)||[st,et].indexOf(c)!==-1&&u===P||c===P&&[P,ft,lt].indexOf(u)!==-1)return F;if([P,ft,lt,nt,rt].indexOf(u)!==-1)for(var d=a;d>=0;){var f=t[d];if(f===P)return F;if([ft,lt].indexOf(f)!==-1)d--;else break}if([dt,ut].indexOf(u)!==-1)for(var d=[nt,rt].indexOf(c)===-1?a:o;d>=0;){var f=t[d];if(f===P)return F;if([ft,lt].indexOf(f)!==-1)d--;else break}if(St===c&&[St,Ct,vt,yt].indexOf(u)!==-1||[Ct,vt].indexOf(c)!==-1&&[Ct,wt].indexOf(u)!==-1||[wt,yt].indexOf(c)!==-1&&u===wt||Lt.indexOf(c)!==-1&&[at,ut].indexOf(u)!==-1||Lt.indexOf(u)!==-1&&c===dt||Mt.indexOf(c)!==-1&&Mt.indexOf(u)!==-1||c===lt&&Mt.indexOf(u)!==-1||Mt.concat(P).indexOf(c)!==-1&&u===st&&Ot.indexOf(e[s])===-1||Mt.concat(P).indexOf(u)!==-1&&c===rt)return F;if(c===Tt&&u===Tt){for(var p=n[a],m=1;p>0&&(p--,t[p]===Tt);)m++;if(m%2!=0)return F}return c===gt&&u===_t?F:At},Ut=function(e,t){t||={lineBreak:`normal`,wordBreak:`normal`};var n=zt(e,t.lineBreak),r=n[0],i=n[1],a=n[2];(t.wordBreak===`break-all`||t.wordBreak===`break-word`)&&(i=i.map(function(e){return[P,mt,Et].indexOf(e)===-1?e:xt}));var o=t.wordBreak===`keep-all`?a.map(function(t,n){return t&&e[n]>=19968&&e[n]<=40959}):void 0;return[r,i,o]},Wt=function(){function e(e,t,n,r){this.codePoints=e,this.required=t===kt,this.start=n,this.end=r}return e.prototype.slice=function(){return N.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),Gt=function(e,t){var n=se(e),r=Ut(n,t),i=r[0],a=r[1],o=r[2],s=n.length,c=0,l=0;return{next:function(){if(l>=s)return{done:!0,value:null};for(var e=F;l=Rn&&e<=57},Yn=function(e){return e>=55296&&e<=57343},Xn=function(e){return L(e)||e>=Wn&&e<=Kn||e>=zn&&e<=Vn},Zn=function(e){return e>=zn&&e<=Un},Qn=function(e){return e>=Wn&&e<=Jn},$n=function(e){return Zn(e)||Qn(e)},er=function(e){return e>=Cn},tr=function(e){return e===Xt||e===$t||e===en},nr=function(e){return $n(e)||er(e)||e===un},rr=function(e){return nr(e)||L(e)||e===I},ir=function(e){return e>=jn&&e<=Mn||e===Nn||e>=Pn&&e<=Fn||e===In},ar=function(e,t){return e===Qt?t!==Xt:!1},or=function(e,t,n){return e===I?nr(t)||ar(t,n):nr(e)?!0:!!(e===Qt&&ar(e,t))},sr=function(e,t,n){return e===En||e===I?L(t)?!0:t===An&&L(n):L(e===An?t:e)},cr=function(e){var t=0,n=1;(e[t]===En||e[t]===I)&&(e[t]===I&&(n=-1),t++);for(var r=[];L(e[t]);)r.push(e[t++]);var i=r.length?parseInt(N.apply(void 0,r),10):0;e[t]===An&&t++;for(var a=[];L(e[t]);)a.push(e[t++]);var o=a.length,s=o?parseInt(N.apply(void 0,a),10):0;(e[t]===Gn||e[t]===Bn)&&t++;var c=1;(e[t]===En||e[t]===I)&&(e[t]===I&&(c=-1),t++);for(var l=[];L(e[t]);)l.push(e[t++]);var u=l.length?parseInt(N.apply(void 0,l),10):0;return n*(i+s*10**-o)*10**(c*u)},lr={type:2},ur={type:3},dr={type:4},fr={type:13},pr={type:8},mr={type:21},hr={type:9},gr={type:10},_r={type:11},vr={type:12},yr={type:14},br={type:23},xr={type:1},Sr={type:25},Cr={type:24},wr={type:26},Tr={type:27},Er={type:28},Dr={type:29},Or={type:31},kr={type:32},Ar=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(se(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==kr;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case tn:return this.consumeStringToken(tn);case rn:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(rr(t)||ar(n,r)){var i=or(t,n,r)?qt:Kt,a=this.consumeName();return{type:5,value:a,flags:i}}break;case an:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),fr;break;case sn:return this.consumeStringToken(sn);case cn:return lr;case ln:return ur;case Tn:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),yr;break;case En:if(sr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Dn:return dr;case I:var o=e,s=this.peekCodePoint(0),c=this.peekCodePoint(1);if(sr(o,s,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(or(o,s,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===I&&c===pn)return this.consumeCodePoint(),this.consumeCodePoint(),Cr;break;case An:if(sr(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Zt:if(this.peekCodePoint(0)===Tn)for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(l===Tn&&(l=this.consumeCodePoint(),l===Zt)||l===Ln)return this.consumeToken()}break;case On:return wr;case kn:return Tr;case fn:if(this.peekCodePoint(0)===dn&&this.peekCodePoint(1)===I&&this.peekCodePoint(2)===I)return this.consumeCodePoint(),this.consumeCodePoint(),Sr;break;case mn:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),f=this.peekCodePoint(2);if(or(u,d,f)){var a=this.consumeName();return{type:7,value:a}}break;case hn:return Er;case Qt:if(ar(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case gn:return Dr;case _n:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),pr;break;case vn:return _r;case bn:return vr;case Hn:case qn:var p=this.peekCodePoint(0),m=this.peekCodePoint(1);return p===En&&(Xn(m)||m===yn)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case xn:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),hr;if(this.peekCodePoint(0)===xn)return this.consumeCodePoint(),mr;break;case Sn:if(this.peekCodePoint(0)===nn)return this.consumeCodePoint(),gr;break;case Ln:return kr}return tr(e)?(this.consumeWhiteSpace(),Or):L(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):nr(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:N(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return e===void 0?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Xn(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;t===yn&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var r=parseInt(N.apply(void 0,e.map(function(e){return e===yn?Rn:e})),16),i=parseInt(N.apply(void 0,e.map(function(e){return e===yn?Kn:e})),16);return{type:30,start:r,end:i}}var a=parseInt(N.apply(void 0,e),16);if(this.peekCodePoint(0)===I&&Xn(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];Xn(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();var i=parseInt(N.apply(void 0,o),16);return{type:30,start:a,end:i}}else return{type:30,start:a,end:a}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()===`url`&&this.peekCodePoint(0)===cn?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===cn?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ln)return{type:22,value:``};var t=this.peekCodePoint(0);if(t===sn||t===tn){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Ln||this.peekCodePoint(0)===ln)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),br)}for(;;){var r=this.consumeCodePoint();if(r===Ln||r===ln)return{type:22,value:N.apply(void 0,e)};if(tr(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Ln||this.peekCodePoint(0)===ln?(this.consumeCodePoint(),{type:22,value:N.apply(void 0,e)}):(this.consumeBadUrlRemnants(),br);if(r===tn||r===sn||r===cn||ir(r))return this.consumeBadUrlRemnants(),br;if(r===Qt)if(ar(r,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),br;else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;tr(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===ln||e===Ln)return;ar(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,n=``;e>0;){var r=Math.min(t,e);n+=N.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),n},e.prototype.consumeStringToken=function(e){var t=``,n=0;do{var r=this._value[n];if(r===Ln||r===void 0||r===e)return t+=this.consumeStringSlice(n),{type:0,value:t};if(r===Xt)return this._value.splice(0,n),xr;if(r===Qt){var i=this._value[n+1];i!==Ln&&i!==void 0&&(i===Xt?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):ar(r,i)&&(t+=this.consumeStringSlice(n),t+=N(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},e.prototype.consumeNumber=function(){var e=[],t=Jt,n=this.peekCodePoint(0);for((n===En||n===I)&&e.push(this.consumeCodePoint());L(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(n===An&&L(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Yt;L(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((n===Gn||n===Bn)&&((r===En||r===I)&&L(i)||L(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Yt;L(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[cr(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),a=this.peekCodePoint(2);if(or(r,i,a)){var o=this.consumeName();return{type:15,number:t,flags:n,unit:o}}return r===on?(this.consumeCodePoint(),{type:16,number:t,flags:n}):{type:17,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Xn(e)){for(var t=N(e);Xn(this.peekCodePoint(0))&&t.length<6;)t+=N(this.consumeCodePoint());tr(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return n===0||Yn(n)||n>1114111?wn:n}return e===Ln?wn:e},e.prototype.consumeName=function(){for(var e=``;;){var t=this.consumeCodePoint();if(rr(t))e+=N(t);else if(ar(t,this.peekCodePoint(0)))e+=N(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}},e}(),jr=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new Ar;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw SyntaxError(`Error parsing CSS component value, unexpected EOF`);this.reconsumeToken(e);var t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw SyntaxError(`Error parsing CSS component value, multiple values found when expecting only one`)},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===32)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===32||zr(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return e===void 0?kr:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),Mr=function(e){return e.type===15},Nr=function(e){return e.type===17},R=function(e){return e.type===20},Pr=function(e){return e.type===0},Fr=function(e,t){return R(e)&&e.value===t},Ir=function(e){return e.type!==31},Lr=function(e){return e.type!==31&&e.type!==4},Rr=function(e){var t=[],n=[];return e.forEach(function(e){if(e.type===4){if(n.length===0)throw Error(`Error parsing function args, zero tokens for arg`);t.push(n),n=[];return}e.type!==31&&n.push(e)}),n.length&&t.push(n),t},zr=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Br=function(e){return e.type===17||e.type===15},z=function(e){return e.type===16||Br(e)},Vr=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},B={type:17,number:0,flags:Jt},Hr={type:16,number:50,flags:Jt},Ur={type:16,number:100,flags:Jt},Wr=function(e,t,n){var r=e[0],i=e[1];return[V(r,t),V(i===void 0?r:i,n)]},V=function(e,t){if(e.type===16)return e.number/100*t;if(Mr(e))switch(e.unit){case`rem`:case`em`:return 16*e.number;case`px`:default:return e.number}return e.number},Gr=`deg`,Kr=`grad`,qr=`rad`,Jr=`turn`,Yr={name:`angle`,parse:function(e,t){if(t.type===15)switch(t.unit){case Gr:return Math.PI*t.number/180;case Kr:return Math.PI/200*t.number;case qr:return t.number;case Jr:return Math.PI*2*t.number}throw Error(`Unsupported angle type`)}},Xr=function(e){return e.type===15&&(e.unit===Gr||e.unit===Kr||e.unit===qr||e.unit===Jr)},Zr=function(e){var t=e.filter(R).map(function(e){return e.value}).join(` `);switch(t){case`to bottom right`:case`to right bottom`:case`left top`:case`top left`:return[B,B];case`to top`:case`bottom`:return H(0);case`to bottom left`:case`to left bottom`:case`right top`:case`top right`:return[B,Ur];case`to right`:case`left`:return H(90);case`to top left`:case`to left top`:case`right bottom`:case`bottom right`:return[Ur,Ur];case`to bottom`:case`top`:return H(180);case`to top right`:case`to right top`:case`left bottom`:case`bottom left`:return[Ur,B];case`to left`:case`right`:return H(270)}return 0},H=function(e){return Math.PI*e/180},Qr={name:`color`,parse:function(e,t){if(t.type===18){var n=ai[t.name];if(n===void 0)throw Error(`Attempting to parse an unsupported color function "`+t.name+`"`);return n(e,t.values)}if(t.type===5){if(t.value.length===3){var r=t.value.substring(0,1),i=t.value.substring(1,2),a=t.value.substring(2,3);return ei(parseInt(r+r,16),parseInt(i+i,16),parseInt(a+a,16),1)}if(t.value.length===4){var r=t.value.substring(0,1),i=t.value.substring(1,2),a=t.value.substring(2,3),o=t.value.substring(3,4);return ei(parseInt(r+r,16),parseInt(i+i,16),parseInt(a+a,16),parseInt(o+o,16)/255)}if(t.value.length===6){var r=t.value.substring(0,2),i=t.value.substring(2,4),a=t.value.substring(4,6);return ei(parseInt(r,16),parseInt(i,16),parseInt(a,16),1)}if(t.value.length===8){var r=t.value.substring(0,2),i=t.value.substring(2,4),a=t.value.substring(4,6),o=t.value.substring(6,8);return ei(parseInt(r,16),parseInt(i,16),parseInt(a,16),parseInt(o,16)/255)}}if(t.type===20){var s=si[t.value.toUpperCase()];if(s!==void 0)return s}return si.TRANSPARENT}},$r=function(e){return(255&e)==0},U=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?`rgba(`+i+`,`+r+`,`+n+`,`+t/255+`)`:`rgb(`+i+`,`+r+`,`+n+`)`},ei=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(r*255)<<0)>>>0},ti=function(e,t){if(e.type===17)return e.number;if(e.type===16){var n=t===3?1:255;return t===3?e.number/100*n:Math.round(e.number/100*n)}return 0},ni=function(e,t){var n=t.filter(Lr);if(n.length===3){var r=n.map(ti),i=r[0],a=r[1],o=r[2];return ei(i,a,o,1)}if(n.length===4){var s=n.map(ti),i=s[0],a=s[1],o=s[2],c=s[3];return ei(i,a,o,c)}return 0};function ri(e,t,n){return n<0&&(n+=1),n>=1&&--n,n<1/6?(t-e)*n*6+e:n<1/2?t:n<2/3?(t-e)*6*(2/3-n)+e:e}var ii=function(e,t){var n=t.filter(Lr),r=n[0],i=n[1],a=n[2],o=n[3],s=(r.type===17?H(r.number):Yr.parse(e,r))/(Math.PI*2),c=z(i)?i.number/100:0,l=z(a)?a.number/100:0,u=o!==void 0&&z(o)?V(o,1):1;if(c===0)return ei(l*255,l*255,l*255,1);var d=l<=.5?l*(c+1):l+c-l*c,f=l*2-d,p=ri(f,d,s+1/3),m=ri(f,d,s),h=ri(f,d,s-1/3);return ei(p*255,m*255,h*255,u)},ai={hsl:ii,hsla:ii,rgb:ni,rgba:ni},oi=function(e,t){return Qr.parse(e,jr.create(t).parseComponentValue())},si={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},ci={name:`background-clip`,initialValue:`border-box`,prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(R(e))switch(e.value){case`padding-box`:return 1;case`content-box`:return 2}return 0})}},li={name:`background-color`,initialValue:`transparent`,prefix:!1,type:3,format:`color`},ui=function(e,t){var n=Qr.parse(e,t[0]),r=t[1];return r&&z(r)?{color:n,stop:r}:{color:n,stop:null}},di=function(e,t){var n=e[0],r=e[e.length-1];n.stop===null&&(n.stop=B),r.stop===null&&(r.stop=Ur);for(var i=[],a=0,o=0;oa?i.push(c):i.push(a),a=c}else i.push(null)}for(var l=null,o=0;oe.optimumDistance)?{optimumCorner:t,optimumDistance:s}:e},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},hi=function(e,t,n,r,i){var a=0,o=0;switch(e.size){case 0:e.shape===0?a=o=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(a=Math.min(Math.abs(t),Math.abs(t-r)),o=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(e.shape===0)a=o=Math.min(W(t,n),W(t,n-i),W(t-r,n),W(t-r,n-i));else if(e.shape===1){var s=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),c=mi(r,i,t,n,!0),l=c[0],u=c[1];a=W(l-t,(u-n)/s),o=s*a}break;case 1:e.shape===0?a=o=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(a=Math.max(Math.abs(t),Math.abs(t-r)),o=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(e.shape===0)a=o=Math.max(W(t,n),W(t,n-i),W(t-r,n),W(t-r,n-i));else if(e.shape===1){var s=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r)),d=mi(r,i,t,n,!1),l=d[0],u=d[1];a=W(l-t,(u-n)/s),o=s*a}break}return Array.isArray(e.size)&&(a=V(e.size[0],r),o=e.size.length===2?V(e.size[1],i):a),[a,o]},gi=function(e,t){var n=H(180),r=[];return Rr(t).forEach(function(t,i){if(i===0){var a=t[0];if(a.type===20&&a.value===`to`){n=Zr(t);return}else if(Xr(a)){n=Yr.parse(e,a);return}}var o=ui(e,t);r.push(o)}),{angle:n,stops:r,type:1}},_i=function(e,t){var n=H(180),r=[];return Rr(t).forEach(function(t,i){if(i===0){var a=t[0];if(a.type===20&&[`top`,`left`,`right`,`bottom`].indexOf(a.value)!==-1){n=Zr(t);return}else if(Xr(a)){n=(Yr.parse(e,a)+H(270))%H(360);return}}var o=ui(e,t);r.push(o)}),{angle:n,stops:r,type:1}},vi=function(e,t){var n=H(180),r=[],i=1,a=0,o=3,s=[];return Rr(t).forEach(function(t,n){var a=t[0];if(n===0){if(R(a)&&a.value===`linear`){i=1;return}else if(R(a)&&a.value===`radial`){i=2;return}}if(a.type===18){if(a.name===`from`){var o=Qr.parse(e,a.values[0]);r.push({stop:B,color:o})}else if(a.name===`to`){var o=Qr.parse(e,a.values[0]);r.push({stop:Ur,color:o})}else if(a.name===`color-stop`){var s=a.values.filter(Lr);if(s.length===2){var o=Qr.parse(e,s[1]),c=s[0];Nr(c)&&r.push({stop:{type:16,number:c.number*100,flags:c.flags},color:o})}}}}),i===1?{angle:(n+H(180))%H(360),stops:r,type:i}:{size:o,shape:a,stops:r,position:s,type:i}},yi=`closest-side`,bi=`farthest-side`,xi=`closest-corner`,Si=`farthest-corner`,Ci=`circle`,wi=`ellipse`,Ti=`cover`,Ei=`contain`,Di=function(e,t){var n=0,r=3,i=[],a=[];return Rr(t).forEach(function(t,o){var s=!0;if(o===0){var c=!1;s=t.reduce(function(e,t){if(c)if(R(t))switch(t.value){case`center`:return a.push(Hr),e;case`top`:case`left`:return a.push(B),e;case`right`:case`bottom`:return a.push(Ur),e}else (z(t)||Br(t))&&a.push(t);else if(R(t))switch(t.value){case Ci:return n=0,!1;case wi:return n=1,!1;case`at`:return c=!0,!1;case yi:return r=0,!1;case Ti:case bi:return r=1,!1;case Ei:case xi:return r=2,!1;case Si:return r=3,!1}else if(Br(t)||z(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},s)}if(s){var l=ui(e,t);i.push(l)}}),{size:r,shape:n,stops:i,position:a,type:2}},Oi=function(e,t){var n=0,r=3,i=[],a=[];return Rr(t).forEach(function(t,o){var s=!0;if(o===0?s=t.reduce(function(e,t){if(R(t))switch(t.value){case`center`:return a.push(Hr),!1;case`top`:case`left`:return a.push(B),!1;case`right`:case`bottom`:return a.push(Ur),!1}else if(z(t)||Br(t))return a.push(t),!1;return e},s):o===1&&(s=t.reduce(function(e,t){if(R(t))switch(t.value){case Ci:return n=0,!1;case wi:return n=1,!1;case Ei:case yi:return r=0,!1;case bi:return r=1,!1;case xi:return r=2,!1;case Ti:case Si:return r=3,!1}else if(Br(t)||z(t))return Array.isArray(r)||(r=[]),r.push(t),!1;return e},s)),s){var c=ui(e,t);i.push(c)}}),{size:r,shape:n,stops:i,position:a,type:2}},ki=function(e){return e.type===1},Ai=function(e){return e.type===2},ji={name:`image`,parse:function(e,t){if(t.type===22){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(t.type===18){var r=Ni[t.name];if(r===void 0)throw Error(`Attempting to parse an unsupported image function "`+t.name+`"`);return r(e,t.values)}throw Error(`Unsupported image type `+t.type)}};function Mi(e){return!(e.type===20&&e.value===`none`)&&(e.type!==18||!!Ni[e.name])}var Ni={"linear-gradient":gi,"-moz-linear-gradient":_i,"-ms-linear-gradient":_i,"-o-linear-gradient":_i,"-webkit-linear-gradient":_i,"radial-gradient":Di,"-moz-radial-gradient":Oi,"-ms-radial-gradient":Oi,"-o-radial-gradient":Oi,"-webkit-radial-gradient":Oi,"-webkit-gradient":vi},Pi={name:`background-image`,initialValue:`none`,type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var n=t[0];return n.type===20&&n.value===`none`?[]:t.filter(function(e){return Lr(e)&&Mi(e)}).map(function(t){return ji.parse(e,t)})}},Fi={name:`background-origin`,initialValue:`border-box`,prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(R(e))switch(e.value){case`padding-box`:return 1;case`content-box`:return 2}return 0})}},Ii={name:`background-position`,initialValue:`0% 0%`,type:1,prefix:!1,parse:function(e,t){return Rr(t).map(function(e){return e.filter(z)}).map(Vr)}},Li={name:`background-repeat`,initialValue:`repeat`,prefix:!1,type:1,parse:function(e,t){return Rr(t).map(function(e){return e.filter(R).map(function(e){return e.value}).join(` `)}).map(Ri)}},Ri=function(e){switch(e){case`no-repeat`:return 1;case`repeat-x`:case`repeat no-repeat`:return 2;case`repeat-y`:case`no-repeat repeat`:return 3;case`repeat`:default:return 0}},zi;(function(e){e.AUTO=`auto`,e.CONTAIN=`contain`,e.COVER=`cover`})(zi||={});var Bi={name:`background-size`,initialValue:`0`,prefix:!1,type:1,parse:function(e,t){return Rr(t).map(function(e){return e.filter(Vi)})}},Vi=function(e){return R(e)||z(e)},Hi=function(e){return{name:`border-`+e+`-color`,initialValue:`transparent`,prefix:!1,type:3,format:`color`}},Ui=Hi(`top`),Wi=Hi(`right`),Gi=Hi(`bottom`),Ki=Hi(`left`),qi=function(e){return{name:`border-radius-`+e,initialValue:`0 0`,prefix:!1,type:1,parse:function(e,t){return Vr(t.filter(z))}}},Ji=qi(`top-left`),Yi=qi(`top-right`),Xi=qi(`bottom-right`),Zi=qi(`bottom-left`),Qi=function(e){return{name:`border-`+e+`-style`,initialValue:`solid`,prefix:!1,type:2,parse:function(e,t){switch(t){case`none`:return 0;case`dashed`:return 2;case`dotted`:return 3;case`double`:return 4}return 1}}},$i=Qi(`top`),ea=Qi(`right`),ta=Qi(`bottom`),na=Qi(`left`),ra=function(e){return{name:`border-`+e+`-width`,initialValue:`0`,type:0,prefix:!1,parse:function(e,t){return Mr(t)?t.number:0}}},ia=ra(`top`),aa=ra(`right`),oa=ra(`bottom`),sa=ra(`left`),ca={name:`color`,initialValue:`transparent`,prefix:!1,type:3,format:`color`},la={name:`direction`,initialValue:`ltr`,prefix:!1,type:2,parse:function(e,t){switch(t){case`rtl`:return 1;case`ltr`:default:return 0}}},ua={name:`display`,initialValue:`inline-block`,prefix:!1,type:1,parse:function(e,t){return t.filter(R).reduce(function(e,t){return e|da(t.value)},0)}},da=function(e){switch(e){case`block`:case`-webkit-box`:return 2;case`inline`:return 4;case`run-in`:return 8;case`flow`:return 16;case`flow-root`:return 32;case`table`:return 64;case`flex`:case`-webkit-flex`:return 128;case`grid`:case`-ms-grid`:return 256;case`ruby`:return 512;case`subgrid`:return 1024;case`list-item`:return 2048;case`table-row-group`:return 4096;case`table-header-group`:return 8192;case`table-footer-group`:return 16384;case`table-row`:return 32768;case`table-cell`:return 65536;case`table-column-group`:return 131072;case`table-column`:return 262144;case`table-caption`:return 524288;case`ruby-base`:return 1048576;case`ruby-text`:return 2097152;case`ruby-base-container`:return 4194304;case`ruby-text-container`:return 8388608;case`contents`:return 16777216;case`inline-block`:return 33554432;case`inline-list-item`:return 67108864;case`inline-table`:return 134217728;case`inline-flex`:return 268435456;case`inline-grid`:return 536870912}return 0},fa={name:`float`,initialValue:`none`,prefix:!1,type:2,parse:function(e,t){switch(t){case`left`:return 1;case`right`:return 2;case`inline-start`:return 3;case`inline-end`:return 4}return 0}},pa={name:`letter-spacing`,initialValue:`0`,prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value===`normal`?0:t.type===17||t.type===15?t.number:0}},ma;(function(e){e.NORMAL=`normal`,e.STRICT=`strict`})(ma||={});var ha={name:`line-break`,initialValue:`normal`,prefix:!1,type:2,parse:function(e,t){switch(t){case`strict`:return ma.STRICT;case`normal`:default:return ma.NORMAL}}},ga={name:`line-height`,initialValue:`normal`,prefix:!1,type:4},_a=function(e,t){return R(e)&&e.value===`normal`?1.2*t:e.type===17?t*e.number:z(e)?V(e,t):t},va={name:`list-style-image`,initialValue:`none`,type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value===`none`?null:ji.parse(e,t)}},ya={name:`list-style-position`,initialValue:`outside`,prefix:!1,type:2,parse:function(e,t){switch(t){case`inside`:return 0;case`outside`:default:return 1}}},ba={name:`list-style-type`,initialValue:`none`,prefix:!1,type:2,parse:function(e,t){switch(t){case`disc`:return 0;case`circle`:return 1;case`square`:return 2;case`decimal`:return 3;case`cjk-decimal`:return 4;case`decimal-leading-zero`:return 5;case`lower-roman`:return 6;case`upper-roman`:return 7;case`lower-greek`:return 8;case`lower-alpha`:return 9;case`upper-alpha`:return 10;case`arabic-indic`:return 11;case`armenian`:return 12;case`bengali`:return 13;case`cambodian`:return 14;case`cjk-earthly-branch`:return 15;case`cjk-heavenly-stem`:return 16;case`cjk-ideographic`:return 17;case`devanagari`:return 18;case`ethiopic-numeric`:return 19;case`georgian`:return 20;case`gujarati`:return 21;case`gurmukhi`:return 22;case`hebrew`:return 22;case`hiragana`:return 23;case`hiragana-iroha`:return 24;case`japanese-formal`:return 25;case`japanese-informal`:return 26;case`kannada`:return 27;case`katakana`:return 28;case`katakana-iroha`:return 29;case`khmer`:return 30;case`korean-hangul-formal`:return 31;case`korean-hanja-formal`:return 32;case`korean-hanja-informal`:return 33;case`lao`:return 34;case`lower-armenian`:return 35;case`malayalam`:return 36;case`mongolian`:return 37;case`myanmar`:return 38;case`oriya`:return 39;case`persian`:return 40;case`simp-chinese-formal`:return 41;case`simp-chinese-informal`:return 42;case`tamil`:return 43;case`telugu`:return 44;case`thai`:return 45;case`tibetan`:return 46;case`trad-chinese-formal`:return 47;case`trad-chinese-informal`:return 48;case`upper-armenian`:return 49;case`disclosure-open`:return 50;case`disclosure-closed`:return 51;case`none`:default:return-1}}},xa=function(e){return{name:`margin-`+e,initialValue:`0`,prefix:!1,type:4}},Sa=xa(`top`),Ca=xa(`right`),wa=xa(`bottom`),Ta=xa(`left`),Ea={name:`overflow`,initialValue:`visible`,prefix:!1,type:1,parse:function(e,t){return t.filter(R).map(function(e){switch(e.value){case`hidden`:return 1;case`scroll`:return 2;case`clip`:return 3;case`auto`:return 4;case`visible`:default:return 0}})}},Da={name:`overflow-wrap`,initialValue:`normal`,prefix:!1,type:2,parse:function(e,t){switch(t){case`break-word`:return`break-word`;case`normal`:default:return`normal`}}},Oa=function(e){return{name:`padding-`+e,initialValue:`0`,prefix:!1,type:3,format:`length-percentage`}},ka=Oa(`top`),Aa=Oa(`right`),ja=Oa(`bottom`),Ma=Oa(`left`),Na={name:`text-align`,initialValue:`left`,prefix:!1,type:2,parse:function(e,t){switch(t){case`right`:return 2;case`center`:case`justify`:return 1;case`left`:default:return 0}}},Pa={name:`position`,initialValue:`static`,prefix:!1,type:2,parse:function(e,t){switch(t){case`relative`:return 1;case`absolute`:return 2;case`fixed`:return 3;case`sticky`:return 4}return 0}},Fa={name:`text-shadow`,initialValue:`none`,type:1,prefix:!1,parse:function(e,t){return t.length===1&&Fr(t[0],`none`)?[]:Rr(t).map(function(t){for(var n={color:si.TRANSPARENT,offsetX:B,offsetY:B,blur:B},r=0,i=0;i1?1:0],this.overflowWrap=K(e,Da,t.overflowWrap),this.paddingTop=K(e,ka,t.paddingTop),this.paddingRight=K(e,Aa,t.paddingRight),this.paddingBottom=K(e,ja,t.paddingBottom),this.paddingLeft=K(e,Ma,t.paddingLeft),this.paintOrder=K(e,uo,t.paintOrder),this.position=K(e,Pa,t.position),this.textAlign=K(e,Na,t.textAlign),this.textDecorationColor=K(e,Xa,(n=t.textDecorationColor)??t.color),this.textDecorationLine=K(e,Za,(r=t.textDecorationLine)??t.textDecoration),this.textShadow=K(e,Fa,t.textShadow),this.textTransform=K(e,Ia,t.textTransform),this.transform=K(e,La,t.transform),this.transformOrigin=K(e,Ua,t.transformOrigin),this.visibility=K(e,Wa,t.visibility),this.webkitTextStrokeColor=K(e,fo,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=K(e,po,t.webkitTextStrokeWidth),this.wordBreak=K(e,Ka,t.wordBreak),this.zIndex=K(e,qa,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return $r(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return G(this.display,4)||G(this.display,33554432)||G(this.display,268435456)||G(this.display,536870912)||G(this.display,67108864)||G(this.display,134217728)},e}(),ho=function(){function e(e,t){this.content=K(e,ro,t.content),this.quotes=K(e,so,t.quotes)}return e}(),go=function(){function e(e,t){this.counterIncrement=K(e,io,t.counterIncrement),this.counterReset=K(e,ao,t.counterReset)}return e}(),K=function(e,t,n){var r=new Ar,i=n==null?t.initialValue:n.toString();r.write(i);var a=new jr(r.read());switch(t.type){case 2:var o=a.parseComponentValue();return t.parse(e,R(o)?o.value:t.initialValue);case 0:return t.parse(e,a.parseComponentValue());case 1:return t.parse(e,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(t.format){case`angle`:return Yr.parse(e,a.parseComponentValue());case`color`:return Qr.parse(e,a.parseComponentValue());case`image`:return ji.parse(e,a.parseComponentValue());case`length`:var s=a.parseComponentValue();return Br(s)?s:B;case`length-percentage`:var c=a.parseComponentValue();return z(c)?c:B;case`time`:return Ja.parse(e,a.parseComponentValue())}break}},_o=`data-html2canvas-debug`,vo=function(e){var t=e.getAttribute(_o);switch(t){case`all`:return 1;case`clone`:return 2;case`parse`:return 3;case`render`:return 4;default:return 0}},yo=function(e,t){var n=vo(e);return n===1||t===n},bo=function(){function e(e,t){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,yo(t,3))debugger;this.styles=new mo(e,window.getComputedStyle(t,null)),mc(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration=`0s`),this.styles.transform!==null&&(t.style.transform=`none`)),this.bounds=ae(this.context,t),yo(t,4)&&(this.flags|=16)}return e}(),xo=`AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=`,So=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Co=typeof Uint8Array>`u`?[]:new Uint8Array(256),wo=0;wo>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Eo=function(e){for(var t=e.length,n=[],r=0;r>Oo,No=1<>Oo,Io=Mo+Fo,Lo=Io,Ro=32,zo=Lo+Ro,Bo=65536>>ko,Vo=1<=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>Oo],t=(t<>Oo)],t=(t<>ko),t=this.index[t],t+=e>>Oo&Ho,t=this.index[t],t=(t<`u`?[]:new Uint8Array(256),Yo=0;Yo=55296&&i<=56319&&n>10)+55296,o%1024+56320)),(i+1===n||r.length>16384)&&(a+=String.fromCharCode.apply(String,r),r.length=0)}return a},ms=Go(xo),hs=`×`,gs=`÷`,_s=function(e){return ms.get(e)},vs=function(e,t,n){var r=n-2,i=t[r],a=t[n-1],o=t[n];if(a===Zo&&o===Qo)return hs;if(a===Zo||a===Qo||a===$o||o===Zo||o===Qo||o===$o)return gs;if(a===ns&&[ns,rs,ss,cs].indexOf(o)!==-1||(a===ss||a===rs)&&(o===rs||o===os)||(a===cs||a===os)&&o===os||o===ls||o===es||o===ts||a===Xo)return hs;if(a===ls&&o===us){for(;i===es;)i=t[--r];if(i===us)return hs}if(a===ds&&o===ds){for(var s=0;i===ds;)s++,i=t[--r];if(s%2==0)return hs}return gs},ys=function(e){var t=fs(e),n=t.length,r=0,i=0,a=t.map(_s);return{next:function(){if(r>=n)return{done:!0,value:null};for(var e=hs;ro.x||i.y>o.y;return o=i,t===0?!0:s});return e.body.removeChild(t),s},Cs=function(){return new Image().crossOrigin!==void 0},ws=function(){return typeof new XMLHttpRequest().responseType==`string`},Ts=function(e){var t=new Image,n=e.createElement(`canvas`),r=n.getContext(`2d`);if(!r)return!1;t.src=`data:image/svg+xml,`;try{r.drawImage(t,0,0),n.toDataURL()}catch{return!1}return!0},Es=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},Ds=function(e){var t=e.createElement(`canvas`),n=100;t.width=n,t.height=n;var r=t.getContext(`2d`);if(!r)return Promise.reject(!1);r.fillStyle=`rgb(0, 255, 0)`,r.fillRect(0,0,n,n);var i=new Image,a=t.toDataURL();i.src=a;var o=Os(n,n,0,0,i);return r.fillStyle=`red`,r.fillRect(0,0,n,n),ks(o).then(function(t){r.drawImage(t,0,0);var i=r.getImageData(0,0,n,n).data;r.fillStyle=`red`,r.fillRect(0,0,n,n);var o=e.createElement(`div`);return o.style.backgroundImage=`url(`+a+`)`,o.style.height=n+`px`,Es(i)?ks(Os(n,n,0,0,o)):Promise.reject(!1)}).then(function(e){return r.drawImage(e,0,0),Es(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})},Os=function(e,t,n,r,i){var a=`http://www.w3.org/2000/svg`,o=document.createElementNS(a,`svg`),s=document.createElementNS(a,`foreignObject`);return o.setAttributeNS(null,`width`,e.toString()),o.setAttributeNS(null,`height`,t.toString()),s.setAttributeNS(null,`width`,`100%`),s.setAttributeNS(null,`height`,`100%`),s.setAttributeNS(null,`x`,n.toString()),s.setAttributeNS(null,`y`,r.toString()),s.setAttributeNS(null,`externalResourcesRequired`,`true`),o.appendChild(s),s.appendChild(i),o},ks=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(new XMLSerializer().serializeToString(e))})},q={get SUPPORT_RANGE_BOUNDS(){var e=xs(document);return Object.defineProperty(q,`SUPPORT_RANGE_BOUNDS`,{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=q.SUPPORT_RANGE_BOUNDS&&Ss(document);return Object.defineProperty(q,`SUPPORT_WORD_BREAKING`,{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=Ts(document);return Object.defineProperty(q,`SUPPORT_SVG_DRAWING`,{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from==`function`&&typeof window.fetch==`function`?Ds(document):Promise.resolve(!1);return Object.defineProperty(q,`SUPPORT_FOREIGNOBJECT_DRAWING`,{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=Cs();return Object.defineProperty(q,`SUPPORT_CORS_IMAGES`,{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=ws();return Object.defineProperty(q,`SUPPORT_RESPONSE_TYPE`,{value:e}),e},get SUPPORT_CORS_XHR(){var e=`withCredentials`in new XMLHttpRequest;return Object.defineProperty(q,`SUPPORT_CORS_XHR`,{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<`u`&&Intl.Segmenter);return Object.defineProperty(q,`SUPPORT_NATIVE_TEXT_SEGMENTATION`,{value:e}),e}},As=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),js=function(e,t,n,r){var i=Is(t,n),a=[],o=0;return i.forEach(function(t){if(n.textDecorationLine.length||t.trim().length>0)if(q.SUPPORT_RANGE_BOUNDS){var i=Ns(r,o,t.length).getClientRects();if(i.length>1){var s=Ps(t),c=0;s.forEach(function(t){a.push(new As(t,M.fromDOMRectList(e,Ns(r,c+o,t.length).getClientRects()))),c+=t.length})}else a.push(new As(t,M.fromDOMRectList(e,i)))}else{var l=r.splitText(t.length);a.push(new As(t,Ms(e,r))),r=l}else q.SUPPORT_RANGE_BOUNDS||(r=r.splitText(t.length));o+=t.length}),a},Ms=function(e,t){var n=t.ownerDocument;if(n){var r=n.createElement(`html2canvaswrapper`);r.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(r,t);var a=ae(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),a}}return M.EMPTY},Ns=function(e,t,n){var r=e.ownerDocument;if(!r)throw Error(`Node has no owner document`);var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),i},Ps=function(e){if(q.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:`grapheme`});return Array.from(t.segment(e)).map(function(e){return e.segment})}return bs(e)},Fs=function(e,t){if(q.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:`word`});return Array.from(n.segment(e)).map(function(e){return e.segment})}return Rs(e,t)},Is=function(e,t){return t.letterSpacing===0?Fs(e,t):Ps(e)},Ls=[32,160,4961,65792,65793,4153,4241],Rs=function(e,t){for(var n=Gt(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap===`break-word`?`break-word`:t.wordBreak}),r=[],i,a=function(){if(i.value){var e=i.value.slice(),t=se(e),n=``;t.forEach(function(e){Ls.indexOf(e)===-1?n+=N(e):(n.length&&r.push(n),r.push(N(e)),n=``)}),n.length&&r.push(n)}};!(i=n.next()).done;)a();return r},zs=function(){function e(e,t,n){this.text=Bs(t.data,n.textTransform),this.textBounds=js(e,this.text,n,t)}return e}(),Bs=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(Vs,Hs);case 2:return e.toUpperCase();default:return e}},Vs=/(^|\s|:|-|\(|\))([a-z])/g,Hs=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Us=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.src=n.currentSrc||n.src,r.intrinsicWidth=n.naturalWidth,r.intrinsicHeight=n.naturalHeight,r.context.cache.addImage(r.src),r}return t}(bo),Ws=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.canvas=n,r.intrinsicWidth=n.width,r.intrinsicHeight=n.height,r}return t}(bo),Gs=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=new XMLSerializer,a=ae(t,n);return n.setAttribute(`width`,a.width+`px`),n.setAttribute(`height`,a.height+`px`),r.svg=`data:image/svg+xml,`+encodeURIComponent(i.serializeToString(n)),r.intrinsicWidth=n.width.baseVal.value,r.intrinsicHeight=n.height.baseVal.value,r.context.cache.addImage(r.svg),r}return t}(bo),Ks=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.value=n.value,r}return t}(bo),qs=function(e){k(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.start=n.start,r.reversed=typeof n.reversed==`boolean`&&n.reversed===!0,r}return t}(bo),Js=[{type:15,flags:0,unit:`px`,number:3}],Ys=[{type:16,flags:0,number:50}],Xs=function(e){return e.width>e.height?new M(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width0)n.textNodes.push(new zs(e,i,n.styles));else if(pc(i))if(Ac(i)&&i.assignedNodes)i.assignedNodes().forEach(function(t){return sc(e,t,n,r)});else{var o=cc(e,i);o.styles.isVisible()&&(uc(i,o,r)?o.flags|=4:dc(o.styles)&&(o.flags|=2),oc.indexOf(i.tagName)!==-1&&(o.flags|=8),n.elements.push(o),i.slot,i.shadowRoot?sc(e,i.shadowRoot,o,r):!Oc(i)&&!bc(i)&&!kc(i)&&sc(e,i,o,r))}},cc=function(e,t){return wc(t)?new Us(e,t):Sc(t)?new Ws(e,t):bc(t)?new Gs(e,t):gc(t)?new Ks(e,t):_c(t)?new qs(e,t):vc(t)?new nc(e,t):kc(t)?new rc(e,t):Oc(t)?new ic(e,t):Tc(t)?new ac(e,t):new bo(e,t)},lc=function(e,t){var n=cc(e,t);return n.flags|=4,sc(e,t,n,n),n},uc=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||xc(e)&&n.styles.isTransparent()},dc=function(e){return e.isPositioned()||e.isFloating()},fc=function(e){return e.nodeType===Node.TEXT_NODE},pc=function(e){return e.nodeType===Node.ELEMENT_NODE},mc=function(e){return pc(e)&&e.style!==void 0&&!hc(e)},hc=function(e){return typeof e.className==`object`},gc=function(e){return e.tagName===`LI`},_c=function(e){return e.tagName===`OL`},vc=function(e){return e.tagName===`INPUT`},yc=function(e){return e.tagName===`HTML`},bc=function(e){return e.tagName===`svg`},xc=function(e){return e.tagName===`BODY`},Sc=function(e){return e.tagName===`CANVAS`},Cc=function(e){return e.tagName===`VIDEO`},wc=function(e){return e.tagName===`IMG`},Tc=function(e){return e.tagName===`IFRAME`},Ec=function(e){return e.tagName===`STYLE`},Dc=function(e){return e.tagName===`SCRIPT`},Oc=function(e){return e.tagName===`TEXTAREA`},kc=function(e){return e.tagName===`SELECT`},Ac=function(e){return e.tagName===`SLOT`},jc=function(e){return e.tagName.indexOf(`-`)>0},Mc=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;n!==null&&n.forEach(function(e){var n=t.counters[e.counter];n&&e.increment!==0&&(i=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=e.increment)});var a=[];return i&&r.forEach(function(e){var n=t.counters[e.counter];a.push(e.counter),n||=t.counters[e.counter]=[],n.push(e.reset)}),a},e}(),Nc={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:[`M`,`CM`,`D`,`CD`,`C`,`XC`,`L`,`XL`,`X`,`IX`,`V`,`IV`,`I`]},Pc={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:`Ք.Փ.Ւ.Ց.Ր.Տ.Վ.Ս.Ռ.Ջ.Պ.Չ.Ո.Շ.Ն.Յ.Մ.Ճ.Ղ.Ձ.Հ.Կ.Ծ.Խ.Լ.Ի.Ժ.Թ.Ը.Է.Զ.Ե.Դ.Գ.Բ.Ա`.split(`.`)},Fc={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:`י׳.ט׳.ח׳.ז׳.ו׳.ה׳.ד׳.ג׳.ב׳.א׳.ת.ש.ר.ק.צ.פ.ע.ס.נ.מ.ל.כ.יט.יח.יז.טז.טו.י.ט.ח.ז.ו.ה.ד.ג.ב.א`.split(`.`)},Ic={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:`ჵ.ჰ.ჯ.ჴ.ხ.ჭ.წ.ძ.ც.ჩ.შ.ყ.ღ.ქ.ფ.ჳ.ტ.ს.რ.ჟ.პ.ო.ჲ.ნ.მ.ლ.კ.ი.თ.ჱ.ზ.ვ.ე.დ.გ.ბ.ა`.split(`.`)},Lc=function(e,t,n,r,i,a){return en?Yc(e,i,a.length>0):r.integers.reduce(function(t,n,i){for(;e>=n;)e-=n,t+=r.values[i];return t},``)+a},Rc=function(e,t,n,r){var i=``;do n||e--,i=r(e)+i,e/=t;while(e*t>=t);return i},J=function(e,t,n,r,i){var a=n-t+1;return(e<0?`-`:``)+(Rc(Math.abs(e),a,r,function(e){return N(Math.floor(e%a)+t)})+i)},zc=function(e,t,n){n===void 0&&(n=`. `);var r=t.length;return Rc(Math.abs(e),r,!1,function(e){return t[Math.floor(e%r)]})+n},Bc=1,Vc=2,Hc=4,Uc=8,Wc=function(e,t,n,r,i,a){if(e<-9999||e>9999)return Yc(e,4,i.length>0);var o=Math.abs(e),s=i;if(o===0)return t[0]+s;for(var c=0;o>0&&c<=4;c++){var l=o%10;l===0&&G(a,Bc)&&s!==``?s=t[l]+s:l>1||l===1&&c===0||l===1&&c===1&&G(a,Vc)||l===1&&c===1&&G(a,Hc)&&e>100||l===1&&c>1&&G(a,Uc)?s=t[l]+(c>0?n[c-1]:``)+s:l===1&&c>0&&(s=n[c-1]+s),o=Math.floor(o/10)}return(e<0?r:``)+s},Gc=`十百千萬`,Kc=`拾佰仟萬`,qc=`マイナス`,Jc=`마이너스`,Yc=function(e,t,n){var r=n?`. `:``,i=n?`、`:``,a=n?`, `:``,o=n?` `:``;switch(t){case 0:return`•`+o;case 1:return`◦`+o;case 2:return`◾`+o;case 5:var s=J(e,48,57,!0,r);return s.length<4?`0`+s:s;case 4:return zc(e,`〇一二三四五六七八九`,i);case 6:return Lc(e,1,3999,Nc,3,r).toLowerCase();case 7:return Lc(e,1,3999,Nc,3,r);case 8:return J(e,945,969,!1,r);case 9:return J(e,97,122,!1,r);case 10:return J(e,65,90,!1,r);case 11:return J(e,1632,1641,!0,r);case 12:case 49:return Lc(e,1,9999,Pc,3,r);case 35:return Lc(e,1,9999,Pc,3,r).toLowerCase();case 13:return J(e,2534,2543,!0,r);case 14:case 30:return J(e,6112,6121,!0,r);case 15:return zc(e,`子丑寅卯辰巳午未申酉戌亥`,i);case 16:return zc(e,`甲乙丙丁戊己庚辛壬癸`,i);case 17:case 48:return Wc(e,`零一二三四五六七八九`,Gc,`負`,i,Vc|Hc|Uc);case 47:return Wc(e,`零壹貳參肆伍陸柒捌玖`,Kc,`負`,i,Bc|Vc|Hc|Uc);case 42:return Wc(e,`零一二三四五六七八九`,Gc,`负`,i,Vc|Hc|Uc);case 41:return Wc(e,`零壹贰叁肆伍陆柒捌玖`,Kc,`负`,i,Bc|Vc|Hc|Uc);case 26:return Wc(e,`〇一二三四五六七八九`,`十百千万`,qc,i,0);case 25:return Wc(e,`零壱弐参四伍六七八九`,`拾百千万`,qc,i,Bc|Vc|Hc);case 31:return Wc(e,`영일이삼사오육칠팔구`,`십백천만`,Jc,a,Bc|Vc|Hc);case 33:return Wc(e,`零一二三四五六七八九`,`十百千萬`,Jc,a,0);case 32:return Wc(e,`零壹貳參四五六七八九`,`拾百千`,Jc,a,Bc|Vc|Hc);case 18:return J(e,2406,2415,!0,r);case 20:return Lc(e,1,19999,Ic,3,r);case 21:return J(e,2790,2799,!0,r);case 22:return J(e,2662,2671,!0,r);case 22:return Lc(e,1,10999,Fc,3,r);case 23:return zc(e,`あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん`);case 24:return zc(e,`いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす`);case 27:return J(e,3302,3311,!0,r);case 28:return zc(e,`アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン`,i);case 29:return zc(e,`イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス`,i);case 34:return J(e,3792,3801,!0,r);case 37:return J(e,6160,6169,!0,r);case 38:return J(e,4160,4169,!0,r);case 39:return J(e,2918,2927,!0,r);case 40:return J(e,1776,1785,!0,r);case 43:return J(e,3046,3055,!0,r);case 44:return J(e,3174,3183,!0,r);case 45:return J(e,3664,3673,!0,r);case 46:return J(e,3872,3881,!0,r);case 3:default:return J(e,48,57,!0,r)}},Xc=`data-html2canvas-ignore`,Zc=function(){function e(e,t,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=t,this.counters=new Mc,this.quoteDepth=0,!t.ownerDocument)throw Error(`Cloned element does not have an owner document`);this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var n=this,r=$c(e,t);if(!r.contentWindow)return Promise.reject(`Unable to find iframe window`);var i=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,o=r.contentWindow,s=o.document,c=nl(r).then(function(){return A(n,void 0,void 0,function(){var e,n;return j(this,function(i){switch(i.label){case 0:return this.scrolledElements.forEach(sl),o&&(o.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==t.top||o.scrollX!==t.left)&&(this.context.logger.warn(`Unable to restore scroll position for cloned document`),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-t.left,o.scrollY-t.top,0,0))),e=this.options.onclone,n=this.clonedReferenceElement,n===void 0?[2,Promise.reject(`Error finding the `+this.referenceElement.nodeName+` in the cloned document`)]:s.fonts&&s.fonts.ready?[4,s.fonts.ready]:[3,2];case 1:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,tl(s)]:[3,4];case 3:i.sent(),i.label=4;case 4:return typeof e==`function`?[2,Promise.resolve().then(function(){return e(s,n)}).then(function(){return r})]:[2,r]}})})});return s.open(),s.write(al(document.doctype)+``),ol(this.referenceElement.ownerDocument,i,a),s.replaceChild(s.adoptNode(this.documentElement),s.documentElement),s.close(),c},e.prototype.createElementClone=function(e){if(yo(e,2))debugger;if(Sc(e))return this.createCanvasClone(e);if(Cc(e))return this.createVideoClone(e);if(Ec(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return wc(t)&&(wc(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`)),jc(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement(`html2canvascustomelement`);return il(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&typeof t.cssText==`string`?e+t.cssText:e},``),r=e.cloneNode(!1);return r.textContent=n,r}}catch(e){if(this.context.logger.error(`Unable to access cssRules property`,e),e.name!==`SecurityError`)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement(`img`);try{return n.src=e.toDataURL(),n}catch{this.context.logger.info(`Unable to inline canvas contents, canvas is tainted`,e)}}var r=e.cloneNode(!1);try{r.width=e.width,r.height=e.height;var i=e.getContext(`2d`),a=r.getContext(`2d`);if(a)if(!this.options.allowTaint&&i)a.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var o=(t=e.getContext(`webgl2`))??e.getContext(`webgl`);if(o){var s=o.getContextAttributes();s?.preserveDrawingBuffer===!1&&this.context.logger.warn(`Unable to clone WebGL context as it has preserveDrawingBuffer=false`,e)}a.drawImage(e,0,0)}return r}catch{this.context.logger.info(`Unable to clone canvas as it is tainted`,e)}return r},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement(`canvas`);t.width=e.offsetWidth,t.height=e.offsetHeight;var n=t.getContext(`2d`);try{return n&&(n.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||n.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info(`Unable to clone video as it is tainted`,e)}var r=e.ownerDocument.createElement(`canvas`);return r.width=e.offsetWidth,r.height=e.offsetHeight,r},e.prototype.appendChildNode=function(e,t,n){(!pc(t)||!Dc(t)&&!t.hasAttribute(Xc)&&(typeof this.options.ignoreElements!=`function`||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!pc(t)||!Ec(t))&&e.appendChild(this.cloneNode(t,n))},e.prototype.cloneChildNodes=function(e,t,n){for(var r=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(pc(i)&&Ac(i)&&typeof i.assignedNodes==`function`){var a=i.assignedNodes();a.length&&a.forEach(function(e){return r.appendChildNode(t,e,n)})}else this.appendChildNode(t,i,n)},e.prototype.cloneNode=function(e,t){if(fc(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&pc(e)&&(mc(e)||hc(e))){var r=this.createElementClone(e);r.style.transitionProperty=`none`;var i=n.getComputedStyle(e),a=n.getComputedStyle(e,`:before`),o=n.getComputedStyle(e,`:after`);this.referenceElement===e&&mc(r)&&(this.clonedReferenceElement=r),xc(r)&&pl(r);var s=this.counters.parse(new go(this.context,i)),c=this.resolvePseudoContent(e,r,a,Qc.BEFORE);jc(e)&&(t=!0),Cc(e)||this.cloneChildNodes(e,r,t),c&&r.insertBefore(c,r.firstChild);var l=this.resolvePseudoContent(e,r,o,Qc.AFTER);return l&&r.appendChild(l),this.counters.pop(s),(i&&(this.options.copyStyles||hc(e))&&!Tc(e)||t)&&il(i,r),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([r,e.scrollLeft,e.scrollTop]),(Oc(e)||kc(e))&&(Oc(r)||kc(r))&&(r.value=e.value),r}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var a=n.content,o=t.ownerDocument;if(!(!o||!a||a===`none`||a===`-moz-alt-content`||n.display===`none`)){this.counters.parse(new go(this.context,n));var s=new ho(this.context,n),c=o.createElement(`html2canvaspseudoelement`);il(n,c),s.content.forEach(function(t){if(t.type===0)c.appendChild(o.createTextNode(t.value));else if(t.type===22){var n=o.createElement(`img`);n.src=t.value,n.style.opacity=`1`,c.appendChild(n)}else if(t.type===18){if(t.name===`attr`){var r=t.values.filter(R);r.length&&c.appendChild(o.createTextNode(e.getAttribute(r[0].value)||``))}else if(t.name===`counter`){var a=t.values.filter(Lr),l=a[0],u=a[1];if(l&&R(l)){var d=i.counters.getCounterValue(l.value),f=u&&R(u)?ba.parse(i.context,u.value):3;c.appendChild(o.createTextNode(Yc(d,f,!1)))}}else if(t.name===`counters`){var p=t.values.filter(Lr),l=p[0],m=p[1],u=p[2];if(l&&R(l)){var h=i.counters.getCounterValues(l.value),g=u&&R(u)?ba.parse(i.context,u.value):3,_=m&&m.type===0?m.value:``,v=h.map(function(e){return Yc(e,g,!1)}).join(_);c.appendChild(o.createTextNode(v))}}}else if(t.type===20)switch(t.value){case`open-quote`:c.appendChild(o.createTextNode(co(s.quotes,i.quoteDepth++,!0)));break;case`close-quote`:c.appendChild(o.createTextNode(co(s.quotes,--i.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(t.value))}}),c.className=ul+` `+dl;var l=r===Qc.BEFORE?` `+ul:` `+dl;return hc(t)?t.className.baseValue+=l:t.className+=l,c}}},e.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},e}(),Qc;(function(e){e[e.BEFORE=0]=`BEFORE`,e[e.AFTER=1]=`AFTER`})(Qc||={});var $c=function(e,t){var n=e.createElement(`iframe`);return n.className=`html2canvas-container`,n.style.visibility=`hidden`,n.style.position=`fixed`,n.style.left=`-10000px`,n.style.top=`0px`,n.style.border=`0`,n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling=`no`,n.setAttribute(Xc,`true`),e.body.appendChild(n),n},el=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},tl=function(e){return Promise.all([].slice.call(e.images,0).map(el))},nl=function(e){return new Promise(function(t,n){var r=e.contentWindow;if(!r)return n(`No window assigned for iframe`);var i=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var n=setInterval(function(){i.body.childNodes.length>0&&i.readyState===`complete`&&(clearInterval(n),t(e))},50)}})},rl=[`all`,`d`,`content`],il=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);rl.indexOf(r)===-1&&t.style.setProperty(r,e.getPropertyValue(r))}return t},al=function(e){var t=``;return e&&(t+=``),t},ol=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},sl=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},cl=`:before`,ll=`:after`,ul=`___html2canvas___pseudoelement_before`,dl=`___html2canvas___pseudoelement_after`,fl=`{ content: "" !important; display: none !important; }`,pl=function(e){ml(e,`.`+ul+cl+fl+` - .`+dl+ll+fl)},ml=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement(`style`);r.textContent=t,e.appendChild(r)}},hl=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):`about:blank`},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement(`a`),e._origin=e.getOrigin(t.location.href)},e._origin=`about:blank`,e}(),gl=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Cl(e)||bl(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return A(this,void 0,void 0,function(){var t,n,r,i,a=this;return j(this,function(o){switch(o.label){case 0:return t=hl.isSameOrigin(e),n=!xl(e)&&this._options.useCORS===!0&&q.SUPPORT_CORS_IMAGES&&!t,r=!xl(e)&&!t&&!Cl(e)&&typeof this._options.proxy==`string`&&q.SUPPORT_CORS_XHR&&!n,!t&&this._options.allowTaint===!1&&!xl(e)&&!Cl(e)&&!r&&!n?[2]:(i=e,r?[4,this.proxy(i)]:[3,2]);case 1:i=o.sent(),o.label=2;case 2:return this.context.logger.debug(`Added image `+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(Sl(i)||n)&&(r.crossOrigin=`anonymous`),r.src=i,r.complete===!0&&setTimeout(function(){return e(r)},500),a._options.imageTimeout>0&&setTimeout(function(){return t(`Timed out (`+a._options.imageTimeout+`ms) loading image`)},a._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(e){return this._cache[e]!==void 0},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw Error(`No proxy defined`);var r=e.substring(0,256);return new Promise(function(i,a){var o=q.SUPPORT_RESPONSE_TYPE?`blob`:`text`,s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(o===`text`)i(s.response);else{var e=new FileReader;e.addEventListener(`load`,function(){return i(e.result)},!1),e.addEventListener(`error`,function(e){return a(e)},!1),e.readAsDataURL(s.response)}else a(`Failed to proxy resource `+r+` with status code `+s.status)},s.onerror=a;var c=n.indexOf(`?`)>-1?`&`:`?`;if(s.open(`GET`,``+n+c+`url=`+encodeURIComponent(e)+`&responseType=`+o),o!==`text`&&s instanceof XMLHttpRequest&&(s.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;s.timeout=l,s.ontimeout=function(){return a(`Timed out (`+l+`ms) proxying `+r)}}s.send()})},e}(),_l=/^data:image\/svg\+xml/i,vl=/^data:image\/.*;base64,/i,yl=/^data:image\/.*/i,bl=function(e){return q.SUPPORT_SVG_DRAWING||!wl(e)},xl=function(e){return yl.test(e)},Sl=function(e){return vl.test(e)},Cl=function(e){return e.substr(0,4)===`blob`},wl=function(e){return e.substr(-3).toLowerCase()===`svg`||_l.test(e)},Y=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Tl=function(e,t,n){return new Y(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},El=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=Tl(this.start,this.startControl,t),i=Tl(this.startControl,this.endControl,t),a=Tl(this.endControl,this.end,t),o=Tl(r,i,t),s=Tl(i,a,t),c=Tl(o,s,t);return n?new e(this.start,r,o,c):new e(c,s,a,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),X=function(e){return e.type===1},Dl=function(){function e(e){var t=e.styles,n=e.bounds,r=Wr(t.borderTopLeftRadius,n.width,n.height),i=r[0],a=r[1],o=Wr(t.borderTopRightRadius,n.width,n.height),s=o[0],c=o[1],l=Wr(t.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],f=Wr(t.borderBottomLeftRadius,n.width,n.height),p=f[0],m=f[1],h=[];h.push((i+s)/n.width),h.push((p+u)/n.width),h.push((a+m)/n.height),h.push((c+d)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,a/=g,s/=g,c/=g,u/=g,d/=g,p/=g,m/=g);var _=n.width-s,v=n.height-d,y=n.width-u,b=n.height-m,x=t.borderTopWidth,S=t.borderRightWidth,C=t.borderBottomWidth,w=t.borderLeftWidth,T=V(t.paddingTop,e.bounds.width),E=V(t.paddingRight,e.bounds.width),ee=V(t.paddingBottom,e.bounds.width),D=V(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?Q(n.left+w/3,n.top+x/3,i-w/3,a-x/3,Z.TOP_LEFT):new Y(n.left+w/3,n.top+x/3),this.topRightBorderDoubleOuterBox=i>0||a>0?Q(n.left+_,n.top+x/3,s-S/3,c-x/3,Z.TOP_RIGHT):new Y(n.left+n.width-S/3,n.top+x/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?Q(n.left+y,n.top+v,u-S/3,d-C/3,Z.BOTTOM_RIGHT):new Y(n.left+n.width-S/3,n.top+n.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Q(n.left+w/3,n.top+b,p-w/3,m-C/3,Z.BOTTOM_LEFT):new Y(n.left+w/3,n.top+n.height-C/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?Q(n.left+w*2/3,n.top+x*2/3,i-w*2/3,a-x*2/3,Z.TOP_LEFT):new Y(n.left+w*2/3,n.top+x*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?Q(n.left+_,n.top+x*2/3,s-S*2/3,c-x*2/3,Z.TOP_RIGHT):new Y(n.left+n.width-S*2/3,n.top+x*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?Q(n.left+y,n.top+v,u-S*2/3,d-C*2/3,Z.BOTTOM_RIGHT):new Y(n.left+n.width-S*2/3,n.top+n.height-C*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Q(n.left+w*2/3,n.top+b,p-w*2/3,m-C*2/3,Z.BOTTOM_LEFT):new Y(n.left+w*2/3,n.top+n.height-C*2/3),this.topLeftBorderStroke=i>0||a>0?Q(n.left+w/2,n.top+x/2,i-w/2,a-x/2,Z.TOP_LEFT):new Y(n.left+w/2,n.top+x/2),this.topRightBorderStroke=i>0||a>0?Q(n.left+_,n.top+x/2,s-S/2,c-x/2,Z.TOP_RIGHT):new Y(n.left+n.width-S/2,n.top+x/2),this.bottomRightBorderStroke=u>0||d>0?Q(n.left+y,n.top+v,u-S/2,d-C/2,Z.BOTTOM_RIGHT):new Y(n.left+n.width-S/2,n.top+n.height-C/2),this.bottomLeftBorderStroke=p>0||m>0?Q(n.left+w/2,n.top+b,p-w/2,m-C/2,Z.BOTTOM_LEFT):new Y(n.left+w/2,n.top+n.height-C/2),this.topLeftBorderBox=i>0||a>0?Q(n.left,n.top,i,a,Z.TOP_LEFT):new Y(n.left,n.top),this.topRightBorderBox=s>0||c>0?Q(n.left+_,n.top,s,c,Z.TOP_RIGHT):new Y(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?Q(n.left+y,n.top+v,u,d,Z.BOTTOM_RIGHT):new Y(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=p>0||m>0?Q(n.left,n.top+b,p,m,Z.BOTTOM_LEFT):new Y(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||a>0?Q(n.left+w,n.top+x,Math.max(0,i-w),Math.max(0,a-x),Z.TOP_LEFT):new Y(n.left+w,n.top+x),this.topRightPaddingBox=s>0||c>0?Q(n.left+Math.min(_,n.width-S),n.top+x,_>n.width+S?0:Math.max(0,s-S),Math.max(0,c-x),Z.TOP_RIGHT):new Y(n.left+n.width-S,n.top+x),this.bottomRightPaddingBox=u>0||d>0?Q(n.left+Math.min(y,n.width-w),n.top+Math.min(v,n.height-C),Math.max(0,u-S),Math.max(0,d-C),Z.BOTTOM_RIGHT):new Y(n.left+n.width-S,n.top+n.height-C),this.bottomLeftPaddingBox=p>0||m>0?Q(n.left+w,n.top+Math.min(b,n.height-C),Math.max(0,p-w),Math.max(0,m-C),Z.BOTTOM_LEFT):new Y(n.left+w,n.top+n.height-C),this.topLeftContentBox=i>0||a>0?Q(n.left+w+D,n.top+x+T,Math.max(0,i-(w+D)),Math.max(0,a-(x+T)),Z.TOP_LEFT):new Y(n.left+w+D,n.top+x+T),this.topRightContentBox=s>0||c>0?Q(n.left+Math.min(_,n.width+w+D),n.top+x+T,_>n.width+w+D?0:s-w+D,c-(x+T),Z.TOP_RIGHT):new Y(n.left+n.width-(S+E),n.top+x+T),this.bottomRightContentBox=u>0||d>0?Q(n.left+Math.min(y,n.width-(w+D)),n.top+Math.min(v,n.height+x+T),Math.max(0,u-(S+E)),d-(C+ee),Z.BOTTOM_RIGHT):new Y(n.left+n.width-(S+E),n.top+n.height-(C+ee)),this.bottomLeftContentBox=p>0||m>0?Q(n.left+w+D,n.top+b,Math.max(0,p-(w+D)),m-(C+ee),Z.BOTTOM_LEFT):new Y(n.left+w+D,n.top+n.height-(C+ee))}return e}(),Z;(function(e){e[e.TOP_LEFT=0]=`TOP_LEFT`,e[e.TOP_RIGHT=1]=`TOP_RIGHT`,e[e.BOTTOM_RIGHT=2]=`BOTTOM_RIGHT`,e[e.BOTTOM_LEFT=3]=`BOTTOM_LEFT`})(Z||={});var Q=function(e,t,n,r,i){var a=4*((Math.sqrt(2)-1)/3),o=n*a,s=r*a,c=e+n,l=t+r;switch(i){case Z.TOP_LEFT:return new El(new Y(e,l),new Y(e,l-s),new Y(c-o,t),new Y(c,t));case Z.TOP_RIGHT:return new El(new Y(e,t),new Y(e+o,t),new Y(c,l-s),new Y(c,l));case Z.BOTTOM_RIGHT:return new El(new Y(c,t),new Y(c,t+s),new Y(e+o,l),new Y(e,l));case Z.BOTTOM_LEFT:default:return new El(new Y(c,l),new Y(c-o,l),new Y(e,t+s),new Y(e,t))}},Ol=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},kl=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Al=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},jl=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),Ml=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Nl=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Pl=function(e){return e.type===0},Fl=function(e){return e.type===1},Il=function(e){return e.type===2},Ll=function(e,t){return e.length===t.length?e.some(function(e,n){return e===t[n]}):!1},Rl=function(e,t,n,r,i){return e.map(function(e,a){switch(a){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e})},zl=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Bl=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Dl(this.container),this.container.styles.opacity<1&&this.effects.push(new Nl(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new jl(n,r,i))}if(this.container.styles.overflowX!==0){var a=Ol(this.curves),o=Al(this.curves);Ll(a,o)?this.effects.push(new Ml(a,6)):(this.effects.push(new Ml(a,2)),this.effects.push(new Ml(o,4)))}}return e.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(e){return!Fl(e)});if(t||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,i),t=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var a=Ol(n.curves),o=Al(n.curves);Ll(a,o)||r.unshift(new Ml(o,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(t){return G(t.target,e)})},e}(),Vl=function(e,t,n,r){e.container.elements.forEach(function(i){var a=G(i.flags,4),o=G(i.flags,2),s=new Bl(i,e);G(i.styles.display,2048)&&r.push(s);var c=G(i.flags,8)?[]:r;if(a||o){var l=a||i.styles.isPositioned()?n:t,u=new zl(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;l.negativeZIndex.some(function(e,t){return d>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),l.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;l.positiveZIndex.some(function(e,t){return d>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),l.positiveZIndex.splice(p,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);Vl(s,u,a?u:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),Vl(s,t,n,c);G(i.flags,8)&&Hl(i,c)})},Hl=function(e,t){for(var n=e instanceof qs?e.start:1,r=e instanceof qs?e.reversed:!1,i=0;i0&&e.intrinsicHeight>0){var r=Xl(e),i=Al(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return A(this,void 0,void 0,function(){var n,r,i,a,o,s,c,c,l,u,d,f,p,m,h,g,_,v,y,c,b,p,g;return j(this,function(x){switch(x.label){case 0:this.applyEffects(e.getEffects(4)),n=e.container,r=e.curves,i=n.styles,a=0,o=n.textNodes,x.label=1;case 1:return a0&&d>0&&(f=r.ctx.createPattern(b,`repeat`),r.renderRepeat(s,f,c,l))):Ai(n)&&(C=$l(e,t,[null,null,null]),s=C[0],w=C[1],T=C[2],u=C[3],d=C[4],E=n.position.length===0?[Hr]:n.position,c=V(E[0],u),l=V(E[E.length-1],d),ee=hi(n,c,l,u,d),D=ee[0],te=ee[1],D>0&&te>0&&(ne=r.ctx.createRadialGradient(w+c,T+l,0,w+c,T+l,D),di(n.stops,D*2).forEach(function(e){return ne.addColorStop(e.stop,U(e.color))}),r.path(s),r.ctx.fillStyle=ne,D===te?r.ctx.fill():(O=e.bounds.left+.5*e.bounds.width,k=e.bounds.top+.5*e.bounds.height,re=te/D,A=1/re,r.ctx.save(),r.ctx.translate(O,k),r.ctx.transform(1,0,0,re,0,0),r.ctx.translate(-O,-k),r.ctx.fillRect(w,A*(T-k)+k,u,d*A),r.ctx.restore()))),j.label=6;case 6:return t--,[2]}})},r=this,i=0,a=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return i0?c.style===2?[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return u.sent(),[3,11];case 5:return c.style===3?[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,3)]:[3,7];case 6:return u.sent(),[3,11];case 7:return c.style===4?[4,this.renderDoubleBorder(c.color,c.width,a,e.curves)]:[3,9];case 8:return u.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,a,e.curves)];case 10:u.sent(),u.label=11;case 11:a++,u.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(e,t,n,r,i){return A(this,void 0,void 0,function(){var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,y,b;return j(this,function(x){return this.ctx.save(),a=ql(r,n),o=Wl(r,n),i===2&&(this.path(o),this.ctx.clip()),X(o[0])?(s=o[0].start.x,c=o[0].start.y):(s=o[0].x,c=o[0].y),X(o[1])?(l=o[1].end.x,u=o[1].end.y):(l=o[1].x,u=o[1].y),d=n===0||n===2?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),i===3?this.formatPath(a):this.formatPath(o.slice(0,2)),f=t<3?t*3:t*2,p=t<3?t*2:t,i===3&&(f=t,p=t),m=!0,d<=f*2?m=!1:d<=f*2+p?(h=d/(2*f+p),f*=h,p*=h):(g=Math.floor((d+p)/(f+p)),_=(d-g*f)/(g-1),v=(d-(g+1)*f)/g,p=v<=0||Math.abs(p-_)D.value.length===0?[wu]:D.value.map(e=>{let t=URL.createObjectURL(e);return v.value.push(()=>URL.revokeObjectURL(t)),t})),O=S(`vibrant`),k=y(`imageRef`),re=y(`canvas`),{updateThemeColor:A}=e(()=>d.value),j=i(()=>O.value===`vibrant`?d.value:O.value===`html2canvas`?_.value:``);async function ie(){if(te.value.length!==0)try{l.value=!0;let e=new ee(te.value[0]),t=await e.getPalette(),n=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`);u.value=n,d.value=t.Vibrant?.hex||t.DarkVibrant?.hex||n[0],await A()}catch(e){console.error(`Color extraction failed:`,e)}finally{l.value=!1}}async function M(){if(k.value)try{l.value=!0;let e=await Cu(k.value,{allowTaint:!0,useCORS:!0,backgroundColor:null,scale:.5,height:100,width:k.value.offsetWidth,logging:!1});if(re.value){let t=re.value.getContext(`2d`);t&&(re.value.width=e.width,re.value.height=e.height,t.drawImage(e,0,0))}let n=e.getContext(`2d`);if(n){let r=n.getImageData(0,0,e.width,20),i=[];for(let e=0;e0&&i.push({mode:`rgb`,r:t,g:n,b:a})}if(i.length>0){let e=t(i);_.value=`rgb(${e.r}, ${e.g}, ${e.b})`}}}catch(e){console.error(`Canvas capture failed:`,e)}finally{l.value=!1}}return p(async()=>{await f(),await ie(),await M()}),b(te,async()=>{await f(),await ie(),await M()}),m(()=>{v.value.forEach(e=>e())}),(e,t)=>(h(),o(`div`,Tu,[a(`div`,Eu,[a(`div`,{class:`pointer-events-none left-0 right-0 top-0 z-10 flex items-center justify-center backdrop-blur-md`,style:T({background:j.value})},t[3]||=[a(`div`,{class:`py-4 text-center text-sm text-white font-medium`},` Top Area `,-1)],4),a(`div`,{class:`transparent-gradient-overlay absolute inset-0 h-[calc((1lh+1rem+1rem)*2)] w-full`,style:T({background:j.value})},null,4),a(`img`,{ref_key:`imageRef`,ref:k,src:te.value[0],class:`h-full max-h-[calc(100dvh-28rem)] w-full object-cover`},null,8,Du),a(`div`,Ou,[c(C(ne),{modelValue:D.value,"onUpdate:modelValue":t[0]||=e=>D.value=e},{default:x(()=>t[4]||=[a(`div`,{class:`rounded-xl bg-black bg-opacity-30 px-5 py-4 text-white backdrop-blur-sm`},` Replace Image `,-1)]),_:1,__:[4]},8,[`modelValue`])])]),a(`div`,ku,[a(`div`,Au,[a(`div`,ju,[a(`h3`,Mu,[t[5]||=a(`span`,null,`Node Vibrant`,-1),a(`button`,{"border-2":``,"border-neutral-300":``,"rounded-xl":``,"border-solid":``,"px-3":``,"py-1":``,"text-sm":``,"font-normal":``,"dark:border-neutral-700":``,class:w([O.value===`vibrant`?`bg-neutral-100 dark:bg-neutral-700`:``]),onClick:t[1]||=e=>O.value=`vibrant`},E(O.value===`vibrant`?`Activated`:`Active`),3)]),a(`div`,Nu,[(h(!0),o(r,null,g(u.value,e=>(h(),o(`div`,{key:e,class:`h-12 w-12 cursor-pointer border-2 border-gray-300 rounded rounded-xl transition-transform duration-200 ease-in-out hover:scale-110 dark:border-gray-900`,style:T({backgroundColor:e}),title:e},null,12,Pu))),128))]),a(`p`,Fu,[t[6]||=s(` Color: `,-1),a(`span`,{style:T({color:d.value})},E(d.value),5)])]),a(`div`,Iu,[a(`h3`,Lu,[t[7]||=a(`span`,null,`html2canvas Top sampling`,-1),a(`button`,{"border-2":``,"border-neutral-300":``,"rounded-xl":``,"border-solid":``,"px-3":``,"py-1":``,"text-sm":``,"font-normal":``,"dark:border-neutral-700":``,class:w([O.value===`html2canvas`?`bg-neutral-100 dark:bg-neutral-700`:``]),onClick:t[2]||=e=>O.value=`html2canvas`},E(O.value===`html2canvas`?`Activated`:`Active`),3)]),a(`div`,Ru,[a(`div`,{class:`color-swatch h-12 w-12 border-2 border-gray-300 rounded rounded-xl dark:border-gray-900`,style:T({backgroundColor:_.value}),title:_.value},null,12,zu)]),a(`p`,Bu,[t[8]||=s(` Color: `,-1),a(`span`,{style:T({color:_.value})},E(_.value),5)])])]),a(`div`,Vu,[t[9]||=a(`h3`,{class:`mb-1 text-lg`},` Captured Canvas (Debug) `,-1),a(`canvas`,Hu,null,512)])])]))}}),Wu=n(Uu,[[`__scopeId`,`data-v-e6e8453f`]]);export{Wu as default}; \ No newline at end of file + .`+dl+ll+fl)},ml=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement(`style`);r.textContent=t,e.appendChild(r)}},hl=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):`about:blank`},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement(`a`),e._origin=e.getOrigin(t.location.href)},e._origin=`about:blank`,e}(),gl=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Cl(e)||bl(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return A(this,void 0,void 0,function(){var t,n,r,i,a=this;return j(this,function(o){switch(o.label){case 0:return t=hl.isSameOrigin(e),n=!xl(e)&&this._options.useCORS===!0&&q.SUPPORT_CORS_IMAGES&&!t,r=!xl(e)&&!t&&!Cl(e)&&typeof this._options.proxy==`string`&&q.SUPPORT_CORS_XHR&&!n,!t&&this._options.allowTaint===!1&&!xl(e)&&!Cl(e)&&!r&&!n?[2]:(i=e,r?[4,this.proxy(i)]:[3,2]);case 1:i=o.sent(),o.label=2;case 2:return this.context.logger.debug(`Added image `+e.substring(0,256)),[4,new Promise(function(e,t){var r=new Image;r.onload=function(){return e(r)},r.onerror=t,(Sl(i)||n)&&(r.crossOrigin=`anonymous`),r.src=i,r.complete===!0&&setTimeout(function(){return e(r)},500),a._options.imageTimeout>0&&setTimeout(function(){return t(`Timed out (`+a._options.imageTimeout+`ms) loading image`)},a._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(e){return this._cache[e]!==void 0},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw Error(`No proxy defined`);var r=e.substring(0,256);return new Promise(function(i,a){var o=q.SUPPORT_RESPONSE_TYPE?`blob`:`text`,s=new XMLHttpRequest;s.onload=function(){if(s.status===200)if(o===`text`)i(s.response);else{var e=new FileReader;e.addEventListener(`load`,function(){return i(e.result)},!1),e.addEventListener(`error`,function(e){return a(e)},!1),e.readAsDataURL(s.response)}else a(`Failed to proxy resource `+r+` with status code `+s.status)},s.onerror=a;var c=n.indexOf(`?`)>-1?`&`:`?`;if(s.open(`GET`,``+n+c+`url=`+encodeURIComponent(e)+`&responseType=`+o),o!==`text`&&s instanceof XMLHttpRequest&&(s.responseType=o),t._options.imageTimeout){var l=t._options.imageTimeout;s.timeout=l,s.ontimeout=function(){return a(`Timed out (`+l+`ms) proxying `+r)}}s.send()})},e}(),_l=/^data:image\/svg\+xml/i,vl=/^data:image\/.*;base64,/i,yl=/^data:image\/.*/i,bl=function(e){return q.SUPPORT_SVG_DRAWING||!wl(e)},xl=function(e){return yl.test(e)},Sl=function(e){return vl.test(e)},Cl=function(e){return e.substr(0,4)===`blob`},wl=function(e){return e.substr(-3).toLowerCase()===`svg`||_l.test(e)},Y=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Tl=function(e,t,n){return new Y(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},El=function(){function e(e,t,n,r){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=Tl(this.start,this.startControl,t),i=Tl(this.startControl,this.endControl,t),a=Tl(this.endControl,this.end,t),o=Tl(r,i,t),s=Tl(i,a,t),c=Tl(o,s,t);return n?new e(this.start,r,o,c):new e(c,s,a,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),X=function(e){return e.type===1},Dl=function(){function e(e){var t=e.styles,n=e.bounds,r=Wr(t.borderTopLeftRadius,n.width,n.height),i=r[0],a=r[1],o=Wr(t.borderTopRightRadius,n.width,n.height),s=o[0],c=o[1],l=Wr(t.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],f=Wr(t.borderBottomLeftRadius,n.width,n.height),p=f[0],m=f[1],h=[];h.push((i+s)/n.width),h.push((p+u)/n.width),h.push((a+m)/n.height),h.push((c+d)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,a/=g,s/=g,c/=g,u/=g,d/=g,p/=g,m/=g);var _=n.width-s,v=n.height-d,y=n.width-u,b=n.height-m,x=t.borderTopWidth,S=t.borderRightWidth,C=t.borderBottomWidth,w=t.borderLeftWidth,T=V(t.paddingTop,e.bounds.width),E=V(t.paddingRight,e.bounds.width),ee=V(t.paddingBottom,e.bounds.width),D=V(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||a>0?Q(n.left+w/3,n.top+x/3,i-w/3,a-x/3,Z.TOP_LEFT):new Y(n.left+w/3,n.top+x/3),this.topRightBorderDoubleOuterBox=i>0||a>0?Q(n.left+_,n.top+x/3,s-S/3,c-x/3,Z.TOP_RIGHT):new Y(n.left+n.width-S/3,n.top+x/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?Q(n.left+y,n.top+v,u-S/3,d-C/3,Z.BOTTOM_RIGHT):new Y(n.left+n.width-S/3,n.top+n.height-C/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Q(n.left+w/3,n.top+b,p-w/3,m-C/3,Z.BOTTOM_LEFT):new Y(n.left+w/3,n.top+n.height-C/3),this.topLeftBorderDoubleInnerBox=i>0||a>0?Q(n.left+w*2/3,n.top+x*2/3,i-w*2/3,a-x*2/3,Z.TOP_LEFT):new Y(n.left+w*2/3,n.top+x*2/3),this.topRightBorderDoubleInnerBox=i>0||a>0?Q(n.left+_,n.top+x*2/3,s-S*2/3,c-x*2/3,Z.TOP_RIGHT):new Y(n.left+n.width-S*2/3,n.top+x*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?Q(n.left+y,n.top+v,u-S*2/3,d-C*2/3,Z.BOTTOM_RIGHT):new Y(n.left+n.width-S*2/3,n.top+n.height-C*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Q(n.left+w*2/3,n.top+b,p-w*2/3,m-C*2/3,Z.BOTTOM_LEFT):new Y(n.left+w*2/3,n.top+n.height-C*2/3),this.topLeftBorderStroke=i>0||a>0?Q(n.left+w/2,n.top+x/2,i-w/2,a-x/2,Z.TOP_LEFT):new Y(n.left+w/2,n.top+x/2),this.topRightBorderStroke=i>0||a>0?Q(n.left+_,n.top+x/2,s-S/2,c-x/2,Z.TOP_RIGHT):new Y(n.left+n.width-S/2,n.top+x/2),this.bottomRightBorderStroke=u>0||d>0?Q(n.left+y,n.top+v,u-S/2,d-C/2,Z.BOTTOM_RIGHT):new Y(n.left+n.width-S/2,n.top+n.height-C/2),this.bottomLeftBorderStroke=p>0||m>0?Q(n.left+w/2,n.top+b,p-w/2,m-C/2,Z.BOTTOM_LEFT):new Y(n.left+w/2,n.top+n.height-C/2),this.topLeftBorderBox=i>0||a>0?Q(n.left,n.top,i,a,Z.TOP_LEFT):new Y(n.left,n.top),this.topRightBorderBox=s>0||c>0?Q(n.left+_,n.top,s,c,Z.TOP_RIGHT):new Y(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?Q(n.left+y,n.top+v,u,d,Z.BOTTOM_RIGHT):new Y(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=p>0||m>0?Q(n.left,n.top+b,p,m,Z.BOTTOM_LEFT):new Y(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||a>0?Q(n.left+w,n.top+x,Math.max(0,i-w),Math.max(0,a-x),Z.TOP_LEFT):new Y(n.left+w,n.top+x),this.topRightPaddingBox=s>0||c>0?Q(n.left+Math.min(_,n.width-S),n.top+x,_>n.width+S?0:Math.max(0,s-S),Math.max(0,c-x),Z.TOP_RIGHT):new Y(n.left+n.width-S,n.top+x),this.bottomRightPaddingBox=u>0||d>0?Q(n.left+Math.min(y,n.width-w),n.top+Math.min(v,n.height-C),Math.max(0,u-S),Math.max(0,d-C),Z.BOTTOM_RIGHT):new Y(n.left+n.width-S,n.top+n.height-C),this.bottomLeftPaddingBox=p>0||m>0?Q(n.left+w,n.top+Math.min(b,n.height-C),Math.max(0,p-w),Math.max(0,m-C),Z.BOTTOM_LEFT):new Y(n.left+w,n.top+n.height-C),this.topLeftContentBox=i>0||a>0?Q(n.left+w+D,n.top+x+T,Math.max(0,i-(w+D)),Math.max(0,a-(x+T)),Z.TOP_LEFT):new Y(n.left+w+D,n.top+x+T),this.topRightContentBox=s>0||c>0?Q(n.left+Math.min(_,n.width+w+D),n.top+x+T,_>n.width+w+D?0:s-w+D,c-(x+T),Z.TOP_RIGHT):new Y(n.left+n.width-(S+E),n.top+x+T),this.bottomRightContentBox=u>0||d>0?Q(n.left+Math.min(y,n.width-(w+D)),n.top+Math.min(v,n.height+x+T),Math.max(0,u-(S+E)),d-(C+ee),Z.BOTTOM_RIGHT):new Y(n.left+n.width-(S+E),n.top+n.height-(C+ee)),this.bottomLeftContentBox=p>0||m>0?Q(n.left+w+D,n.top+b,Math.max(0,p-(w+D)),m-(C+ee),Z.BOTTOM_LEFT):new Y(n.left+w+D,n.top+n.height-(C+ee))}return e}(),Z;(function(e){e[e.TOP_LEFT=0]=`TOP_LEFT`,e[e.TOP_RIGHT=1]=`TOP_RIGHT`,e[e.BOTTOM_RIGHT=2]=`BOTTOM_RIGHT`,e[e.BOTTOM_LEFT=3]=`BOTTOM_LEFT`})(Z||={});var Q=function(e,t,n,r,i){var a=4*((Math.sqrt(2)-1)/3),o=n*a,s=r*a,c=e+n,l=t+r;switch(i){case Z.TOP_LEFT:return new El(new Y(e,l),new Y(e,l-s),new Y(c-o,t),new Y(c,t));case Z.TOP_RIGHT:return new El(new Y(e,t),new Y(e+o,t),new Y(c,l-s),new Y(c,l));case Z.BOTTOM_RIGHT:return new El(new Y(c,t),new Y(c,t+s),new Y(e+o,l),new Y(e,l));case Z.BOTTOM_LEFT:default:return new El(new Y(c,l),new Y(c-o,l),new Y(e,t+s),new Y(e,t))}},Ol=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},kl=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},Al=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},jl=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),Ml=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Nl=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Pl=function(e){return e.type===0},Fl=function(e){return e.type===1},Il=function(e){return e.type===2},Ll=function(e,t){return e.length===t.length?e.some(function(e,n){return e===t[n]}):!1},Rl=function(e,t,n,r,i){return e.map(function(e,a){switch(a){case 0:return e.add(t,n);case 1:return e.add(t+r,n);case 2:return e.add(t+r,n+i);case 3:return e.add(t,n+i)}return e})},zl=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Bl=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Dl(this.container),this.container.styles.opacity<1&&this.effects.push(new Nl(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,r=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new jl(n,r,i))}if(this.container.styles.overflowX!==0){var a=Ol(this.curves),o=Al(this.curves);Ll(a,o)?this.effects.push(new Ml(a,6)):(this.effects.push(new Ml(a,2)),this.effects.push(new Ml(o,4)))}}return e.prototype.getEffects=function(e){for(var t=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,r=this.effects.slice(0);n;){var i=n.effects.filter(function(e){return!Fl(e)});if(t||n.container.styles.position!==0||!n.parent){if(r.unshift.apply(r,i),t=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var a=Ol(n.curves),o=Al(n.curves);Ll(a,o)||r.unshift(new Ml(o,6))}}else r.unshift.apply(r,i);n=n.parent}return r.filter(function(t){return G(t.target,e)})},e}(),Vl=function(e,t,n,r){e.container.elements.forEach(function(i){var a=G(i.flags,4),o=G(i.flags,2),s=new Bl(i,e);G(i.styles.display,2048)&&r.push(s);var c=G(i.flags,8)?[]:r;if(a||o){var l=a||i.styles.isPositioned()?n:t,u=new zl(s);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var d=i.styles.zIndex.order;if(d<0){var f=0;l.negativeZIndex.some(function(e,t){return d>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),l.negativeZIndex.splice(f,0,u)}else if(d>0){var p=0;l.positiveZIndex.some(function(e,t){return d>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0}),l.positiveZIndex.splice(p,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else i.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);Vl(s,u,a?u:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),Vl(s,t,n,c);G(i.flags,8)&&Hl(i,c)})},Hl=function(e,t){for(var n=e instanceof qs?e.start:1,r=e instanceof qs?e.reversed:!1,i=0;i0&&e.intrinsicHeight>0){var r=Xl(e),i=Al(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(e){return A(this,void 0,void 0,function(){var n,r,i,a,o,s,c,c,l,u,d,f,p,m,h,g,_,v,y,c,b,p,g;return j(this,function(x){switch(x.label){case 0:this.applyEffects(e.getEffects(4)),n=e.container,r=e.curves,i=n.styles,a=0,o=n.textNodes,x.label=1;case 1:return a0&&d>0&&(f=r.ctx.createPattern(b,`repeat`),r.renderRepeat(s,f,c,l))):Ai(n)&&(C=$l(e,t,[null,null,null]),s=C[0],w=C[1],T=C[2],u=C[3],d=C[4],E=n.position.length===0?[Hr]:n.position,c=V(E[0],u),l=V(E[E.length-1],d),ee=hi(n,c,l,u,d),D=ee[0],te=ee[1],D>0&&te>0&&(ne=r.ctx.createRadialGradient(w+c,T+l,0,w+c,T+l,D),di(n.stops,D*2).forEach(function(e){return ne.addColorStop(e.stop,U(e.color))}),r.path(s),r.ctx.fillStyle=ne,D===te?r.ctx.fill():(O=e.bounds.left+.5*e.bounds.width,k=e.bounds.top+.5*e.bounds.height,re=te/D,A=1/re,r.ctx.save(),r.ctx.translate(O,k),r.ctx.transform(1,0,0,re,0,0),r.ctx.translate(-O,-k),r.ctx.fillRect(w,A*(T-k)+k,u,d*A),r.ctx.restore()))),j.label=6;case 6:return t--,[2]}})},r=this,i=0,a=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return i0?c.style===2?[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,2)]:[3,5]:[3,11]):[3,13];case 4:return u.sent(),[3,11];case 5:return c.style===3?[4,this.renderDashedDottedBorder(c.color,c.width,a,e.curves,3)]:[3,7];case 6:return u.sent(),[3,11];case 7:return c.style===4?[4,this.renderDoubleBorder(c.color,c.width,a,e.curves)]:[3,9];case 8:return u.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,a,e.curves)];case 10:u.sent(),u.label=11;case 11:a++,u.label=12;case 12:return o++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(e,t,n,r,i){return A(this,void 0,void 0,function(){var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,y,b;return j(this,function(x){return this.ctx.save(),a=ql(r,n),o=Wl(r,n),i===2&&(this.path(o),this.ctx.clip()),X(o[0])?(s=o[0].start.x,c=o[0].start.y):(s=o[0].x,c=o[0].y),X(o[1])?(l=o[1].end.x,u=o[1].end.y):(l=o[1].x,u=o[1].y),d=n===0||n===2?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),i===3?this.formatPath(a):this.formatPath(o.slice(0,2)),f=t<3?t*3:t*2,p=t<3?t*2:t,i===3&&(f=t,p=t),m=!0,d<=f*2?m=!1:d<=f*2+p?(h=d/(2*f+p),f*=h,p*=h):(g=Math.floor((d+p)/(f+p)),_=(d-g*f)/(g-1),v=(d-(g+1)*f)/g,p=v<=0||Math.abs(p-_)D.value.length===0?[wu]:D.value.map(e=>{let t=URL.createObjectURL(e);return v.value.push(()=>URL.revokeObjectURL(t)),t})),O=S(`vibrant`),k=y(`imageRef`),re=y(`canvas`),{updateThemeColor:A}=e(()=>d.value),j=a(()=>O.value===`vibrant`?d.value:O.value===`html2canvas`?_.value:``);async function ie(){if(te.value.length!==0)try{r.value=!0;let e=new ee(te.value[0]),t=await e.getPalette(),n=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`);u.value=n,d.value=t.Vibrant?.hex||t.DarkVibrant?.hex||n[0],await A()}catch(e){console.error(`Color extraction failed:`,e)}finally{r.value=!1}}async function M(){if(k.value)try{r.value=!0;let e=await Cu(k.value,{allowTaint:!0,useCORS:!0,backgroundColor:null,scale:.5,height:100,width:k.value.offsetWidth,logging:!1});if(re.value){let t=re.value.getContext(`2d`);t&&(re.value.width=e.width,re.value.height=e.height,t.drawImage(e,0,0))}let n=e.getContext(`2d`);if(n){let r=n.getImageData(0,0,e.width,20),i=[];for(let e=0;e0&&i.push({mode:`rgb`,r:t,g:n,b:a})}if(i.length>0){let e=t(i);_.value=`rgb(${e.r}, ${e.g}, ${e.b})`}}}catch(e){console.error(`Canvas capture failed:`,e)}finally{r.value=!1}}return p(async()=>{await f(),await ie(),await M()}),b(te,async()=>{await f(),await ie(),await M()}),m(()=>{v.value.forEach(e=>e())}),(e,t)=>(h(),s(`div`,Tu,[o(`div`,Eu,[o(`div`,{class:`pointer-events-none left-0 right-0 top-0 z-10 flex items-center justify-center backdrop-blur-md`,style:T({background:j.value})},t[3]||=[o(`div`,{class:`py-4 text-center text-sm text-white font-medium`},` Top Area `,-1)],4),o(`div`,{class:`transparent-gradient-overlay absolute inset-0 h-[calc((1lh+1rem+1rem)*2)] w-full`,style:T({background:j.value})},null,4),o(`img`,{ref_key:`imageRef`,ref:k,src:te.value[0],class:`h-full max-h-[calc(100dvh-28rem)] w-full object-cover`},null,8,Du),o(`div`,Ou,[l(C(ne),{modelValue:D.value,"onUpdate:modelValue":t[0]||=e=>D.value=e},{default:x(()=>t[4]||=[o(`div`,{class:`rounded-xl bg-black bg-opacity-30 px-5 py-4 text-white backdrop-blur-sm`},` Replace Image `,-1)]),_:1,__:[4]},8,[`modelValue`])])]),o(`div`,ku,[o(`div`,Au,[o(`div`,ju,[o(`h3`,Mu,[t[5]||=o(`span`,null,`Node Vibrant`,-1),o(`button`,{"border-2":``,"border-neutral-300":``,"rounded-xl":``,"border-solid":``,"px-3":``,"py-1":``,"text-sm":``,"font-normal":``,"dark:border-neutral-700":``,class:w([O.value===`vibrant`?`bg-neutral-100 dark:bg-neutral-700`:``]),onClick:t[1]||=e=>O.value=`vibrant`},E(O.value===`vibrant`?`Activated`:`Active`),3)]),o(`div`,Nu,[(h(!0),s(i,null,g(u.value,e=>(h(),s(`div`,{key:e,class:`h-12 w-12 cursor-pointer border-2 border-gray-300 rounded rounded-xl transition-transform duration-200 ease-in-out hover:scale-110 dark:border-gray-900`,style:T({backgroundColor:e}),title:e},null,12,Pu))),128))]),o(`p`,Fu,[t[6]||=c(` Color: `,-1),o(`span`,{style:T({color:d.value})},E(d.value),5)])]),o(`div`,Iu,[o(`h3`,Lu,[t[7]||=o(`span`,null,`html2canvas Top sampling`,-1),o(`button`,{"border-2":``,"border-neutral-300":``,"rounded-xl":``,"border-solid":``,"px-3":``,"py-1":``,"text-sm":``,"font-normal":``,"dark:border-neutral-700":``,class:w([O.value===`html2canvas`?`bg-neutral-100 dark:bg-neutral-700`:``]),onClick:t[2]||=e=>O.value=`html2canvas`},E(O.value===`html2canvas`?`Activated`:`Active`),3)]),o(`div`,Ru,[o(`div`,{class:`color-swatch h-12 w-12 border-2 border-gray-300 rounded rounded-xl dark:border-gray-900`,style:T({backgroundColor:_.value}),title:_.value},null,12,zu)]),o(`p`,Bu,[t[8]||=c(` Color: `,-1),o(`span`,{style:T({color:_.value})},E(_.value),5)])])]),o(`div`,Vu,[t[9]||=o(`h3`,{class:`mb-1 text-lg`},` Captured Canvas (Debug) `,-1),o(`canvas`,Hu,null,512)])])]))}}),Wu=n(Uu,[[`__scopeId`,`data-v-e6e8453f`]]);export{Wu as default}; \ No newline at end of file diff --git a/assets/background-remove-0JZi3Enw.js b/assets/background-remove-fLURqKXM.js similarity index 65% rename from assets/background-remove-0JZi3Enw.js rename to assets/background-remove-fLURqKXM.js index 68bbe66b1a3d154415264121985bb0bc9b8d380b..a295dc880716df4bcbfd180b7df2cb34a1ba44d5 100644 --- a/assets/background-remove-0JZi3Enw.js +++ b/assets/background-remove-fLURqKXM.js @@ -1 +1 @@ -import{b as e}from"./InputFile-BfCkG18J.js";import{dR as t,dT as n,dU as r,dW as i,dX as a,dZ as o,d_ as s,e4 as c,e6 as l,e7 as u,eh as d,el as f,eo as p,ep as m,z as h}from"./index-DEpwtsc8.js";import{b as g,c as _,d as v,f as y}from"./transformers.web-Dx6XCSrY.js";const b={flex:``,"flex-col":``,"items-center":``,"gap-4":``},x=[`disabled`],S={"h-full":``,"w-full":``,flex:``,"gap-2":``},C={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,"overflow-hidden":``,"rounded-lg":``},w=[`src`],T={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,relative:``,"overflow-hidden":``,"rounded-lg":``},E={key:0,bg:`black/50`,absolute:``,"inset-0":``,"z-10":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``},D={"mb-4":``,"text-white":``,"font-medium":``},O={bg:`gray-200/30`,w:`70%`,"h-2":``,"overflow-hidden":``,"rounded-full":``},k=[`src`],A={bg:`black/0 group-hover:black/20`,absolute:``,"inset-0":``,flex:``,"items-center":``,"justify-center":``,"transition-all":``,"duration-200":``},j=[`onClick`],M={key:1,absolute:``,"bottom-2":``,"right-2":``};var N=s({__name:`background-remove`,setup(s){let N=d(),P=d(),F=d(),I=d(),L=d(!1),R=d(0),z=d(),B=d(),V=d([]),H=n(()=>V.value.map(e=>URL.createObjectURL(e)));c(async()=>{try{if(!(await h()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;y.backends.onnx.wasm.proxy=!1,N.value??=await g.from_pretrained(e,{device:`webgpu`}),P.value??=await _.from_pretrained(e,{})}catch(e){F.value=e}I.value=!1});async function U(){if(!N.value||!P.value)return;L.value=!0,R.value=0,z.value=[];let e=H.value.length;for(let t=0;t=z.value.length||!V.value[e])return;let t=V.value[e].name,n=t.substring(0,t.lastIndexOf(`.`))||t,r=t.substring(t.lastIndexOf(`.`))||`.png`,i=`${n}-background-removed${r}`,a=document.createElement(`a`);a.href=z.value[e],a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function G(){!z.value||z.value.length===0||z.value.forEach((e,t)=>{setTimeout(()=>W(t),t*100)})}return(n,s)=>(l(),a(`div`,b,[r(`button`,{bg:`neutral-100 dark:neutral-800`,"w-full":``,"cursor-pointer":``,"rounded-lg":``,"px-3":``,"py-2":``,disabled:L.value,onClick:U},m(L.value?`Processing...`:`Process`),9,x),r(`div`,S,[r(`div`,C,[(l(!0),a(t,null,u(H.value,(e,t)=>(l(),a(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,w))),128))]),r(`div`,T,[L.value?(l(),a(`div`,E,[r(`div`,D,m(R.value)+`% `,1),r(`div`,O,[r(`div`,{bg:`emerald-500`,"h-full":``,style:p({width:`${R.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):i(``,!0),(l(!0),a(t,null,u(z.value,(e,t)=>(l(),a(`div`,{key:t,relative:``,class:`group`,"h-full":``,"w-full":``},[r(`img`,{src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,k),r(`div`,A,[r(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,"opacity-0":``,"transition-all":``,"duration-200":``,"group-hover:opacity-100":``,onClick:e=>W(t)},s[1]||=[r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[r(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})],-1)],8,j)])]))),128)),z.value&&z.value.length>1?(l(),a(`div`,M,[r(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:G},s[2]||=[r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[r(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})],-1)])])):i(``,!0)])]),o(f(e),{modelValue:V.value,"onUpdate:modelValue":s[0]||=e=>V.value=e,"w-full":``},null,8,[`modelValue`])]))}}),P=N;export{P as default}; \ No newline at end of file +import{b as e}from"./InputFile-CWezcrJG.js";import{d$ as t,dS as n,dU as r,dV as i,dX as a,dY as o,d_ as s,e5 as c,e7 as l,e8 as u,ei as d,em as f,ep as p,eq as m,z as h}from"./index-BF1-WNuF.js";import{b as g,c as _,d as v,f as y}from"./transformers.web-BCbx_Nx1.js";const b={flex:``,"flex-col":``,"items-center":``,"gap-4":``},x=[`disabled`],S={"h-full":``,"w-full":``,flex:``,"gap-2":``},C={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,"overflow-hidden":``,"rounded-lg":``},w=[`src`],T={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,relative:``,"overflow-hidden":``,"rounded-lg":``},E={key:0,bg:`black/50`,absolute:``,"inset-0":``,"z-10":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``},D={"mb-4":``,"text-white":``,"font-medium":``},O={bg:`gray-200/30`,w:`70%`,"h-2":``,"overflow-hidden":``,"rounded-full":``},k=[`src`],A={bg:`black/0 group-hover:black/20`,absolute:``,"inset-0":``,flex:``,"items-center":``,"justify-center":``,"transition-all":``,"duration-200":``},j=[`onClick`],M={key:1,absolute:``,"bottom-2":``,"right-2":``};var N=t({__name:`background-remove`,setup(t){let N=d(),P=d(),F=d(),I=d(),L=d(!1),R=d(0),z=d(),B=d(),V=d([]),H=r(()=>V.value.map(e=>URL.createObjectURL(e)));c(async()=>{try{if(!(await h()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;y.backends.onnx.wasm.proxy=!1,N.value??=await g.from_pretrained(e,{device:`webgpu`}),P.value??=await _.from_pretrained(e,{})}catch(e){F.value=e}I.value=!1});async function U(){if(!N.value||!P.value)return;L.value=!0,R.value=0,z.value=[];let e=H.value.length;for(let t=0;t=z.value.length||!V.value[e])return;let t=V.value[e].name,n=t.substring(0,t.lastIndexOf(`.`))||t,r=t.substring(t.lastIndexOf(`.`))||`.png`,i=`${n}-background-removed${r}`,a=document.createElement(`a`);a.href=z.value[e],a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function G(){!z.value||z.value.length===0||z.value.forEach((e,t)=>{setTimeout(()=>W(t),t*100)})}return(t,r)=>(l(),o(`div`,b,[i(`button`,{bg:`neutral-100 dark:neutral-800`,"w-full":``,"cursor-pointer":``,"rounded-lg":``,"px-3":``,"py-2":``,disabled:L.value,onClick:U},m(L.value?`Processing...`:`Process`),9,x),i(`div`,S,[i(`div`,C,[(l(!0),o(n,null,u(H.value,(e,t)=>(l(),o(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,w))),128))]),i(`div`,T,[L.value?(l(),o(`div`,E,[i(`div`,D,m(R.value)+`% `,1),i(`div`,O,[i(`div`,{bg:`emerald-500`,"h-full":``,style:p({width:`${R.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):a(``,!0),(l(!0),o(n,null,u(z.value,(e,t)=>(l(),o(`div`,{key:t,relative:``,class:`group`,"h-full":``,"w-full":``},[i(`img`,{src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,k),i(`div`,A,[i(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,"opacity-0":``,"transition-all":``,"duration-200":``,"group-hover:opacity-100":``,onClick:e=>W(t)},r[1]||=[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})],-1)],8,j)])]))),128)),z.value&&z.value.length>1?(l(),o(`div`,M,[i(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:G},r[2]||=[i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})],-1)])])):a(``,!0)])]),s(f(e),{modelValue:V.value,"onUpdate:modelValue":r[0]||=e=>V.value=e,"w-full":``},null,8,[`modelValue`])]))}}),P=N;export{P as default}; \ No newline at end of file diff --git a/assets/chat-D1aTQy3Z.js b/assets/chat-DL9i4zaS.js similarity index 86% rename from assets/chat-D1aTQy3Z.js rename to assets/chat-DL9i4zaS.js index 69375ccbc3d3f2f6a36a01b366f7d403ee54514a..442b788f278cce2820f451f074f6226729501e32 100644 --- a/assets/chat-D1aTQy3Z.js +++ b/assets/chat-DL9i4zaS.js @@ -1,3 +1,3 @@ -import{bS as e,dO as t,dR as n,dU as r,dW as i,dX as a,d_ as o,dg as s,e6 as c,e7 as l,ef as u,eg as d,eh as f,ej as p,el as m,ep as h}from"./index-DEpwtsc8.js";const g=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(t,n){e=t;try{return n()}finally{e=null}}}},_=new WeakMap,v=new WeakMap;let y=0,b=0;const x=e=>{let t=`${y++}`,n={debugLabel:e?.debugLabel??t,include:e=>r.has(e),with:i=>{let a=`${b++}`,o={[Symbol.toStringTag]:e?.debugLabel??`WorkflowEvent(${t}.${a})`,toString:()=>e?.debugLabel?e.debugLabel:`WorkflowEvent(${t}.${a})`,toJSON:()=>({type:e?.debugLabel?e.debugLabel:t,data:i}),get data(){return i}};return r.add(o),v.set(o,n),o}},r=new WeakSet;_.set(n,r),Object.defineProperty(n,Symbol.toStringTag,{get:()=>n?.debugLabel??`WorkflowEvent<${t}>`}),Object.defineProperty(n,`displayName`,{value:n?.debugLabel??`WorkflowEvent<${t}>`});let i=e?.uniqueId;return Object.defineProperty(n,`uniqueId`,{get:()=>(i||=t,i),set:()=>{throw Error(`uniqueId is readonly`)}}),n.toString=()=>e?.debugLabel??`WorkflowEvent<${t}>`,n},S=e=>typeof e==`object`&&e?_.has(e):!1,C=e=>typeof e==`object`&&e?v.get(e):void 0,w=e=>typeof e==`object`&&!!e&&`data`in e,T=e=>e!=null&&typeof e.then==`function`;function E(e,t){let n=Array(e.length);for(let r of t)for(let t=0;t(e.add(t),()=>{e.delete(t)}),publish:(...t)=>{let n=[];for(let r of e)n.push(r(...t));return n}};return D.set(t,e),t}var A=class extends TransformStream{constructor(){super({transform:(e,t)=>{C(e)&&t.enqueue(JSON.stringify({data:e.data,uniqueId:C(e).uniqueId})+` +import{bS as e,d$ as t,dP as n,dS as r,dV as i,dX as a,dY as o,dg as s,e7 as c,e8 as l,eg as u,eh as d,ei as f,ek as p,em as m,eq as h}from"./index-BF1-WNuF.js";const g=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(t,n){e=t;try{return n()}finally{e=null}}}},_=new WeakMap,v=new WeakMap;let y=0,b=0;const x=e=>{let t=`${y++}`,n={debugLabel:e?.debugLabel??t,include:e=>r.has(e),with:i=>{let a=`${b++}`,o={[Symbol.toStringTag]:e?.debugLabel??`WorkflowEvent(${t}.${a})`,toString:()=>e?.debugLabel?e.debugLabel:`WorkflowEvent(${t}.${a})`,toJSON:()=>({type:e?.debugLabel?e.debugLabel:t,data:i}),get data(){return i}};return r.add(o),v.set(o,n),o}},r=new WeakSet;_.set(n,r),Object.defineProperty(n,Symbol.toStringTag,{get:()=>n?.debugLabel??`WorkflowEvent<${t}>`}),Object.defineProperty(n,`displayName`,{value:n?.debugLabel??`WorkflowEvent<${t}>`});let i=e?.uniqueId;return Object.defineProperty(n,`uniqueId`,{get:()=>(i||=t,i),set:()=>{throw Error(`uniqueId is readonly`)}}),n.toString=()=>e?.debugLabel??`WorkflowEvent<${t}>`,n},S=e=>typeof e==`object`&&e?_.has(e):!1,C=e=>typeof e==`object`&&e?v.get(e):void 0,w=e=>typeof e==`object`&&!!e&&`data`in e,T=e=>e!=null&&typeof e.then==`function`;function E(e,t){let n=Array(e.length);for(let r of t)for(let t=0;t(e.add(t),()=>{e.delete(t)}),publish:(...t)=>{let n=[];for(let r of e)n.push(r(...t));return n}};return D.set(t,e),t}var A=class extends TransformStream{constructor(){super({transform:(e,t)=>{C(e)&&t.enqueue(JSON.stringify({data:e.data,uniqueId:C(e).uniqueId})+` `)}})}},j=class extends TransformStream{#eventMap;constructor(e){super({transform:(e,t)=>{let n=e.split(` -`).map(e=>e.trim()).filter(e=>e.length>0);n.forEach(e=>{let n=JSON.parse(e),r=Object.values(this.#eventMap).find(e=>e.uniqueId===n.uniqueId);if(r){let e=r.with(n.data);t.enqueue(e)}else console.warn(`Unknown event: ${n.uniqueId}`)})}}),this.#eventMap=e}},M=class e extends ReadableStream{#stream;#subscribable;on(e,t){return this.#subscribable.subscribe(n=>{e.include(n)&&t(n)})}constructor(e,t){if(!e&&!t)throw TypeError(`Either subscribable or root stream must be provided`);if(super(),e){this.#subscribable=e;let n;this.#stream=t??new ReadableStream({start:t=>{n=e.subscribe(e=>{t.enqueue(e)})},cancel:()=>{n()}})}else{this.#subscribable=k(),this.#stream=t.pipeThrough(new TransformStream({transform:(e,t)=>{this.#subscribable.publish(e),t.enqueue(e)}}));return}}static fromReadableStream(t){return new e(null,t.pipeThrough(new TransformStream({transform:(e,t)=>{t.enqueue(e)}})))}static fromResponse(t,n){let r=t.body;if(!r)throw Error(`Response body is not readable`);return new e(null,r.pipeThrough(new TextDecoderStream).pipeThrough(new j(n)))}toResponse(e,t=new A){return new Response(this.#stream.pipeThrough(t).pipeThrough(new TextEncoderStream),e)}get locked(){return this.#stream.locked}[Symbol.asyncIterator](){return this.#stream[Symbol.asyncIterator]()}cancel(e){return this.#stream.cancel(e)}getReader(){return this.#stream.getReader()}pipeThrough(t,n){let r=this.#stream.pipeThrough(t,n);return new e(null,r)}pipeTo(e,t){return this.#stream.pipeTo(e,t)}tee(){let[t,n]=this.#stream.tee();return[new e(this.#subscribable,t),new e(this.#subscribable,n)]}forEach(e){return this.#stream.pipeTo(new WritableStream({write:t=>{e(t)}}))}map(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(e(t))}}))}values(e){return this.#stream.values(e)}take(e){let t=0;return this.pipeThrough(new TransformStream({transform:(n,r)=>{t=e&&r.terminate()}}))}filter(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.enqueue(t)}}))}until(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(t),(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.terminate()}}))}async toArray(){let e=[];return await this.pipeTo(new WritableStream({write:t=>{e.push(t)}})),e}};const N=g();function P(){let e=N.getStore();if(!e)throw Error(`No current context found`);return e}const F=g(),I=new WeakMap,L=({listeners:e})=>{let t=[],n=(e,t,n,r)=>{let c,l={get abortController(){return c||=new AbortController,c},async:`constructor`in e?e.constructor.name===`AsyncFunction`:!1,pending:null,handler:e,inputEvents:t,inputs:n,outputs:[],prev:r,next:new Set,get root(){return o}};l.prev.next.add(l);let u=i(l);F.run(l,()=>{let e=[...new Set([...O(s.__internal__call_context),...O(u.__internal__call_context)])];N.run(u,()=>{let t=0,n=r=>{if(t===e.length){let e;try{e=r.handler(...r.inputs)}catch(e){if(c??a)(c??a).abort(e);else throw console.error(`unhandled error in handler`,e),e}T(e)?(l.async=!0,l.pending=e.then(e=>(w(e)&&u.sendEvent(e),e))):w(e)&&u.sendEvent(e)}let i=e[t];i&&(t++,i(r,n))};n(l)})})},r=r=>{let i=[...t];[...e].filter(([e])=>{let t=E(e,i);return t.length===e.length}).map(([e,a])=>{let o=E(e,i);o.forEach(e=>{t.splice(t.indexOf(e),1)});for(let t of a)n(t,e,o,r)})},i=e=>{let n=null;return{get stream(){if(!n){let t=k();s.__internal__call_send_event.subscribe(n=>{let r=I.get(n);for(;r;){if(r===e){t.publish(n);break}r=r.prev}}),n=new M(t,null)}return n},get signal(){return e.abortController.signal},sendEvent:(...n)=>{n.forEach(n=>{I.set(n,e),e.outputs.push(n),t.push(n),s.__internal__call_send_event.publish(n,e),r(e)})},__internal__call_context:k(),__internal__call_send_event:k()}},a=new AbortController,o={get abortController(){return a||=new AbortController,a},async:!1,pending:null,inputEvents:[],inputs:[],outputs:[],handler:null,prev:null,next:new Set,get root(){return o}},s=i(o);return s},R=()=>{let e={steps:new Map};return{handle:(t,n)=>{if(e.steps.has(t)){let r=e.steps.get(t);r.add(n)}else{let r=new Set;r.add(n),e.steps.set(t,r)}},createContext(){return L({listeners:e.steps})}}};function z(e,t){let n=(...e)=>{let n=t.filter(([t])=>t.every((t,n)=>t.include(e[n]))).map(([e,t])=>t),r=P(),i=r.sendEvent;return(...e)=>{for(let t=0;tt.include(e[n])))return i(...e)}return console.warn(`Invalid input detected [%s]`,e.map(e=>e.data).join(`, `)),i(...e)}};return{...e,strictHandle:(t,n)=>{let r=(...e)=>{let t=P();return n(t.safeSendEvent,...e)};return e.handle(t,r)},createContext(){let t=e.createContext();return t.__internal__call_context.subscribe((e,t)=>{P().safeSendEvent=n(...e.inputs),t(e)}),t}}}async function B(e,t,n){let{stream:r,sendEvent:i}=e.createContext();i(t);let a=(await r.until(n).toArray()).at(-1);if(!a)throw Error(`No output event received`);return a}const V={flex:``,"flex-col":``,"gap-2":``},H={flex:`~ col`,"gap-2":``},U={flex:``,"flex-col":``,"gap-2":``},W={grid:``,"grid-cols-2":``,"gap-2":``},G={flex:``,"items-center":``,"gap-2":``},K={flex:``,"items-center":``,"gap-2":``},q={flex:``,"items-center":``,"gap-2":``},J={key:0},Y={key:1};var X=o({__name:`chat`,setup(o){let g=s(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=s(`settings/llm/apiKey`,``),v=s(`settings/llm/model`,`openai/gpt-4o-mini`),y=f(``),b=f([]),S=f({role:`assistant`,content:``}),C=f(!1),w=x(),T=x(),E=x(),D=x(),O=x();async function k(){C.value=!0;try{let t=z(R(),[[[w],[T,O]],[[T],[E]],[[E],[D]]]);t.handle([w],async()=>{let{sendEvent:n}=t.createContext();S.value={role:`assistant`,content:``},b.value.push({role:`user`,content:y.value}),b.value.push(S.value);let r=await e({baseURL:g.value,apiKey:_.value,model:v.value,messages:b.value.slice(0,b.value.length-1).map(e=>p(e))});for await(let e of r.fullStream)e.type===`text-delta`&&n(T.with(e.text||``));return O.with()}),t.handle([T],async e=>{S.value.content?S.value.content+=e.data:S.value.content=e.data}),await B(t,w.with(),O)}catch(e){console.error(e)}finally{C.value=!1}}return(e,o)=>(c(),a(`div`,V,[r(`div`,H,[r(`div`,U,[o[7]||=r(`div`,null,[r(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),r(`div`,W,[r(`label`,G,[o[4]||=r(`span`,{"text-nowrap":``},` Base URL `,-1),u(r(`input`,{"onUpdate:modelValue":o[0]||=e=>d(g)?g.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[t,m(g)]])]),r(`label`,K,[o[5]||=r(`span`,{"text-nowrap":``},` API Key `,-1),u(r(`input`,{"onUpdate:modelValue":o[1]||=e=>d(_)?_.value=e:null,type:`password`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[t,m(_)]])]),r(`label`,q,[o[6]||=r(`span`,{"text-nowrap":``},` Model `,-1),u(r(`input`,{"onUpdate:modelValue":o[2]||=e=>d(v)?v.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[t,m(v)]])])])]),r(`div`,null,[u(r(`textarea`,{"onUpdate:modelValue":o[3]||=e=>y.value=e,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[t,y.value]])]),r(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),r(`div`,null,[(c(!0),a(n,null,l(b.value,(e,t)=>(c(),a(`div`,{key:t},[e.role===`user`?(c(),a(`div`,J,[r(`span`,null,h(e.content),1)])):i(``,!0),e.role===`assistant`?(c(),a(`div`,Y,[r(`span`,null,h(e.content),1)])):i(``,!0)]))),128))])])]))}}),Z=X;export{Z as default}; \ No newline at end of file +`).map(e=>e.trim()).filter(e=>e.length>0);n.forEach(e=>{let n=JSON.parse(e),r=Object.values(this.#eventMap).find(e=>e.uniqueId===n.uniqueId);if(r){let e=r.with(n.data);t.enqueue(e)}else console.warn(`Unknown event: ${n.uniqueId}`)})}}),this.#eventMap=e}},M=class e extends ReadableStream{#stream;#subscribable;on(e,t){return this.#subscribable.subscribe(n=>{e.include(n)&&t(n)})}constructor(e,t){if(!e&&!t)throw TypeError(`Either subscribable or root stream must be provided`);if(super(),e){this.#subscribable=e;let n;this.#stream=t??new ReadableStream({start:t=>{n=e.subscribe(e=>{t.enqueue(e)})},cancel:()=>{n()}})}else{this.#subscribable=k(),this.#stream=t.pipeThrough(new TransformStream({transform:(e,t)=>{this.#subscribable.publish(e),t.enqueue(e)}}));return}}static fromReadableStream(t){return new e(null,t.pipeThrough(new TransformStream({transform:(e,t)=>{t.enqueue(e)}})))}static fromResponse(t,n){let r=t.body;if(!r)throw Error(`Response body is not readable`);return new e(null,r.pipeThrough(new TextDecoderStream).pipeThrough(new j(n)))}toResponse(e,t=new A){return new Response(this.#stream.pipeThrough(t).pipeThrough(new TextEncoderStream),e)}get locked(){return this.#stream.locked}[Symbol.asyncIterator](){return this.#stream[Symbol.asyncIterator]()}cancel(e){return this.#stream.cancel(e)}getReader(){return this.#stream.getReader()}pipeThrough(t,n){let r=this.#stream.pipeThrough(t,n);return new e(null,r)}pipeTo(e,t){return this.#stream.pipeTo(e,t)}tee(){let[t,n]=this.#stream.tee();return[new e(this.#subscribable,t),new e(this.#subscribable,n)]}forEach(e){return this.#stream.pipeTo(new WritableStream({write:t=>{e(t)}}))}map(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(e(t))}}))}values(e){return this.#stream.values(e)}take(e){let t=0;return this.pipeThrough(new TransformStream({transform:(n,r)=>{t=e&&r.terminate()}}))}filter(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.enqueue(t)}}))}until(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(t),(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.terminate()}}))}async toArray(){let e=[];return await this.pipeTo(new WritableStream({write:t=>{e.push(t)}})),e}};const N=g();function P(){let e=N.getStore();if(!e)throw Error(`No current context found`);return e}const F=g(),I=new WeakMap,L=({listeners:e})=>{let t=[],n=(e,t,n,r)=>{let c,l={get abortController(){return c||=new AbortController,c},async:`constructor`in e?e.constructor.name===`AsyncFunction`:!1,pending:null,handler:e,inputEvents:t,inputs:n,outputs:[],prev:r,next:new Set,get root(){return o}};l.prev.next.add(l);let u=i(l);F.run(l,()=>{let e=[...new Set([...O(s.__internal__call_context),...O(u.__internal__call_context)])];N.run(u,()=>{let t=0,n=r=>{if(t===e.length){let e;try{e=r.handler(...r.inputs)}catch(e){if(c??a)(c??a).abort(e);else throw console.error(`unhandled error in handler`,e),e}T(e)?(l.async=!0,l.pending=e.then(e=>(w(e)&&u.sendEvent(e),e))):w(e)&&u.sendEvent(e)}let i=e[t];i&&(t++,i(r,n))};n(l)})})},r=r=>{let i=[...t];[...e].filter(([e])=>{let t=E(e,i);return t.length===e.length}).map(([e,a])=>{let o=E(e,i);o.forEach(e=>{t.splice(t.indexOf(e),1)});for(let t of a)n(t,e,o,r)})},i=e=>{let n=null;return{get stream(){if(!n){let t=k();s.__internal__call_send_event.subscribe(n=>{let r=I.get(n);for(;r;){if(r===e){t.publish(n);break}r=r.prev}}),n=new M(t,null)}return n},get signal(){return e.abortController.signal},sendEvent:(...n)=>{n.forEach(n=>{I.set(n,e),e.outputs.push(n),t.push(n),s.__internal__call_send_event.publish(n,e),r(e)})},__internal__call_context:k(),__internal__call_send_event:k()}},a=new AbortController,o={get abortController(){return a||=new AbortController,a},async:!1,pending:null,inputEvents:[],inputs:[],outputs:[],handler:null,prev:null,next:new Set,get root(){return o}},s=i(o);return s},R=()=>{let e={steps:new Map};return{handle:(t,n)=>{if(e.steps.has(t)){let r=e.steps.get(t);r.add(n)}else{let r=new Set;r.add(n),e.steps.set(t,r)}},createContext(){return L({listeners:e.steps})}}};function z(e,t){let n=(...e)=>{let n=t.filter(([t])=>t.every((t,n)=>t.include(e[n]))).map(([e,t])=>t),r=P(),i=r.sendEvent;return(...e)=>{for(let t=0;tt.include(e[n])))return i(...e)}return console.warn(`Invalid input detected [%s]`,e.map(e=>e.data).join(`, `)),i(...e)}};return{...e,strictHandle:(t,n)=>{let r=(...e)=>{let t=P();return n(t.safeSendEvent,...e)};return e.handle(t,r)},createContext(){let t=e.createContext();return t.__internal__call_context.subscribe((e,t)=>{P().safeSendEvent=n(...e.inputs),t(e)}),t}}}async function B(e,t,n){let{stream:r,sendEvent:i}=e.createContext();i(t);let a=(await r.until(n).toArray()).at(-1);if(!a)throw Error(`No output event received`);return a}const V={flex:``,"flex-col":``,"gap-2":``},H={flex:`~ col`,"gap-2":``},U={flex:``,"flex-col":``,"gap-2":``},W={grid:``,"grid-cols-2":``,"gap-2":``},G={flex:``,"items-center":``,"gap-2":``},K={flex:``,"items-center":``,"gap-2":``},q={flex:``,"items-center":``,"gap-2":``},J={key:0},Y={key:1};var X=t({__name:`chat`,setup(t){let g=s(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=s(`settings/llm/apiKey`,``),v=s(`settings/llm/model`,`openai/gpt-4o-mini`),y=f(``),b=f([]),S=f({role:`assistant`,content:``}),C=f(!1),w=x(),T=x(),E=x(),D=x(),O=x();async function k(){C.value=!0;try{let t=z(R(),[[[w],[T,O]],[[T],[E]],[[E],[D]]]);t.handle([w],async()=>{let{sendEvent:n}=t.createContext();S.value={role:`assistant`,content:``},b.value.push({role:`user`,content:y.value}),b.value.push(S.value);let r=await e({baseURL:g.value,apiKey:_.value,model:v.value,messages:b.value.slice(0,b.value.length-1).map(e=>p(e))});for await(let e of r.fullStream)e.type===`text-delta`&&n(T.with(e.text||``));return O.with()}),t.handle([T],async e=>{S.value.content?S.value.content+=e.data:S.value.content=e.data}),await B(t,w.with(),O)}catch(e){console.error(e)}finally{C.value=!1}}return(e,t)=>(c(),o(`div`,V,[i(`div`,H,[i(`div`,U,[t[7]||=i(`div`,null,[i(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),i(`div`,W,[i(`label`,G,[t[4]||=i(`span`,{"text-nowrap":``},` Base URL `,-1),u(i(`input`,{"onUpdate:modelValue":t[0]||=e=>d(g)?g.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,m(g)]])]),i(`label`,K,[t[5]||=i(`span`,{"text-nowrap":``},` API Key `,-1),u(i(`input`,{"onUpdate:modelValue":t[1]||=e=>d(_)?_.value=e:null,type:`password`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,m(_)]])]),i(`label`,q,[t[6]||=i(`span`,{"text-nowrap":``},` Model `,-1),u(i(`input`,{"onUpdate:modelValue":t[2]||=e=>d(v)?v.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,m(v)]])])])]),i(`div`,null,[u(i(`textarea`,{"onUpdate:modelValue":t[3]||=e=>y.value=e,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,y.value]])]),i(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),i(`div`,null,[(c(!0),o(r,null,l(b.value,(e,t)=>(c(),o(`div`,{key:t},[e.role===`user`?(c(),o(`div`,J,[i(`span`,null,h(e.content),1)])):a(``,!0),e.role===`assistant`?(c(),o(`div`,Y,[i(`span`,null,h(e.content),1)])):a(``,!0)]))),128))])])]))}}),Z=X;export{Z as default}; \ No newline at end of file diff --git a/assets/cloudflare-workers-ai-BXiaJYup.js b/assets/cloudflare-workers-ai-DH8y1cuF.js similarity index 62% rename from assets/cloudflare-workers-ai-BXiaJYup.js rename to assets/cloudflare-workers-ai-DH8y1cuF.js index 572f62e49cf7977f190e5cbf29d1f8cd569d3a39..ee3c8576e6922c61d4516d43346d245d0badab93 100644 --- a/assets/cloudflare-workers-ai-BXiaJYup.js +++ b/assets/cloudflare-workers-ai-DH8y1cuF.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,k as h,m as g,y as _}from"./index-DEpwtsc8.js";import{b as v}from"./route-block-gWR0cCIm.js";const y=`cloudflare-workers-ai`;var b=o({__name:`cloudflare-workers-ai`,setup(o){let{t:v}=e(),b=t(),x=_(),{providers:S}=n(x),C=r(()=>x.getProviderMetadata(y)),w=r({get:()=>S.value[y]?.apiKey||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=r({get:()=>S.value[y]?.accountId||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});s(()=>{x.initializeProvider(y),w.value=S.value[y]?.apiKey||``,T.value=S.value[y]?.accountId||``}),l([w,T],()=>{S.value[y]={...S.value[y],apiKey:w.value,accountId:T.value}});function E(){S.value[y]={...C.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":C.value?.localizedName,"provider-icon-color":C.value?.iconColor,"on-back":()=>d(b).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(v)(`settings.pages.providers.common.section.basic.title`),description:d(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:u(()=>[a(d(h),{modelValue:w.value,"onUpdate:modelValue":t[0]||=e=>w.value=e,"provider-name":C.value?.localizedName,placeholder:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[1]||=e=>T.value=e,label:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof v==`function`&&v(b);var x=b;export{x as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,k as h,m as g,y as _}from"./index-BF1-WNuF.js";import{b as v}from"./route-block-gWR0cCIm.js";const y=`cloudflare-workers-ai`;var b=t({__name:`cloudflare-workers-ai`,setup(t){let{t:v}=e(),b=n(),x=_(),{providers:S}=r(x),C=i(()=>x.getProviderMetadata(y)),w=i({get:()=>S.value[y]?.apiKey||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=i({get:()=>S.value[y]?.accountId||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});s(()=>{x.initializeProvider(y),w.value=S.value[y]?.apiKey||``,T.value=S.value[y]?.accountId||``}),l([w,T],()=>{S.value[y]={...S.value[y],apiKey:w.value,accountId:T.value}});function E(){S.value[y]={...C.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":C.value?.localizedName,"provider-icon-color":C.value?.iconColor,"on-back":()=>d(b).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(v)(`settings.pages.providers.common.section.basic.title`),description:d(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:u(()=>[o(d(h),{modelValue:w.value,"onUpdate:modelValue":t[0]||=e=>w.value=e,"provider-name":C.value?.localizedName,placeholder:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[1]||=e=>T.value=e,label:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof v==`function`&&v(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/color-scheme-CG_WOyF8.js b/assets/color-scheme-gSwocc3L.js similarity index 53% rename from assets/color-scheme-CG_WOyF8.js rename to assets/color-scheme-gSwocc3L.js index 16a8d6f1d474f4fc6b9fb463df8797f1e98612e5..7c17b153ddd569ef9a11998f2931fdbe31f8598f 100644 --- a/assets/color-scheme-CG_WOyF8.js +++ b/assets/color-scheme-gSwocc3L.js @@ -1 +1 @@ -import{A as e,b as t,cK as n,cO as r,cq as i,dM as a,dR as o,dU as s,dV as c,dX as l,dY as u,dZ as d,d_ as f,e6 as p,e7 as m,ea as h,ee as g,ef as _,el as v,ep as y,o as b}from"./index-DEpwtsc8.js";import{b as x}from"./route-block-gWR0cCIm.js";var S=[[],[`#A5978B`,`#D8CAAF`,`#B8B4A7`,`#C4BCB1`,`#E5DED8`,`#9A8F7D`,`#BEB5A7`,`#C9C0B6`],[`#7A9EAF`,`#B8C7CC`,`#D4B79C`,`#8B9D77`,`#C7D5CB`,`#E6D0B1`,`#94A7B1`,`#B4C8C3`],[`#D9B48F`,`#B5917A`,`#8C7A6B`,`#A17F5F`,`#B98C46`,`#C7A252`,`#DAB300`,`#D19826`],[`#9BA7B0`,`#C1CBD4`,`#A5ADB6`,`#8B959E`,`#D4DCE4`,`#7F8A94`,`#B3BCC6`,`#98A4AE`],[`#E4C6D0`,`#A61B29`,`#5D513C`,`#789262`,`#1C0D1A`,`#F7C242`,`#62A9DD`,`#8C4B3C`]];const C={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:250,transition:`all ease-in-out duration-250`},w={"text-lg":``,"font-normal":``},T={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},E={class:`color-bar text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:350,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:400,transition:`all ease-in-out duration-250`},O={class:`color-bar transparency-grid text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:450,transition:`all ease-in-out duration-250`},k=[`duration`,`delay`],A={"font-medium":``},j={text:`sm neutral-500`},M={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var N=f({__name:`color-scheme`,setup(r){let f=b(),{t:x}=e();return(e,r)=>{let b=h(`motion`);return p(),l(o,null,[_((p(),c(v(i),{"mb-2":``,title:v(x)(`settings.pages.themes.sections.section.custom-color.title`),icon:`i-solar:pallete-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:290,delay:200,transition:`all ease-in-out duration-250`},{default:g(()=>[_((p(),l(`div`,C,[s(`span`,w,y(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),s(`label`,T,[_(s(`input`,{"onUpdate:modelValue":r[0]||=e=>v(f).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[a,v(f).themeColorsHueDynamic]]),r[2]||=s(`div`,{class:`h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white`},null,-1),u(` `+y(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[b]]),_(d(v(n),{modelValue:v(f).themeColorsHue,"onUpdate:modelValue":r[1]||=e=>v(f).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:300,disabled:v(f).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[b]]),_((p(),l(`div`,E,[r[4]||=s(`span`,{"bg-primary-50":``},`50`,-1),r[5]||=s(`span`,{"bg-primary-100":``},`100`,-1),r[6]||=s(`span`,{"bg-primary-200":``},`200`,-1),r[7]||=s(`span`,{"bg-primary-300":``},`300`,-1),r[8]||=s(`span`,{"bg-primary-400":``},`400`,-1),r[9]||=s(`span`,{"bg-primary-500":``},`500`,-1),_((p(),l(`div`,D,r[3]||=[s(`span`,{"bg-primary-600":``},`600`,-1),s(`span`,{"bg-primary-700":``},`700`,-1),s(`span`,{"bg-primary-800":``},`800`,-1),s(`span`,{"bg-primary-900":``},`900`,-1),s(`span`,{"bg-primary-950":``},`950`,-1)])),[[b]])])),[[b]]),_((p(),l(`div`,O,r[10]||=[s(`span`,{bg:`primary-500/5`},`500/5`,-1),s(`span`,{bg:`primary-500/10`},`500/10`,-1),s(`span`,{bg:`primary-500/20`},`500/20`,-1),s(`span`,{bg:`primary-500/30`},`500/30`,-1),s(`span`,{bg:`primary-500/40`},`500/40`,-1),s(`span`,{bg:`primary-500/50`},`500/50`,-1),s(`span`,{bg:`primary-500/60`},`500/60`,-1),s(`span`,{bg:`primary-500/70`},`500/70`,-1),s(`span`,{bg:`primary-500/80`},`500/80`,-1),s(`span`,{bg:`primary-500/90`},`500/90`,-1),s(`span`,{bg:`primary-500`},`500`,-1)])),[[b]])]),_:1},8,[`title`])),[[b]]),_((p(),c(v(i),{"mb-2":``,title:v(x)(`settings.pages.themes.sections.section.theme-presets.title`),icon:`i-solar:magic-stick-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:350,delay:500,transition:`all ease-in-out duration-250`},{default:g(()=>[(p(!0),l(o,null,m(e.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:n,description:r,colors:i},a)=>_((p(),l(`div`,{key:a,class:`w-full flex flex-col items-start justify-between gap-2 rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out md:flex-row md:items-center md:gap-0`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:360+a*10,delay:550+a*50,transition:`all ease-in-out duration-250`},[s(`div`,null,[s(`span`,A,y(e.$rt(n)),1),s(`div`,j,y(e.$rt(r)),1)]),d(v(t),{colors:i.map((t,n)=>({hex:v(S)[a][n],name:e.$rt(t)}))},null,8,[`colors`])],8,k)),[[b]])),128))]),_:1},8,[`title`])),[[b]]),_((p(),l(`div`,M,r[11]||=[s(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[b]])],64)}}});typeof x==`function`&&x(N);var P=r(N,[[`__scopeId`,`data-v-659ad349`]]);export{P as default}; \ No newline at end of file +import{A as e,b as t,cK as n,cO as r,cq as i,d$ as a,dN as o,dS as s,dV as c,dW as l,dY as u,dZ as d,d_ as f,e7 as p,e8 as m,eb as h,ef as g,eg as _,em as v,eq as y,o as b}from"./index-BF1-WNuF.js";import{b as x}from"./route-block-gWR0cCIm.js";var S=[[],[`#A5978B`,`#D8CAAF`,`#B8B4A7`,`#C4BCB1`,`#E5DED8`,`#9A8F7D`,`#BEB5A7`,`#C9C0B6`],[`#7A9EAF`,`#B8C7CC`,`#D4B79C`,`#8B9D77`,`#C7D5CB`,`#E6D0B1`,`#94A7B1`,`#B4C8C3`],[`#D9B48F`,`#B5917A`,`#8C7A6B`,`#A17F5F`,`#B98C46`,`#C7A252`,`#DAB300`,`#D19826`],[`#9BA7B0`,`#C1CBD4`,`#A5ADB6`,`#8B959E`,`#D4DCE4`,`#7F8A94`,`#B3BCC6`,`#98A4AE`],[`#E4C6D0`,`#A61B29`,`#5D513C`,`#789262`,`#1C0D1A`,`#F7C242`,`#62A9DD`,`#8C4B3C`]];const C={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:250,transition:`all ease-in-out duration-250`},w={"text-lg":``,"font-normal":``},T={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},E={class:`color-bar text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:350,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:400,transition:`all ease-in-out duration-250`},O={class:`color-bar transparency-grid text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:450,transition:`all ease-in-out duration-250`},k=[`duration`,`delay`],A={"font-medium":``},j={text:`sm neutral-500`},M={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var N=a({__name:`color-scheme`,setup(r){let a=b(),{t:x}=e();return(e,r)=>{let b=h(`motion`);return p(),u(s,null,[_((p(),l(v(i),{"mb-2":``,title:v(x)(`settings.pages.themes.sections.section.custom-color.title`),icon:`i-solar:pallete-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:290,delay:200,transition:`all ease-in-out duration-250`},{default:g(()=>[_((p(),u(`div`,C,[c(`span`,w,y(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),c(`label`,T,[_(c(`input`,{"onUpdate:modelValue":r[0]||=e=>v(a).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[o,v(a).themeColorsHueDynamic]]),r[2]||=c(`div`,{class:`h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white`},null,-1),d(` `+y(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[b]]),_(f(v(n),{modelValue:v(a).themeColorsHue,"onUpdate:modelValue":r[1]||=e=>v(a).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:300,disabled:v(a).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[b]]),_((p(),u(`div`,E,[r[4]||=c(`span`,{"bg-primary-50":``},`50`,-1),r[5]||=c(`span`,{"bg-primary-100":``},`100`,-1),r[6]||=c(`span`,{"bg-primary-200":``},`200`,-1),r[7]||=c(`span`,{"bg-primary-300":``},`300`,-1),r[8]||=c(`span`,{"bg-primary-400":``},`400`,-1),r[9]||=c(`span`,{"bg-primary-500":``},`500`,-1),_((p(),u(`div`,D,r[3]||=[c(`span`,{"bg-primary-600":``},`600`,-1),c(`span`,{"bg-primary-700":``},`700`,-1),c(`span`,{"bg-primary-800":``},`800`,-1),c(`span`,{"bg-primary-900":``},`900`,-1),c(`span`,{"bg-primary-950":``},`950`,-1)])),[[b]])])),[[b]]),_((p(),u(`div`,O,r[10]||=[c(`span`,{bg:`primary-500/5`},`500/5`,-1),c(`span`,{bg:`primary-500/10`},`500/10`,-1),c(`span`,{bg:`primary-500/20`},`500/20`,-1),c(`span`,{bg:`primary-500/30`},`500/30`,-1),c(`span`,{bg:`primary-500/40`},`500/40`,-1),c(`span`,{bg:`primary-500/50`},`500/50`,-1),c(`span`,{bg:`primary-500/60`},`500/60`,-1),c(`span`,{bg:`primary-500/70`},`500/70`,-1),c(`span`,{bg:`primary-500/80`},`500/80`,-1),c(`span`,{bg:`primary-500/90`},`500/90`,-1),c(`span`,{bg:`primary-500`},`500`,-1)])),[[b]])]),_:1},8,[`title`])),[[b]]),_((p(),l(v(i),{"mb-2":``,title:v(x)(`settings.pages.themes.sections.section.theme-presets.title`),icon:`i-solar:magic-stick-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:350,delay:500,transition:`all ease-in-out duration-250`},{default:g(()=>[(p(!0),u(s,null,m(e.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:n,description:r,colors:i},a)=>_((p(),u(`div`,{key:a,class:`w-full flex flex-col items-start justify-between gap-2 rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out md:flex-row md:items-center md:gap-0`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:360+a*10,delay:550+a*50,transition:`all ease-in-out duration-250`},[c(`div`,null,[c(`span`,A,y(e.$rt(n)),1),c(`div`,j,y(e.$rt(r)),1)]),f(v(t),{colors:i.map((t,n)=>({hex:v(S)[a][n],name:e.$rt(t)}))},null,8,[`colors`])],8,k)),[[b]])),128))]),_:1},8,[`title`])),[[b]]),_((p(),u(`div`,M,r[11]||=[c(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[b]])],64)}}});typeof x==`function`&&x(N);var P=r(N,[[`__scopeId`,`data-v-659ad349`]]);export{P as default}; \ No newline at end of file diff --git a/assets/consciousness-CcGtuK1e.js b/assets/consciousness-CcGtuK1e.js deleted file mode 100644 index 73be19f10b31d70ba082579dd42798c5a5b9f05c..0000000000000000000000000000000000000000 --- a/assets/consciousness-CcGtuK1e.js +++ /dev/null @@ -1 +0,0 @@ -import{A as e,ci as t,cl as n,cm as ee,cn as te,d3 as r,d8 as i,dO as ne,dR as a,dU as o,dV as s,dW as c,dX as l,dY as u,dZ as re,d_ as d,e4 as ie,e6 as f,e7 as p,ea as m,ee as h,ef as g,eg as _,el as v,ep as y,x as ae,y as oe}from"./index-DEpwtsc8.js";import{b}from"./route-block-gWR0cCIm.js";const x={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},S={flex:`~ col gap-4`},C={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},w={text:`neutral-400 dark:neutral-400`},T={"max-w-full":``},E={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},D={key:1},O={key:0},k={flex:`~ col gap-4`},A={class:`text-lg md:text-2xl`},j={text:`neutral-400 dark:neutral-400`},M={key:0,class:`flex items-center justify-center py-4`},N={key:1},P={flex:`~ col gap-4`},F={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},I={text:`neutral-400 dark:neutral-500`},se={class:`flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20`},L={class:`flex flex-col`},R={class:`font-medium`},z={class:`text-sm text-primary-600 dark:text-primary-400`},B={class:`mt-2`},V={class:`mb-1 block text-sm font-medium`},H=[`placeholder`],U={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var W=d({__name:`consciousness`,setup(d){let b=oe(),W=ae(),{configuredChatProvidersMetadata:G}=i(b),{activeProvider:K,activeModel:q,customModelName:ce,modelSearchQuery:J,supportsModelListing:Y,providerModels:X,isLoadingActiveProviderModels:Z,activeProviderModelError:Q}=i(W),{t:$}=e();ie(async()=>{await W.loadModelsForProvider(K.value)});function le(e){ce.value=e}return(e,i)=>{let d=m(`motion`);return f(),l(a,null,[o(`div`,x,[o(`div`,null,[o(`div`,S,[o(`div`,null,[o(`h2`,C,y(v($)(`settings.pages.providers.title`)),1),o(`div`,w,[o(`span`,null,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),o(`div`,T,[v(G).length>0?(f(),l(`fieldset`,E,[(f(!0),l(a,null,p(v(G),e=>(f(),s(v(n),{id:e.id,key:e.id,modelValue:v(K),"onUpdate:modelValue":i[0]||=e=>_(K)?K.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(f(),l(`div`,D,[re(v(r),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:h(()=>i[4]||=[o(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),o(`div`,{class:`flex flex-col`},[o(`span`,{class:`font-medium`},`No Providers Configured`),o(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),o(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),v(K)&&v(Y)?(f(),l(`div`,O,[o(`div`,k,[o(`div`,null,[o(`h2`,A,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),o(`div`,j,[o(`span`,null,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),v(Z)?(f(),l(`div`,M,[i[5]||=o(`div`,{class:`mr-2 animate-spin`},[o(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),o(`span`,null,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):v(Q)?(f(),s(v(t),{key:1,title:v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:v(Q)},null,8,[`title`,`error`])):v(X).length===0&&!v(Z)?(f(),s(v(te),{key:2,type:`warning`},{title:h(()=>[u(y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:h(()=>[u(y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):v(X).length>0?(f(),s(v(ee),{key:3,modelValue:v(q),"onUpdate:modelValue":i[1]||=e=>_(q)?q.value=e:null,"search-query":v(J),"onUpdate:searchQuery":i[2]||=e=>_(J)?J.value=e:null,items:v(X).sort((e,t)=>e.id===v(q)?-1:t.id===v(q)?1:0),searchable:!0,"search-placeholder":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:v(J)}),"search-results-text":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":le},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):c(``,!0)])])):v(K)&&!v(Y)?(f(),l(`div`,N,[o(`div`,P,[o(`div`,null,[o(`h2`,F,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),o(`div`,I,[o(`span`,null,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),o(`div`,se,[i[6]||=o(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),o(`div`,L,[o(`span`,R,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),o(`span`,z,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),o(`div`,B,[o(`label`,V,y(v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),g(o(`input`,{"onUpdate:modelValue":i[3]||=e=>_(q)?q.value=e:null,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`,placeholder:v($)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,H),[[ne,v(q)]])])])])):c(``,!0)]),g((f(),l(`div`,U,i[7]||=[o(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[d]])],64)}}});typeof b==`function`&&b(W);var G=W;export{G as default}; \ No newline at end of file diff --git a/assets/consciousness-D-mOgB0P.js b/assets/consciousness-D-mOgB0P.js new file mode 100644 index 0000000000000000000000000000000000000000..f594a5f901738d0cfef6f6b292f0a9089b6c453e --- /dev/null +++ b/assets/consciousness-D-mOgB0P.js @@ -0,0 +1 @@ +import{A as e,ci as t,cl as n,cm as ee,cn as te,d$ as r,d3 as ne,d8 as i,dP as re,dS as a,dV as o,dW as s,dX as c,dY as l,dZ as u,d_ as ie,e5 as ae,e7 as d,e8 as f,eb as p,ef as m,eg as h,eh as g,em as _,eq as v,x as oe,y as se}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},x={flex:`~ col gap-4`},S={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},C={text:`neutral-400 dark:neutral-400`},w={"max-w-full":``},T={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},E={key:1},D={key:0},O={flex:`~ col gap-4`},k={class:`text-lg md:text-2xl`},A={text:`neutral-400 dark:neutral-400`},j={key:0,class:`flex items-center justify-center py-4`},M={key:1},N={flex:`~ col gap-4`},P={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},F={text:`neutral-400 dark:neutral-500`},ce={class:`flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20`},I={class:`flex flex-col`},L={class:`font-medium`},R={class:`text-sm text-primary-600 dark:text-primary-400`},z={class:`mt-2`},B={class:`mb-1 block text-sm font-medium`},V=[`placeholder`],H={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var U=r({__name:`consciousness`,setup(r){let y=se(),U=oe(),{configuredChatProvidersMetadata:W}=i(y),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=i(U),{t:Q}=e();ae(async()=>{await U.loadModelsForProvider(G.value)});function $(e){le.value=e}return(e,r)=>{let i=p(`motion`);return d(),l(a,null,[o(`div`,b,[o(`div`,null,[o(`div`,x,[o(`div`,null,[o(`h2`,S,v(_(Q)(`settings.pages.providers.title`)),1),o(`div`,C,[o(`span`,null,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),o(`div`,w,[_(W).length>0?(d(),l(`fieldset`,T,[(d(!0),l(a,null,f(_(W),e=>(d(),s(_(n),{id:e.id,key:e.id,modelValue:_(G),"onUpdate:modelValue":r[0]||=e=>g(G)?G.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(d(),l(`div`,E,[ie(_(ne),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:m(()=>r[4]||=[o(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),o(`div`,{class:`flex flex-col`},[o(`span`,{class:`font-medium`},`No Providers Configured`),o(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),o(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),_(G)&&_(J)?(d(),l(`div`,D,[o(`div`,O,[o(`div`,null,[o(`h2`,k,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),o(`div`,A,[o(`span`,null,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),_(X)?(d(),l(`div`,j,[r[5]||=o(`div`,{class:`mr-2 animate-spin`},[o(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),o(`span`,null,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):_(Z)?(d(),s(_(t),{key:1,title:_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:_(Z)},null,8,[`title`,`error`])):_(Y).length===0&&!_(X)?(d(),s(_(te),{key:2,type:`warning`},{title:m(()=>[u(v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:m(()=>[u(v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):_(Y).length>0?(d(),s(_(ee),{key:3,modelValue:_(K),"onUpdate:modelValue":r[1]||=e=>g(K)?K.value=e:null,"search-query":_(q),"onUpdate:searchQuery":r[2]||=e=>g(q)?q.value=e:null,items:_(Y).sort((e,t)=>e.id===_(K)?-1:t.id===_(K)?1:0),searchable:!0,"search-placeholder":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:_(q)}),"search-results-text":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":$},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):c(``,!0)])])):_(G)&&!_(J)?(d(),l(`div`,M,[o(`div`,N,[o(`div`,null,[o(`h2`,P,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),o(`div`,F,[o(`span`,null,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),o(`div`,ce,[r[6]||=o(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),o(`div`,I,[o(`span`,L,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),o(`span`,R,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),o(`div`,z,[o(`label`,B,v(_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),h(o(`input`,{"onUpdate:modelValue":r[3]||=e=>g(K)?K.value=e:null,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`,placeholder:_(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,V),[[re,_(K)]])])])])):c(``,!0)]),h((d(),l(`div`,H,r[7]||=[o(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[i]])],64)}}});typeof y==`function`&&y(U);var W=U;export{W as default}; \ No newline at end of file diff --git a/assets/core-BqSYgbr9.js b/assets/core-DnrPmW0D.js similarity index 98% rename from assets/core-BqSYgbr9.js rename to assets/core-DnrPmW0D.js index fedb4ff40f9c4dbed4e7f3cd043770a8c27808a6..3bf96f72f27edddaebf21327104606c8ccdf860a 100644 --- a/assets/core-BqSYgbr9.js +++ b/assets/core-DnrPmW0D.js @@ -1 +1 @@ -import{$ as ee,B as te,C as e,D as t,E as n,F as r,G as i,H as a,I as o,J as s,K as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,T as _,U as v,V as y,W as b,X as x,Y as S,Z as C,_ as w,a$ as T,a1 as E,a2 as D,a3 as O,a4 as k,a5 as A,a6 as j,a7 as M,a8 as N,a9 as P,aA as F,aB as I,aC as L,aD as R,aE as z,aF as B,aG as V,aH as H,aI as U,aJ as W,aK as G,aL as K,aM as q,aN as J,aO as Y,aP as X,aQ as Z,aR as Q,aS as ne,aT as re,aU as ie,aV as ae,aW as oe,aX as se,aY as ce,aZ as le,a_ as ue,aa as de,ab as fe,ac as pe,ad as me,ae as he,af as ge,ag as _e,ah as ve,ai as ye,aj as be,ak as xe,al as Se,am as $,an as Ce,ao as we,ap as Te,aq as Ee,ar as De,as as Oe,at as ke,au as Ae,av as je,aw as Me,ax as Ne,ay as Pe,az as Fe,b0 as Ie,b1 as Le,b2 as Re,b3 as ze,b4 as Be,b5 as Ve,b6 as He,b7 as Ue,b8 as We,b9 as Ge,bA as Ke,bB as qe,bC as Je,bD as Ye,bE as Xe,bF as Ze,bG as Qe,bH as $e,bI as et,bJ as tt,bK as nt,bL as rt,bM as it,bN as at,bO as ot,bP as st,ba as ct,bb as lt,bc as ut,bd as dt,be as ft,bf as pt,bg as mt,bh as ht,bi as gt,bj as _t,bk as vt,bl as yt,bm as bt,bn as xt,bo as St,bp as Ct,bq as wt,br as Tt,bs as Et,bt as Dt,bu as Ot,bv as kt,bw as At,bx as jt,by as Mt,bz as Nt}from"./index-DEpwtsc8.js";export{Pe as $ZodArray,it as $ZodAsyncError,Fe as $ZodBase64,F as $ZodBase64URL,I as $ZodBoolean,L as $ZodCIDRv4,R as $ZodCIDRv6,z as $ZodCUID,B as $ZodCUID2,V as $ZodCatch,yt as $ZodCheck,bt as $ZodCheckEndsWith,xt as $ZodCheckGreaterThan,St as $ZodCheckIncludes,Ct as $ZodCheckLengthEquals,wt as $ZodCheckLessThan,Tt as $ZodCheckLowerCase,Et as $ZodCheckMaxLength,Dt as $ZodCheckMinLength,Ot as $ZodCheckMultipleOf,kt as $ZodCheckNumberFormat,At as $ZodCheckOverwrite,jt as $ZodCheckRegex,Mt as $ZodCheckStartsWith,Nt as $ZodCheckStringFormat,Ke as $ZodCheckUpperCase,H as $ZodCustom,U as $ZodDefault,W as $ZodE164,G as $ZodEmail,K as $ZodEmoji,q as $ZodEnum,$e as $ZodError,J as $ZodGUID,Y as $ZodIPv4,X as $ZodIPv6,Z as $ZodISODate,Q as $ZodISODateTime,ne as $ZodISODuration,re as $ZodISOTime,ie as $ZodIntersection,ae as $ZodJWT,oe as $ZodKSUID,se as $ZodNanoID,ce as $ZodNever,le as $ZodNonOptional,ue as $ZodNullable,T as $ZodNumber,Ie as $ZodNumberFormat,Le as $ZodObject,Re as $ZodOptional,ze as $ZodPipe,Be as $ZodPrefault,Ve as $ZodReadonly,et as $ZodRealError,je as $ZodRegistry,He as $ZodString,Ue as $ZodStringFormat,We as $ZodTransform,Ge as $ZodType,ct as $ZodULID,lt as $ZodURL,ut as $ZodUUID,dt as $ZodUnion,ft as $ZodUnknown,pt as $ZodXID,at as $constructor,vt as Doc,te as JSONSchemaGenerator,t as _array,n as _base64,r as _base64url,i as _boolean,a as _check,o as _cidrv4,s as _cidrv6,c as _cuid,l as _cuid2,u as _e164,d as _email,f as _emoji,p as _endsWith,m as _gt,h as _gte,h as _min,g as _guid,_ as _includes,v as _int,y as _ipv4,b as _ipv6,x as _isoDate,S as _isoDateTime,C as _isoDuration,w as _isoTime,ee as _jwt,E as _ksuid,D as _length,O as _lowercase,k as _lt,A as _lte,A as _max,j as _maxLength,M as _minLength,N as _multipleOf,P as _nanoid,de as _never,fe as _normalize,pe as _number,me as _overwrite,qe as _parse,Je as _parseAsync,he as _refine,ge as _regex,Ye as _safeParse,Xe as _safeParseAsync,_e as _startsWith,ve as _string,ye as _superRefine,be as _toLowerCase,xe as _toUpperCase,Se as _trim,$ as _ulid,Ce as _unknown,we as _uppercase,Te as _url,Ee as _uuid,De as _uuidv4,Oe as _uuidv6,ke as _uuidv7,Ae as _xid,rt as clone,ot as config,tt as flattenError,nt as formatError,st as globalConfig,Me as globalRegistry,mt as isValidBase64,ht as isValidBase64URL,gt as isValidJWT,Ne as registry,Ze as safeParse,Qe as safeParseAsync,e as toJSONSchema,_t as version}; \ No newline at end of file +import{$ as ee,B as te,C as e,D as t,E as n,F as r,G as i,H as a,I as o,J as s,K as c,L as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,T as _,U as v,V as y,W as b,X as x,Y as S,Z as C,_ as w,a$ as T,a1 as E,a2 as D,a3 as O,a4 as k,a5 as A,a6 as j,a7 as M,a8 as N,a9 as P,aA as F,aB as I,aC as L,aD as R,aE as z,aF as B,aG as V,aH as H,aI as U,aJ as W,aK as G,aL as K,aM as q,aN as J,aO as Y,aP as X,aQ as Z,aR as Q,aS as ne,aT as re,aU as ie,aV as ae,aW as oe,aX as se,aY as ce,aZ as le,a_ as ue,aa as de,ab as fe,ac as pe,ad as me,ae as he,af as ge,ag as _e,ah as ve,ai as ye,aj as be,ak as xe,al as Se,am as $,an as Ce,ao as we,ap as Te,aq as Ee,ar as De,as as Oe,at as ke,au as Ae,av as je,aw as Me,ax as Ne,ay as Pe,az as Fe,b0 as Ie,b1 as Le,b2 as Re,b3 as ze,b4 as Be,b5 as Ve,b6 as He,b7 as Ue,b8 as We,b9 as Ge,bA as Ke,bB as qe,bC as Je,bD as Ye,bE as Xe,bF as Ze,bG as Qe,bH as $e,bI as et,bJ as tt,bK as nt,bL as rt,bM as it,bN as at,bO as ot,bP as st,ba as ct,bb as lt,bc as ut,bd as dt,be as ft,bf as pt,bg as mt,bh as ht,bi as gt,bj as _t,bk as vt,bl as yt,bm as bt,bn as xt,bo as St,bp as Ct,bq as wt,br as Tt,bs as Et,bt as Dt,bu as Ot,bv as kt,bw as At,bx as jt,by as Mt,bz as Nt}from"./index-BF1-WNuF.js";export{Pe as $ZodArray,it as $ZodAsyncError,Fe as $ZodBase64,F as $ZodBase64URL,I as $ZodBoolean,L as $ZodCIDRv4,R as $ZodCIDRv6,z as $ZodCUID,B as $ZodCUID2,V as $ZodCatch,yt as $ZodCheck,bt as $ZodCheckEndsWith,xt as $ZodCheckGreaterThan,St as $ZodCheckIncludes,Ct as $ZodCheckLengthEquals,wt as $ZodCheckLessThan,Tt as $ZodCheckLowerCase,Et as $ZodCheckMaxLength,Dt as $ZodCheckMinLength,Ot as $ZodCheckMultipleOf,kt as $ZodCheckNumberFormat,At as $ZodCheckOverwrite,jt as $ZodCheckRegex,Mt as $ZodCheckStartsWith,Nt as $ZodCheckStringFormat,Ke as $ZodCheckUpperCase,H as $ZodCustom,U as $ZodDefault,W as $ZodE164,G as $ZodEmail,K as $ZodEmoji,q as $ZodEnum,$e as $ZodError,J as $ZodGUID,Y as $ZodIPv4,X as $ZodIPv6,Z as $ZodISODate,Q as $ZodISODateTime,ne as $ZodISODuration,re as $ZodISOTime,ie as $ZodIntersection,ae as $ZodJWT,oe as $ZodKSUID,se as $ZodNanoID,ce as $ZodNever,le as $ZodNonOptional,ue as $ZodNullable,T as $ZodNumber,Ie as $ZodNumberFormat,Le as $ZodObject,Re as $ZodOptional,ze as $ZodPipe,Be as $ZodPrefault,Ve as $ZodReadonly,et as $ZodRealError,je as $ZodRegistry,He as $ZodString,Ue as $ZodStringFormat,We as $ZodTransform,Ge as $ZodType,ct as $ZodULID,lt as $ZodURL,ut as $ZodUUID,dt as $ZodUnion,ft as $ZodUnknown,pt as $ZodXID,at as $constructor,vt as Doc,te as JSONSchemaGenerator,t as _array,n as _base64,r as _base64url,i as _boolean,a as _check,o as _cidrv4,s as _cidrv6,c as _cuid,l as _cuid2,u as _e164,d as _email,f as _emoji,p as _endsWith,m as _gt,h as _gte,h as _min,g as _guid,_ as _includes,v as _int,y as _ipv4,b as _ipv6,x as _isoDate,S as _isoDateTime,C as _isoDuration,w as _isoTime,ee as _jwt,E as _ksuid,D as _length,O as _lowercase,k as _lt,A as _lte,A as _max,j as _maxLength,M as _minLength,N as _multipleOf,P as _nanoid,de as _never,fe as _normalize,pe as _number,me as _overwrite,qe as _parse,Je as _parseAsync,he as _refine,ge as _regex,Ye as _safeParse,Xe as _safeParseAsync,_e as _startsWith,ve as _string,ye as _superRefine,be as _toLowerCase,xe as _toUpperCase,Se as _trim,$ as _ulid,Ce as _unknown,we as _uppercase,Te as _url,Ee as _uuid,De as _uuidv4,Oe as _uuidv6,ke as _uuidv7,Ae as _xid,rt as clone,ot as config,tt as flattenError,nt as formatError,st as globalConfig,Me as globalRegistry,mt as isValidBase64,ht as isValidBase64URL,gt as isValidJWT,Ne as registry,Ze as safeParse,Qe as safeParseAsync,e as toJSONSchema,_t as version}; \ No newline at end of file diff --git a/assets/deepseek-BlcTFZgO.js b/assets/deepseek-DJ4XOLdP.js similarity index 55% rename from assets/deepseek-BlcTFZgO.js rename to assets/deepseek-DJ4XOLdP.js index 3a633e25575af0a0e621fc0e503212598b6640ca..1a55512cb008269c1213ce156ca775b5e9a51cdb 100644 --- a/assets/deepseek-BlcTFZgO.js +++ b/assets/deepseek-DJ4XOLdP.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`deepseek`;var x=o({__name:`deepseek`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.deepseek.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`deepseek`;var x=t({__name:`deepseek`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.deepseek.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/default-CKyRS7eC.js b/assets/default-CKyRS7eC.js new file mode 100644 index 0000000000000000000000000000000000000000..adb99b628d362e7af54826f9d98d35a3241977de --- /dev/null +++ b/assets/default-CKyRS7eC.js @@ -0,0 +1 @@ +import{d$ as e,d4 as t,dV as n,dY as r,d_ as i,e7 as a,em as o}from"./index-BF1-WNuF.js";import{b as s}from"./HeaderLink-DVkQgheP.js";const c={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},l={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},u={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,h:`[calc(100%-56px)]`};var d=e({__name:`default`,setup(e){return(e,d)=>(a(),r(`div`,c,[n(`div`,l,[i(s)]),n(`div`,u,[i(o(t))])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/default-DkdbeVDA.js b/assets/default-DkdbeVDA.js deleted file mode 100644 index 78de67d35bb61ae9daa06b9aa76fdaabe77a1ba8..0000000000000000000000000000000000000000 --- a/assets/default-DkdbeVDA.js +++ /dev/null @@ -1 +0,0 @@ -import{d4 as e,dU as t,dX as n,dZ as r,d_ as i,e6 as a,el as o}from"./index-DEpwtsc8.js";import{b as s}from"./HeaderLink-Cg3P1d5b.js";const c={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},l={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},u={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,h:`[calc(100%-56px)]`};var d=i({__name:`default`,setup(i){return(i,d)=>(a(),n(`div`,c,[t(`div`,l,[r(s)]),t(`div`,u,[r(o(e))])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/default-node-D0HoLEZS.js b/assets/default-node-whATspOv.js similarity index 70% rename from assets/default-node-D0HoLEZS.js rename to assets/default-node-whATspOv.js index 145b2aad78961ca335f686953c5444a19e932116..efe496883e8679b2d81cfb786a125e4b83c1a90b 100644 --- a/assets/default-node-D0HoLEZS.js +++ b/assets/default-node-whATspOv.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-DFqcVPwo.js","assets/index-DEpwtsc8.js","assets/index-DStbve3n.css"])))=>i.map(i=>d[i]); -import{d7 as e,et as t}from"./index-DEpwtsc8.js";async function n(){let{createRequire:n}=await e(async()=>{let{createRequire:e}=await import(`./__vite-browser-external-DFqcVPwo.js`).then(t(1));return{createRequire:e}},__vite__mapDeps([0,1,2])),{dirname:r,resolve:i}=await e(async()=>{let{dirname:e,resolve:n}=await import(`./__vite-browser-external-DFqcVPwo.js`).then(t(1));return{dirname:e,resolve:n}},__vite__mapDeps([0,1,2])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-Cp7ZP3Cb.js","assets/index-BF1-WNuF.js","assets/index-DStbve3n.css"])))=>i.map(i=>d[i]); +import{d7 as e,eu as t}from"./index-BF1-WNuF.js";async function n(){let{createRequire:n}=await e(async()=>{let{createRequire:e}=await import(`./__vite-browser-external-Cp7ZP3Cb.js`).then(t(1));return{createRequire:e}},__vite__mapDeps([0,1,2])),{dirname:r,resolve:i}=await e(async()=>{let{dirname:e,resolve:n}=await import(`./__vite-browser-external-Cp7ZP3Cb.js`).then(t(1));return{dirname:e,resolve:n}},__vite__mapDeps([0,1,2])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file diff --git a/assets/delays-6S4zxQEt.js b/assets/delays-6S4zxQEt.js new file mode 100644 index 0000000000000000000000000000000000000000..18c1f05ea1f8b03ef0884aac286ee9673a0c0d00 --- /dev/null +++ b/assets/delays-6S4zxQEt.js @@ -0,0 +1 @@ +import"./Basic-kTOabOY_.js";import{b as e}from"./Textarea-DjE71tF2.js";import{c2 as t,cu as n,d$ as r,dS as i,dV as a,dY as o,d_ as s,e7 as c,e8 as l,ei as u,em as d,eq as f}from"./index-BF1-WNuF.js";const p={flex:``,"flex-col":``,"gap-2":``,"p-2":``},m={flex:``,"flex-row":``,"gap-2":``},h={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},g={"w-full":``,flex:``,"flex-row":``,"gap-4":``},_={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=r({__name:`delays`,setup(r){let y=u(``),b=u([]),x=u([]),S=u(!1),C=t();C.onHandlerEvent(`delay`,e=>{x.value.push(e)});function w(){S.value=!0;let e=y.value.split(``);for(let t of e)C.add(t);C.add(n),y.value=``,S.value=!1}return(t,n)=>(c(),o(`div`,p,[a(`div`,m,[s(d(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),a(`button`,h,f(S.value?`Processing...`:`Send`),1)]),a(`div`,g,[a(`div`,_,[n[1]||=a(`h3`,{"font-normal":``},` Emotion Message `,-1),(c(!0),o(i,null,l(b.value,e=>(c(),o(`div`,{key:e},[a(`div`,null,f(e),1)]))),128))]),a(`div`,v,[n[2]||=a(`h3`,{"font-normal":``},` Delays `,-1),(c(!0),o(i,null,l(x.value,e=>(c(),o(`div`,{key:e},[a(`div`,null,f(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/delays-BTktspbJ.js b/assets/delays-BTktspbJ.js deleted file mode 100644 index ab90c579373d9c6f5d5757d7309501f2d1c8deaf..0000000000000000000000000000000000000000 --- a/assets/delays-BTktspbJ.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-DOfBA0ws.js";import{b as e}from"./Textarea-BXmK5gJR.js";import{c2 as t,cu as n,dR as r,dU as i,dX as a,dZ as o,d_ as s,e6 as c,e7 as l,eh as u,el as d,ep as f}from"./index-DEpwtsc8.js";const p={flex:``,"flex-col":``,"gap-2":``,"p-2":``},m={flex:``,"flex-row":``,"gap-2":``},h={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},g={"w-full":``,flex:``,"flex-row":``,"gap-4":``},_={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=s({__name:`delays`,setup(s){let y=u(``),b=u([]),x=u([]),S=u(!1),C=t();C.onHandlerEvent(`delay`,e=>{x.value.push(e)});function w(){S.value=!0;let e=y.value.split(``);for(let t of e)C.add(t);C.add(n),y.value=``,S.value=!1}return(t,n)=>(c(),a(`div`,p,[i(`div`,m,[o(d(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),i(`button`,h,f(S.value?`Processing...`:`Send`),1)]),i(`div`,g,[i(`div`,_,[n[1]||=i(`h3`,{"font-normal":``},` Emotion Message `,-1),(c(!0),a(r,null,l(b.value,e=>(c(),a(`div`,{key:e},[i(`div`,null,f(e),1)]))),128))]),i(`div`,v,[n[2]||=i(`h3`,{"font-normal":``},` Delays `,-1),(c(!0),a(r,null,l(x.value,e=>(c(),a(`div`,{key:e},[i(`div`,null,f(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/developer-HmG7Pz8z.js b/assets/developer-BGgZf27o.js similarity index 52% rename from assets/developer-HmG7Pz8z.js rename to assets/developer-BGgZf27o.js index 3325946cca1b8c7352f7286fb562e533f6f050b5..70082989290a8014dd271f1e70a28ad421532f1b 100644 --- a/assets/developer-HmG7Pz8z.js +++ b/assets/developer-BGgZf27o.js @@ -1 +1 @@ -import{dL as e,dM as t,dR as n,dU as r,dW as i,dX as a,dY as o,dZ as s,d_ as c,e1 as l,e6 as u,ea as d,eb as f,ee as p,ef as m,el as h,em as g,ep as _,o as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={class:`w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out`,bg:`neutral-50 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`},x=[`aria-checked`],S={key:0,text:`sm neutral-500`};var C=c({__name:`CheckBar`,props:l({text:{},iconOn:{},iconOff:{},description:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let c=f(n,`modelValue`);return(n,l)=>(u(),a(`label`,b,[m(r(`input`,{"onUpdate:modelValue":l[0]||=e=>c.value=e,"aria-checked":c.value,type:`checkbox`,hidden:``},null,8,x),[[t,c.value]]),r(`div`,null,[o(_(n.$t(n.text))+` `,1),n.description?(u(),a(`div`,S,_(n.$t(n.description)),1)):i(``,!0)]),s(e,{name:`slide-away`,mode:`out-in`},{default:p(()=>[c.value?(u(),a(`div`,{key:0,class:g(n.iconOn),transition:`all ease-in-out duration-250`},null,2)):(u(),a(`div`,{key:1,class:g(n.iconOff),transition:`all ease-in-out duration-250`},null,2))]),_:1})]))}}),w=C;const T={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var E=c({__name:`developer`,setup(e){let t=v();return(e,i)=>{let o=d(`motion`);return u(),a(n,null,[m(s(w,{modelValue:h(t).disableTransitions,"onUpdate:modelValue":i[0]||=e=>h(t).disableTransitions=e,"mb-2":``,"icon-on":`i-solar:people-nearby-bold-duotone`,"icon-off":`i-solar:running-2-line-duotone`,text:`settings.animations.stage-transitions.title`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:440,delay:950,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[o]]),m(s(w,{modelValue:h(t).usePageSpecificTransitions,"onUpdate:modelValue":i[1]||=e=>h(t).usePageSpecificTransitions=e,disabled:h(t).disableTransitions,"icon-on":`i-solar:running-2-line-duotone`,"icon-off":`i-solar:people-nearby-bold-duotone`,text:`settings.animations.use-page-specific-transitions.title`,description:`settings.animations.use-page-specific-transitions.description`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:450,delay:1e3,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[o]]),m((u(),a(`div`,T,i[2]||=[r(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)])),[[o]])],64)}}});typeof y==`function`&&y(E);var D=E;export{D as default}; \ No newline at end of file +import{d$ as e,dM as t,dN as n,dS as r,dV as i,dX as a,dY as o,dZ as s,d_ as c,e2 as l,e7 as u,eb as d,ec as f,ef as p,eg as m,em as h,en as g,eq as _,o as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={class:`w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out`,bg:`neutral-50 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`},x=[`aria-checked`],S={key:0,text:`sm neutral-500`};var C=e({__name:`CheckBar`,props:l({text:{},iconOn:{},iconOff:{},description:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let r=f(e,`modelValue`);return(e,l)=>(u(),o(`label`,b,[m(i(`input`,{"onUpdate:modelValue":l[0]||=e=>r.value=e,"aria-checked":r.value,type:`checkbox`,hidden:``},null,8,x),[[n,r.value]]),i(`div`,null,[s(_(e.$t(e.text))+` `,1),e.description?(u(),o(`div`,S,_(e.$t(e.description)),1)):a(``,!0)]),c(t,{name:`slide-away`,mode:`out-in`},{default:p(()=>[r.value?(u(),o(`div`,{key:0,class:g(e.iconOn),transition:`all ease-in-out duration-250`},null,2)):(u(),o(`div`,{key:1,class:g(e.iconOff),transition:`all ease-in-out duration-250`},null,2))]),_:1})]))}}),w=C;const T={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var E=e({__name:`developer`,setup(e){let t=v();return(e,n)=>{let a=d(`motion`);return u(),o(r,null,[m(c(w,{modelValue:h(t).disableTransitions,"onUpdate:modelValue":n[0]||=e=>h(t).disableTransitions=e,"mb-2":``,"icon-on":`i-solar:people-nearby-bold-duotone`,"icon-off":`i-solar:running-2-line-duotone`,text:`settings.animations.stage-transitions.title`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:440,delay:950,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[a]]),m(c(w,{modelValue:h(t).usePageSpecificTransitions,"onUpdate:modelValue":n[1]||=e=>h(t).usePageSpecificTransitions=e,disabled:h(t).disableTransitions,"icon-on":`i-solar:running-2-line-duotone`,"icon-off":`i-solar:people-nearby-bold-duotone`,text:`settings.animations.use-page-specific-transitions.title`,description:`settings.animations.use-page-specific-transitions.description`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:450,delay:1e3,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[a]]),m((u(),o(`div`,T,n[2]||=[i(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)])),[[a]])],64)}}});typeof y==`function`&&y(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/effect--zg3C1LQ-BC7uVPyf.js b/assets/effect--zg3C1LQ-ld3Bkn4f.js similarity index 72% rename from assets/effect--zg3C1LQ-BC7uVPyf.js rename to assets/effect--zg3C1LQ-ld3Bkn4f.js index c388f1a44f95e5adb1f406310830bf40f269f603..e697bbb68f8df61c64ba6e6023bc4025d0830e6e 100644 --- a/assets/effect--zg3C1LQ-BC7uVPyf.js +++ b/assets/effect--zg3C1LQ-ld3Bkn4f.js @@ -1 +1 @@ -import{bR as e,d7 as t}from"./index-DEpwtsc8.js";const n=async()=>{let{JSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_effect_xsschema-BcDABPW0.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{bR as e,d7 as t}from"./index-BF1-WNuF.js";const n=async()=>{let{JSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_effect_xsschema-BcDABPW0.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/elevenlabs-Bjs_ey_R.js b/assets/elevenlabs-CIJ-36gn.js similarity index 76% rename from assets/elevenlabs-Bjs_ey_R.js rename to assets/elevenlabs-CIJ-36gn.js index d29ec374113299de391776815fd56d22c0c73d59..2a092bfd5ad59cf271eca598f5af7a5d690db4e4 100644 --- a/assets/elevenlabs-Bjs_ey_R.js +++ b/assets/elevenlabs-CIJ-36gn.js @@ -1 +1 @@ -import{A as e,cN as t,cS as n,d8 as r,dT as i,dU as a,dV as o,dZ as s,d_ as c,e as l,e4 as u,e6 as d,ed as f,ee as p,eh as m,el as h,f as g,v as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=c({__name:`elevenlabs`,setup(c){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=m(0),w=m(1),T=m(0),E=m(0),D=m(.5),O=m(.75),k=m(!1),A=_(),j=v(),{providers:M}=r(j),{t:N}=e(),P=i(()=>!!M.value[x]?.apiKey),F=i(()=>A.availableVoices[x]||[]);async function I(e,t,n){let r=await j.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=j.getProviderConfig(x),a=i.model||S;return await A.speech(r,a,e,t,{...i,...y})}return u(async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),f(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),f(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),f(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),f(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),f(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),f(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),f(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),f(M,async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(d(),o(h(l),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":p(()=>[a(`div`,b,[s(h(t),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:h(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:h(N)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),s(h(t),{modelValue:w.value,"onUpdate:modelValue":r[1]||=e=>w.value=e,label:h(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),s(h(t),{modelValue:T.value,"onUpdate:modelValue":r[2]||=e=>T.value=e,label:h(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:h(N)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),s(h(t),{modelValue:E.value,"onUpdate:modelValue":r[3]||=e=>E.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),s(h(t),{modelValue:D.value,"onUpdate:modelValue":r[4]||=e=>D.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),s(h(t),{modelValue:O.value,"onUpdate:modelValue":r[5]||=e=>O.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),s(h(n),{modelValue:k.value,"onUpdate:modelValue":r[6]||=e=>k.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:p(()=>[s(h(g),{"available-voices":F.value,"generate-speech":I,"api-key-configured":P.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{A as e,cN as t,cS as n,d$ as r,d8 as i,dU as a,dV as o,dW as s,d_ as c,e as l,e5 as u,e7 as d,ee as f,ef as p,ei as m,em as h,f as g,v as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=r({__name:`elevenlabs`,setup(r){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=m(0),w=m(1),T=m(0),E=m(0),D=m(.5),O=m(.75),k=m(!1),A=_(),j=v(),{providers:M}=i(j),{t:N}=e(),P=a(()=>!!M.value[x]?.apiKey),F=a(()=>A.availableVoices[x]||[]);async function I(e,t,n){let r=await j.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=j.getProviderConfig(x),a=i.model||S;return await A.speech(r,a,e,t,{...i,...y})}return u(async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),f(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),f(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),f(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),f(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),f(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),f(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),f(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),f(M,async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(d(),s(h(l),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":p(()=>[o(`div`,b,[c(h(t),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:h(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:h(N)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),c(h(t),{modelValue:w.value,"onUpdate:modelValue":r[1]||=e=>w.value=e,label:h(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),c(h(t),{modelValue:T.value,"onUpdate:modelValue":r[2]||=e=>T.value=e,label:h(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:h(N)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),c(h(t),{modelValue:E.value,"onUpdate:modelValue":r[3]||=e=>E.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),c(h(t),{modelValue:D.value,"onUpdate:modelValue":r[4]||=e=>D.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),c(h(t),{modelValue:O.value,"onUpdate:modelValue":r[5]||=e=>O.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),c(h(n),{modelValue:k.value,"onUpdate:modelValue":r[6]||=e=>k.value=e,label:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:h(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:p(()=>[c(h(g),{"available-voices":F.value,"generate-speech":I,"api-key-configured":P.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/emotions-BEnYe8CF.js b/assets/emotions-BEnYe8CF.js new file mode 100644 index 0000000000000000000000000000000000000000..edf00d290d47fa511707c4706b7bd8bf27e039b0 --- /dev/null +++ b/assets/emotions-BEnYe8CF.js @@ -0,0 +1 @@ +import"./Basic-kTOabOY_.js";import{b as e}from"./Textarea-DjE71tF2.js";import{c3 as t,c5 as n,cu as r,d$ as i,dS as a,dV as o,dY as s,d_ as c,e7 as l,e8 as u,ei as d,em as f,eq as p}from"./index-BF1-WNuF.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},y={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var b=i({__name:`emotions`,setup(i){let b=d(``),x=d([]),S=d([]),C=d(!1),w=n({handlers:[async e=>{S.value.push(e.data)}]}),T=t(w);function E(){C.value=!0;let e=b.value.split(``);for(let t of e)T.add(t);T.add(r),b.value=``,C.value=!1}return(t,n)=>(l(),s(`div`,m,[o(`div`,h,[c(f(e),{modelValue:b.value,"onUpdate:modelValue":n[0]||=e=>b.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:E},null,8,[`modelValue`]),o(`button`,g,p(C.value?`Processing...`:`Send`),1)]),o(`div`,_,[o(`div`,v,[n[1]||=o(`h3`,{"font-normal":``},` Messages `,-1),(l(!0),s(a,null,u(x.value,e=>(l(),s(`div`,{key:e},[o(`div`,null,p(e),1)]))),128))]),o(`div`,y,[n[2]||=o(`h3`,{"font-normal":``},` Emotions `,-1),(l(!0),s(a,null,u(S.value,e=>(l(),s(`div`,{key:e},[o(`div`,null,p(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/emotions-Dirlka9n.js b/assets/emotions-Dirlka9n.js deleted file mode 100644 index 18220851f073c4266132343881ea41eea753826f..0000000000000000000000000000000000000000 --- a/assets/emotions-Dirlka9n.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-DOfBA0ws.js";import{b as e}from"./Textarea-BXmK5gJR.js";import{c3 as t,c5 as n,cu as r,dR as i,dU as a,dX as o,dZ as s,d_ as c,e6 as l,e7 as u,eh as d,el as f,ep as p}from"./index-DEpwtsc8.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},y={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var b=c({__name:`emotions`,setup(c){let b=d(``),x=d([]),S=d([]),C=d(!1),w=n({handlers:[async e=>{S.value.push(e.data)}]}),T=t(w);function E(){C.value=!0;let e=b.value.split(``);for(let t of e)T.add(t);T.add(r),b.value=``,C.value=!1}return(t,n)=>(l(),o(`div`,m,[a(`div`,h,[s(f(e),{modelValue:b.value,"onUpdate:modelValue":n[0]||=e=>b.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:E},null,8,[`modelValue`]),a(`button`,g,p(C.value?`Processing...`:`Send`),1)]),a(`div`,_,[a(`div`,v,[n[1]||=a(`h3`,{"font-normal":``},` Messages `,-1),(l(!0),o(i,null,u(x.value,e=>(l(),o(`div`,{key:e},[a(`div`,null,p(e),1)]))),128))]),a(`div`,y,[n[2]||=a(`h3`,{"font-normal":``},` Emotions `,-1),(l(!0),o(i,null,u(S.value,e=>(l(),o(`div`,{key:e},[a(`div`,null,p(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/featherless-ai-s6uvg7Qq.js b/assets/featherless-ai-5Km5myH_.js similarity index 55% rename from assets/featherless-ai-s6uvg7Qq.js rename to assets/featherless-ai-5Km5myH_.js index cd732f9d39d6760dd7432cd3fabc895b1faa8e97..2ed69f4ff64f4ee6af0b9421fcfd200be7b48aa5 100644 --- a/assets/featherless-ai-s6uvg7Qq.js +++ b/assets/featherless-ai-5Km5myH_.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`featherless-ai`;var x=o({__name:`featherless-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.featherless.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`featherless-ai`;var x=t({__name:`featherless-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.featherless.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/filter-message-NvdjEGfA.js b/assets/filter-message-DeoOY8to.js similarity index 61% rename from assets/filter-message-NvdjEGfA.js rename to assets/filter-message-DeoOY8to.js index 3f2768f6b79736bd5d96261b2ab236bc72086695..dc796a218a70bec7c383d9597a994983cd2d064d 100644 --- a/assets/filter-message-NvdjEGfA.js +++ b/assets/filter-message-DeoOY8to.js @@ -1 +1 @@ -import"./Basic-DOfBA0ws.js";import{b as e}from"./Textarea-BXmK5gJR.js";import{ca as t,dU as n,dX as r,dZ as i,d_ as a,e6 as o,eh as s,el as c,ep as l}from"./index-DEpwtsc8.js";const u={flex:``,"flex-col":``,"gap-2":``,"p-2":``},d={flex:``,"flex-row":``,"gap-2":``},f={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},p={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var m=a({__name:`filter-message`,setup(a){let m=s(``),h=s(!1),g=s({content:``});async function _(){h.value=!0;let e=m.value.split(``),n=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),r=n.Literal,i=``;for(let a of e){await t(50);let e=r;a===`<`?e=n.Special:a===`>`&&(e=n.Literal),r===n.Literal&&e===n.Special&&(g.value.content+=i,i=``),r===n.Special&&e===n.Literal&&(i=``),r===n.Literal&&e===n.Literal&&(g.value.content+=a,i=``),r=e}i&&(g.value.content+=i),m.value=``,h.value=!1}return(t,a)=>(o(),r(`div`,u,[n(`div`,d,[i(c(e),{modelValue:m.value,"onUpdate:modelValue":a[0]||=e=>m.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),n(`button`,f,l(h.value?`Processing...`:`Send`),1)]),n(`div`,p,[a[1]||=n(`h3`,{"font-normal":``},` Streaming Message `,-1),n(`div`,null,l(g.value.content),1)])]))}}),h=m;export{h as default}; \ No newline at end of file +import"./Basic-kTOabOY_.js";import{b as e}from"./Textarea-DjE71tF2.js";import{ca as t,d$ as n,dV as r,dY as i,d_ as a,e7 as o,ei as s,em as c,eq as l}from"./index-BF1-WNuF.js";const u={flex:``,"flex-col":``,"gap-2":``,"p-2":``},d={flex:``,"flex-row":``,"gap-2":``},f={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},p={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var m=n({__name:`filter-message`,setup(n){let m=s(``),h=s(!1),g=s({content:``});async function _(){h.value=!0;let e=m.value.split(``),n=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),r=n.Literal,i=``;for(let a of e){await t(50);let e=r;a===`<`?e=n.Special:a===`>`&&(e=n.Literal),r===n.Literal&&e===n.Special&&(g.value.content+=i,i=``),r===n.Special&&e===n.Literal&&(i=``),r===n.Literal&&e===n.Literal&&(g.value.content+=a,i=``),r=e}i&&(g.value.content+=i),m.value=``,h.value=!1}return(t,n)=>(o(),i(`div`,u,[r(`div`,d,[a(c(e),{modelValue:m.value,"onUpdate:modelValue":n[0]||=e=>m.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),r(`button`,f,l(h.value?`Processing...`:`Send`),1)]),r(`div`,p,[n[1]||=r(`h3`,{"font-normal":``},` Streaming Message `,-1),r(`div`,null,l(g.value.content),1)])]))}}),h=m;export{h as default}; \ No newline at end of file diff --git a/assets/fireworks-ai-CO6L0o7G.js b/assets/fireworks-ai-B-as3TcQ.js similarity index 55% rename from assets/fireworks-ai-CO6L0o7G.js rename to assets/fireworks-ai-B-as3TcQ.js index e4e3aaae4a4d38386db22cd0edeab42ea37bc600..6853858575e518d00616d5175fda76bb72b08b4b 100644 --- a/assets/fireworks-ai-CO6L0o7G.js +++ b/assets/fireworks-ai-B-as3TcQ.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`fireworks-ai`;var x=o({__name:`fireworks-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.fireworks.ai/inference/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`fireworks-ai`;var x=t({__name:`fireworks-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.fireworks.ai/inference/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/general-a1pJgmhe.js b/assets/general-CQDJm-ty.js similarity index 63% rename from assets/general-a1pJgmhe.js rename to assets/general-CQDJm-ty.js index f516ea094052c6153c8f094308e096c1f68568b9..a86d555fa561ccad0140c63f0bb21d4b02d73201 100644 --- a/assets/general-a1pJgmhe.js +++ b/assets/general-CQDJm-ty.js @@ -1 +1 @@ -import{A as e,cM as t,cS as n,dT as r,dU as i,dX as a,dZ as o,d_ as s,dc as c,e6 as l,ea as u,ef as d,eg as f,el as p,o as m}from"./index-DEpwtsc8.js";import{b as h}from"./route-block-gWR0cCIm.js";const g={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var v=s({__name:`general`,setup(s){let h=m(),{t:v,messages:y}=e(),b=c(),x=r(()=>Object.keys(y.value).map(e=>({label:v(`settings.language.options.${e}`),value:e})));return(e,r)=>{let s=u(`motion`);return l(),a(`div`,g,[d(o(p(n),{modelValue:p(b),"onUpdate:modelValue":r[0]||=e=>f(b)?b.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:100,label:p(v)(`settings.theme.title`),description:p(v)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[s]]),d(o(p(t),{modelValue:p(h).language,"onUpdate:modelValue":r[1]||=e=>p(h).language=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:150,transition:`all ease-in-out duration-250`,label:p(v)(`settings.language.title`),description:p(v)(`settings.language.description`),options:x.value},null,8,[`modelValue`,`label`,`description`,`options`]),[[s]]),d((l(),a(`div`,_,r[2]||=[i(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[s]])])}}});typeof h==`function`&&h(v);var y=v;export{y as default}; \ No newline at end of file +import{A as e,cM as t,cS as n,d$ as r,dU as i,dV as a,dY as o,d_ as s,dc as c,e7 as l,eb as u,eg as d,eh as f,em as p,o as m}from"./index-BF1-WNuF.js";import{b as h}from"./route-block-gWR0cCIm.js";const g={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var v=r({__name:`general`,setup(r){let h=m(),{t:v,messages:y}=e(),b=c(),x=i(()=>Object.keys(y.value).map(e=>({label:v(`settings.language.options.${e}`),value:e})));return(e,r)=>{let i=u(`motion`);return l(),o(`div`,g,[d(s(p(n),{modelValue:p(b),"onUpdate:modelValue":r[0]||=e=>f(b)?b.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:100,label:p(v)(`settings.theme.title`),description:p(v)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[i]]),d(s(p(t),{modelValue:p(h).language,"onUpdate:modelValue":r[1]||=e=>p(h).language=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:150,transition:`all ease-in-out duration-250`,label:p(v)(`settings.language.title`),description:p(v)(`settings.language.description`),options:x.value},null,8,[`modelValue`,`label`,`description`,`options`]),[[i]]),d((l(),o(`div`,_,r[2]||=[a(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[i]])])}}});typeof h==`function`&&h(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/gesture-circle-BOzZAIEv.js b/assets/gesture-circle-BOzZAIEv.js new file mode 100644 index 0000000000000000000000000000000000000000..ab5a408fa560326d104f2622ccce9f058f8efd34 --- /dev/null +++ b/assets/gesture-circle-BOzZAIEv.js @@ -0,0 +1 @@ +import{d$ as e,dU as t,dV as n,dY as r,de as i,dj as a,dk as o,dn as s,do as c,e7 as l,ee as u,ei as d,em as f,eq as p}from"./index-BF1-WNuF.js";import{b as m}from"./route-block-gWR0cCIm.js";const h={relative:``,"h-full":``},g={bg:`neutral-100/50 dark:neutral-900/50`,absolute:``,"inset-0":``,"h-fit":``,"rounded-xl":``,"px-3":``,"py-2":``,"font-mono":``,"shadow-md":``,"backdrop-blur-md":``,grid:`~ cols-[150px_1fr]`},_=6;var v=e({__name:`gesture-circle`,setup(e){let m=d(),v=d(),y=d(),b=d(),{x,y:S}=a({target:y}),C=i(v,{immediate:!0,windowResize:!0}),w=t(()=>({x:x.value,y:S.value}));o(v,e=>{let t=e[0],{width:n,height:r}=t.contentRect;y.value&&(y.value.width=n,y.value.height=r)}),u(v,e=>{if(!e)return;let t=document.createElement(`canvas`);t.width=C.width.value,t.height=C.height.value,t.style.objectFit=`contain`;let n=t.getContext(`2d`);b.value=n,y.value=t,v.value?.appendChild(t)});let T=c(w,50),E=s(w,50),D=d(E.value),O=d(0),k=d(0),A=d(!1),j=d([]),M=d(!1);return u([x,S],()=>{b.value&&(b.value.beginPath(),b.value.fillStyle=`red`,b.value.arc(x.value-20,S.value-40-40,4,0,2*Math.PI),b.value.closePath(),b.value.fill())}),u(E,()=>{if(M.value=!1,b.value&&b.value.reset(),j.value.length>=_){let e=j.value.reduce((e,t)=>e+t.x,0)/j.value.length,t=j.value.reduce((e,t)=>e+t.y,0)/j.value.length,n=j.value.map(n=>Math.sqrt((n.x-e)**2+(n.y-t)**2)),r=n.reduce((e,t)=>e+t,0)/n.length,i=n.reduce((e,t)=>e+(t-r)**2,0)/n.length,a=Math.sqrt(i);a<20&&(k.value++,M.value=!0)}j.value=[]}),u(T,e=>{j.value.push(e)}),(e,t)=>(l(),r(`div`,{ref_key:`containerRef`,ref:m,h:`[calc(100dvh-40px)]`},[n(`div`,h,[n(`div`,g,[t[0]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` pointThrottled: `,-1),n(`div`,null,p(f(T)),1),t[1]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` pointDebounced: `,-1),n(`div`,null,p(f(E)),1),t[2]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoint: `,-1),n(`div`,null,p(D.value),1),t[3]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` distance: `,-1),n(`div`,null,p(O.value),1),t[4]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` count: `,-1),n(`div`,null,p(k.value),1),t[5]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` show: `,-1),n(`div`,null,p(A.value),1),t[6]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoints: `,-1),n(`div`,null,p(j.value),1),t[7]||=n(`div`,{text:`neutral-400 dark:neutral-600`},` isCircle: `,-1),n(`div`,null,p(M.value),1)]),n(`div`,{ref_key:`canvasContainerRef`,ref:v,"h-full":``,"w-full":``},null,512)])],512))}});typeof m==`function`&&m(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/gesture-circle-uev4Cm8I.js b/assets/gesture-circle-uev4Cm8I.js deleted file mode 100644 index 57706c84f964941074598d9ff6d65215976f331d..0000000000000000000000000000000000000000 --- a/assets/gesture-circle-uev4Cm8I.js +++ /dev/null @@ -1 +0,0 @@ -import{dT as e,dU as t,dX as n,d_ as r,de as i,dj as a,dk as o,dn as s,do as c,e6 as l,ed as u,eh as d,el as f,ep as p}from"./index-DEpwtsc8.js";import{b as m}from"./route-block-gWR0cCIm.js";const h={relative:``,"h-full":``},g={bg:`neutral-100/50 dark:neutral-900/50`,absolute:``,"inset-0":``,"h-fit":``,"rounded-xl":``,"px-3":``,"py-2":``,"font-mono":``,"shadow-md":``,"backdrop-blur-md":``,grid:`~ cols-[150px_1fr]`},_=6;var v=r({__name:`gesture-circle`,setup(r){let m=d(),v=d(),y=d(),b=d(),{x,y:S}=a({target:y}),C=i(v,{immediate:!0,windowResize:!0}),w=e(()=>({x:x.value,y:S.value}));o(v,e=>{let t=e[0],{width:n,height:r}=t.contentRect;y.value&&(y.value.width=n,y.value.height=r)}),u(v,e=>{if(!e)return;let t=document.createElement(`canvas`);t.width=C.width.value,t.height=C.height.value,t.style.objectFit=`contain`;let n=t.getContext(`2d`);b.value=n,y.value=t,v.value?.appendChild(t)});let T=c(w,50),E=s(w,50),D=d(E.value),O=d(0),k=d(0),A=d(!1),j=d([]),M=d(!1);return u([x,S],()=>{b.value&&(b.value.beginPath(),b.value.fillStyle=`red`,b.value.arc(x.value-20,S.value-40-40,4,0,2*Math.PI),b.value.closePath(),b.value.fill())}),u(E,()=>{if(M.value=!1,b.value&&b.value.reset(),j.value.length>=_){let e=j.value.reduce((e,t)=>e+t.x,0)/j.value.length,t=j.value.reduce((e,t)=>e+t.y,0)/j.value.length,n=j.value.map(n=>Math.sqrt((n.x-e)**2+(n.y-t)**2)),r=n.reduce((e,t)=>e+t,0)/n.length,i=n.reduce((e,t)=>e+(t-r)**2,0)/n.length,a=Math.sqrt(i);a<20&&(k.value++,M.value=!0)}j.value=[]}),u(T,e=>{j.value.push(e)}),(e,r)=>(l(),n(`div`,{ref_key:`containerRef`,ref:m,h:`[calc(100dvh-40px)]`},[t(`div`,h,[t(`div`,g,[r[0]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` pointThrottled: `,-1),t(`div`,null,p(f(T)),1),r[1]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` pointDebounced: `,-1),t(`div`,null,p(f(E)),1),r[2]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoint: `,-1),t(`div`,null,p(D.value),1),r[3]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` distance: `,-1),t(`div`,null,p(O.value),1),r[4]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` count: `,-1),t(`div`,null,p(k.value),1),r[5]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` show: `,-1),t(`div`,null,p(A.value),1),r[6]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoints: `,-1),t(`div`,null,p(j.value),1),r[7]||=t(`div`,{text:`neutral-400 dark:neutral-600`},` isCircle: `,-1),t(`div`,null,p(M.value),1)]),t(`div`,{ref_key:`canvasContainerRef`,ref:v,"h-full":``,"w-full":``},null,512)])],512))}});typeof m==`function`&&m(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/google-generative-ai-D1AeaCUG.js b/assets/google-generative-ai-BJ5FqLIb.js similarity index 62% rename from assets/google-generative-ai-D1AeaCUG.js rename to assets/google-generative-ai-BJ5FqLIb.js index 55e472dd75fdb6191e98cbc81cbe4351e1956986..f682064408443c461cbe834a03c962992fd0808b 100644 --- a/assets/google-generative-ai-D1AeaCUG.js +++ b/assets/google-generative-ai-BJ5FqLIb.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`google-generative-ai`;var x=o({__name:`google-generative-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.anthropic.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://generativelanguage.googleapis.com/v1beta/openai/`}});function D(){C.value[b]={baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName||`Google | Gemini`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Google`,placeholder:`GEMINI_API_KEY`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://generativelanguage.googleapis.com/v1beta/openai/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`google-generative-ai`;var x=t({__name:`google-generative-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.anthropic.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://generativelanguage.googleapis.com/v1beta/openai/`}});function D(){C.value[b]={baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName||`Google | Gemini`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Google`,placeholder:`GEMINI_API_KEY`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://generativelanguage.googleapis.com/v1beta/openai/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/hearing-6WR66KfG.js b/assets/hearing-GzHWsAjD.js similarity index 77% rename from assets/hearing-6WR66KfG.js rename to assets/hearing-GzHWsAjD.js index 33b68fb22cc52101ff0af723b74ec6808c856cbf..3207521d878753340fc114b15320131708949bfc 100644 --- a/assets/hearing-6WR66KfG.js +++ b/assets/hearing-GzHWsAjD.js @@ -1 +1 @@ -import{A as e,c8 as t,cC as n,cD as r,cE as i,cM as a,cN as o,cS as s,cc as c,ci as l,cj as ee,cl as te,cm as ne,cn as re,ct as ie,d8 as u,dR as ae,dT as oe,dU as d,dV as f,dW as p,dX as m,dY as h,dZ as g,d_ as se,e4 as ce,e5 as le,e6 as _,e7 as v,e9 as ue,ed as y,ee as b,eg as x,eh as S,el as C,em as de,ep as w,p as fe,t as pe,y as me}from"./index-DEpwtsc8.js";import{b as T,e as E}from"./transformers.web-Dx6XCSrY.js";import{b as D}from"./route-block-gWR0cCIm.js";function he(){let e=S(),t=S(),n=S(),r=S([]),i=S(0),a=S();function o(e){r.value.push(e)}function s(){let a=()=>{if(!e.value||!t.value)return;e.value.getByteFrequencyData(t.value);let o=0;for(let e=0;e{let{buffer:t}=e.data;t&&t.length>0&&await this.vad.processAudio(new Float32Array(t))}}catch(e){throw console.error(`Failed to initialize audio worklet:`,e),e}}async start(e){if(!this.audioContext||!this.audioWorkletNode)throw Error(`Audio system not initialized. Call initialize() first.`);try{this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.mediaStream=e,this.sourceNode=this.audioContext.createMediaStreamSource(this.mediaStream),this.sourceNode.connect(this.audioWorkletNode);let t=this.audioContext.createGain();t.gain.value=0,this.audioWorkletNode.connect(t),t.connect(this.audioContext.destination)}catch(e){throw console.error(`Failed to start microphone:`,e),e}}stop(){this.sourceNode&&this.audioWorkletNode&&(this.sourceNode.disconnect(),this.audioWorkletNode.disconnect()),this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null),this.audioContext&&this.audioContext.state!==`closed`&&this.audioContext.suspend(),this.sourceNode=null,this.audioWorkletNode?.disconnect(),this.audioWorkletNode=null}dispose(){this.stop(),this.audioContext&&this.audioContext.state!==`closed`&&(this.audioContext.close(),this.audioContext=null),this.workletInitialized=!1}},O=class{config;model;state;sampleRateTensor;buffer;bufferPointer=0;isRecording=!1;postSpeechSamples=0;prevBuffers=[];inferenceChain=Promise.resolve();eventListeners={};isReady=!1;constructor(e={}){let t={sampleRate:16e3,speechThreshold:.3,exitThreshold:.1,minSilenceDurationMs:400,speechPadMs:80,minSpeechDurationMs:250,maxBufferDuration:30,newBufferSize:512};this.config={...t,...e},this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.sampleRateTensor=new E(`int64`,[this.config.sampleRate],[]),this.state=new E(`float32`,new Float32Array(256),[2,1,128])}async initialize(){try{this.emit(`status`,{type:`info`,message:`Loading VAD model...`}),this.model=await T.from_pretrained(`onnx-community/silero-vad`,{config:{model_type:`custom`},dtype:`fp32`}),this.isReady=!0,this.emit(`status`,{type:`info`,message:`VAD model loaded successfully`})}catch(e){throw this.emit(`status`,{type:`error`,message:`Failed to load VAD model: ${e}`}),e}}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}off(e,t){this.eventListeners[e]&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t))}emit(e,t){if(this.eventListeners[e])for(let n of this.eventListeners[e])n(t)}async processAudio(e){if(!this.isReady)throw Error(`VAD model is not initialized. Call initialize() first.`);let t=this.isRecording,n=await this.detectSpeech(e),r=this.config.sampleRate/1e3,i=this.config.minSilenceDurationMs*r,a=this.config.speechPadMs*r,o=this.config.minSpeechDurationMs*r,s=Math.ceil(a/this.config.newBufferSize);if(!t&&!n){this.prevBuffers.length>=s&&this.prevBuffers.shift(),this.prevBuffers.push(e.slice(0));return}let c=this.buffer.length-this.bufferPointer;if(e.length>=c){this.buffer.set(e.subarray(0,c),this.bufferPointer),this.bufferPointer+=c;let t=e.subarray(c);this.processSpeechSegment(t);return}else this.buffer.set(e,this.bufferPointer),this.bufferPointer+=e.length;if(n){this.isRecording||(this.emit(`speech-start`,void 0),this.emit(`status`,{type:`info`,message:`Speech detected`})),this.isRecording=!0,this.postSpeechSamples=0;return}if(this.postSpeechSamples+=e.length,this.postSpeechSamples>=i){if(this.bufferPointerthis.model?.({input:t,sr:this.sampleRateTensor,state:this.state})));this.state=n;let i=r.data[0];return this.emit(`debug`,{message:`VAD score`,data:{probability:i}}),i>this.config.speechThreshold||this.isRecording&&i>=this.config.exitThreshold}processSpeechSegment(e){let t=this.config.sampleRate/1e3,n=this.config.speechPadMs*t,r=this.bufferPointer/this.config.sampleRate*1e3,i=e?.length??0,a=this.prevBuffers.reduce((e,t)=>e+t.length,0),o=new Float32Array(a+this.bufferPointer+n),s=0;for(let e of this.prevBuffers)o.set(e,s),s+=e.length;o.set(this.buffer.slice(0,this.bufferPointer+n),s),this.emit(`speech-end`,void 0),this.emit(`speech-ready`,{buffer:o,duration:r}),e&&this.buffer.set(e,0),this.reset(i)}reset(e=0){this.buffer.fill(0,e),this.bufferPointer=e,this.isRecording=!1,this.postSpeechSamples=0,this.prevBuffers=[]}updateConfig(e){this.config={...this.config,...e},(e.maxBufferDuration||e.sampleRate)&&(this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.bufferPointer=0),e.sampleRate&&(this.sampleRateTensor=new E(`int64`,[this.config.sampleRate],[]))}getLastProbability(){return 0}isCurrentlyRecording(){return this.isRecording}};async function ve(e){let t=new O(e);return await t.initialize(),t}const ye={flex:`~ col md:row gap-6`},be={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},xe={flex:`~ col gap-4`},Se={flex:`~ col gap-4`},Ce={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},we={text:`neutral-400 dark:neutral-400`},Te={"max-w-full":``},Ee={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},De={key:1},Oe={key:0},ke={flex:`~ col gap-4`},Ae={class:`text-lg md:text-2xl`},je={text:`neutral-400 dark:neutral-400`},Me={key:0,class:`flex items-center justify-center py-4`},Ne={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Pe={"w-full":``,"rounded-xl":``},Fe={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Ie={class:`inline-flex items-center gap-4`},Le=[`src`],Re={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},ze={flex:`~ col gap-4`},Be={class:`space-y-4`},Ve={class:`space-y-3`},He={key:1,class:`space-y-3`},Ue={key:2,class:`space-y-3`},We={class:`flex items-center gap-3`},Ge={class:`text-sm font-medium`},Ke={class:`ml-auto text-xs text-neutral-500`},qe={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},Je={key:0,class:`mt-3 space-y-2`},Ye={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Xe={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},Ze={class:`ml-auto text-xs text-neutral-500`},Qe={key:0,class:`border-t border-neutral-200 pt-4 dark:border-neutral-700`},$e={key:0,class:`mt-3`},et={key:1,class:`border border-amber-200 rounded-lg bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20`},tt=50;var k=se({__name:`hearing`,setup(se){let{t:T}=e(),E=pe(),{activeTranscriptionProvider:D,activeTranscriptionModel:O,providerModels:k,activeProviderModelError:A,isLoadingActiveProviderModels:nt,supportsModelListing:rt,transcriptionModelSearchQuery:j,activeCustomModelName:it}=u(E),M=me(),{configuredTranscriptionProvidersMetadata:at}=u(M),{stopStream:ot,startStream:st}=fe(),{audioInputs:ct,selectedAudioInput:N,stream:P}=u(fe()),{startRecord:lt,stopRecord:ut,onStopRecord:dt}=t(P),{startAnalyzer:ft,stopAnalyzer:pt,onAnalyzerUpdate:mt,volumeLevel:ht}=he(),{audioContext:F}=u(c()),I=S(``),L=S(``),R=S(!1),z=S(!1),B=S(),V=S(),H=S(!1),U=S(25),W=S(50),G=S(),K=S(!1),q=S(!1),J=S(!0),Y=S(0),X=S(.5),Z=S([]),gt=S([]),_t=S([]),vt=oe(()=>gt.value.map(e=>{let t=URL.createObjectURL(e);return _t.value.push(()=>URL.revokeObjectURL(t)),t})),Q=S([]);async function yt(){if(!(K.value||q.value)){q.value=!0,L.value=``;try{let e=await ve({sampleRate:16e3,speechThreshold:X.value,exitThreshold:X.value*.3,minSilenceDurationMs:400});e.on(`speech-start`,()=>{H.value=!0,lt()}),e.on(`speech-end`,()=>{H.value=!1,ut()}),e.on(`debug`,({data:e})=>{e?.probability!==void 0&&(Y.value=e.probability,Z.value.push(e.probability),Z.value.length>tt&&Z.value.shift())}),e.on(`status`,({type:e,message:t})=>{e===`error`&&(L.value=t)});let t=new _e(e,{minChunkSize:512,audioContextOptions:{sampleRate:16e3,latencyHint:`interactive`}});await t.initialize(ge),G.value=t,K.value=!0}catch(e){L.value=e instanceof Error?e.message:String(e),console.error(`Failed to load VAD model:`,e)}finally{q.value=!1}}}async function bt(){try{if(!N.value){console.warn(`No audio input device selected`);return}if(await $(),await st(),!P.value){console.warn(`No audio stream available`);return}dt(async e=>{if(e)try{if(e&&e.size>0){gt.value.push(e);let t=await M.getProviderInstance(D.value);if(!t)throw Error(`Failed to initialize speech provider`);let n=O.value,r=await E.transcription(t,n,new File([e],`recording.wav`));Q.value.push(r.text)}}catch(e){I.value=e instanceof Error?e.message:String(e),console.error(`Error generating transcription:`,I.value)}});let e=F.value.createMediaStreamSource(P.value),t=ft(F.value);mt(e=>{(!J.value||!K.value)&&(H.value=e>U.value)}),B.value=F.value.createGain(),B.value.gain.value=z.value?W.value/100:0,t&&e.connect(t),z.value&&(e.connect(B.value),B.value.connect(F.value.destination)),J.value&&(await yt(),G.value&&await G.value.start(P.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),L.value=e instanceof Error?e.message:String(e)}}async function $(){V.value&&(cancelAnimationFrame(V.value),V.value=void 0),G.value&&await G.value.stop(),P.value&&ot(),pt(),B.value=void 0,H.value=!1,Y.value=0,Z.value=[]}async function xt(){!F.value||!B.value||(z.value?(B.value.gain.value=W.value/100,B.value.connect(F.value.destination)):(B.value.gain.value=0,B.value.disconnect()))}y(N,async()=>{R.value&&await bt()}),y(z,xt),y(W,()=>{B.value&&z.value&&(B.value.gain.value=W.value/100)}),y(X,()=>{G.value&&K.value});async function St(){R.value?(await $(),R.value=!1):(await bt(),R.value=!0)}let Ct=oe(()=>{if(!J.value||!K.value)return H.value?`bg-green-500 shadow-lg shadow-green-500/50`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`;let e=Y.value,t=X.value;return e>t?`bg-green-500 shadow-lg shadow-green-500/50`:e>t*.5?`bg-yellow-500 shadow-lg shadow-yellow-500/30`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`});function wt(e){it.value=e}return ce(async()=>{await E.loadModelsForProvider(D.value)}),le(()=>{$(),G.value&&G.value.dispose(),_t.value.forEach(e=>e())}),(e,t)=>{let c=ue(`RouterLink`);return _(),m(`div`,ye,[d(`div`,be,[d(`div`,xe,[d(`div`,null,[g(C(a),{modelValue:C(N),"onUpdate:modelValue":t[0]||=e=>x(N)?N.value=e:null,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:C(ct).map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`,layout:`vertical`},null,8,[`modelValue`,`options`])]),d(`div`,Se,[d(`div`,null,[d(`h2`,Ce,w(C(T)(`settings.pages.providers.title`)),1),d(`div`,we,[d(`span`,null,w(C(T)(`settings.pages.modules.hearing.sections.section.provider-model-selection.description`)),1)])]),d(`div`,Te,[C(at).length>0?(_(),m(`fieldset`,Ee,[(_(!0),m(ae,null,v(C(at),e=>(_(),f(C(te),{id:e.id,key:e.id,modelValue:C(D),"onUpdate:modelValue":t[1]||=e=>x(D)?D.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(_(),m(`div`,De,[g(c,{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:b(()=>t[9]||=[d(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),d(`div`,{class:`flex flex-col`},[d(`span`,{class:`font-medium`},`No Providers Configured`),d(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your Transcription providers`)],-1),d(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[9]})]))])]),C(D)&&C(rt)?(_(),m(`div`,Oe,[d(`div`,ke,[d(`div`,null,[d(`h2`,Ae,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),d(`div`,je,[d(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),C(nt)?(_(),m(`div`,Me,[t[10]||=d(`div`,{class:`mr-2 animate-spin`},[d(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),d(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):C(A)?(_(),f(C(l),{key:1,title:C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:C(A)},null,8,[`title`,`error`])):C(k).length===0&&!C(nt)?(_(),f(C(re),{key:2,type:`warning`},{title:b(()=>[h(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:b(()=>[h(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):C(k).length>0?(_(),f(C(ne),{key:3,modelValue:C(O),"onUpdate:modelValue":t[2]||=e=>x(O)?O.value=e:null,"search-query":C(j),"onUpdate:searchQuery":t[3]||=e=>x(j)?j.value=e:null,items:C(k).sort((e,t)=>e.id===C(O)?-1:t.id===C(O)?1:0),searchable:!0,"search-placeholder":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:C(j)}),"search-results-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":wt},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):p(``,!0)])])):p(``,!0)])]),d(`div`,Ne,[d(`div`,Pe,[d(`h2`,Fe,[d(`div`,Ie,[g(C(r)),d(`div`,null,w(C(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),I.value?(_(),f(C(l),{key:0,title:`Error occurred`,error:I.value,"mb-4":``},null,8,[`error`])):p(``,!0),g(C(ee),{class:`mb-4`,"w-full":``,onClick:St},{default:b(()=>[h(w(R.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),d(`div`,null,[(_(!0),m(ae,null,v(vt.value,(e,t)=>(_(),m(`div`,{key:t,class:`mb-2`},[d(`audio`,{src:e,controls:``,class:`w-full`},null,8,Le),Q.value[t]?(_(),m(`div`,Re,w(Q.value[t]),1)):p(``,!0)]))),128))]),d(`div`,ze,[d(`div`,Be,[d(`div`,Ve,[g(C(i),{level:C(ht),label:`Input Level`},null,8,[`level`]),J.value&&K.value?(_(),f(C(n),{key:0,value:Y.value,threshold:X.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):p(``,!0),J.value&&K.value?(_(),m(`div`,He,[g(C(o),{modelValue:X.value,"onUpdate:modelValue":t[4]||=e=>X.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:.1,max:.9,step:.05,"format-value":e=>`${(e*100).toFixed(0)}%`},null,8,[`modelValue`,`format-value`])])):(_(),m(`div`,Ue,[g(C(o),{modelValue:U.value,"onUpdate:modelValue":t[5]||=e=>U.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:1,max:80,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])),d(`div`,We,[d(`div`,{class:de([`h-4 w-4 rounded-full transition-all duration-200`,Ct.value])},null,2),d(`span`,Ge,w(H.value?`Speaking Detected`:`Silence`),1),d(`span`,Ke,w(J.value&&K.value?`Model Based`:`Volume Based`),1)]),d(`div`,qe,[g(C(s),{modelValue:J.value,"onUpdate:modelValue":t[6]||=e=>J.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),J.value?(_(),m(`div`,Je,[q.value?(_(),m(`div`,Ye,t[11]||=[d(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),d(`span`,{class:`text-sm`},`Loading...`,-1)])):L.value?(_(),f(C(l),{key:1,title:`Inference error`,error:L.value},null,8,[`error`])):K.value?(_(),m(`div`,Xe,[t[12]||=d(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),t[13]||=d(`span`,{class:`text-sm`},`Activated`,-1),d(`span`,Ze,` Probability: `+w((Y.value*100).toFixed(1))+`% `,1)])):p(``,!0)])):p(``,!0)]),J.value&&K.value?(_(),f(C(ie),{key:3,history:Z.value,"current-value":Y.value,threshold:X.value,"is-active":H.value,title:`Voice Activity`,subtitle:`Last 2 seconds`,"active-label":`Speaking`,"active-legend-label":`Voice detected`,"inactive-legend-label":`Silence`,"threshold-label":`Speech threshold`},null,8,[`history`,`current-value`,`threshold`,`is-active`])):p(``,!0)]),R.value?(_(),m(`div`,Qe,[g(C(s),{modelValue:z.value,"onUpdate:modelValue":t[7]||=e=>z.value=e,label:`Monitor Audio (Listen)`,description:`Enable audio playback monitoring (like OBS). Be careful of feedback!`},null,8,[`modelValue`]),z.value?(_(),m(`div`,$e,[g(C(o),{modelValue:W.value,"onUpdate:modelValue":t[8]||=e=>W.value=e,label:`Monitor Volume`,description:`Control the volume of audio monitoring playback`,min:0,max:100,step:5,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])):p(``,!0)])):p(``,!0),z.value?(_(),m(`div`,et,t[14]||=[d(`div`,{class:`flex items-center gap-2 text-amber-700 dark:text-amber-300`},[d(`div`,{class:`text-sm`,"i-solar:warning-circle-bold-duotone":``}),d(`span`,{class:`text-sm font-medium`},`Audio feedback warning`)],-1),d(`div`,{class:`mt-1 text-xs text-amber-600 dark:text-amber-400`},` Use headphones to prevent audio feedback. Lower the monitor volume if you hear echoing. `,-1)])):p(``,!0)])])])])])}}});typeof D==`function`&&D(k);var A=k;export{A as default}; \ No newline at end of file +import{A as e,c8 as t,cC as n,cD as r,cE as i,cM as a,cN as o,cS as s,cc as c,ci as l,cj as ee,cl as te,cm as ne,cn as re,ct as ie,d$ as ae,d8 as u,dS as oe,dU as se,dV as d,dW as f,dX as p,dY as m,dZ as h,d_ as g,e5 as ce,e6 as le,e7 as _,e8 as v,ea as ue,ee as y,ef as b,eh as x,ei as S,em as C,en as de,eq as w,p as fe,t as pe,y as me}from"./index-BF1-WNuF.js";import{b as T,e as E}from"./transformers.web-BCbx_Nx1.js";import{b as D}from"./route-block-gWR0cCIm.js";function he(){let e=S(),t=S(),n=S(),r=S([]),i=S(0),a=S();function o(e){r.value.push(e)}function s(){let a=()=>{if(!e.value||!t.value)return;e.value.getByteFrequencyData(t.value);let o=0;for(let e=0;e{let{buffer:t}=e.data;t&&t.length>0&&await this.vad.processAudio(new Float32Array(t))}}catch(e){throw console.error(`Failed to initialize audio worklet:`,e),e}}async start(e){if(!this.audioContext||!this.audioWorkletNode)throw Error(`Audio system not initialized. Call initialize() first.`);try{this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.mediaStream=e,this.sourceNode=this.audioContext.createMediaStreamSource(this.mediaStream),this.sourceNode.connect(this.audioWorkletNode);let t=this.audioContext.createGain();t.gain.value=0,this.audioWorkletNode.connect(t),t.connect(this.audioContext.destination)}catch(e){throw console.error(`Failed to start microphone:`,e),e}}stop(){this.sourceNode&&this.audioWorkletNode&&(this.sourceNode.disconnect(),this.audioWorkletNode.disconnect()),this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null),this.audioContext&&this.audioContext.state!==`closed`&&this.audioContext.suspend(),this.sourceNode=null,this.audioWorkletNode?.disconnect(),this.audioWorkletNode=null}dispose(){this.stop(),this.audioContext&&this.audioContext.state!==`closed`&&(this.audioContext.close(),this.audioContext=null),this.workletInitialized=!1}},O=class{config;model;state;sampleRateTensor;buffer;bufferPointer=0;isRecording=!1;postSpeechSamples=0;prevBuffers=[];inferenceChain=Promise.resolve();eventListeners={};isReady=!1;constructor(e={}){let t={sampleRate:16e3,speechThreshold:.3,exitThreshold:.1,minSilenceDurationMs:400,speechPadMs:80,minSpeechDurationMs:250,maxBufferDuration:30,newBufferSize:512};this.config={...t,...e},this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.sampleRateTensor=new E(`int64`,[this.config.sampleRate],[]),this.state=new E(`float32`,new Float32Array(256),[2,1,128])}async initialize(){try{this.emit(`status`,{type:`info`,message:`Loading VAD model...`}),this.model=await T.from_pretrained(`onnx-community/silero-vad`,{config:{model_type:`custom`},dtype:`fp32`}),this.isReady=!0,this.emit(`status`,{type:`info`,message:`VAD model loaded successfully`})}catch(e){throw this.emit(`status`,{type:`error`,message:`Failed to load VAD model: ${e}`}),e}}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}off(e,t){this.eventListeners[e]&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t))}emit(e,t){if(this.eventListeners[e])for(let n of this.eventListeners[e])n(t)}async processAudio(e){if(!this.isReady)throw Error(`VAD model is not initialized. Call initialize() first.`);let t=this.isRecording,n=await this.detectSpeech(e),r=this.config.sampleRate/1e3,i=this.config.minSilenceDurationMs*r,a=this.config.speechPadMs*r,o=this.config.minSpeechDurationMs*r,s=Math.ceil(a/this.config.newBufferSize);if(!t&&!n){this.prevBuffers.length>=s&&this.prevBuffers.shift(),this.prevBuffers.push(e.slice(0));return}let c=this.buffer.length-this.bufferPointer;if(e.length>=c){this.buffer.set(e.subarray(0,c),this.bufferPointer),this.bufferPointer+=c;let t=e.subarray(c);this.processSpeechSegment(t);return}else this.buffer.set(e,this.bufferPointer),this.bufferPointer+=e.length;if(n){this.isRecording||(this.emit(`speech-start`,void 0),this.emit(`status`,{type:`info`,message:`Speech detected`})),this.isRecording=!0,this.postSpeechSamples=0;return}if(this.postSpeechSamples+=e.length,this.postSpeechSamples>=i){if(this.bufferPointerthis.model?.({input:t,sr:this.sampleRateTensor,state:this.state})));this.state=n;let i=r.data[0];return this.emit(`debug`,{message:`VAD score`,data:{probability:i}}),i>this.config.speechThreshold||this.isRecording&&i>=this.config.exitThreshold}processSpeechSegment(e){let t=this.config.sampleRate/1e3,n=this.config.speechPadMs*t,r=this.bufferPointer/this.config.sampleRate*1e3,i=e?.length??0,a=this.prevBuffers.reduce((e,t)=>e+t.length,0),o=new Float32Array(a+this.bufferPointer+n),s=0;for(let e of this.prevBuffers)o.set(e,s),s+=e.length;o.set(this.buffer.slice(0,this.bufferPointer+n),s),this.emit(`speech-end`,void 0),this.emit(`speech-ready`,{buffer:o,duration:r}),e&&this.buffer.set(e,0),this.reset(i)}reset(e=0){this.buffer.fill(0,e),this.bufferPointer=e,this.isRecording=!1,this.postSpeechSamples=0,this.prevBuffers=[]}updateConfig(e){this.config={...this.config,...e},(e.maxBufferDuration||e.sampleRate)&&(this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.bufferPointer=0),e.sampleRate&&(this.sampleRateTensor=new E(`int64`,[this.config.sampleRate],[]))}getLastProbability(){return 0}isCurrentlyRecording(){return this.isRecording}};async function ve(e){let t=new O(e);return await t.initialize(),t}const ye={flex:`~ col md:row gap-6`},be={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},xe={flex:`~ col gap-4`},Se={flex:`~ col gap-4`},Ce={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},we={text:`neutral-400 dark:neutral-400`},Te={"max-w-full":``},Ee={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},De={key:1},Oe={key:0},ke={flex:`~ col gap-4`},Ae={class:`text-lg md:text-2xl`},je={text:`neutral-400 dark:neutral-400`},Me={key:0,class:`flex items-center justify-center py-4`},Ne={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Pe={"w-full":``,"rounded-xl":``},Fe={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Ie={class:`inline-flex items-center gap-4`},Le=[`src`],Re={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},ze={flex:`~ col gap-4`},Be={class:`space-y-4`},Ve={class:`space-y-3`},He={key:1,class:`space-y-3`},Ue={key:2,class:`space-y-3`},We={class:`flex items-center gap-3`},Ge={class:`text-sm font-medium`},Ke={class:`ml-auto text-xs text-neutral-500`},qe={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},Je={key:0,class:`mt-3 space-y-2`},Ye={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Xe={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},Ze={class:`ml-auto text-xs text-neutral-500`},Qe={key:0,class:`border-t border-neutral-200 pt-4 dark:border-neutral-700`},$e={key:0,class:`mt-3`},et={key:1,class:`border border-amber-200 rounded-lg bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20`},tt=50;var k=ae({__name:`hearing`,setup(ae){let{t:T}=e(),E=pe(),{activeTranscriptionProvider:D,activeTranscriptionModel:O,providerModels:k,activeProviderModelError:A,isLoadingActiveProviderModels:nt,supportsModelListing:rt,transcriptionModelSearchQuery:j,activeCustomModelName:it}=u(E),at=me(),{configuredTranscriptionProvidersMetadata:M}=u(at),{stopStream:ot,startStream:st}=fe(),{audioInputs:ct,selectedAudioInput:N,stream:P}=u(fe()),{startRecord:lt,stopRecord:ut,onStopRecord:dt}=t(P),{startAnalyzer:ft,stopAnalyzer:pt,onAnalyzerUpdate:mt,volumeLevel:ht}=he(),{audioContext:F}=u(c()),I=S(``),L=S(``),R=S(!1),z=S(!1),B=S(),V=S(),H=S(!1),U=S(25),W=S(50),G=S(),K=S(!1),q=S(!1),J=S(!0),Y=S(0),X=S(.5),Z=S([]),gt=S([]),_t=S([]),vt=se(()=>gt.value.map(e=>{let t=URL.createObjectURL(e);return _t.value.push(()=>URL.revokeObjectURL(t)),t})),Q=S([]);async function yt(){if(!(K.value||q.value)){q.value=!0,L.value=``;try{let e=await ve({sampleRate:16e3,speechThreshold:X.value,exitThreshold:X.value*.3,minSilenceDurationMs:400});e.on(`speech-start`,()=>{H.value=!0,lt()}),e.on(`speech-end`,()=>{H.value=!1,ut()}),e.on(`debug`,({data:e})=>{e?.probability!==void 0&&(Y.value=e.probability,Z.value.push(e.probability),Z.value.length>tt&&Z.value.shift())}),e.on(`status`,({type:e,message:t})=>{e===`error`&&(L.value=t)});let t=new _e(e,{minChunkSize:512,audioContextOptions:{sampleRate:16e3,latencyHint:`interactive`}});await t.initialize(ge),G.value=t,K.value=!0}catch(e){L.value=e instanceof Error?e.message:String(e),console.error(`Failed to load VAD model:`,e)}finally{q.value=!1}}}async function bt(){try{if(!N.value){console.warn(`No audio input device selected`);return}if(await $(),await st(),!P.value){console.warn(`No audio stream available`);return}dt(async e=>{if(e)try{if(e&&e.size>0){gt.value.push(e);let t=await at.getProviderInstance(D.value);if(!t)throw Error(`Failed to initialize speech provider`);let n=O.value,r=await E.transcription(t,n,new File([e],`recording.wav`));Q.value.push(r.text)}}catch(e){I.value=e instanceof Error?e.message:String(e),console.error(`Error generating transcription:`,I.value)}});let e=F.value.createMediaStreamSource(P.value),t=ft(F.value);mt(e=>{(!J.value||!K.value)&&(H.value=e>U.value)}),B.value=F.value.createGain(),B.value.gain.value=z.value?W.value/100:0,t&&e.connect(t),z.value&&(e.connect(B.value),B.value.connect(F.value.destination)),J.value&&(await yt(),G.value&&await G.value.start(P.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),L.value=e instanceof Error?e.message:String(e)}}async function $(){V.value&&(cancelAnimationFrame(V.value),V.value=void 0),G.value&&await G.value.stop(),P.value&&ot(),pt(),B.value=void 0,H.value=!1,Y.value=0,Z.value=[]}async function xt(){!F.value||!B.value||(z.value?(B.value.gain.value=W.value/100,B.value.connect(F.value.destination)):(B.value.gain.value=0,B.value.disconnect()))}y(N,async()=>{R.value&&await bt()}),y(z,xt),y(W,()=>{B.value&&z.value&&(B.value.gain.value=W.value/100)}),y(X,()=>{G.value&&K.value});async function St(){R.value?(await $(),R.value=!1):(await bt(),R.value=!0)}let Ct=se(()=>{if(!J.value||!K.value)return H.value?`bg-green-500 shadow-lg shadow-green-500/50`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`;let e=Y.value,t=X.value;return e>t?`bg-green-500 shadow-lg shadow-green-500/50`:e>t*.5?`bg-yellow-500 shadow-lg shadow-yellow-500/30`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`});function wt(e){it.value=e}return ce(async()=>{await E.loadModelsForProvider(D.value)}),le(()=>{$(),G.value&&G.value.dispose(),_t.value.forEach(e=>e())}),(e,t)=>{let c=ue(`RouterLink`);return _(),m(`div`,ye,[d(`div`,be,[d(`div`,xe,[d(`div`,null,[g(C(a),{modelValue:C(N),"onUpdate:modelValue":t[0]||=e=>x(N)?N.value=e:null,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:C(ct).map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`,layout:`vertical`},null,8,[`modelValue`,`options`])]),d(`div`,Se,[d(`div`,null,[d(`h2`,Ce,w(C(T)(`settings.pages.providers.title`)),1),d(`div`,we,[d(`span`,null,w(C(T)(`settings.pages.modules.hearing.sections.section.provider-model-selection.description`)),1)])]),d(`div`,Te,[C(M).length>0?(_(),m(`fieldset`,Ee,[(_(!0),m(oe,null,v(C(M),e=>(_(),f(C(te),{id:e.id,key:e.id,modelValue:C(D),"onUpdate:modelValue":t[1]||=e=>x(D)?D.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(_(),m(`div`,De,[g(c,{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:b(()=>t[9]||=[d(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),d(`div`,{class:`flex flex-col`},[d(`span`,{class:`font-medium`},`No Providers Configured`),d(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your Transcription providers`)],-1),d(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[9]})]))])]),C(D)&&C(rt)?(_(),m(`div`,Oe,[d(`div`,ke,[d(`div`,null,[d(`h2`,Ae,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),d(`div`,je,[d(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),C(nt)?(_(),m(`div`,Me,[t[10]||=d(`div`,{class:`mr-2 animate-spin`},[d(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),d(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):C(A)?(_(),f(C(l),{key:1,title:C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:C(A)},null,8,[`title`,`error`])):C(k).length===0&&!C(nt)?(_(),f(C(re),{key:2,type:`warning`},{title:b(()=>[h(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:b(()=>[h(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):C(k).length>0?(_(),f(C(ne),{key:3,modelValue:C(O),"onUpdate:modelValue":t[2]||=e=>x(O)?O.value=e:null,"search-query":C(j),"onUpdate:searchQuery":t[3]||=e=>x(j)?j.value=e:null,items:C(k).sort((e,t)=>e.id===C(O)?-1:t.id===C(O)?1:0),searchable:!0,"search-placeholder":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:C(j)}),"search-results-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":wt},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):p(``,!0)])])):p(``,!0)])]),d(`div`,Ne,[d(`div`,Pe,[d(`h2`,Fe,[d(`div`,Ie,[g(C(r)),d(`div`,null,w(C(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),I.value?(_(),f(C(l),{key:0,title:`Error occurred`,error:I.value,"mb-4":``},null,8,[`error`])):p(``,!0),g(C(ee),{class:`mb-4`,"w-full":``,onClick:St},{default:b(()=>[h(w(R.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),d(`div`,null,[(_(!0),m(oe,null,v(vt.value,(e,t)=>(_(),m(`div`,{key:t,class:`mb-2`},[d(`audio`,{src:e,controls:``,class:`w-full`},null,8,Le),Q.value[t]?(_(),m(`div`,Re,w(Q.value[t]),1)):p(``,!0)]))),128))]),d(`div`,ze,[d(`div`,Be,[d(`div`,Ve,[g(C(i),{level:C(ht),label:`Input Level`},null,8,[`level`]),J.value&&K.value?(_(),f(C(n),{key:0,value:Y.value,threshold:X.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):p(``,!0),J.value&&K.value?(_(),m(`div`,He,[g(C(o),{modelValue:X.value,"onUpdate:modelValue":t[4]||=e=>X.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:.1,max:.9,step:.05,"format-value":e=>`${(e*100).toFixed(0)}%`},null,8,[`modelValue`,`format-value`])])):(_(),m(`div`,Ue,[g(C(o),{modelValue:U.value,"onUpdate:modelValue":t[5]||=e=>U.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:1,max:80,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])),d(`div`,We,[d(`div`,{class:de([`h-4 w-4 rounded-full transition-all duration-200`,Ct.value])},null,2),d(`span`,Ge,w(H.value?`Speaking Detected`:`Silence`),1),d(`span`,Ke,w(J.value&&K.value?`Model Based`:`Volume Based`),1)]),d(`div`,qe,[g(C(s),{modelValue:J.value,"onUpdate:modelValue":t[6]||=e=>J.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),J.value?(_(),m(`div`,Je,[q.value?(_(),m(`div`,Ye,t[11]||=[d(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),d(`span`,{class:`text-sm`},`Loading...`,-1)])):L.value?(_(),f(C(l),{key:1,title:`Inference error`,error:L.value},null,8,[`error`])):K.value?(_(),m(`div`,Xe,[t[12]||=d(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),t[13]||=d(`span`,{class:`text-sm`},`Activated`,-1),d(`span`,Ze,` Probability: `+w((Y.value*100).toFixed(1))+`% `,1)])):p(``,!0)])):p(``,!0)]),J.value&&K.value?(_(),f(C(ie),{key:3,history:Z.value,"current-value":Y.value,threshold:X.value,"is-active":H.value,title:`Voice Activity`,subtitle:`Last 2 seconds`,"active-label":`Speaking`,"active-legend-label":`Voice detected`,"inactive-legend-label":`Silence`,"threshold-label":`Speech threshold`},null,8,[`history`,`current-value`,`threshold`,`is-active`])):p(``,!0)]),R.value?(_(),m(`div`,Qe,[g(C(s),{modelValue:z.value,"onUpdate:modelValue":t[7]||=e=>z.value=e,label:`Monitor Audio (Listen)`,description:`Enable audio playback monitoring (like OBS). Be careful of feedback!`},null,8,[`modelValue`]),z.value?(_(),m(`div`,$e,[g(C(o),{modelValue:W.value,"onUpdate:modelValue":t[8]||=e=>W.value=e,label:`Monitor Volume`,description:`Control the volume of audio monitoring playback`,min:0,max:100,step:5,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])):p(``,!0)])):p(``,!0),z.value?(_(),m(`div`,et,t[14]||=[d(`div`,{class:`flex items-center gap-2 text-amber-700 dark:text-amber-300`},[d(`div`,{class:`text-sm`,"i-solar:warning-circle-bold-duotone":``}),d(`span`,{class:`text-sm font-medium`},`Audio feedback warning`)],-1),d(`div`,{class:`mt-1 text-xs text-amber-600 dark:text-amber-400`},` Use headphones to prevent audio feedback. Lower the monitor volume if you hear echoing. `,-1)])):p(``,!0)])])])])])}}});typeof D==`function`&&D(k);var A=k;export{A as default}; \ No newline at end of file diff --git a/assets/home-QHat2eLA.js b/assets/home-QHat2eLA.js new file mode 100644 index 0000000000000000000000000000000000000000..44b103e7aa4404d4228462244ae2c8f8c662b0ef --- /dev/null +++ b/assets/home-QHat2eLA.js @@ -0,0 +1 @@ +import{d$ as e,d4 as t,dV as n,dY as r,d_ as i,e7 as a,em as o}from"./index-BF1-WNuF.js";const s={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},c={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"h-full":``};var l=e({__name:`home`,setup(e){return(e,l)=>(a(),r(`div`,s,[n(`div`,c,[i(o(t))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/home-YPkPvYfc.js b/assets/home-YPkPvYfc.js deleted file mode 100644 index 7654095d509f1f5a20865a5cf6d4072fb6d4c369..0000000000000000000000000000000000000000 --- a/assets/home-YPkPvYfc.js +++ /dev/null @@ -1 +0,0 @@ -import{d4 as e,dU as t,dX as n,dZ as r,d_ as i,e6 as a,el as o}from"./index-DEpwtsc8.js";const s={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},c={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"h-full":``};var l=i({__name:`home`,setup(i){return(i,l)=>(a(),n(`div`,s,[t(`div`,c,[r(o(e))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/icon-animation-C4P_W_Br.js b/assets/icon-animation-DON3nMjf.js similarity index 64% rename from assets/icon-animation-C4P_W_Br.js rename to assets/icon-animation-DON3nMjf.js index 6d40860333e90730a79580480fd09dc5570ee781..84925716f27f569694c863a488eb6736711848ea 100644 --- a/assets/icon-animation-C4P_W_Br.js +++ b/assets/icon-animation-DON3nMjf.js @@ -1 +1 @@ -import{dT as e,e4 as t,e5 as n,eh as r,o as i}from"./index-DEpwtsc8.js";function a(a){let o=r(!1),s=r(!1),c=r(a),l=i(),u=e(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return t(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),n(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as b}; \ No newline at end of file +import{dU as e,e5 as t,e6 as n,ei as r,o as i}from"./index-BF1-WNuF.js";function a(a){let o=r(!1),s=r(!1),c=r(a),l=i(),u=e(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return t(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),n(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as b}; \ No newline at end of file diff --git a/assets/image-26XCOKEz.js b/assets/image-26XCOKEz.js new file mode 100644 index 0000000000000000000000000000000000000000..68b1c5fce65c2e4009a64bfa4b0ab002c6ee266c --- /dev/null +++ b/assets/image-26XCOKEz.js @@ -0,0 +1,2 @@ +import{cO as e,d$ as t,dV as n,dX as r,dY as i,db as a,e7 as o,ei as s,em as c,eq as l}from"./index-BF1-WNuF.js";const u={bg:`neutral-100`,flex:`~ col`,"items-center":``,"justify-center":``,"rounded-lg":``,"px-4":``,"py-3":``},d={key:0},f=[`src`],p={bg:`neutral-100`,class:`text-wrap-any`,"max-h":`100`,"overflow-scroll":``,"rounded-lg":``,"text-wrap":``,"text-black":``,"font-mono":``};var m=t({__name:`image`,setup(e){let t=s(),m=s(``),{copy:h}=a({source:m});async function g(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result?.toString()||``)},r.onerror=e=>{n(e)},r.readAsDataURL(e)})}async function _(e){let n=e.target,r=n.files?.[0];if(r){t.value=r;let e=await g(r);m.value=e}}return(e,t)=>(o(),i(`div`,null,[n(`label`,u,[n(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),t[1]||=n(`span`,null,`Upload Image`,-1)]),m.value?(o(),i(`div`,d,[n(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),n(`pre`,p,` `+l(m.value)+` + `,1),n(`button`,{bg:`primary-500`,text:`white`,"mt-4":``,"rounded-lg":``,"px-4":``,"py-2":``,onClick:t[0]||=()=>c(h)()},` Copy Data URL `)])):r(``,!0)]))}}),h=e(m,[[`__scopeId`,`data-v-7edd53e6`]]);export{h as default}; \ No newline at end of file diff --git a/assets/image-D4na5vq2.js b/assets/image-D4na5vq2.js deleted file mode 100644 index a558e9ceff135823559cab9e0ee7e1547a9afe2e..0000000000000000000000000000000000000000 --- a/assets/image-D4na5vq2.js +++ /dev/null @@ -1,2 +0,0 @@ -import{cO as e,dU as t,dW as n,dX as r,d_ as i,db as a,e6 as o,eh as s,el as c,ep as l}from"./index-DEpwtsc8.js";const u={bg:`neutral-100`,flex:`~ col`,"items-center":``,"justify-center":``,"rounded-lg":``,"px-4":``,"py-3":``},d={key:0},f=[`src`],p={bg:`neutral-100`,class:`text-wrap-any`,"max-h":`100`,"overflow-scroll":``,"rounded-lg":``,"text-wrap":``,"text-black":``,"font-mono":``};var m=i({__name:`image`,setup(e){let i=s(),m=s(``),{copy:h}=a({source:m});async function g(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result?.toString()||``)},r.onerror=e=>{n(e)},r.readAsDataURL(e)})}async function _(e){let t=e.target,n=t.files?.[0];if(n){i.value=n;let e=await g(n);m.value=e}}return(e,i)=>(o(),r(`div`,null,[t(`label`,u,[t(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),i[1]||=t(`span`,null,`Upload Image`,-1)]),m.value?(o(),r(`div`,d,[t(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),t(`pre`,p,` `+l(m.value)+` - `,1),t(`button`,{bg:`primary-500`,text:`white`,"mt-4":``,"rounded-lg":``,"px-4":``,"py-2":``,onClick:i[0]||=()=>c(h)()},` Copy Data URL `)])):n(``,!0)]))}}),h=e(m,[[`__scopeId`,`data-v-7edd53e6`]]);export{h as default}; \ No newline at end of file diff --git a/assets/index-DEpwtsc8.js b/assets/index-BF1-WNuF.js similarity index 99% rename from assets/index-DEpwtsc8.js rename to assets/index-BF1-WNuF.js index 4177dbddfc5fa60accf17145ab1cb1d1e0051c9f..92a2575d85d93d881809c405bd45b50b7346ac62 100644 --- a/assets/index-DEpwtsc8.js +++ b/assets/index-BF1-WNuF.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-DkdbeVDA.js","assets/HeaderLink-Cg3P1d5b.js","assets/HeaderLink-4n3ShASi.css","assets/settings-XapIzgYq.js","assets/theme-color-B02Jz7A8.js","assets/pages-DCVmkLmw.js","assets/AnimatedWave-BifePjRS.js","assets/Scenes-C-Sbq7ai.js","assets/import-url-browser-D0zVIqhu.js","assets/duckdb-mvp-P5KShsBk.js","assets/Basic-DOfBA0ws.js","assets/AnimatedWave-CW4ij04Q.css","assets/route-block-gWR0cCIm.js","assets/background-gradient-blending-BBSUXTlB.js","assets/browser-bFm1l1qg.js","assets/background-gradient-blending-6ss5Fg2-.css","assets/background-remove-0JZi3Enw.js","assets/transformers.web-Dx6XCSrY.js","assets/InputFile-BfCkG18J.js","assets/gesture-circle-uev4Cm8I.js","assets/image-D4na5vq2.js","assets/image-BhuwcwI9.css","assets/polaroid-D7wvNIY_.js","assets/vibrant-BBcDcY4H.js","assets/settings-DZLC48Fg.js","assets/IconAnimation-DufoONwd.js","assets/airi-card-Dt8lnkmS.js","assets/CardCreate-DO-bH_p3.js","assets/CardCreationDialog-CxSxad_k.js","assets/DialogTitle-D3E9wBQi.js","assets/CardCreationDialog-UIvAa4Bx.css","assets/CardDetailDialog-CTtvzxCu.js","assets/DeleteCardDialog-D4etY9xD.js","assets/CardListItem-Dl6W0_Rh.js","assets/CardCreate-DNezsN8h.js","assets/CardCreationDialog-zZ6xk9W3.js","assets/CardDetailDialog-h5b58PK2.js","assets/CardListItem-DcGJophG.js","assets/DeleteCardDialog-emOJOrss.js","assets/appearance--O06LEpn.js","assets/color-scheme-CG_WOyF8.js","assets/color-scheme-r2m6hu6X.css","assets/developer-HmG7Pz8z.js","assets/general-a1pJgmhe.js","assets/memory-Cz1bx8kl.js","assets/models-FPOqD7a1.js","assets/icon-animation-C4P_W_Br.js","assets/modules-Butv2iNA.js","assets/consciousness-CcGtuK1e.js","assets/hearing-6WR66KfG.js","assets/memory-long-term-aOPg0SoZ.js","assets/memory-short-term-3rd3oGvN.js","assets/speech-CKJ0G9iZ.js","assets/Textarea-BXmK5gJR.js","assets/providers-piPjwyiC.js","assets/alibaba-cloud-model-studio-CQtjyEa_.js","assets/anthropic-B5Rr8xN4.js","assets/azure-ai-foundry-BUeB-9vc.js","assets/cloudflare-workers-ai-BXiaJYup.js","assets/deepseek-BlcTFZgO.js","assets/elevenlabs-Bjs_ey_R.js","assets/featherless-ai-s6uvg7Qq.js","assets/fireworks-ai-CO6L0o7G.js","assets/google-generative-ai-D1AeaCUG.js","assets/microsoft-speech-bW0zpaDE.js","assets/mistral-ai-BtAe5JTJ.js","assets/moonshot-ai-BTmYBRPo.js","assets/novita-ai-DrCt992g.js","assets/ollama-DRW2bGA7.js","assets/openai-CgMQRKzs.js","assets/openai-audio-speech-BJXomLm7.js","assets/openai-audio-transcription-CNjeZbT4.js","assets/openrouter-ai-Db66h2nl.js","assets/player2-eDuFfc86.js","assets/player2-speech-66bux_II.js","assets/together-ai-DECvdY-v.js","assets/volcengine-BXLg-lBL.js","assets/xai-2cc0qIXE.js","assets/scene-D_ELFQMq.js","assets/stage-BZBO0dUM.js","assets/filter-message-NvdjEGfA.js","assets/delays-BTktspbJ.js","assets/emotions-Dirlka9n.js","assets/messages-OFTKTDnc.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-CKyRS7eC.js","assets/HeaderLink-DVkQgheP.js","assets/HeaderLink-4n3ShASi.css","assets/settings-DJ0YDc_8.js","assets/theme-color-DY2bNlFZ.js","assets/pages-CjjKzga2.js","assets/AnimatedWave-wua8MzWE.js","assets/Scenes-CogR6jTf.js","assets/import-url-browser-D0zVIqhu.js","assets/duckdb-mvp-P5KShsBk.js","assets/Basic-kTOabOY_.js","assets/AnimatedWave-CW4ij04Q.css","assets/route-block-gWR0cCIm.js","assets/background-gradient-blending-CykJ-DB6.js","assets/browser-bFm1l1qg.js","assets/background-gradient-blending-6ss5Fg2-.css","assets/background-remove-fLURqKXM.js","assets/transformers.web-BCbx_Nx1.js","assets/InputFile-CWezcrJG.js","assets/gesture-circle-BOzZAIEv.js","assets/image-26XCOKEz.js","assets/image-BhuwcwI9.css","assets/polaroid-BoV0pdO1.js","assets/vibrant-LsjL0AjJ.js","assets/settings-BayMzedR.js","assets/IconAnimation-PgvikmZb.js","assets/airi-card-BaqHfUxO.js","assets/CardCreate-CVfo1sY1.js","assets/CardCreationDialog-Ccy00rjA.js","assets/DialogTitle-DeExZXr0.js","assets/CardCreationDialog-UIvAa4Bx.css","assets/CardDetailDialog-Cz1N4FQk.js","assets/DeleteCardDialog-CAFkJEuJ.js","assets/CardListItem-oFjJO8yD.js","assets/CardCreate-D1L2CNWh.js","assets/CardCreationDialog-DVYMLoWa.js","assets/CardDetailDialog-CTDWU09J.js","assets/CardListItem-CK8o7jg4.js","assets/DeleteCardDialog-BMk3CSBA.js","assets/appearance-Bqk97F-6.js","assets/color-scheme-gSwocc3L.js","assets/color-scheme-r2m6hu6X.css","assets/developer-BGgZf27o.js","assets/general-CQDJm-ty.js","assets/memory-CrPU-NEp.js","assets/models-BM2HFRNH.js","assets/icon-animation-DON3nMjf.js","assets/modules-D6tOd0hQ.js","assets/consciousness-D-mOgB0P.js","assets/hearing-GzHWsAjD.js","assets/memory-long-term-DCk6zf2R.js","assets/memory-short-term-DvyQeTmq.js","assets/speech-Bn9l8ac1.js","assets/Textarea-DjE71tF2.js","assets/providers-BRImID3U.js","assets/alibaba-cloud-model-studio-u_KMUc3I.js","assets/anthropic-BljXHKAw.js","assets/azure-ai-foundry-CmnN_e4a.js","assets/cloudflare-workers-ai-DH8y1cuF.js","assets/deepseek-DJ4XOLdP.js","assets/elevenlabs-CIJ-36gn.js","assets/featherless-ai-5Km5myH_.js","assets/fireworks-ai-B-as3TcQ.js","assets/google-generative-ai-BJ5FqLIb.js","assets/microsoft-speech-Bko6hWlU.js","assets/mistral-ai-teLdtiwv.js","assets/moonshot-ai-u73XFCFi.js","assets/novita-ai-7ipBHksn.js","assets/ollama-CuqQePdH.js","assets/openai-B9sunSqD.js","assets/openai-audio-speech-CbGH6VQ3.js","assets/openai-audio-transcription-BiCtqKwn.js","assets/openrouter-ai-C4TWeOIO.js","assets/player2-ClAVJB5x.js","assets/player2-speech-BP2h--1L.js","assets/together-ai-6XPxX9Zr.js","assets/volcengine-BQiNcwbw.js","assets/xai-CK1EupZF.js","assets/scene-DQODToDR.js","assets/stage-5LZVOFch.js","assets/filter-message-DeoOY8to.js","assets/delays-6S4zxQEt.js","assets/emotions-BEnYe8CF.js","assets/messages-DlXkV5Rk.js"])))=>i.map(i=>d[i]); var __create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__esmMin=(fn$5,res)=>()=>(fn$5&&(res=fn$5(fn$5=0)),res),__commonJSMin=(cb$1,mod)=>()=>(mod||cb$1((mod={exports:{}}).exports,mod),mod.exports),__export=(target$1,all$3)=>{for(var name$2 in all$3)__defProp$1(target$1,name$2,{get:all$3[name$2],enumerable:!0})},__copyProps=(to$1,from,except,desc)=>{if(from&&typeof from==`object`||typeof from==`function`)for(var keys$3=__getOwnPropNames(from),i=0,n=keys$3.length,key$2;ifrom[k$3]).bind(null,key$2),enumerable:!(desc=__getOwnPropDesc(from,key$2))||desc.enumerable});return to$1},__toESM=(mod,isNodeMode,target$1)=>(target$1=mod==null?{}:__create(__getProtoOf(mod)),__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp$1(target$1,`default`,{value:mod,enumerable:!0}):target$1,mod)),__toCommonJS=mod=>__copyProps(__defProp$1({},`__esModule`,{value:!0}),mod),__toDynamicImportESM=isNodeMode=>mod=>__toESM(mod.default,isNodeMode),__require=(x$1=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(x$1,{get:(a$1,b$1)=>(typeof require<`u`?require:a$1)[b$1]}):x$1)(function(x$1){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+x$1+"\" in an environment that doesn't expose the `require` function.")});(function(){let relList=document.createElement(`link`).relList;if(relList&&relList.supports&&relList.supports(`modulepreload`))return;for(let link$1 of document.querySelectorAll(`link[rel="modulepreload"]`))processPreload(link$1);new MutationObserver(mutations$1=>{for(let mutation of mutations$1){if(mutation.type!==`childList`)continue;for(let node$1 of mutation.addedNodes)node$1.tagName===`LINK`&&node$1.rel===`modulepreload`&&processPreload(node$1)}}).observe(document,{childList:!0,subtree:!0});function getFetchOpts(link$1){let fetchOpts={};return link$1.integrity&&(fetchOpts.integrity=link$1.integrity),link$1.referrerPolicy&&(fetchOpts.referrerPolicy=link$1.referrerPolicy),link$1.crossOrigin===`use-credentials`?fetchOpts.credentials=`include`:link$1.crossOrigin===`anonymous`?fetchOpts.credentials=`omit`:fetchOpts.credentials=`same-origin`,fetchOpts}function processPreload(link$1){if(link$1.ep)return;link$1.ep=!0;let fetchOpts=getFetchOpts(link$1);fetch(link$1.href,fetchOpts)}})(); /** * @vue/shared v3.5.18 @@ -3848,7 +3848,7 @@ void main() { }`;var WebXRDepthSensing=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(depthData,renderState){if(this.texture===null){let texture=new ExternalTexture(depthData.texture);(depthData.depthNear!==renderState.depthNear||depthData.depthFar!==renderState.depthFar)&&(this.depthNear=depthData.depthNear,this.depthFar=depthData.depthFar),this.texture=texture}}getMesh(cameraXR){if(this.texture!==null&&this.mesh===null){let viewport=cameraXR.cameras[0].viewport,material=new ShaderMaterial({vertexShader:_occlusion_vertex,fragmentShader:_occlusion_fragment,uniforms:{depthColor:{value:this.texture},depthWidth:{value:viewport.z},depthHeight:{value:viewport.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),material)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},WebXRManager=class extends EventDispatcher{constructor(renderer$1,gl){super();let scope$1=this,session=null,framebufferScaleFactor=1,referenceSpace=null,referenceSpaceType=`local-floor`,foveation=1,customReferenceSpace=null,pose=null,glBinding=null,glProjLayer=null,glBaseLayer=null,xrFrame=null,depthSensing=new WebXRDepthSensing,cameraAccessTextures={},attributes=gl.getContextAttributes(),initialRenderTarget=null,newRenderTarget=null,controllers=[],controllerInputSources=[],currentSize=new Vector2,currentPixelRatio=null,cameraL=new PerspectiveCamera;cameraL.viewport=new Vector4;let cameraR=new PerspectiveCamera;cameraR.viewport=new Vector4;let cameras=[cameraL,cameraR],cameraXR=new ArrayCamera,_currentDepthNear=null,_currentDepthFar=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(index$1){let controller=controllers[index$1];return controller===void 0&&(controller=new WebXRController,controllers[index$1]=controller),controller.getTargetRaySpace()},this.getControllerGrip=function(index$1){let controller=controllers[index$1];return controller===void 0&&(controller=new WebXRController,controllers[index$1]=controller),controller.getGripSpace()},this.getHand=function(index$1){let controller=controllers[index$1];return controller===void 0&&(controller=new WebXRController,controllers[index$1]=controller),controller.getHandSpace()};function onSessionEvent(event){let controllerIndex=controllerInputSources.indexOf(event.inputSource);if(controllerIndex===-1)return;let controller=controllers[controllerIndex];controller!==void 0&&(controller.update(event.inputSource,event.frame,customReferenceSpace||referenceSpace),controller.dispatchEvent({type:event.type,data:event.inputSource}))}function onSessionEnd(){session.removeEventListener(`select`,onSessionEvent),session.removeEventListener(`selectstart`,onSessionEvent),session.removeEventListener(`selectend`,onSessionEvent),session.removeEventListener(`squeeze`,onSessionEvent),session.removeEventListener(`squeezestart`,onSessionEvent),session.removeEventListener(`squeezeend`,onSessionEvent),session.removeEventListener(`end`,onSessionEnd),session.removeEventListener(`inputsourceschange`,onInputSourcesChange);for(let i=0;i=0&&(controllerInputSources[index$1]=null,controllers[index$1].disconnect(inputSource))}for(let i=0;i=controllerInputSources.length){controllerInputSources.push(inputSource),controllerIndex=i$1;break}else if(controllerInputSources[i$1]===null){controllerInputSources[i$1]=inputSource,controllerIndex=i$1;break}if(controllerIndex===-1)break}let controller=controllers[controllerIndex];controller&&controller.connect(inputSource)}}let cameraLPos=new Vector3,cameraRPos=new Vector3;function setProjectionFromUnion(camera,cameraL$1,cameraR$1){cameraLPos.setFromMatrixPosition(cameraL$1.matrixWorld),cameraRPos.setFromMatrixPosition(cameraR$1.matrixWorld);let ipd=cameraLPos.distanceTo(cameraRPos),projL=cameraL$1.projectionMatrix.elements,projR=cameraR$1.projectionMatrix.elements,near=projL[14]/(projL[10]-1),far=projL[14]/(projL[10]+1),topFov=(projL[9]+1)/projL[5],bottomFov=(projL[9]-1)/projL[5],leftFov=(projL[8]-1)/projL[0],rightFov=(projR[8]+1)/projR[0],left=near*leftFov,right=near*rightFov,zOffset=ipd/(-leftFov+rightFov),xOffset=zOffset*-leftFov;if(cameraL$1.matrixWorld.decompose(camera.position,camera.quaternion,camera.scale),camera.translateX(xOffset),camera.translateZ(zOffset),camera.matrixWorld.compose(camera.position,camera.quaternion,camera.scale),camera.matrixWorldInverse.copy(camera.matrixWorld).invert(),projL[10]===-1)camera.projectionMatrix.copy(cameraL$1.projectionMatrix),camera.projectionMatrixInverse.copy(cameraL$1.projectionMatrixInverse);else{let near2=near+zOffset,far2=far+zOffset,left2=left-xOffset,right2=right+(ipd-xOffset),top2=topFov*far/far2*near2,bottom2=bottomFov*far/far2*near2;camera.projectionMatrix.makePerspective(left2,right2,top2,bottom2,near2,far2),camera.projectionMatrixInverse.copy(camera.projectionMatrix).invert()}}function updateCamera(camera,parent){parent===null?camera.matrixWorld.copy(camera.matrix):camera.matrixWorld.multiplyMatrices(parent.matrixWorld,camera.matrix),camera.matrixWorldInverse.copy(camera.matrixWorld).invert()}this.updateCamera=function(camera){if(session===null)return;let depthNear=camera.near,depthFar=camera.far;depthSensing.texture!==null&&(depthSensing.depthNear>0&&(depthNear=depthSensing.depthNear),depthSensing.depthFar>0&&(depthFar=depthSensing.depthFar)),cameraXR.near=cameraR.near=cameraL.near=depthNear,cameraXR.far=cameraR.far=cameraL.far=depthFar,(_currentDepthNear!==cameraXR.near||_currentDepthFar!==cameraXR.far)&&(session.updateRenderState({depthNear:cameraXR.near,depthFar:cameraXR.far}),_currentDepthNear=cameraXR.near,_currentDepthFar=cameraXR.far),cameraXR.layers.mask=camera.layers.mask|6,cameraL.layers.mask=cameraXR.layers.mask&3,cameraR.layers.mask=cameraXR.layers.mask&5;let parent=camera.parent,cameras$1=cameraXR.cameras;updateCamera(cameraXR,parent);for(let i=0;i0&&(uniforms.alphaTest.value=material.alphaTest);let materialProperties=properties.get(material),envMap=materialProperties.envMap,envMapRotation=materialProperties.envMapRotation;envMap&&(uniforms.envMap.value=envMap,_e1.copy(envMapRotation),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,envMap.isCubeTexture&&envMap.isRenderTargetTexture===!1&&(_e1.y*=-1,_e1.z*=-1),uniforms.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),uniforms.flipEnvMap.value=envMap.isCubeTexture&&envMap.isRenderTargetTexture===!1?-1:1,uniforms.reflectivity.value=material.reflectivity,uniforms.ior.value=material.ior,uniforms.refractionRatio.value=material.refractionRatio),material.lightMap&&(uniforms.lightMap.value=material.lightMap,uniforms.lightMapIntensity.value=material.lightMapIntensity,refreshTransformUniform(material.lightMap,uniforms.lightMapTransform)),material.aoMap&&(uniforms.aoMap.value=material.aoMap,uniforms.aoMapIntensity.value=material.aoMapIntensity,refreshTransformUniform(material.aoMap,uniforms.aoMapTransform))}function refreshUniformsLine(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform))}function refreshUniformsDash(uniforms,material){uniforms.dashSize.value=material.dashSize,uniforms.totalSize.value=material.dashSize+material.gapSize,uniforms.scale.value=material.scale}function refreshUniformsPoints(uniforms,material,pixelRatio,height){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.size.value=material.size*pixelRatio,uniforms.scale.value=height*.5,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.uvTransform)),material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform)),material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}function refreshUniformsSprites(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.rotation.value=material.rotation,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform)),material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform)),material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}function refreshUniformsPhong(uniforms,material){uniforms.specular.value.copy(material.specular),uniforms.shininess.value=Math.max(material.shininess,1e-4)}function refreshUniformsToon(uniforms,material){material.gradientMap&&(uniforms.gradientMap.value=material.gradientMap)}function refreshUniformsStandard(uniforms,material){uniforms.metalness.value=material.metalness,material.metalnessMap&&(uniforms.metalnessMap.value=material.metalnessMap,refreshTransformUniform(material.metalnessMap,uniforms.metalnessMapTransform)),uniforms.roughness.value=material.roughness,material.roughnessMap&&(uniforms.roughnessMap.value=material.roughnessMap,refreshTransformUniform(material.roughnessMap,uniforms.roughnessMapTransform)),material.envMap&&(uniforms.envMapIntensity.value=material.envMapIntensity)}function refreshUniformsPhysical(uniforms,material,transmissionRenderTarget){uniforms.ior.value=material.ior,material.sheen>0&&(uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen),uniforms.sheenRoughness.value=material.sheenRoughness,material.sheenColorMap&&(uniforms.sheenColorMap.value=material.sheenColorMap,refreshTransformUniform(material.sheenColorMap,uniforms.sheenColorMapTransform)),material.sheenRoughnessMap&&(uniforms.sheenRoughnessMap.value=material.sheenRoughnessMap,refreshTransformUniform(material.sheenRoughnessMap,uniforms.sheenRoughnessMapTransform))),material.clearcoat>0&&(uniforms.clearcoat.value=material.clearcoat,uniforms.clearcoatRoughness.value=material.clearcoatRoughness,material.clearcoatMap&&(uniforms.clearcoatMap.value=material.clearcoatMap,refreshTransformUniform(material.clearcoatMap,uniforms.clearcoatMapTransform)),material.clearcoatRoughnessMap&&(uniforms.clearcoatRoughnessMap.value=material.clearcoatRoughnessMap,refreshTransformUniform(material.clearcoatRoughnessMap,uniforms.clearcoatRoughnessMapTransform)),material.clearcoatNormalMap&&(uniforms.clearcoatNormalMap.value=material.clearcoatNormalMap,refreshTransformUniform(material.clearcoatNormalMap,uniforms.clearcoatNormalMapTransform),uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale),material.side===BackSide&&uniforms.clearcoatNormalScale.value.negate())),material.dispersion>0&&(uniforms.dispersion.value=material.dispersion),material.iridescence>0&&(uniforms.iridescence.value=material.iridescence,uniforms.iridescenceIOR.value=material.iridescenceIOR,uniforms.iridescenceThicknessMinimum.value=material.iridescenceThicknessRange[0],uniforms.iridescenceThicknessMaximum.value=material.iridescenceThicknessRange[1],material.iridescenceMap&&(uniforms.iridescenceMap.value=material.iridescenceMap,refreshTransformUniform(material.iridescenceMap,uniforms.iridescenceMapTransform)),material.iridescenceThicknessMap&&(uniforms.iridescenceThicknessMap.value=material.iridescenceThicknessMap,refreshTransformUniform(material.iridescenceThicknessMap,uniforms.iridescenceThicknessMapTransform))),material.transmission>0&&(uniforms.transmission.value=material.transmission,uniforms.transmissionSamplerMap.value=transmissionRenderTarget.texture,uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width,transmissionRenderTarget.height),material.transmissionMap&&(uniforms.transmissionMap.value=material.transmissionMap,refreshTransformUniform(material.transmissionMap,uniforms.transmissionMapTransform)),uniforms.thickness.value=material.thickness,material.thicknessMap&&(uniforms.thicknessMap.value=material.thicknessMap,refreshTransformUniform(material.thicknessMap,uniforms.thicknessMapTransform)),uniforms.attenuationDistance.value=material.attenuationDistance,uniforms.attenuationColor.value.copy(material.attenuationColor)),material.anisotropy>0&&(uniforms.anisotropyVector.value.set(material.anisotropy*Math.cos(material.anisotropyRotation),material.anisotropy*Math.sin(material.anisotropyRotation)),material.anisotropyMap&&(uniforms.anisotropyMap.value=material.anisotropyMap,refreshTransformUniform(material.anisotropyMap,uniforms.anisotropyMapTransform))),uniforms.specularIntensity.value=material.specularIntensity,uniforms.specularColor.value.copy(material.specularColor),material.specularColorMap&&(uniforms.specularColorMap.value=material.specularColorMap,refreshTransformUniform(material.specularColorMap,uniforms.specularColorMapTransform)),material.specularIntensityMap&&(uniforms.specularIntensityMap.value=material.specularIntensityMap,refreshTransformUniform(material.specularIntensityMap,uniforms.specularIntensityMapTransform))}function refreshUniformsMatcap(uniforms,material){material.matcap&&(uniforms.matcap.value=material.matcap)}function refreshUniformsDistance(uniforms,material){let light=properties.get(material).light;uniforms.referencePosition.value.setFromMatrixPosition(light.matrixWorld),uniforms.nearDistance.value=light.shadow.camera.near,uniforms.farDistance.value=light.shadow.camera.far}return{refreshFogUniforms,refreshMaterialUniforms}}function WebGLUniformsGroups(gl,info,capabilities,state){let buffers={},updateList={},allocatedBindingPoints=[],maxBindingPoints=gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS);function bind(uniformsGroup,program){let webglProgram=program.program;state.uniformBlockBinding(uniformsGroup,webglProgram)}function update(uniformsGroup,program){let buffer$1=buffers[uniformsGroup.id];buffer$1===void 0&&(prepareUniformsGroup(uniformsGroup),buffer$1=createBuffer(uniformsGroup),buffers[uniformsGroup.id]=buffer$1,uniformsGroup.addEventListener(`dispose`,onUniformsGroupsDispose));let webglProgram=program.program;state.updateUBOMapping(uniformsGroup,webglProgram);let frame$1=info.render.frame;updateList[uniformsGroup.id]!==frame$1&&(updateBufferData(uniformsGroup),updateList[uniformsGroup.id]=frame$1)}function createBuffer(uniformsGroup){let bindingPointIndex=allocateBindingPointIndex();uniformsGroup.__bindingPointIndex=bindingPointIndex;let buffer$1=gl.createBuffer(),size$2=uniformsGroup.__size,usage=uniformsGroup.usage;return gl.bindBuffer(gl.UNIFORM_BUFFER,buffer$1),gl.bufferData(gl.UNIFORM_BUFFER,size$2,usage),gl.bindBuffer(gl.UNIFORM_BUFFER,null),gl.bindBufferBase(gl.UNIFORM_BUFFER,bindingPointIndex,buffer$1),buffer$1}function allocateBindingPointIndex(){for(let i=0;i0&&(offset$2+=chunkSize-chunkOffset),uniformsGroup.__size=offset$2,uniformsGroup.__cache={},this}function getUniformSize(value$1){let info$1={boundary:0,storage:0};return typeof value$1==`number`||typeof value$1==`boolean`?(info$1.boundary=4,info$1.storage=4):value$1.isVector2?(info$1.boundary=8,info$1.storage=8):value$1.isVector3||value$1.isColor?(info$1.boundary=16,info$1.storage=12):value$1.isVector4?(info$1.boundary=16,info$1.storage=16):value$1.isMatrix3?(info$1.boundary=48,info$1.storage=48):value$1.isMatrix4?(info$1.boundary=64,info$1.storage=64):value$1.isTexture?console.warn(`THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.`):console.warn(`THREE.WebGLRenderer: Unsupported uniform value type.`,value$1),info$1}function onUniformsGroupsDispose(event){let uniformsGroup=event.target;uniformsGroup.removeEventListener(`dispose`,onUniformsGroupsDispose);let index$1=allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex);allocatedBindingPoints.splice(index$1,1),gl.deleteBuffer(buffers[uniformsGroup.id]),delete buffers[uniformsGroup.id],delete updateList[uniformsGroup.id]}function dispose$1(){for(let id in buffers)gl.deleteBuffer(buffers[id]);allocatedBindingPoints=[],buffers={},updateList={}}return{bind,update,dispose:dispose$1}}var WebGLRenderer=class{constructor(parameters={}){let{canvas=createCanvasElement(),context:context$1=null,depth=!0,stencil=!1,alpha:alpha$1=!1,antialias=!1,premultipliedAlpha=!0,preserveDrawingBuffer=!1,powerPreference=`default`,failIfMajorPerformanceCaveat=!1,reversedDepthBuffer=!1}=parameters;this.isWebGLRenderer=!0;let _alpha;if(context$1!==null){if(typeof WebGLRenderingContext<`u`&&context$1 instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);_alpha=context$1.getContextAttributes().alpha}else _alpha=alpha$1;let uintClearColor=new Uint32Array(4),intClearColor=new Int32Array(4),currentRenderList=null,currentRenderState=null,renderListStack=[],renderStateStack=[];this.domElement=canvas,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let _this=this,_isContextLost=!1;this._outputColorSpace=SRGBColorSpace;let _currentActiveCubeFace=0,_currentActiveMipmapLevel=0,_currentRenderTarget=null,_currentMaterialId=-1,_currentCamera=null,_currentViewport=new Vector4,_currentScissor=new Vector4,_currentScissorTest=null,_currentClearColor=new Color(0),_currentClearAlpha=0,_width=canvas.width,_height=canvas.height,_pixelRatio=1,_opaqueSort=null,_transparentSort=null,_viewport=new Vector4(0,0,_width,_height),_scissor=new Vector4(0,0,_width,_height),_scissorTest=!1,_frustum$2=new Frustum,_clippingEnabled=!1,_localClippingEnabled=!1,_projScreenMatrix$3=new Matrix4,_vector3$1=new Vector3,_vector4=new Vector4,_emptyScene={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},_renderBackground=!1;function getTargetPixelRatio(){return _currentRenderTarget===null?_pixelRatio:1}let _gl=context$1;function getContext$1(contextName,contextAttributes){return canvas.getContext(contextName,contextAttributes)}try{let contextAttributes={alpha:!0,depth,stencil,antialias,premultipliedAlpha,preserveDrawingBuffer,powerPreference,failIfMajorPerformanceCaveat};if(`setAttribute`in canvas&&canvas.setAttribute(`data-engine`,`three.js r${REVISION}`),canvas.addEventListener(`webglcontextlost`,onContextLost,!1),canvas.addEventListener(`webglcontextrestored`,onContextRestore,!1),canvas.addEventListener(`webglcontextcreationerror`,onContextCreationError,!1),_gl===null){let contextName=`webgl2`;if(_gl=getContext$1(contextName,contextAttributes),_gl===null)throw getContext$1(contextName)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(error){throw console.error(`THREE.WebGLRenderer: `+error.message),error}let extensions,capabilities,state,info,properties,textures,cubemaps,cubeuvmaps,attributes,geometries,objects,programCache,materials,renderLists,renderStates,clipping,shadowMap,background,morphtargets,bufferRenderer,indexedBufferRenderer,utils$1,bindingStates,uniformsGroups;function initGLContext(){extensions=new WebGLExtensions(_gl),extensions.init(),utils$1=new WebGLUtils(_gl,extensions),capabilities=new WebGLCapabilities(_gl,extensions,parameters,utils$1),state=new WebGLState(_gl,extensions),capabilities.reversedDepthBuffer&&reversedDepthBuffer&&state.buffers.depth.setReversed(!0),info=new WebGLInfo(_gl),properties=new WebGLProperties,textures=new WebGLTextures(_gl,extensions,state,properties,capabilities,utils$1,info),cubemaps=new WebGLCubeMaps(_this),cubeuvmaps=new WebGLCubeUVMaps(_this),attributes=new WebGLAttributes(_gl),bindingStates=new WebGLBindingStates(_gl,attributes),geometries=new WebGLGeometries(_gl,attributes,info,bindingStates),objects=new WebGLObjects(_gl,geometries,attributes,info),morphtargets=new WebGLMorphtargets(_gl,capabilities,textures),clipping=new WebGLClipping(properties),programCache=new WebGLPrograms(_this,cubemaps,cubeuvmaps,extensions,capabilities,bindingStates,clipping),materials=new WebGLMaterials(_this,properties),renderLists=new WebGLRenderLists,renderStates=new WebGLRenderStates(extensions),background=new WebGLBackground(_this,cubemaps,cubeuvmaps,state,objects,_alpha,premultipliedAlpha),shadowMap=new WebGLShadowMap(_this,objects,capabilities),uniformsGroups=new WebGLUniformsGroups(_gl,info,capabilities,state),bufferRenderer=new WebGLBufferRenderer(_gl,extensions,info),indexedBufferRenderer=new WebGLIndexedBufferRenderer(_gl,extensions,info),info.programs=programCache.programs,_this.capabilities=capabilities,_this.extensions=extensions,_this.properties=properties,_this.renderLists=renderLists,_this.shadowMap=shadowMap,_this.state=state,_this.info=info}initGLContext();let xr$1=new WebXRManager(_this,_gl);this.xr=xr$1,this.getContext=function(){return _gl},this.getContextAttributes=function(){return _gl.getContextAttributes()},this.forceContextLoss=function(){let extension$1=extensions.get(`WEBGL_lose_context`);extension$1&&extension$1.loseContext()},this.forceContextRestore=function(){let extension$1=extensions.get(`WEBGL_lose_context`);extension$1&&extension$1.restoreContext()},this.getPixelRatio=function(){return _pixelRatio},this.setPixelRatio=function(value$1){value$1!==void 0&&(_pixelRatio=value$1,this.setSize(_width,_height,!1))},this.getSize=function(target$1){return target$1.set(_width,_height)},this.setSize=function(width,height,updateStyle=!0){if(xr$1.isPresenting){console.warn(`THREE.WebGLRenderer: Can't change size while VR device is presenting.`);return}_width=width,_height=height,canvas.width=Math.floor(width*_pixelRatio),canvas.height=Math.floor(height*_pixelRatio),updateStyle===!0&&(canvas.style.width=width+`px`,canvas.style.height=height+`px`),this.setViewport(0,0,width,height)},this.getDrawingBufferSize=function(target$1){return target$1.set(_width*_pixelRatio,_height*_pixelRatio).floor()},this.setDrawingBufferSize=function(width,height,pixelRatio){_width=width,_height=height,_pixelRatio=pixelRatio,canvas.width=Math.floor(width*pixelRatio),canvas.height=Math.floor(height*pixelRatio),this.setViewport(0,0,width,height)},this.getCurrentViewport=function(target$1){return target$1.copy(_currentViewport)},this.getViewport=function(target$1){return target$1.copy(_viewport)},this.setViewport=function(x$1,y,width,height){x$1.isVector4?_viewport.set(x$1.x,x$1.y,x$1.z,x$1.w):_viewport.set(x$1,y,width,height),state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).round())},this.getScissor=function(target$1){return target$1.copy(_scissor)},this.setScissor=function(x$1,y,width,height){x$1.isVector4?_scissor.set(x$1.x,x$1.y,x$1.z,x$1.w):_scissor.set(x$1,y,width,height),state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).round())},this.getScissorTest=function(){return _scissorTest},this.setScissorTest=function(boolean$3){state.setScissorTest(_scissorTest=boolean$3)},this.setOpaqueSort=function(method){_opaqueSort=method},this.setTransparentSort=function(method){_transparentSort=method},this.getClearColor=function(target$1){return target$1.copy(background.getClearColor())},this.setClearColor=function(){background.setClearColor(...arguments)},this.getClearAlpha=function(){return background.getClearAlpha()},this.setClearAlpha=function(){background.setClearAlpha(...arguments)},this.clear=function(color$2=!0,depth$1=!0,stencil$1=!0){let bits=0;if(color$2){let isIntegerFormat=!1;if(_currentRenderTarget!==null){let targetFormat=_currentRenderTarget.texture.format;isIntegerFormat=targetFormat===RGBAIntegerFormat||targetFormat===RGIntegerFormat||targetFormat===RedIntegerFormat}if(isIntegerFormat){let targetType=_currentRenderTarget.texture.type,isUnsignedType=targetType===UnsignedByteType||targetType===UnsignedIntType||targetType===UnsignedShortType||targetType===UnsignedInt248Type||targetType===UnsignedShort4444Type||targetType===UnsignedShort5551Type,clearColor=background.getClearColor(),a$1=background.getClearAlpha(),r$1=clearColor.r,g=clearColor.g,b$1=clearColor.b;isUnsignedType?(uintClearColor[0]=r$1,uintClearColor[1]=g,uintClearColor[2]=b$1,uintClearColor[3]=a$1,_gl.clearBufferuiv(_gl.COLOR,0,uintClearColor)):(intClearColor[0]=r$1,intClearColor[1]=g,intClearColor[2]=b$1,intClearColor[3]=a$1,_gl.clearBufferiv(_gl.COLOR,0,intClearColor))}else bits|=_gl.COLOR_BUFFER_BIT}depth$1&&(bits|=_gl.DEPTH_BUFFER_BIT),stencil$1&&(bits|=_gl.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),_gl.clear(bits)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){canvas.removeEventListener(`webglcontextlost`,onContextLost,!1),canvas.removeEventListener(`webglcontextrestored`,onContextRestore,!1),canvas.removeEventListener(`webglcontextcreationerror`,onContextCreationError,!1),background.dispose(),renderLists.dispose(),renderStates.dispose(),properties.dispose(),cubemaps.dispose(),cubeuvmaps.dispose(),objects.dispose(),bindingStates.dispose(),uniformsGroups.dispose(),programCache.dispose(),xr$1.dispose(),xr$1.removeEventListener(`sessionstart`,onXRSessionStart),xr$1.removeEventListener(`sessionend`,onXRSessionEnd),animation.stop()};function onContextLost(event){event.preventDefault(),console.log(`THREE.WebGLRenderer: Context Lost.`),_isContextLost=!0}function onContextRestore(){console.log(`THREE.WebGLRenderer: Context Restored.`),_isContextLost=!1;let infoAutoReset=info.autoReset,shadowMapEnabled=shadowMap.enabled,shadowMapAutoUpdate=shadowMap.autoUpdate,shadowMapNeedsUpdate=shadowMap.needsUpdate,shadowMapType=shadowMap.type;initGLContext(),info.autoReset=infoAutoReset,shadowMap.enabled=shadowMapEnabled,shadowMap.autoUpdate=shadowMapAutoUpdate,shadowMap.needsUpdate=shadowMapNeedsUpdate,shadowMap.type=shadowMapType}function onContextCreationError(event){console.error(`THREE.WebGLRenderer: A WebGL context could not be created. Reason: `,event.statusMessage)}function onMaterialDispose(event){let material=event.target;material.removeEventListener(`dispose`,onMaterialDispose),deallocateMaterial(material)}function deallocateMaterial(material){releaseMaterialProgramReferences(material),properties.remove(material)}function releaseMaterialProgramReferences(material){let programs=properties.get(material).programs;programs!==void 0&&(programs.forEach(function(program){programCache.releaseProgram(program)}),material.isShaderMaterial&&programCache.releaseShaderCache(material))}this.renderBufferDirect=function(camera,scene,geometry,material,object$1,group){scene===null&&(scene=_emptyScene);let frontFaceCW=object$1.isMesh&&object$1.matrixWorld.determinant()<0,program=setProgram(camera,scene,geometry,material,object$1);state.setMaterial(material,frontFaceCW);let index$1=geometry.index,rangeFactor=1;if(material.wireframe===!0){if(index$1=geometries.getWireframeAttribute(geometry),index$1===void 0)return;rangeFactor=2}let drawRange=geometry.drawRange,position$2=geometry.attributes.position,drawStart=drawRange.start*rangeFactor,drawEnd=(drawRange.start+drawRange.count)*rangeFactor;group!==null&&(drawStart=Math.max(drawStart,group.start*rangeFactor),drawEnd=Math.min(drawEnd,(group.start+group.count)*rangeFactor)),index$1===null?position$2!=null&&(drawStart=Math.max(drawStart,0),drawEnd=Math.min(drawEnd,position$2.count)):(drawStart=Math.max(drawStart,0),drawEnd=Math.min(drawEnd,index$1.count));let drawCount=drawEnd-drawStart;if(drawCount<0||drawCount===1/0)return;bindingStates.setup(object$1,material,program,geometry,index$1);let attribute,renderer$1=bufferRenderer;if(index$1!==null&&(attribute=attributes.get(index$1),renderer$1=indexedBufferRenderer,renderer$1.setIndex(attribute)),object$1.isMesh)material.wireframe===!0?(state.setLineWidth(material.wireframeLinewidth*getTargetPixelRatio()),renderer$1.setMode(_gl.LINES)):renderer$1.setMode(_gl.TRIANGLES);else if(object$1.isLine){let lineWidth=material.linewidth;lineWidth===void 0&&(lineWidth=1),state.setLineWidth(lineWidth*getTargetPixelRatio()),object$1.isLineSegments?renderer$1.setMode(_gl.LINES):object$1.isLineLoop?renderer$1.setMode(_gl.LINE_LOOP):renderer$1.setMode(_gl.LINE_STRIP)}else object$1.isPoints?renderer$1.setMode(_gl.POINTS):object$1.isSprite&&renderer$1.setMode(_gl.TRIANGLES);if(object$1.isBatchedMesh)if(object$1._multiDrawInstances!==null)warnOnce$1(`THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.`),renderer$1.renderMultiDrawInstances(object$1._multiDrawStarts,object$1._multiDrawCounts,object$1._multiDrawCount,object$1._multiDrawInstances);else if(extensions.get(`WEBGL_multi_draw`))renderer$1.renderMultiDraw(object$1._multiDrawStarts,object$1._multiDrawCounts,object$1._multiDrawCount);else{let starts=object$1._multiDrawStarts,counts=object$1._multiDrawCounts,drawCount$1=object$1._multiDrawCount,bytesPerElement=index$1?attributes.get(index$1).bytesPerElement:1,uniforms=properties.get(material).currentProgram.getUniforms();for(let i=0;i{function checkMaterialsReady(){if(materials$1.forEach(function(material){let materialProperties=properties.get(material),program=materialProperties.currentProgram;program.isReady()&&materials$1.delete(material)}),materials$1.size===0){resolve$1(scene);return}setTimeout(checkMaterialsReady,10)}extensions.get(`KHR_parallel_shader_compile`)===null?setTimeout(checkMaterialsReady,10):checkMaterialsReady()})};let onAnimationFrameCallback=null;function onAnimationFrame(time$2){onAnimationFrameCallback&&onAnimationFrameCallback(time$2)}function onXRSessionStart(){animation.stop()}function onXRSessionEnd(){animation.start()}let animation=new WebGLAnimation;animation.setAnimationLoop(onAnimationFrame),typeof self<`u`&&animation.setContext(self),this.setAnimationLoop=function(callback){onAnimationFrameCallback=callback,xr$1.setAnimationLoop(callback),callback===null?animation.stop():animation.start()},xr$1.addEventListener(`sessionstart`,onXRSessionStart),xr$1.addEventListener(`sessionend`,onXRSessionEnd),this.render=function(scene,camera){if(camera!==void 0&&camera.isCamera!==!0){console.error(`THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(_isContextLost===!0)return;if(scene.matrixWorldAutoUpdate===!0&&scene.updateMatrixWorld(),camera.parent===null&&camera.matrixWorldAutoUpdate===!0&&camera.updateMatrixWorld(),xr$1.enabled===!0&&xr$1.isPresenting===!0&&(xr$1.cameraAutoUpdate===!0&&xr$1.updateCamera(camera),camera=xr$1.getCamera()),scene.isScene===!0&&scene.onBeforeRender(_this,scene,camera,_currentRenderTarget),currentRenderState=renderStates.get(scene,renderStateStack.length),currentRenderState.init(camera),renderStateStack.push(currentRenderState),_projScreenMatrix$3.multiplyMatrices(camera.projectionMatrix,camera.matrixWorldInverse),_frustum$2.setFromProjectionMatrix(_projScreenMatrix$3,WebGLCoordinateSystem,camera.reversedDepth),_localClippingEnabled=this.localClippingEnabled,_clippingEnabled=clipping.init(this.clippingPlanes,_localClippingEnabled),currentRenderList=renderLists.get(scene,renderListStack.length),currentRenderList.init(),renderListStack.push(currentRenderList),xr$1.enabled===!0&&xr$1.isPresenting===!0){let depthSensingMesh=_this.xr.getDepthSensingMesh();depthSensingMesh!==null&&projectObject(depthSensingMesh,camera,-1/0,_this.sortObjects)}projectObject(scene,camera,0,_this.sortObjects),currentRenderList.finish(),_this.sortObjects===!0&¤tRenderList.sort(_opaqueSort,_transparentSort),_renderBackground=xr$1.enabled===!1||xr$1.isPresenting===!1||xr$1.hasDepthSensing()===!1,_renderBackground&&background.addToRenderList(currentRenderList,scene),this.info.render.frame++,_clippingEnabled===!0&&clipping.beginShadows();let shadowsArray=currentRenderState.state.shadowsArray;shadowMap.render(shadowsArray,scene,camera),_clippingEnabled===!0&&clipping.endShadows(),this.info.autoReset===!0&&this.info.reset();let opaqueObjects=currentRenderList.opaque,transmissiveObjects=currentRenderList.transmissive;if(currentRenderState.setupLights(),camera.isArrayCamera){let cameras=camera.cameras;if(transmissiveObjects.length>0)for(let i=0,l=cameras.length;i0&&renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera),_renderBackground&&background.render(scene),renderScene(currentRenderList,scene,camera);_currentRenderTarget!==null&&_currentActiveMipmapLevel===0&&(textures.updateMultisampleRenderTarget(_currentRenderTarget),textures.updateRenderTargetMipmap(_currentRenderTarget)),scene.isScene===!0&&scene.onAfterRender(_this,scene,camera),bindingStates.resetDefaultState(),_currentMaterialId=-1,_currentCamera=null,renderStateStack.pop(),renderStateStack.length>0?(currentRenderState=renderStateStack[renderStateStack.length-1],_clippingEnabled===!0&&clipping.setGlobalState(_this.clippingPlanes,currentRenderState.state.camera)):currentRenderState=null,renderListStack.pop(),currentRenderList=renderListStack.length>0?renderListStack[renderListStack.length-1]:null};function projectObject(object$1,camera,groupOrder,sortObjects){if(object$1.visible===!1)return;let visible=object$1.layers.test(camera.layers);if(visible){if(object$1.isGroup)groupOrder=object$1.renderOrder;else if(object$1.isLOD)object$1.autoUpdate===!0&&object$1.update(camera);else if(object$1.isLight)currentRenderState.pushLight(object$1),object$1.castShadow&¤tRenderState.pushShadow(object$1);else if(object$1.isSprite){if(!object$1.frustumCulled||_frustum$2.intersectsSprite(object$1)){sortObjects&&_vector4.setFromMatrixPosition(object$1.matrixWorld).applyMatrix4(_projScreenMatrix$3);let geometry=objects.update(object$1),material=object$1.material;material.visible&¤tRenderList.push(object$1,geometry,material,groupOrder,_vector4.z,null)}}else if((object$1.isMesh||object$1.isLine||object$1.isPoints)&&(!object$1.frustumCulled||_frustum$2.intersectsObject(object$1))){let geometry=objects.update(object$1),material=object$1.material;if(sortObjects&&(object$1.boundingSphere===void 0?(geometry.boundingSphere===null&&geometry.computeBoundingSphere(),_vector4.copy(geometry.boundingSphere.center)):(object$1.boundingSphere===null&&object$1.computeBoundingSphere(),_vector4.copy(object$1.boundingSphere.center)),_vector4.applyMatrix4(object$1.matrixWorld).applyMatrix4(_projScreenMatrix$3)),Array.isArray(material)){let groups=geometry.groups;for(let i=0,l=groups.length;i0&&renderObjects(opaqueObjects,scene,camera),transmissiveObjects.length>0&&renderObjects(transmissiveObjects,scene,camera),transparentObjects.length>0&&renderObjects(transparentObjects,scene,camera),state.buffers.depth.setTest(!0),state.buffers.depth.setMask(!0),state.buffers.color.setMask(!0),state.setPolygonOffset(!1)}function renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera){let overrideMaterial=scene.isScene===!0?scene.overrideMaterial:null;if(overrideMaterial!==null)return;currentRenderState.state.transmissionRenderTarget[camera.id]===void 0&&(currentRenderState.state.transmissionRenderTarget[camera.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:extensions.has(`EXT_color_buffer_half_float`)||extensions.has(`EXT_color_buffer_float`)?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ColorManagement.workingColorSpace}));let transmissionRenderTarget=currentRenderState.state.transmissionRenderTarget[camera.id],activeViewport=camera.viewport||_currentViewport;transmissionRenderTarget.setSize(activeViewport.z*_this.transmissionResolutionScale,activeViewport.w*_this.transmissionResolutionScale);let currentRenderTarget=_this.getRenderTarget(),currentActiveCubeFace=_this.getActiveCubeFace(),currentActiveMipmapLevel=_this.getActiveMipmapLevel();_this.setRenderTarget(transmissionRenderTarget),_this.getClearColor(_currentClearColor),_currentClearAlpha=_this.getClearAlpha(),_currentClearAlpha<1&&_this.setClearColor(16777215,.5),_this.clear(),_renderBackground&&background.render(scene);let currentToneMapping=_this.toneMapping;_this.toneMapping=NoToneMapping;let currentCameraViewport=camera.viewport;if(camera.viewport!==void 0&&(camera.viewport=void 0),currentRenderState.setupLightsView(camera),_clippingEnabled===!0&&clipping.setGlobalState(_this.clippingPlanes,camera),renderObjects(opaqueObjects,scene,camera),textures.updateMultisampleRenderTarget(transmissionRenderTarget),textures.updateRenderTargetMipmap(transmissionRenderTarget),extensions.has(`WEBGL_multisampled_render_to_texture`)===!1){let renderTargetNeedsUpdate=!1;for(let i=0,l=transmissiveObjects.length;i0),morphTargets=!!geometry.morphAttributes.position,morphNormals=!!geometry.morphAttributes.normal,morphColors=!!geometry.morphAttributes.color,toneMapping=NoToneMapping;material.toneMapped&&(_currentRenderTarget===null||_currentRenderTarget.isXRRenderTarget===!0)&&(toneMapping=_this.toneMapping);let morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color,morphTargetsCount=morphAttribute===void 0?0:morphAttribute.length,materialProperties=properties.get(material),lights=currentRenderState.state.lights;if(_clippingEnabled===!0&&(_localClippingEnabled===!0||camera!==_currentCamera)){let useCache=camera===_currentCamera&&material.id===_currentMaterialId;clipping.setState(material,camera,useCache)}let needsProgramChange=!1;material.version===materialProperties.__version?materialProperties.needsLights&&materialProperties.lightsStateVersion!==lights.state.version?needsProgramChange=!0:materialProperties.outputColorSpace===colorSpace?object$1.isBatchedMesh&&materialProperties.batching===!1||!object$1.isBatchedMesh&&materialProperties.batching===!0||object$1.isBatchedMesh&&materialProperties.batchingColor===!0&&object$1.colorTexture===null||object$1.isBatchedMesh&&materialProperties.batchingColor===!1&&object$1.colorTexture!==null||object$1.isInstancedMesh&&materialProperties.instancing===!1||!object$1.isInstancedMesh&&materialProperties.instancing===!0||object$1.isSkinnedMesh&&materialProperties.skinning===!1||!object$1.isSkinnedMesh&&materialProperties.skinning===!0||object$1.isInstancedMesh&&materialProperties.instancingColor===!0&&object$1.instanceColor===null||object$1.isInstancedMesh&&materialProperties.instancingColor===!1&&object$1.instanceColor!==null||object$1.isInstancedMesh&&materialProperties.instancingMorph===!0&&object$1.morphTexture===null||object$1.isInstancedMesh&&materialProperties.instancingMorph===!1&&object$1.morphTexture!==null?needsProgramChange=!0:materialProperties.envMap===envMap?material.fog===!0&&materialProperties.fog!==fog||materialProperties.numClippingPlanes!==void 0&&(materialProperties.numClippingPlanes!==clipping.numPlanes||materialProperties.numIntersection!==clipping.numIntersection)?needsProgramChange=!0:materialProperties.vertexAlphas===vertexAlphas&&materialProperties.vertexTangents===vertexTangents&&materialProperties.morphTargets===morphTargets&&materialProperties.morphNormals===morphNormals&&materialProperties.morphColors===morphColors&&materialProperties.toneMapping===toneMapping?materialProperties.morphTargetsCount!==morphTargetsCount&&(needsProgramChange=!0):needsProgramChange=!0:needsProgramChange=!0:needsProgramChange=!0:(needsProgramChange=!0,materialProperties.__version=material.version);let program=materialProperties.currentProgram;needsProgramChange===!0&&(program=getProgram(material,scene,object$1));let refreshProgram=!1,refreshMaterial=!1,refreshLights=!1,p_uniforms=program.getUniforms(),m_uniforms=materialProperties.uniforms;if(state.useProgram(program.program)&&(refreshProgram=!0,refreshMaterial=!0,refreshLights=!0),material.id!==_currentMaterialId&&(_currentMaterialId=material.id,refreshMaterial=!0),refreshProgram||_currentCamera!==camera){let reversedDepthBuffer$1=state.buffers.depth.getReversed();reversedDepthBuffer$1&&camera.reversedDepth!==!0&&(camera._reversedDepth=!0,camera.updateProjectionMatrix()),p_uniforms.setValue(_gl,`projectionMatrix`,camera.projectionMatrix),p_uniforms.setValue(_gl,`viewMatrix`,camera.matrixWorldInverse);let uCamPos=p_uniforms.map.cameraPosition;uCamPos!==void 0&&uCamPos.setValue(_gl,_vector3$1.setFromMatrixPosition(camera.matrixWorld)),capabilities.logarithmicDepthBuffer&&p_uniforms.setValue(_gl,`logDepthBufFC`,2/(Math.log(camera.far+1)/Math.LN2)),(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial)&&p_uniforms.setValue(_gl,`isOrthographic`,camera.isOrthographicCamera===!0),_currentCamera!==camera&&(_currentCamera=camera,refreshMaterial=!0,refreshLights=!0)}if(object$1.isSkinnedMesh){p_uniforms.setOptional(_gl,object$1,`bindMatrix`),p_uniforms.setOptional(_gl,object$1,`bindMatrixInverse`);let skeleton=object$1.skeleton;skeleton&&(skeleton.boneTexture===null&&skeleton.computeBoneTexture(),p_uniforms.setValue(_gl,`boneTexture`,skeleton.boneTexture,textures))}object$1.isBatchedMesh&&(p_uniforms.setOptional(_gl,object$1,`batchingTexture`),p_uniforms.setValue(_gl,`batchingTexture`,object$1._matricesTexture,textures),p_uniforms.setOptional(_gl,object$1,`batchingIdTexture`),p_uniforms.setValue(_gl,`batchingIdTexture`,object$1._indirectTexture,textures),p_uniforms.setOptional(_gl,object$1,`batchingColorTexture`),object$1._colorsTexture!==null&&p_uniforms.setValue(_gl,`batchingColorTexture`,object$1._colorsTexture,textures));let morphAttributes=geometry.morphAttributes;if((morphAttributes.position!==void 0||morphAttributes.normal!==void 0||morphAttributes.color!==void 0)&&morphtargets.update(object$1,geometry,program),(refreshMaterial||materialProperties.receiveShadow!==object$1.receiveShadow)&&(materialProperties.receiveShadow=object$1.receiveShadow,p_uniforms.setValue(_gl,`receiveShadow`,object$1.receiveShadow)),material.isMeshGouraudMaterial&&material.envMap!==null&&(m_uniforms.envMap.value=envMap,m_uniforms.flipEnvMap.value=envMap.isCubeTexture&&envMap.isRenderTargetTexture===!1?-1:1),material.isMeshStandardMaterial&&material.envMap===null&&scene.environment!==null&&(m_uniforms.envMapIntensity.value=scene.environmentIntensity),refreshMaterial&&(p_uniforms.setValue(_gl,`toneMappingExposure`,_this.toneMappingExposure),materialProperties.needsLights&&markUniformsLightsNeedsUpdate(m_uniforms,refreshLights),fog&&material.fog===!0&&materials.refreshFogUniforms(m_uniforms,fog),materials.refreshMaterialUniforms(m_uniforms,material,_pixelRatio,_height,currentRenderState.state.transmissionRenderTarget[camera.id]),WebGLUniforms.upload(_gl,getUniformList(materialProperties),m_uniforms,textures)),material.isShaderMaterial&&material.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(_gl,getUniformList(materialProperties),m_uniforms,textures),material.uniformsNeedUpdate=!1),material.isSpriteMaterial&&p_uniforms.setValue(_gl,`center`,object$1.center),p_uniforms.setValue(_gl,`modelViewMatrix`,object$1.modelViewMatrix),p_uniforms.setValue(_gl,`normalMatrix`,object$1.normalMatrix),p_uniforms.setValue(_gl,`modelMatrix`,object$1.matrixWorld),material.isShaderMaterial||material.isRawShaderMaterial){let groups=material.uniformsGroups;for(let i=0,l=groups.length;i0&&textures.useMultisampledRTT(renderTarget)===!1?properties.get(renderTarget).__webglMultisampledFramebuffer:Array.isArray(__webglFramebuffer)?__webglFramebuffer[activeMipmapLevel]:__webglFramebuffer,_currentViewport.copy(renderTarget.viewport),_currentScissor.copy(renderTarget.scissor),_currentScissorTest=renderTarget.scissorTest}else _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(),_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(),_currentScissorTest=_scissorTest;activeMipmapLevel!==0&&(framebuffer=_scratchFrameBuffer);let framebufferBound=state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);if(framebufferBound&&useDefaultFramebuffer&&state.drawBuffers(renderTarget,framebuffer),state.viewport(_currentViewport),state.scissor(_currentScissor),state.setScissorTest(_currentScissorTest),isCube){let textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_CUBE_MAP_POSITIVE_X+activeCubeFace,textureProperties.__webglTexture,activeMipmapLevel)}else if(isRenderTarget3D){let layer=activeCubeFace;for(let i=0;i=0&&x$1<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height&&(renderTarget.textures.length>1&&_gl.readBuffer(_gl.COLOR_ATTACHMENT0+textureIndex),_gl.readPixels(x$1,y,width,height,utils$1.convert(textureFormat),utils$1.convert(textureType),buffer$1))}finally{let framebuffer$1=_currentRenderTarget===null?null:properties.get(_currentRenderTarget).__webglFramebuffer;state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer$1)}}},this.readRenderTargetPixelsAsync=async function(renderTarget,x$1,y,width,height,buffer$1,activeCubeFaceIndex,textureIndex=0){if(!(renderTarget&&renderTarget.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&activeCubeFaceIndex!==void 0&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer)if(x$1>=0&&x$1<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);let texture=renderTarget.textures[textureIndex],textureFormat=texture.format,textureType=texture.type;if(!capabilities.textureFormatReadable(textureFormat))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!capabilities.textureTypeReadable(textureType))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let glBuffer=_gl.createBuffer();_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER,glBuffer),_gl.bufferData(_gl.PIXEL_PACK_BUFFER,buffer$1.byteLength,_gl.STREAM_READ),renderTarget.textures.length>1&&_gl.readBuffer(_gl.COLOR_ATTACHMENT0+textureIndex),_gl.readPixels(x$1,y,width,height,utils$1.convert(textureFormat),utils$1.convert(textureType),0);let currFramebuffer=_currentRenderTarget===null?null:properties.get(_currentRenderTarget).__webglFramebuffer;state.bindFramebuffer(_gl.FRAMEBUFFER,currFramebuffer);let sync$2=_gl.fenceSync(_gl.SYNC_GPU_COMMANDS_COMPLETE,0);return _gl.flush(),await probeAsync(_gl,sync$2,4),_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER,glBuffer),_gl.getBufferSubData(_gl.PIXEL_PACK_BUFFER,0,buffer$1),_gl.deleteBuffer(glBuffer),_gl.deleteSync(sync$2),buffer$1}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(texture,position$2=null,level=0){let levelScale=2**-level,width=Math.floor(texture.image.width*levelScale),height=Math.floor(texture.image.height*levelScale),x$1=position$2===null?0:position$2.x,y=position$2===null?0:position$2.y;textures.setTexture2D(texture,0),_gl.copyTexSubImage2D(_gl.TEXTURE_2D,level,0,0,x$1,y,width,height),state.unbindTexture()};let _srcFramebuffer=_gl.createFramebuffer(),_dstFramebuffer=_gl.createFramebuffer();this.copyTextureToTexture=function(srcTexture,dstTexture,srcRegion=null,dstPosition=null,srcLevel=0,dstLevel=null){dstLevel===null&&(srcLevel===0?dstLevel=0:(warnOnce$1(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),dstLevel=srcLevel,srcLevel=0));let width,height,depth$1,minX,minY,minZ,dstX,dstY,dstZ,image$1=srcTexture.isCompressedTexture?srcTexture.mipmaps[dstLevel]:srcTexture.image;if(srcRegion!==null)width=srcRegion.max.x-srcRegion.min.x,height=srcRegion.max.y-srcRegion.min.y,depth$1=srcRegion.isBox3?srcRegion.max.z-srcRegion.min.z:1,minX=srcRegion.min.x,minY=srcRegion.min.y,minZ=srcRegion.isBox3?srcRegion.min.z:0;else{let levelScale=2**-srcLevel;width=Math.floor(image$1.width*levelScale),height=Math.floor(image$1.height*levelScale),depth$1=srcTexture.isDataArrayTexture?image$1.depth:srcTexture.isData3DTexture?Math.floor(image$1.depth*levelScale):1,minX=0,minY=0,minZ=0}dstPosition===null?(dstX=0,dstY=0,dstZ=0):(dstX=dstPosition.x,dstY=dstPosition.y,dstZ=dstPosition.z);let glFormat=utils$1.convert(dstTexture.format),glType=utils$1.convert(dstTexture.type),glTarget;dstTexture.isData3DTexture?(textures.setTexture3D(dstTexture,0),glTarget=_gl.TEXTURE_3D):dstTexture.isDataArrayTexture||dstTexture.isCompressedArrayTexture?(textures.setTexture2DArray(dstTexture,0),glTarget=_gl.TEXTURE_2D_ARRAY):(textures.setTexture2D(dstTexture,0),glTarget=_gl.TEXTURE_2D),_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,dstTexture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dstTexture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,dstTexture.unpackAlignment);let currentUnpackRowLen=_gl.getParameter(_gl.UNPACK_ROW_LENGTH),currentUnpackImageHeight=_gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT),currentUnpackSkipPixels=_gl.getParameter(_gl.UNPACK_SKIP_PIXELS),currentUnpackSkipRows=_gl.getParameter(_gl.UNPACK_SKIP_ROWS),currentUnpackSkipImages=_gl.getParameter(_gl.UNPACK_SKIP_IMAGES);_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,image$1.width),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,image$1.height),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,minX),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,minY),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,minZ);let isSrc3D=srcTexture.isDataArrayTexture||srcTexture.isData3DTexture,isDst3D=dstTexture.isDataArrayTexture||dstTexture.isData3DTexture;if(srcTexture.isDepthTexture){let srcTextureProperties=properties.get(srcTexture),dstTextureProperties=properties.get(dstTexture),srcRenderTargetProperties=properties.get(srcTextureProperties.__renderTarget),dstRenderTargetProperties=properties.get(dstTextureProperties.__renderTarget);state.bindFramebuffer(_gl.READ_FRAMEBUFFER,srcRenderTargetProperties.__webglFramebuffer),state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER,dstRenderTargetProperties.__webglFramebuffer);for(let i=0;i{result.value=fn$5()},{...options$1,flush:(_a$2=options$1?.flush)??`sync`}),readonly$1(result)}function tryOnScopeDispose$1(fn$5){return getCurrentScope()?(onScopeDispose(fn$5),!0):!1}function createEventHook(){let fns=new Set,off=fn$5=>{fns.delete(fn$5)},clear=()=>{fns.clear()},on$1=fn$5=>{fns.add(fn$5);let offFn=()=>off(fn$5);return tryOnScopeDispose$1(offFn),{off:offFn}},trigger$1=(...args)=>Promise.all(Array.from(fns).map(fn$5=>fn$5(...args)));return{on:on$1,off,trigger:trigger$1,clear}}function createGlobalState(stateFactory){let initialized=!1,state,scope$1=effectScope(!0);return(...args)=>(initialized||(state=scope$1.run(()=>stateFactory(...args)),initialized=!0),state)}const localProvidedStateMap$1=new WeakMap,injectLocal$1=(...args)=>{var _a$2;let key$2=args[0],instance=(_a$2=getCurrentInstance())?.proxy;if(instance==null&&!hasInjectionContext())throw Error(`injectLocal must be called in setup`);return instance&&localProvidedStateMap$1.has(instance)&&key$2 in localProvidedStateMap$1.get(instance)?localProvidedStateMap$1.get(instance)[key$2]:inject(...args)};function createSharedComposable(composable){let subscribers=0,state,scope$1,dispose$1=()=>{--subscribers,scope$1&&subscribers<=0&&(scope$1.stop(),state=void 0,scope$1=void 0)};return(...args)=>(subscribers+=1,scope$1||(scope$1=effectScope(!0),state=scope$1.run(()=>composable(...args))),tryOnScopeDispose$1(dispose$1),state)}const isClient$1=typeof window<`u`&&typeof document<`u`,isWorker$1=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,isDef$1=val=>val!==void 0,notNullish$1=val=>val!=null,toString$3=Object.prototype.toString,isObject$5=val=>toString$3.call(val)===`[object Object]`,noop$4=()=>{},isIOS=getIsIOS();function getIsIOS(){var _a$2,_b;return isClient$1&&(_a$2=window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(_b=window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function createFilterWrapper$1(filter$1,fn$5){function wrapper(...args){return new Promise((resolve$1,reject)=>{Promise.resolve(filter$1(()=>fn$5.apply(this,args),{fn:fn$5,thisArg:this,args})).then(resolve$1).catch(reject)})}return wrapper}function debounceFilter$1(ms,options$1={}){let timer,maxTimer,lastRejector=noop$4,_clearTimeout=timer2=>{clearTimeout(timer2),lastRejector(),lastRejector=noop$4},lastInvoker,filter$1=invoke$1=>{let duration$2=toValue$1(ms),maxDuration$1=toValue$1(options$1.maxWait);return timer&&_clearTimeout(timer),duration$2<=0||maxDuration$1!==void 0&&maxDuration$1<=0?(maxTimer&&(_clearTimeout(maxTimer),maxTimer=null),Promise.resolve(invoke$1())):new Promise((resolve$1,reject)=>{lastRejector=options$1.rejectOnCancel?reject:resolve$1,lastInvoker=invoke$1,maxDuration$1&&!maxTimer&&(maxTimer=setTimeout(()=>{timer&&_clearTimeout(timer),maxTimer=null,resolve$1(lastInvoker())},maxDuration$1)),timer=setTimeout(()=>{maxTimer&&_clearTimeout(maxTimer),maxTimer=null,resolve$1(invoke$1())},duration$2)})};return filter$1}function cacheStringFunction$1(fn$5){let cache$1=Object.create(null);return str=>{let hit=cache$1[str];return hit||(cache$1[str]=fn$5(str))}}const hyphenateRE$1=/\B([A-Z])/g,hyphenate$1=cacheStringFunction$1(str=>str.replace(hyphenateRE$1,`-$1`).toLowerCase()),camelizeRE$1=/-(\w)/g,camelize$2=cacheStringFunction$1(str=>str.replace(camelizeRE$1,(_$1,c$3)=>c$3?c$3.toUpperCase():``));function pxValue$1(px$2){return px$2.endsWith(`rem`)?Number.parseFloat(px$2)*16:Number.parseFloat(px$2)}function objectPick$1(obj,keys$3,omitUndefined=!1){return keys$3.reduce((n,k$3)=>(k$3 in obj&&(!omitUndefined||obj[k$3]!==void 0)&&(n[k$3]=obj[k$3]),n),{})}function getLifeCycleTarget$1(target$1){return target$1||getCurrentInstance()}function toArray$1(value$1){return Array.isArray(value$1)?value$1:[value$1]}function refAutoReset(defaultValue,afterMs=1e4){return customRef((track$1,trigger$1)=>{let value$1=toValue$1(defaultValue),timer,resetAfter=()=>setTimeout(()=>{value$1=toValue$1(defaultValue),trigger$1()},toValue$1(afterMs));return tryOnScopeDispose$1(()=>{clearTimeout(timer)}),{get(){return track$1(),value$1},set(newValue){value$1=newValue,trigger$1(),clearTimeout(timer),timer=resetAfter()}}})}function useDebounceFn$1(fn$5,ms=200,options$1={}){return createFilterWrapper$1(debounceFilter$1(ms,options$1),fn$5)}function refDebounced$1(value$1,ms=200,options$1={}){let debounced=ref(value$1.value),updater=useDebounceFn$1(()=>{debounced.value=value$1.value},ms,options$1);return watch(value$1,()=>updater()),debounced}function toRefs$2(objectRef,options$1={}){if(!isRef(objectRef))return toRefs(objectRef);let result=Array.isArray(objectRef.value)?Array.from({length:objectRef.value.length}):{};for(let key$2 in objectRef.value)result[key$2]=customRef(()=>({get(){return objectRef.value[key$2]},set(v){var _a$2;let replaceRef=(_a$2=toValue$1(options$1.replaceRef))??!0;if(replaceRef)if(Array.isArray(objectRef.value)){let copy=[...objectRef.value];copy[key$2]=v,objectRef.value=copy}else{let newObject={...objectRef.value,[key$2]:v};Object.setPrototypeOf(newObject,Object.getPrototypeOf(objectRef.value)),objectRef.value=newObject}else objectRef.value[key$2]=v}}));return result}const toValue$2=toValue$1;function tryOnBeforeUnmount(fn$5,target$1){let instance=getLifeCycleTarget$1(target$1);instance&&onBeforeUnmount(fn$5,target$1)}function tryOnMounted$1(fn$5,sync$2=!0,target$1){let instance=getLifeCycleTarget$1();instance?onMounted(fn$5,target$1):sync$2?fn$5():nextTick(fn$5)}function useIntervalFn$1(cb$1,interval=1e3,options$1={}){let{immediate=!0,immediateCallback=!1}=options$1,timer=null,isActive=shallowRef(!1);function clean$3(){timer&&(clearInterval(timer),timer=null)}function pause(){isActive.value=!1,clean$3()}function resume(){let intervalValue=toValue$1(interval);intervalValue<=0||(isActive.value=!0,immediateCallback&&cb$1(),clean$3(),isActive.value&&(timer=setInterval(cb$1,intervalValue)))}if(immediate&&isClient$1&&resume(),isRef(interval)||typeof interval==`function`){let stopWatch=watch(interval,()=>{isActive.value&&isClient$1&&resume()});tryOnScopeDispose$1(stopWatch)}return tryOnScopeDispose$1(pause),{isActive,pause,resume}}function useTimeoutFn(cb$1,interval,options$1={}){let{immediate=!0,immediateCallback=!1}=options$1,isPending=shallowRef(!1),timer=null;function clear(){timer&&(clearTimeout(timer),timer=null)}function stop$1(){isPending.value=!1,clear()}function start(...args){immediateCallback&&cb$1(),clear(),isPending.value=!0,timer=setTimeout(()=>{isPending.value=!1,timer=null,cb$1(...args)},toValue$1(interval))}return immediate&&(isPending.value=!0,isClient$1&&start()),tryOnScopeDispose$1(stop$1),{isPending:readonly$1(isPending),start,stop:stop$1}}function watchImmediate$1(source,cb$1,options$1){return watch(source,cb$1,{...options$1,immediate:!0})}const defaultWindow=isClient$1?window:void 0,defaultDocument$1=isClient$1?window.document:void 0,defaultNavigator$1=isClient$1?window.navigator:void 0,defaultLocation$1=isClient$1?window.location:void 0;function unrefElement$1(elRef){var _a$2;let plain=toValue$1(elRef);return(_a$2=plain?.$el)??plain}function useEventListener$1(...args){let cleanups=[],cleanup=()=>{cleanups.forEach(fn$5=>fn$5()),cleanups.length=0},register=(el,event,listener,options$1)=>(el.addEventListener(event,listener,options$1),()=>el.removeEventListener(event,listener,options$1)),firstParamTargets=computed(()=>{let test$1=toArray$1(toValue$1(args[0])).filter(e$4=>e$4!=null);return test$1.every(e$4=>typeof e$4!=`string`)?test$1:void 0}),stopWatch=watchImmediate$1(()=>{var _a$2,_b;return[(_b=(_a$2=firstParamTargets.value)?.map(e$4=>unrefElement$1(e$4)))??[defaultWindow].filter(e$4=>e$4!=null),toArray$1(toValue$1(firstParamTargets.value?args[1]:args[0])),toArray$1(unref(firstParamTargets.value?args[2]:args[1])),toValue$1(firstParamTargets.value?args[3]:args[2])]},([raw_targets,raw_events,raw_listeners,raw_options])=>{if(cleanup(),!raw_targets?.length||!raw_events?.length||!raw_listeners?.length)return;let optionsClone=isObject$5(raw_options)?{...raw_options}:raw_options;cleanups.push(...raw_targets.flatMap(el=>raw_events.flatMap(event=>raw_listeners.map(listener=>register(el,event,listener,optionsClone)))))},{flush:`post`}),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose$1(cleanup),stop$1}function useMounted(){let isMounted=shallowRef(!1),instance=getCurrentInstance();return instance&&onMounted(()=>{isMounted.value=!0},instance),isMounted}function useSupported$1(callback){let isMounted=useMounted();return computed(()=>(isMounted.value,!!callback()))}function useMutationObserver$1(target$1,callback,options$1={}){let{window:window$1=defaultWindow,...mutationOptions}=options$1,observer,isSupported=useSupported$1(()=>window$1&&`MutationObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let value$1=toValue$1(target$1),items=toArray$1(value$1).map(unrefElement$1).filter(notNullish$1);return new Set(items)}),stopWatch=watch(()=>targets.value,targets2=>{cleanup(),isSupported.value&&targets2.size&&(observer=new MutationObserver(callback),targets2.forEach(el=>observer.observe(el,mutationOptions)))},{immediate:!0,flush:`post`}),takeRecords=()=>observer?.takeRecords(),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose$1(stop$1),{isSupported,stop:stop$1,takeRecords}}function createKeyPredicate(keyFilter){return typeof keyFilter==`function`?keyFilter:typeof keyFilter==`string`?event=>event.key===keyFilter:Array.isArray(keyFilter)?event=>keyFilter.includes(event.key):()=>!0}function onKeyStroke(...args){let key$2,handler,options$1={};args.length===3?(key$2=args[0],handler=args[1],options$1=args[2]):args.length===2?typeof args[1]==`object`?(key$2=!0,handler=args[0],options$1=args[1]):(key$2=args[0],handler=args[1]):(key$2=!0,handler=args[0]);let{target:target$1=defaultWindow,eventName=`keydown`,passive=!1,dedupe=!1}=options$1,predicate=createKeyPredicate(key$2),listener=e$4=>{!(e$4.repeat&&toValue$1(dedupe))&&predicate(e$4)&&handler(e$4)};return useEventListener$1(target$1,eventName,listener,passive)}function useRafFn(fn$5,options$1={}){let{immediate=!0,fpsLimit=void 0,window:window$1=defaultWindow,once=!1}=options$1,isActive=shallowRef(!1),intervalLimit=computed(()=>fpsLimit?1e3/toValue$1(fpsLimit):null),previousFrameTimestamp=0,rafId=null;function loop(timestamp$2){if(!isActive.value||!window$1)return;previousFrameTimestamp||=timestamp$2;let delta=timestamp$2-previousFrameTimestamp;if(intervalLimit.value&&deltawindow$1&&`matchMedia`in window$1&&typeof window$1.matchMedia==`function`),ssrSupport=shallowRef(typeof ssrWidth==`number`),mediaQuery=shallowRef(),matches$1=shallowRef(!1),handler=event=>{matches$1.value=event.matches};return watchEffect(()=>{if(ssrSupport.value){ssrSupport.value=!isSupported.value;let queryStrings=toValue$1(query).split(`,`);matches$1.value=queryStrings.some(queryString=>{let not=queryString.includes(`not all`),minWidth=queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),maxWidth=queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),res=!!(minWidth||maxWidth);return minWidth&&res&&(res=ssrWidth>=pxValue$1(minWidth[1])),maxWidth&&res&&(res=ssrWidth<=pxValue$1(maxWidth[1])),not?!res:res});return}isSupported.value&&(mediaQuery.value=window$1.matchMedia(toValue$1(query)),matches$1.value=mediaQuery.value.matches)}),useEventListener$1(mediaQuery,`change`,handler,{passive:!0}),computed(()=>matches$1.value)}function cloneFnJSON(source){return JSON.parse(JSON.stringify(source))}function useDevicePixelRatio(options$1={}){let{window:window$1=defaultWindow}=options$1,pixelRatio=shallowRef(1),query=useMediaQuery$1(()=>`(resolution: ${pixelRatio.value}dppx)`,options$1),stop$1=noop$4;return window$1&&(stop$1=watchImmediate$1(query,()=>pixelRatio.value=window$1.devicePixelRatio)),{pixelRatio:readonly$1(pixelRatio),stop:stop$1}}function useResizeObserver$1(target$1,callback,options$1={}){let{window:window$1=defaultWindow,...observerOptions}=options$1,observer,isSupported=useSupported$1(()=>window$1&&`ResizeObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let _targets=toValue$1(target$1);return Array.isArray(_targets)?_targets.map(el=>unrefElement$1(el)):[unrefElement$1(_targets)]}),stopWatch=watch(targets,els=>{if(cleanup(),isSupported.value&&window$1){observer=new ResizeObserver(callback);for(let _el of els)_el&&observer.observe(_el,observerOptions)}},{immediate:!0,flush:`post`}),stop$1=()=>{cleanup(),stopWatch()};return tryOnScopeDispose$1(stop$1),{isSupported,stop:stop$1}}function useElementBounding$1(target$1,options$1={}){let{reset=!0,windowResize=!0,windowScroll=!0,immediate=!0,updateTiming=`sync`}=options$1,height=shallowRef(0),bottom=shallowRef(0),left=shallowRef(0),right=shallowRef(0),top=shallowRef(0),width=shallowRef(0),x$1=shallowRef(0),y=shallowRef(0);function recalculate(){let el=unrefElement$1(target$1);if(!el){reset&&(height.value=0,bottom.value=0,left.value=0,right.value=0,top.value=0,width.value=0,x$1.value=0,y.value=0);return}let rect=el.getBoundingClientRect();height.value=rect.height,bottom.value=rect.bottom,left.value=rect.left,right.value=rect.right,top.value=rect.top,width.value=rect.width,x$1.value=rect.x,y.value=rect.y}function update(){updateTiming===`sync`?recalculate():updateTiming===`next-frame`&&requestAnimationFrame(()=>recalculate())}return useResizeObserver$1(target$1,update),watch(()=>unrefElement$1(target$1),ele=>!ele&&update()),useMutationObserver$1(target$1,update,{attributeFilter:[`style`,`class`]}),windowScroll&&useEventListener$1(`scroll`,update,{capture:!0,passive:!0}),windowResize&&useEventListener$1(`resize`,update,{passive:!0}),tryOnMounted$1(()=>{immediate&&update()}),{height,bottom,left,right,top,width,x:x$1,y,update}}function useElementSize(target$1,initialSize={width:0,height:0},options$1={}){let{window:window$1=defaultWindow,box=`content-box`}=options$1,isSVG=computed(()=>{var _a$2,_b;return(_b=(_a$2=unrefElement$1(target$1))?.namespaceURI)?.includes(`svg`)}),width=shallowRef(initialSize.width),height=shallowRef(initialSize.height),{stop:stop1}=useResizeObserver$1(target$1,([entry])=>{let boxSize=box===`border-box`?entry.borderBoxSize:box===`content-box`?entry.contentBoxSize:entry.devicePixelContentBoxSize;if(window$1&&isSVG.value){let $elem=unrefElement$1(target$1);if($elem){let rect=$elem.getBoundingClientRect();width.value=rect.width,height.value=rect.height}}else if(boxSize){let formatBoxSize=toArray$1(boxSize);width.value=formatBoxSize.reduce((acc,{inlineSize})=>acc+inlineSize,0),height.value=formatBoxSize.reduce((acc,{blockSize})=>acc+blockSize,0)}else width.value=entry.contentRect.width,height.value=entry.contentRect.height},options$1);tryOnMounted$1(()=>{let ele=unrefElement$1(target$1);ele&&(width.value=`offsetWidth`in ele?ele.offsetWidth:initialSize.width,height.value=`offsetHeight`in ele?ele.offsetHeight:initialSize.height)});let stop2=watch(()=>unrefElement$1(target$1),ele=>{width.value=ele?initialSize.width:0,height.value=ele?initialSize.height:0});function stop$1(){stop1(),stop2()}return{width,height,stop:stop$1}}function useFps(options$1){var _a$2;let fps=shallowRef(0);if(typeof performance>`u`)return fps;let every=(_a$2=options$1?.every)??10,last=performance.now(),ticks=0;return useRafFn(()=>{if(ticks+=1,ticks>=every){let now$1=performance.now(),diff=now$1-last;fps.value=Math.round(1e3/(diff/ticks)),last=now$1,ticks=0}}),fps}function useMemory(options$1={}){let memory=ref(),isSupported=useSupported$1(()=>typeof performance<`u`&&`memory`in performance);if(isSupported.value){let{interval=1e3}=options$1;useIntervalFn$1(()=>{memory.value=performance.memory},interval,{immediate:options$1.immediate,immediateCallback:options$1.immediateCallback})}return{isSupported,memory}}const defaultState$1={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},keys$2=Object.keys(defaultState$1);function usePointer$1(options$1={}){let{target:target$1=defaultWindow}=options$1,isInside=shallowRef(!1),state=ref(options$1.initialValue||{});Object.assign(state.value,defaultState$1,state.value);let handler=event=>{isInside.value=!0,!(options$1.pointerTypes&&!options$1.pointerTypes.includes(event.pointerType))&&(state.value=objectPick$1(event,keys$2,!1))};if(target$1){let listenerOptions={passive:!0};useEventListener$1(target$1,[`pointerdown`,`pointermove`,`pointerup`],handler,listenerOptions),useEventListener$1(target$1,`pointerleave`,()=>isInside.value=!1,listenerOptions)}return{...toRefs$2(state),isInside}}const DEFAULT_UNITS$1=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}],DEFAULT_MESSAGES$1={justNow:`just now`,past:n=>n.match(/\d/)?`${n} ago`:n,future:n=>n.match(/\d/)?`in ${n}`:n,month:(n,past)=>n===1?past?`last month`:`next month`:`${n} month${n>1?`s`:``}`,year:(n,past)=>n===1?past?`last year`:`next year`:`${n} year${n>1?`s`:``}`,day:(n,past)=>n===1?past?`yesterday`:`tomorrow`:`${n} day${n>1?`s`:``}`,week:(n,past)=>n===1?past?`last week`:`next week`:`${n} week${n>1?`s`:``}`,hour:n=>`${n} hour${n>1?`s`:``}`,minute:n=>`${n} minute${n>1?`s`:``}`,second:n=>`${n} second${n>1?`s`:``}`,invalid:``};function useVModel(props,key$2,emit$1,options$1={}){var _a$2,_b,_c;let{clone:clone$3=!1,passive=!1,eventName,deep=!1,defaultValue,shouldEmit}=options$1,vm=getCurrentInstance(),_emit=emit$1||vm?.emit||(_a$2=vm?.$emit)?.bind(vm)||(_c=(_b=vm?.proxy)?.$emit)?.bind(vm?.proxy),event=eventName;key$2||=`modelValue`,event||=`update:${key$2.toString()}`;let cloneFn=val=>clone$3?typeof clone$3==`function`?clone$3(val):cloneFnJSON(val):val,getValue$2=()=>isDef$1(props[key$2])?cloneFn(props[key$2]):defaultValue,triggerEmit=value$1=>{shouldEmit?shouldEmit(value$1)&&_emit(event,value$1):_emit(event,value$1)};if(passive){let initialValue=getValue$2(),proxy=ref(initialValue),isUpdating=!1;return watch(()=>props[key$2],v=>{isUpdating||(isUpdating=!0,proxy.value=cloneFn(v),nextTick(()=>isUpdating=!1))}),watch(proxy,v=>{!isUpdating&&(v!==props[key$2]||deep)&&triggerEmit(v)},{deep}),proxy}else return computed({get(){return getValue$2()},set(value$1){triggerEmit(value$1)}})}function useWindowSize$1(options$1={}){let{window:window$1=defaultWindow,initialWidth=1/0,initialHeight=1/0,listenOrientation=!0,includeScrollbar=!0,type=`inner`}=options$1,width=shallowRef(initialWidth),height=shallowRef(initialHeight),update=()=>{if(window$1)if(type===`outer`)width.value=window$1.outerWidth,height.value=window$1.outerHeight;else if(type===`visual`&&window$1.visualViewport){let{width:visualViewportWidth,height:visualViewportHeight,scale:scale$1}=window$1.visualViewport;width.value=Math.round(visualViewportWidth*scale$1),height.value=Math.round(visualViewportHeight*scale$1)}else includeScrollbar?(width.value=window$1.innerWidth,height.value=window$1.innerHeight):(width.value=window$1.document.documentElement.clientWidth,height.value=window$1.document.documentElement.clientHeight)};update(),tryOnMounted$1(update);let listenerOptions={passive:!0};if(useEventListener$1(`resize`,update,listenerOptions),window$1&&type===`visual`&&window$1.visualViewport&&useEventListener$1(window$1.visualViewport,`resize`,update,listenerOptions),listenOrientation){let matches$1=useMediaQuery$1(`(orientation: portrait)`);watch(matches$1,()=>update())}return{width,height}}var At=Object.defineProperty,xt=(e$4,t$1,r$1)=>t$1 in e$4?At(e$4,t$1,{enumerable:!0,configurable:!0,writable:!0,value:r$1}):e$4[t$1]=r$1,de$1=(e$4,t$1,r$1)=>xt(e$4,typeof t$1==`symbol`?t$1:t$1+``,r$1);const gr=`@tresjs/core`,hr=`module`,vr=`4.3.6`,yr=`pnpm@10.6.3`,_r=`Declarative ThreeJS using Vue Components`,wr=`Alvaro Saburido (https://github.com/alvarosabu/)`,br=`MIT`,Mr={type:`git`,url:`git+https://github.com/Tresjs/tres.git`},Pr=[`vue`,`3d`,`threejs`,`three`,`threejs-vue`],Cr=!1,Er={".":{types:`./dist/index.d.ts`,import:`./dist/tres.js`,require:`./dist/tres.umd.cjs`},"./components":{types:`./dist/src/components/index.d.ts`},"./composables":{types:`./dist/src/composables/index.d.ts`},"./types":{types:`./dist/src/types/index.d.ts`},"./utils":{types:`./dist/src/utils/index.d.ts`},"./*":`./*`},Tr=`./dist/tres.js`,Sr=`./dist/tres.js`,Ar=`./dist/index.d.ts`,xr=[`*.d.ts`,`dist`],kr={access:`public`},Lr={dev:`pnpm --filter='./playground/vue' dev`,"dev:nuxt":`pnpm --filter='./playground/nuxt' dev`,build:`vite build`,test:`vitest`,"test:ci":`vitest run`,"test:ui":`vitest --ui --coverage.enabled=true`,release:`release-it`,coverage:`vitest run --coverage`,lint:`eslint .`,"lint:fix":`eslint . --fix`,"docs:dev":`vitepress dev docs`,"docs:build":`vitepress build docs`,"docs:serve":`vitepress serve docs`,"docs:preview":`vitepress preview docs`,"docs:contributors":`esno scripts/update-contributors.ts`},Rr={three:`>=0.133`,vue:`>=3.4`},Or={"@alvarosabu/utils":`^3.2.0`,"@vue/devtools-api":`^6.6.3`,"@vueuse/core":`^12.5.0`},Dr={"@release-it/conventional-changelog":`^10.0.0`,"@stackblitz/sdk":`^1.11.0`,"@tresjs/cientos":`4.1.0`,"@tresjs/eslint-config":`^1.4.0`,"@types/three":`^0.173.0`,"@typescript-eslint/eslint-plugin":`^8.23.0`,"@typescript-eslint/parser":`^8.23.0`,"@vitejs/plugin-vue":`^5.2.1`,"@vitest/coverage-c8":`^0.33.0`,"@vitest/coverage-v8":`^3.0.5`,"@vitest/ui":`^3.0.5`,"@vue/test-utils":`^2.4.6`,eslint:`^9.19.0`,"eslint-plugin-vue":`^9.32.0`,esno:`^4.8.0`,gsap:`^3.12.7`,jsdom:`^26.0.0`,kolorist:`^1.8.0`,ohmyfetch:`^0.4.21`,pathe:`^2.0.2`,"release-it":`^18.1.2`,"rollup-plugin-analyzer":`^4.0.0`,"rollup-plugin-copy":`^3.5.0`,"rollup-plugin-visualizer":`^5.14.0`,sponsorkit:`^16.3.0`,three:`^0.173.0`,unocss:`^65.4.3`,unplugin:`^2.1.2`,"unplugin-vue-components":`^28.0.0`,vite:`^6.1.0`,"vite-plugin-banner":`^0.8.0`,"vite-plugin-dts":`4.5.0`,"vite-plugin-inspect":`^10.1.0`,"vite-plugin-require-transform":`^1.0.21`,"vite-svg-loader":`^5.1.0`,vitepress:`1.6.3`,vitest:`3.0.5`,vue:`3.5.13`,"vue-demi":`^0.14.10`},jr={name:gr,type:hr,version:vr,packageManager:yr,description:_r,author:wr,license:br,repository:Mr,keywords:Pr,sideEffects:Cr,exports:Er,main:Tr,module:Sr,types:Ar,files:xr,publishConfig:kr,scripts:Lr,peerDependencies:Rr,dependencies:Or,devDependencies:Dr};var $r=class extends Mesh{constructor(...r$1){super(...r$1),de$1(this,`type`,`HightlightMesh`),de$1(this,`createTime`),this.createTime=Date.now()}onBeforeRender(){let n=(Date.now()-this.createTime)/1e3,s=1+.07*Math.sin(2.5*n);this.scale.set(s,s,s)}};function be(e$4){return typeof e$4>`u`}function ke(e$4){return Array.isArray(e$4)}function Hr(e$4){return typeof e$4==`number`}function dt$2(e$4){return typeof e$4==`string`}function Y(e$4){return typeof e$4==`function`}function j(e$4){return e$4===Object(e$4)&&!ke(e$4)&&!Y(e$4)}function N(e$4){return j(e$4)&&!!e$4.isObject3D}function mt$1(e$4){return j(e$4)&&!!e$4.isColor}function Ur(e$4){return e$4!=null&&(typeof e$4==`string`||typeof e$4==`number`||mt$1(e$4))}function Me(e$4){return typeof e$4==`object`&&!!e$4&&`set`in e$4&&typeof e$4.set==`function`}function Fr(e$4){return Me(e$4)&&`copy`in e$4&&typeof e$4.copy==`function`}function Wr(e$4){return!!(e$4!=null&&e$4.constructor)}function Ge(e$4){return e$4 instanceof Layers}function Ve(e$4){return j(e$4)&&!!e$4.isCamera}function Nr(e$4){return j(e$4)&&!!e$4.isBufferGeometry}function zr(e$4){return j(e$4)&&!!e$4.isMaterial}function Gr(e$4){return j(e$4)&&!!e$4.isLight}function Vr(e$4){return j(e$4)&&!!e$4.isFog}function Yr(e$4){return j(e$4)&&!!e$4.isScene}function ne(e$4){return N(e$4)||Nr(e$4)||zr(e$4)||Vr(e$4)}function qr(e$4){return j(e$4)&&!!e$4.isPrimitive}const gt$1=(e$4,t$1)=>{for(let r$1 of Object.keys(t$1))t$1[r$1]instanceof Object&&Object.assign(t$1[r$1],gt$1(e$4[r$1],t$1[r$1]));return Object.assign(e$4||{},t$1),e$4},Kr=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,Jr=Zr(Kr);function Ye(e$4){return e$4&&e$4.nodeType===1}function he(e$4){return e$4.replace(/-([a-z])/g,(t$1,r$1)=>r$1.toUpperCase())}const Qr=/\B([A-Z])/g;function Xr(e$4){return e$4.replace(Qr,`-$1`).toLowerCase()}function Zr(e$4,t$1){let r$1=Object.create(null),n=e$4.split(`,`);for(let o=0;o!!r$1[o.toLowerCase()]:o=>!!r$1[o]}const qe=(e$4,t$1)=>{if(!t$1)return;let r$1=Array.isArray(t$1)?t$1:t$1.match(/([^[.\]])+/g);return r$1?.reduce((n,o)=>n&&n[o],e$4)},en=(e$4,t$1,r$1)=>{let n=Array.isArray(t$1)?t$1:t$1.match(/([^[.\]])+/g);n&&n.reduce((o,l,s)=>(o[l]===void 0&&(o[l]={}),s===n.length-1&&(o[l]=r$1),o[l]),e$4)};function ht$1(e$4,t$1){if(Ye(e$4)&&Ye(t$1)){let o=e$4.attributes,l=t$1.attributes;return o.length===l.length?Array.from(o).every(({name:s,value:a$1})=>t$1.getAttribute(s)===a$1):!1}if(e$4===t$1)return!0;if(typeof e$4!=`object`||!e$4||typeof t$1!=`object`||!t$1)return!1;let r$1=Object.keys(e$4),n=Object.keys(t$1);if(r$1.length!==n.length)return!1;for(let o of r$1)if(!n.includes(o)||!ht$1(e$4[o],t$1[o]))return!1;return!0}function tn(e$4,t$1){if(!Array.isArray(e$4)||!Array.isArray(t$1)||e$4.length!==t$1.length)return!1;for(let r$1=0;r$1{if(c$3.uuid===t$1)return c$3;for(let i of c$3.children){let f$2=o(i);if(f$2)return f$2}},l=o(e$4);if(!l){console.warn(`Object with UUID not found in the scene.`);return}let s=l;for(let c$3=0;c$3vt$1(o)),!(e$4 instanceof Scene)){let o=e$4;e$4&&((n=e$4.dispose)==null||n.call(e$4)),o.geometry&&o.geometry.dispose(),Array.isArray(o.material)?o.material.forEach(l=>Ke(l)):o.material&&Ke(o.material)}}function ln(e$4,t$1){let r$1=0;for(let n=0;nr$1===0?t$1:t$1.charAt(0).toUpperCase()+t$1.slice(1)).join(``)}const Qe=/-\d+$/;function cn$1(e$4,t$1,r$1){if(dt$2(r$1)){if(Qe.test(r$1)){let l=r$1.replace(Qe,``),{target:s,key:a$1}=Pe(e$4,l);if(!Array.isArray(s[a$1])){let c$3=s[a$1],i=[];i.__tresDetach=()=>{i.every(f$2=>be(f$2))&&(s[a$1]=c$3)},s[a$1]=i}}let{target:n,key:o}=Pe(e$4,r$1);t$1.__tres.previousAttach=n[o],n[o]=J(t$1)}else t$1.__tres.previousAttach=r$1(e$4,t$1)}function un$2(e$4,t$1,r$1){var n,o,l;if(dt$2(r$1)){let{target:s,key:a$1}=Pe(e$4,r$1),c$3=t$1.__tres.previousAttach;c$3===void 0?delete s[a$1]:s[a$1]=c$3,`__tresDetach`in s&&s.__tresDetach()}else (o=(n=t$1.__tres)?.previousAttach)==null||o.call(n,e$4,t$1);(l=t$1.__tres)==null||delete l.previousAttach}function z(e$4,t$1,r$1){let n=e$4;return n.__tres={type:`unknown`,eventCount:0,root:r$1,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...t$1},n.__tres.attach||(n.isMaterial?n.__tres.attach=`material`:n.isBufferGeometry?n.__tres.attach=`geometry`:n.isFog&&(n.__tres.attach=`fog`)),n}function yt$1(e$4){var r$1;let t$1=(r$1=e$4?.__tres)?.root;t$1&&t$1.render&&t$1.render.canBeInvalidated.value&&t$1.invalidate()}function fn$4(e$4,t$1,r$1){var o;if(!Y(e$4.setPixelRatio))return;let n=0;if(r$1&&ke(r$1)&&r$1.length>=2){let[l,s]=r$1;n=MathUtils.clamp(t$1,l,s)}else n=Hr(r$1)?r$1:t$1;n!==(o=e$4.getPixelRatio)?.call(e$4)&&e$4.setPixelRatio(n)}function pn(e$4,t$1,r$1,n,o){let l=[...t$1.__tres.objects],s=J(t$1);if(e$4=J(e$4),s===e$4)return!0;let a$1=z(e$4,t$1.__tres??{},o),c$3=t$1.parent??t$1.__tres.parent??null,i={...t$1.__tres.memoizedProps};delete i.object;for(let f$2 of l)_t$1(f$2,o),wt$1(f$2,o);s.__tres.objects=[],n.remove(t$1);for(let[f$2,v]of Object.entries(i))n.patchProp(a$1,f$2,a$1[f$2],v);r$1(e$4),n.insert(t$1,c$3);for(let f$2 of l)n.insert(f$2,t$1);return!0}function J(e$4){return qr(e$4)?(e$4.object.__tres=e$4.__tres,e$4.object):e$4}function _t$1(e$4,t$1){var n,o,l,s;let r$1=(n=e$4.__tres)?.parent||t$1.scene.value;e$4.__tres&&(e$4.__tres.parent=null),r$1&&r$1.__tres&&`objects`in r$1.__tres&&ln(r$1.__tres.objects,a$1=>a$1!==e$4),(o=e$4.__tres)!=null&&o.attach?un$2(r$1,e$4,e$4.__tres.attach):((s=(l=e$4.parent)?.remove)==null||s.call(l,J(e$4)),e$4.parent=null)}function wt$1(e$4,t$1){var r$1;(r$1=e$4.traverse)==null||r$1.call(e$4,n=>{var o;t$1.deregisterCamera(n),(o=t$1.eventManager)==null||o.deregisterPointerMissedObject(n)}),t$1.deregisterCamera(e$4),yt$1(e$4)}async function dn(e$4,t$1){let r$1=new TextureLoader(t$1),n=o=>new Promise((l,s)=>{r$1.load(o,a$1=>l(a$1),()=>null,()=>{s(Error(`[useTextures] - Failed to load texture`))})});if(rn(e$4)){let o=await Promise.all(e$4.map(l=>n(l)));return e$4.length>1?o:o[0]}else{let{map:o,displacementMap:l,normalMap:s,roughnessMap:a$1,metalnessMap:c$3,aoMap:i,alphaMap:f$2,matcap:v}=e$4;return{map:o?await n(o):null,displacementMap:l?await n(l):null,normalMap:s?await n(s):null,roughnessMap:a$1?await n(a$1):null,metalnessMap:c$3?await n(c$3):null,aoMap:i?await n(i):null,alphaMap:f$2?await n(f$2):null,matcap:v?await n(v):null}}}const to=defineComponent({__name:`component`,props:{map:{},displacementMap:{},normalMap:{},roughnessMap:{},metalnessMap:{},aoMap:{},alphaMap:{},matcap:{}},async setup(e$4){let t$1,r$1,n=e$4,o=([t$1,r$1]=withAsyncContext(()=>reactive(dn(n))),t$1=await t$1,r$1(),t$1);return(l,s)=>renderSlot(l.$slots,`default`,{textures:unref(o)})}}),mn=({sizes:e$4})=>{let t$1=ref([]),r$1=computed(()=>t$1.value[0]),n=s=>{let a$1=s instanceof Camera?s:t$1.value.find(i=>i.uuid===s);if(!a$1)return;let c$3=t$1.value.filter(({uuid:i})=>i!==a$1.uuid);t$1.value=[a$1,...c$3]},o=(s,a$1=!1)=>{if(Ve(s)){let c$3=s;if(t$1.value.some(({uuid:i})=>i===c$3.uuid))return;a$1?n(c$3):t$1.value.push(c$3)}},l=s=>{if(Ve(s)){let a$1=s;t$1.value=t$1.value.filter(({uuid:c$3})=>c$3!==a$1.uuid)}};return watchEffect(()=>{e$4.aspectRatio.value&&t$1.value.forEach(s=>{!s.manual&&(s instanceof PerspectiveCamera||gn(s))&&(s instanceof PerspectiveCamera?s.aspect=e$4.aspectRatio.value:(s.left=e$4.width.value*-.5,s.right=e$4.width.value*.5,s.top=e$4.height.value*.5,s.bottom=e$4.height.value*-.5),s.updateProjectionMatrix())})}),onUnmounted(()=>{t$1.value=[]}),{camera:r$1,cameras:t$1,registerCamera:o,deregisterCamera:l,setCameraActive:n}};function gn(e$4){return e$4.hasOwnProperty(`isOrthographicCamera`)&&e$4.isOrthographicCamera}const ro=!0,fe=`[TresJS ▲ ■ ●] `;function hn(...e$4){typeof e$4[0]==`string`?e$4[0]=fe+e$4[0]:e$4.unshift(fe),console.error(...e$4)}function vn$2(...e$4){typeof e$4[0]==`string`?e$4[0]=fe+e$4[0]:e$4.unshift(fe),console.warn(...e$4)}function yn(e$4,t$1){}function Q$1(){return{logError:hn,logWarning:vn$2,logMessage:yn}}const Ce$1=ref({}),Ee$1=e$4=>Object.assign(Ce$1.value,e$4);function ve(){let e$4=new Map,t$1=new Set,r$1=0,n=!1,o=()=>{let i=Array.from(e$4.entries()).sort((f$2,v)=>{let u=f$2[1].priority-v[1].priority;return u===0?f$2[1].addI-v[1].addI:u});t$1.clear(),i.forEach(f$2=>t$1.add(f$2[0]))},l=i=>{e$4.delete(i),t$1.delete(i)};return{on:(i,f$2=0)=>{e$4.set(i,{priority:f$2,addI:r$1++});let v=()=>l(i);return tryOnScopeDispose$1(v),n=!0,{off:v}},off:l,trigger:(...i)=>{n&&(o(),n=!1),t$1.forEach(f$2=>f$2(...i))},dispose:()=>{e$4.clear(),t$1.clear()},get count(){return e$4.size}}}function _n(){let e$4=!0,t$1=!0,r$1=!1,n=new Clock$1(!1),o=ref(n.running),l=ref(!1),s,a$1=MathUtils.generateUUID(),c$3=null,i=ve(),f$2=ve(),v=ve();S();let u={};function _$1(M$1){u=M$1}function d(M$1,x$1,m=0){switch(x$1){case`before`:return i.on(M$1,m);case`render`:return c$3||=M$1,f$2.dispose(),f$2.on(M$1);case`after`:return v.on(M$1,m)}}function y(){t$1&&(t$1=!1,S(),E())}function p$4(){t$1=!0,S(),cancelAnimationFrame(s)}function h$1(){r$1=!1,S()}function P(){r$1=!0,S()}function C$1(){l.value=!0}function b$1(){l.value=!1}function E(){if(!e$4){s=requestAnimationFrame(E);return}let M$1=n.getDelta(),x$1=n.getElapsedTime(),m={camera:unref(u.camera),scene:unref(u.scene),renderer:unref(u.renderer),raycaster:unref(u.raycaster),controls:unref(u.controls),invalidate:u.invalidate,advance:u.advance},w={delta:M$1,elapsed:x$1,clock:n,...m};o.value&&i.trigger(w),l.value||(f$2.count?f$2.trigger(w):c$3&&c$3(w)),o.value&&v.trigger(w),s=requestAnimationFrame(E)}function S(){let M$1=!t$1&&!r$1;n.running!==M$1&&(n.running?n.stop():n.start()),o.value=n.running}return{loopId:a$1,register:(M$1,x$1,m)=>d(M$1,x$1,m),start:y,stop:p$4,pause:P,resume:h$1,pauseRender:C$1,resumeRender:b$1,isRenderPaused:l,isActive:o,setContext:_$1,setReady:M$1=>e$4=M$1}}function Le(e$4){let t$1=0;return e$4.traverse(r$1=>{if(r$1.isMesh&&r$1.geometry&&r$1.type!==`HightlightMesh`){let n=r$1.geometry,o=n.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,l=n.index?n.index.count*Uint32Array.BYTES_PER_ELEMENT:0,s=n.attributes.normal?n.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a$1=n.attributes.uv?n.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,c$3=o+l+s+a$1;t$1+=c$3}}),t$1}function wn(e$4){return(e$4/1024).toFixed(2)}const bn=Number.parseInt(REVISION.replace(`dev`,``));function Mn(e$4){return e$4 instanceof Color?e$4:Array.isArray(e$4)?new Color(...e$4):new Color(e$4)}const oe={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:SRGBColorSpace,toneMapping:ACESFilmicToneMapping,toneMappingExposure:3,shadowMap:{enabled:!0,type:PCFSoftShadowMap}},flat:{toneMapping:NoToneMapping,toneMappingExposure:1}};function Pn({canvas:e$4,options:t$1,contextParts:{sizes:r$1,render:n,invalidate:o,advance:l}}){let s=computed(()=>({alpha:toValue$2(t$1.alpha)??!0,depth:toValue$2(t$1.depth),canvas:unrefElement$1(e$4),context:toValue$2(t$1.context),stencil:toValue$2(t$1.stencil),antialias:toValue$2(t$1.antialias)??!0,precision:toValue$2(t$1.precision),powerPreference:toValue$2(t$1.powerPreference),premultipliedAlpha:toValue$2(t$1.premultipliedAlpha),preserveDrawingBuffer:toValue$2(t$1.preserveDrawingBuffer),logarithmicDepthBuffer:toValue$2(t$1.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:toValue$2(t$1.failIfMajorPerformanceCaveat)})),a$1=shallowRef(new WebGLRenderer(s.value));function c$3(){t$1.renderMode===`on-demand`&&o()}watch(s,()=>{a$1.value.dispose(),a$1.value=new WebGLRenderer(s.value),c$3()}),watch([r$1.width,r$1.height],()=>{a$1.value.setSize(r$1.width.value,r$1.height.value),c$3()},{immediate:!0}),watch(()=>t$1.clearColor,c$3);let{pixelRatio:i}=useDevicePixelRatio(),{logError:f$2}=Q$1(),u=(()=>{let d=new WebGLRenderer,y={shadowMap:{enabled:d.shadowMap.enabled,type:d.shadowMap.type},toneMapping:d.toneMapping,toneMappingExposure:d.toneMappingExposure,outputColorSpace:d.outputColorSpace};return d.dispose(),y})(),_$1=toValue$2(t$1.renderMode);return _$1===`on-demand`&&o(),_$1===`manual`&&setTimeout(()=>{l()},100),watchEffect(()=>{let d=toValue$2(t$1.preset);d&&(d in oe||f$2(`Renderer Preset must be one of these: ${Object.keys(oe).join(`, `)}`),gt$1(a$1.value,oe[d])),fn$4(a$1.value,i.value,toValue$2(t$1.dpr)),_$1===`always`&&(n.frames.value=Math.max(1,n.frames.value));let y=(P,C$1)=>{let b$1=toValue$2(P),E=()=>{if(d)return qe(oe[d],C$1)};if(b$1!==void 0)return b$1;let S=E();return S===void 0?qe(u,C$1):S},p$4=(P,C$1)=>en(a$1.value,C$1,y(P,C$1));p$4(t$1.shadows,`shadowMap.enabled`),p$4(t$1.toneMapping??ACESFilmicToneMapping,`toneMapping`),p$4(t$1.shadowMapType,`shadowMap.type`),bn<150&&p$4(!t$1.useLegacyLights,`physicallyCorrectLights`),p$4(t$1.outputColorSpace,`outputColorSpace`),p$4(t$1.toneMappingExposure,`toneMappingExposure`);let h$1=y(t$1.clearColor,`clearColor`);h$1&&a$1.value.setClearColor(h$1?Mn(h$1):new Color(0))}),onUnmounted(()=>{a$1.value.dispose(),a$1.value.forceContextLoss()}),{renderer:a$1}}function Cn(e$4,t$1,r$1=10){let n=toValue$2(e$4)?useWindowSize$1():useElementSize(computed(()=>toValue$2(t$1).parentElement)),o=readonly$1(refDebounced$1(n.width,r$1)),l=readonly$1(refDebounced$1(n.height,r$1)),s=computed(()=>o.value/l.value);return{height:l,width:o,aspectRatio:s}}const En=(e$4,t$1)=>{let r$1=computed(()=>t$1.renderer.value.domElement),n=shallowRef([]),{x:o,y:l}=usePointer$1({target:r$1}),s=0,{width:a$1,height:c$3,top:i,left:f$2}=useElementBounding$1(r$1),v=({x:g,y:T})=>{if(r$1.value)return{x:(g-f$2.value)/a$1.value*2-1,y:-((T-i.value)/c$3.value)*2+1}},u=({x:g,y:T})=>{if(t$1.camera.value)return t$1.raycaster.value.setFromCamera(new Vector2(g,T),t$1.camera.value),n.value=t$1.raycaster.value.intersectObjects(e$4.value,!0),n.value},_$1=g=>{let T=v({x:g?.clientX??o.value,y:g?.clientY??l.value});return T&&u(T)||[]},d=createEventHook(),y=createEventHook(),p$4=createEventHook(),h$1=createEventHook(),P=createEventHook(),C$1=createEventHook(),b$1=createEventHook(),E=createEventHook();function S(g){let T={};for(let U in g)typeof U!=`function`&&(T[U]=g[U]);return T}let M$1=(g,T)=>{var Ie,$e$1,He;let U=S(T),re$2=new Vector3(T?.clientX,T?.clientY,0).unproject((Ie=t$1.camera)?.value);g.trigger({...U,intersections:n.value,unprojectedPoint:re$2,ray:($e$1=t$1.raycaster)?.value.ray,camera:(He=t$1.camera)?.value,sourceEvent:T,delta:s,stopPropagating:!1})},x$1,m=g=>{_$1(g),M$1(p$4,g),x$1=g},w=()=>{x$1&&m(x$1)},k$3,L,R,B=g=>{var T;k$3=(T=n.value[0])?.object,s=0,L=new Vector2(g?.clientX??o.value,g?.clientY??l.value),M$1(P,g)},O$1,G=!1,Oe$1=g=>{var T,U,re$2;g instanceof PointerEvent&&(n.value.length===0&&M$1(C$1,g),k$3===(T=n.value[0])?.object&&(R=new Vector2(g?.clientX??o.value,g?.clientY??l.value),s=L?.distanceTo(R),g.button===0?(M$1(d,g),O$1===(U=n.value[0])?.object?G=!0:(O$1=(re$2=n.value[0])?.object,G=!1)):g.button===2&&M$1(b$1,g)),M$1(h$1,g))},De=g=>{G&&(M$1(y,g),O$1=void 0,G=!1)},je=g=>M$1(p$4,g),Be$1=g=>M$1(E,g);return r$1.value.addEventListener(`pointerup`,Oe$1),r$1.value.addEventListener(`pointerdown`,B),r$1.value.addEventListener(`pointermove`,m),r$1.value.addEventListener(`pointerleave`,je),r$1.value.addEventListener(`dblclick`,De),r$1.value.addEventListener(`wheel`,Be$1),onUnmounted(()=>{r$1!=null&&r$1.value&&(r$1.value.removeEventListener(`pointerup`,Oe$1),r$1.value.removeEventListener(`pointerdown`,B),r$1.value.removeEventListener(`pointermove`,m),r$1.value.removeEventListener(`pointerleave`,je),r$1.value.removeEventListener(`dblclick`,De),r$1.value.removeEventListener(`wheel`,Be$1))}),{intersects:n,onClick:g=>d.on(g).off,onDblClick:g=>y.on(g).off,onContextMenu:g=>b$1.on(g).off,onPointerMove:g=>p$4.on(g).off,onPointerUp:g=>h$1.on(g).off,onPointerDown:g=>P.on(g).off,onPointerMissed:g=>C$1.on(g).off,onWheel:g=>E.on(g).off,forceUpdate:w}};function ye(e$4,t$1){if(Array.isArray(e$4))for(let r$1 of e$4)r$1(t$1);typeof e$4==`function`&&e$4(t$1)}function Tn(e$4,t$1,r$1){var x$1;let n=shallowRef(),o=shallowRef();e$4&&(n.value=e$4),t$1&&(o.value=t$1);let l=m=>{var w;return(w=m.__tres)?.eventCount>0},s=m=>{var w;return(w=m.children)?.some(k$3=>s(k$3))||l(m)},a$1=shallowRef(((x$1=n.value)?.children).filter(s)||[]);function c$3(m,w){let k$3=[],L=()=>w.stopPropagating=!0;w.stopPropagation=L;for(let R of w?.intersections){if(w.stopPropagating)return;w={...w,...R};let{object:B}=R;w.eventObject=B,ye(B[m],w),k$3.push(B);let O$1=B.parent;for(;O$1!==null&&!w.stopPropagating&&!k$3.includes(O$1);)w.eventObject=O$1,ye(O$1[m],w),k$3.push(O$1),O$1=O$1.parent;let G=Xr(m.slice(2));r$1(G,{intersection:R,event:w})}}let{onClick:i,onDblClick:f$2,onContextMenu:v,onPointerMove:u,onPointerDown:_$1,onPointerUp:d,onPointerMissed:y,onWheel:p$4,forceUpdate:h$1}=En(a$1,t$1);d(m=>c$3(`onPointerUp`,m)),_$1(m=>c$3(`onPointerDown`,m)),i(m=>c$3(`onClick`,m)),f$2(m=>c$3(`onDoubleClick`,m)),v(m=>c$3(`onContextMenu`,m)),p$4(m=>c$3(`onWheel`,m));let P=[];u(m=>{let w=m.intersections.map(({object:L})=>L),k$3=m.intersections;P.forEach(({object:L})=>{w.includes(L)||(m.intersections=P,c$3(`onPointerLeave`,m),c$3(`onPointerOut`,m))}),m.intersections=k$3,m.intersections.forEach(({object:L})=>{P.includes(L)||(c$3(`onPointerEnter`,m),c$3(`onPointerOver`,m))}),c$3(`onPointerMove`,m),P=m.intersections});let C$1=[];y(m=>{let w=()=>m.stopPropagating=!0;m.stopPropagation=w,C$1.forEach(k$3=>{m.stopPropagating||(m.eventObject=k$3,ye(k$3.onPointerMissed,m))}),r$1(`pointer-missed`,{event:m})});function b$1(m){ne(m)&&N(m)&&a$1.value.push(m)}function E(m){if(ne(m)&&N(m)){let w=a$1.value.indexOf(m);w>-1&&a$1.value.splice(w,1)}}function S(m){ne(m)&&N(m)&&m.onPointerMissed&&C$1.push(m)}function M$1(m){if(ne(m)&&N(m)){let w=C$1.indexOf(m);w>-1&&C$1.splice(w,1)}}return t$1.eventManager={forceUpdate:h$1,registerObject:b$1,deregisterObject:E,registerPointerMissedObject:S,deregisterPointerMissedObject:M$1},{forceUpdate:h$1,registerObject:b$1,deregisterObject:E,registerPointerMissedObject:S,deregisterPointerMissedObject:M$1}}function Sn(e$4,t$1,r$1=100){r$1=r$1<=0?100:r$1;let n=createEventHook(),o=new Set,l=!1,s=!1,a$1=null;function c$3(){a$1&&clearTimeout(a$1),!s&&!l&&e$4()?(n.trigger(t$1),o.forEach(u=>u()),o.clear(),l=!0):!s&&!l&&(a$1=setTimeout(c$3,r$1))}function i(){s=!0,a$1&&clearTimeout(a$1)}c$3();let f$2=(u,..._$1)=>{u(..._$1)};return{on:u=>{if(l)return f$2(u,t$1),{off:()=>{}};{let _$1=n.on(u);return o.add(_$1.off),n.on(u)}},off:n.off,trigger:n.trigger,clear:n.clear,cancel:i}}const ee$1=new WeakMap;function bt$1(e$4){if(e$4||=pe(),ee$1.has(e$4))return ee$1.get(e$4);let t$1=100,r$1=Date.now(),l=Sn(()=>{if(Date.now()-r$1>=t$1)return!0;{let s=e$4.renderer.value,a$1=s?.domElement||{width:0,height:0};return!!(s&&a$1.width>0&&a$1.height>0)}},e$4);return ee$1.set(e$4,l),l}function An({scene:e$4,canvas:t$1,windowSize:r$1,rendererOptions:n,emit:o}){let l=shallowRef(e$4),s=Cn(r$1,t$1),{camera:a$1,cameras:c$3,registerCamera:i,deregisterCamera:f$2,setCameraActive:v}=mn({sizes:s}),u={mode:ref(n.renderMode||`always`),priority:ref(0),frames:ref(0),maxFrames:60,canBeInvalidated:computed(()=>u.mode.value===`on-demand`&&u.frames.value===0)};function _$1(R=1){n.renderMode===`on-demand`&&(u.frames.value=Math.min(u.maxFrames,u.frames.value+R))}function d(){n.renderMode===`manual`&&(u.frames.value=1)}let{renderer:y}=Pn({canvas:t$1,options:n,contextParts:{sizes:s,render:u,invalidate:_$1,advance:d}}),p$4={sizes:s,scene:l,camera:a$1,cameras:readonly$1(c$3),renderer:y,raycaster:shallowRef(new Raycaster),controls:ref(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:u,advance:d,extend:Ee$1,invalidate:_$1,registerCamera:i,setCameraActive:v,deregisterCamera:f$2,loop:_n()};provide(`useTres`,p$4),p$4.scene.value.__tres={root:p$4},p$4.loop.register(()=>{a$1.value&&u.frames.value>0&&(y.value.render(e$4,a$1.value),o(`render`,p$4.renderer.value)),u.priority.value=0,u.mode.value===`always`?u.frames.value=1:u.frames.value=Math.max(0,u.frames.value-1)},`render`);let{on:h$1,cancel:P}=bt$1(p$4);p$4.loop.setReady(!1),p$4.loop.start(),h$1(()=>{o(`ready`,p$4),p$4.loop.setReady(!0),Tn(e$4,p$4,o)}),onUnmounted(()=>{P(),p$4.loop.stop()});let C$1=100,b$1=useFps({every:C$1}),{isSupported:E,memory:S}=useMemory({interval:C$1}),M$1=160,x$1=performance.now(),m=({timestamp:R})=>{p$4.scene.value&&(p$4.perf.memory.allocatedMem=Le(p$4.scene.value)),R-x$1>=C$1&&(x$1=R,p$4.perf.fps.accumulator.push(b$1.value),p$4.perf.fps.accumulator.length>M$1&&p$4.perf.fps.accumulator.shift(),p$4.perf.fps.value=b$1.value,E.value&&S.value&&(p$4.perf.memory.accumulator.push(S.value.usedJSHeapSize/1024/1024),p$4.perf.memory.accumulator.length>M$1&&p$4.perf.memory.accumulator.shift(),p$4.perf.memory.currentMem=p$4.perf.memory.accumulator.reduce((B,O$1)=>B+O$1,0)/p$4.perf.memory.accumulator.length))},w=0,k$3=1,{pause:L}=useRafFn(({delta:R})=>{window.__TRES__DEVTOOLS__&&(m({timestamp:performance.now()}),w+=R,w>=k$3&&(window.__TRES__DEVTOOLS__.cb(p$4),w=0))},{immediate:!0});return onUnmounted(()=>{L()}),p$4}function pe(){let e$4=inject(`useTres`);if(!e$4)throw Error(`useTresContext must be used together with useTresContextProvider`);return e$4}function io(){let{camera:e$4,scene:t$1,renderer:r$1,loop:n,raycaster:o,controls:l,invalidate:s,advance:a$1}=pe();n.setContext({camera:e$4,scene:t$1,renderer:r$1,raycaster:o,controls:l,invalidate:s,advance:a$1});function c$3(v,u=0){return n.register(v,`before`,u)}function i(v){return n.register(v,`render`)}function f$2(v,u=0){return n.register(v,`after`,u)}return{pause:n.pause,resume:n.resume,pauseRender:n.pauseRender,resumeRender:n.resumeRender,isActive:n.isActive,onBeforeRender:c$3,render:i,onAfterRender:f$2}}const Mt=createEventHook(),Pt$1=createEventHook(),Re=createEventHook(),te=new Clock$1;let le=0,ce=0;const{pause:xn,resume:Xe,isActive:kn}=useRafFn(()=>{Mt.trigger({delta:le,elapsed:ce,clock:te}),Pt$1.trigger({delta:le,elapsed:ce,clock:te}),Re.trigger({delta:le,elapsed:ce,clock:te})},{immediate:!1});Re.on(()=>{le=te.getDelta(),ce=te.getElapsedTime()});function Ln(e$4,t$1={},r$1={}){let n=e$4,o=a$1=>{n=a$1},l=new Proxy({},{}),s={has(a$1,c$3){return c$3 in t$1||c$3 in n},get(a$1,c$3,i){return c$3 in t$1?t$1[c$3](n):n[c$3]},set(a$1,c$3,i){return r$1[c$3]?r$1[c$3](i,n,l,o):n[c$3]=i,!0}};return l=new Proxy({},s),l}const{logError:et}=Q$1(),tt=[`onClick`,`onContextMenu`,`onPointerMove`,`onPointerEnter`,`onPointerLeave`,`onPointerOver`,`onPointerOut`,`onDoubleClick`,`onPointerDown`,`onPointerUp`,`onPointerCancel`,`onPointerMissed`,`onLostPointerCapture`,`onWheel`],Rn=e$4=>{let t$1=e$4.scene.value;function r$1(i,f$2,v,u){if(u||={},u.args||=[],i===`template`||Jr(i))return null;let _$1=i.replace(`Tres`,``),d;if(i===`primitive`){(!j(u.object)||isRef(u.object))&&et(`Tres primitives need an 'object' prop, whose value is an object or shallowRef`),_$1=u.object.type;let y={};d=Ln(u.object,{object:h$1=>h$1,isPrimitive:()=>!0,__tres:()=>y},{object:(h$1,P,C$1,b$1)=>{pn(h$1,C$1,b$1,{patchProp:l,remove:o,insert:n},e$4)},__tres:h$1=>{Object.assign(y,h$1)}})}else{let y=Ce$1.value[_$1];y||et(`${_$1} is not defined on the THREE namespace. Use extend to add it to the catalog.`),d=new y(...u.args)}return d?(d.isCamera&&(u!=null&&u.position||d.position.set(3,3,3),u!=null&&u.lookAt||d.lookAt(0,0,0)),d=z(d,{...d.__tres,type:_$1,memoizedProps:u,eventCount:0,primitive:i===`primitive`,attach:u.attach},e$4),d):null}function n(i,f$2){var _$1,d,y;if(!i)return;f$2||=t$1;let v=i.__tres?i:z(i,{},e$4),u=f$2.__tres?f$2:z(f$2,{},e$4);i=J(v),f$2=J(u),i.__tres&&(_$1=i.__tres)?.eventCount>0&&((d=e$4.eventManager)==null||d.registerObject(i)),e$4.registerCamera(i),(y=e$4.eventManager)==null||y.registerPointerMissedObject(i),v.__tres.attach?cn$1(u,v,v.__tres.attach):N(i)&&N(u)&&(u.add(i),i.dispatchEvent({type:`added`})),v.__tres.parent=u,u.__tres.objects&&!u.__tres.objects.includes(v)&&u.__tres.objects.push(v)}function o(i,f$2){var d,y,p$4,h$1;if(!i)return;i!=null&&i.__tres&&(d=i.__tres)?.eventCount>0&&((y=e$4.eventManager)==null||y.deregisterObject(i)),f$2=be(f$2)?`default`:f$2;let v=(p$4=i.__tres)?.dispose;be(v)||(f$2=v===null?!1:v);let u=(h$1=i.__tres)?.primitive,_$1=f$2===`default`?!u:!!f$2;if(i.__tres&&`objects`in i.__tres&&[...i.__tres.objects].forEach(P=>o(P,f$2)),_$1&&i.children&&[...i.children].forEach(P=>o(P,f$2)),_t$1(i,e$4),wt$1(i,e$4),_$1&&!Yr(i)){if(Y(f$2))f$2(i);else if(Y(i.dispose))try{i.dispose()}catch{}}`__tres`in i&&delete i.__tres}function l(i,f$2,v,u){var P,C$1;if(!i)return;let _$1=i,d=f$2;if(i.__tres&&(i.__tres.memoizedProps[f$2]=u),f$2===`attach`){let b$1=(P=i.__tres)?.parent||i.parent;o(i),z(i,{attach:u},e$4),b$1&&n(i,b$1);return}if(f$2===`dispose`){i.__tres||(i=z(i,{},e$4)),i.__tres.dispose=u;return}if(N(i)&&d===`blocks-pointer-events`){u||u===``?i[d]=u:delete i[d];return}tt.includes(f$2)&&i.__tres&&(i.__tres.eventCount+=1);let y=he(d),p$4=_$1?.[y];if(d===`args`){let b$1=i,E=v??[],S=u??[],M$1=(C$1=i.__tres)?.type||i.type;M$1&&E.length&&!tn(E,S)&&(_$1=Object.assign(b$1,new Ce$1.value[M$1](...u)));return}if(_$1.type===`BufferGeometry`){if(d===`args`)return;_$1.setAttribute(he(d),new BufferAttribute(...u));return}if(d.includes(`-`)&&p$4===void 0){p$4=_$1;for(let b$1 of d.split(`-`))y=d=he(b$1),_$1=p$4,p$4=p$4?.[d]}let h$1=u;if(h$1===``&&(h$1=!0),Y(p$4)){tt.includes(f$2)||(ke(h$1)?i[y](...h$1):i[y](h$1)),y.startsWith(`on`)&&Y(h$1)&&(_$1[y]=h$1);return}Ge(p$4)&&Ge(h$1)?p$4.mask=h$1.mask:mt$1(p$4)&&Ur(h$1)?p$4.set(h$1):Fr(p$4)&&Wr(h$1)&&p$4.constructor===h$1.constructor?p$4.copy(h$1):Me(p$4)&&Array.isArray(h$1)?`fromArray`in p$4&&typeof p$4.fromArray==`function`?p$4.fromArray(h$1):p$4.set(...h$1):Me(p$4)&&typeof h$1==`number`?`setScalar`in p$4&&typeof p$4.setScalar==`function`?p$4.setScalar(h$1):p$4.set(h$1):_$1[y]=h$1,yt$1(i)}function s(i){var f$2;return(f$2=i?.__tres)?.parent||null}function a$1(i){let f$2=z(new Object3D,{type:`Comment`},e$4);return f$2.name=i,f$2}function c$3(i){var _$1;let f$2=s(i),v=(_$1=f$2?.__tres)?.objects||[],u=v.indexOf(i);return u<0||u>=v.length-1?null:v[u+1]}return{insert:n,remove:o,createElement:r$1,patchProp:l,parentNode:s,createText:()=>void 0,createComment:a$1,setText:()=>void 0,setElementText:()=>void 0,nextSibling:c$3,querySelector:()=>void 0,setScopeId:()=>void 0,cloneNode:()=>void 0,insertStaticContent:()=>void 0}};function On(){return Ct$1().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ct$1(){return typeof navigator<`u`&&typeof window<`u`?window:typeof globalThis<`u`?globalThis:{}}const Dn=typeof Proxy==`function`,jn=`devtools-plugin:setup`,Bn=`plugin:settings:set`;let V,Te$1;function In(){var e$4;return V!==void 0||(typeof window<`u`&&window.performance?(V=!0,Te$1=window.performance):typeof globalThis<`u`&&(e$4=globalThis.perf_hooks)!=null&&e$4.performance?(V=!0,Te$1=globalThis.perf_hooks.performance):V=!1),V}function $n(){return In()?Te$1.now():Date.now()}var Hn=class{constructor(t$1,r$1){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t$1,this.hook=r$1;let n={};if(t$1.settings)for(let s in t$1.settings){let a$1=t$1.settings[s];n[s]=a$1.defaultValue}let o=`__vue-devtools-plugin-settings__${t$1.id}`,l=Object.assign({},n);try{let s=localStorage.getItem(o),a$1=JSON.parse(s);Object.assign(l,a$1)}catch{}this.fallbacks={getSettings(){return l},setSettings(s){try{localStorage.setItem(o,JSON.stringify(s))}catch{}l=s},now(){return $n()}},r$1&&r$1.on(Bn,(s,a$1)=>{s===this.plugin.id&&this.fallbacks.setSettings(a$1)}),this.proxiedOn=new Proxy({},{get:(s,a$1)=>this.target?this.target.on[a$1]:(...c$3)=>{this.onQueue.push({method:a$1,args:c$3})}}),this.proxiedTarget=new Proxy({},{get:(s,a$1)=>this.target?this.target[a$1]:a$1===`on`?this.proxiedOn:Object.keys(this.fallbacks).includes(a$1)?(...c$3)=>(this.targetQueue.push({method:a$1,args:c$3,resolve:()=>{}}),this.fallbacks[a$1](...c$3)):(...c$3)=>new Promise(i=>{this.targetQueue.push({method:a$1,args:c$3,resolve:i})})})}async setRealTarget(t$1){this.target=t$1;for(let r$1 of this.onQueue)this.target.on[r$1.method](...r$1.args);for(let r$1 of this.targetQueue)r$1.resolve(await this.target[r$1.method](...r$1.args))}};function Un(e$4,t$1){let r$1=e$4,n=Ct$1(),o=On(),l=Dn&&r$1.enableEarlyProxy;if(o&&(n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!l))o.emit(jn,e$4,t$1);else{let s=l?new Hn(r$1,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r$1,setupFn:t$1,proxy:s}),s&&t$1(s.proxiedTarget)}}function Fn(e$4,t$1){let r$1=`▲ ■ ●${e$4}`;typeof rt$1==`function`?rt$1(r$1,t$1):console.log(r$1)}function rt$1(e$4,t$1){throw Error(e$4+t$1)}const Et=e$4=>{let t$1={id:e$4.uuid,label:e$4.type,children:[],tags:[]};e$4.name!==``&&t$1.tags.push({label:e$4.name,textColor:5750629,backgroundColor:15793395});let r$1=Le(e$4);return r$1>0&&t$1.tags.push({label:`${wn(r$1)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e$4.type.includes(`Light`)&&(Gr(e$4)&&t$1.tags.push({label:`${e$4.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t$1.tags.push({label:`#${new Color(e$4.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:`Color`})),e$4.type.includes(`Camera`)&&(t$1.tags.push({label:`${e$4.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:`Field of view`}),t$1.tags.push({label:`x: ${Math.round(e$4.position.x)} y: ${Math.round(e$4.position.y)} z: ${Math.round(e$4.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:`Position`})),t$1};function Tt$1(e$4,t$1,r$1=``){e$4.children.forEach(n=>{if(n.type===`HightlightMesh`||r$1&&!n.type.includes(r$1)&&!n.name.includes(r$1))return;let o=Et(n);t$1.children.push(o),Tt$1(n,o,r$1)})}const Wn=[],X=`tres:inspector`,Nn=reactive({sceneGraph:null});function zn(e$4,t$1){Un({id:`dev.esm.tres`,label:`TresJS 🪐`,logo:`https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg`,packageName:`tresjs`,homepage:`https://tresjs.org`,componentStateTypes:Wn,app:e$4},r$1=>{typeof r$1.now!=`function`&&Fn(`You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.`),r$1.addInspector({id:X,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{r$1.sendInspectorTree(X)},1e3),setInterval(()=>{r$1.notifyComponentUpdate()},5e3),r$1.on.getInspectorTree(l=>{if(l.inspectorId===X){let s=Et(t$1.scene.value);Tt$1(t$1.scene.value,s,l.filter),Nn.sceneGraph=s,l.rootNodes=[s]}});let n=null,o=null;r$1.on.getInspectorState(l=>{var s;if(l.inspectorId===X){let[a$1]=t$1.scene.value.getObjectsByProperty(`uuid`,l.nodeId);if(!a$1)return;if(o&&n&&n.parent&&o.remove(n),a$1.isMesh){let c$3=on(a$1);a$1.add(c$3),n=c$3,o=a$1}l.state={object:Object.entries(a$1).map(([c$3,i])=>c$3===`children`?{key:c$3,value:i.filter(f$2=>f$2.type!==`HightlightMesh`)}:{key:c$3,value:i,editable:!0}).filter(({key:c$3})=>c$3!==`parent`)},a$1.isScene&&(l.state={...l.state,state:[{key:`Scene Info`,value:{objects:a$1.children.length,memory:Le(a$1),calls:t$1.renderer.value.info.render.calls,triangles:t$1.renderer.value.info.render.triangles,points:t$1.renderer.value.info.render.points,lines:t$1.renderer.value.info.render.lines}},{key:`Programs`,value:(s=t$1.renderer.value.info.programs)?.map(c$3=>({...c$3,programName:c$3.name}))||[]}]})}}),r$1.on.editInspectorState(l=>{l.inspectorId===X&&nn(t$1.scene.value,l.nodeId,l.path,l.state.value)})})}const Gn=[`data-scene`,`data-tres`],Vn=defineComponent({__name:`TresCanvas`,props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:`always`},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:[`render`,`click`,`double-click`,`context-menu`,`pointer-move`,`pointer-up`,`pointer-down`,`pointer-enter`,`pointer-leave`,`pointer-over`,`pointer-out`,`pointer-missed`,`wheel`,`ready`],setup(e$4,{expose:t$1,emit:r$1}){let n=e$4,o=r$1,l=useSlots(),s=ref(),a$1=shallowRef(new Scene),c$3=getCurrentInstance();Ee$1(three_module_exports);let i=(d,y=!1)=>defineComponent({setup(){var C$1;let p$4=(C$1=getCurrentInstance())?.appContext;p$4&&(p$4.app=c$3?.appContext.app);let h$1={};function P(b$1){b$1&&(b$1.parent&&P(b$1.parent),b$1.provides&&Object.assign(h$1,b$1.provides))}return c$3!=null&&c$3.parent&&n.enableProvideBridge&&(P(c$3.parent),Reflect.ownKeys(h$1).forEach(b$1=>{provide(b$1,h$1[b$1])})),provide(`useTres`,d),provide(`extend`,Ee$1),typeof window<`u`&&zn(p$4?.app,d),()=>h(Fragment,null,y?[]:l.default())}}),f$2=(d,y=!1)=>{let p$4=i(d,y),{render:h$1}=createRenderer(Rn(d));h$1(h(p$4),a$1.value)},v=(d,y=!1)=>{vt$1(d.scene.value),y&&(d.renderer.value.dispose(),d.renderer.value.renderLists.dispose(),d.renderer.value.forceContextLoss()),a$1.value.__tres={root:d}},u=shallowRef(null);t$1({context:u,dispose:()=>v(u.value,!0)});let _$1=()=>{v(u.value),f$2(u.value,!0)};return onMounted(()=>{let d=s;u.value=An({scene:a$1.value,canvas:d,windowSize:n.windowSize??!1,rendererOptions:n,emit:o});let{registerCamera:y,camera:p$4,cameras:h$1,deregisterCamera:P}=u.value;f$2(u.value);let C$1=()=>{let b$1=new PerspectiveCamera(45,window.innerWidth/window.innerHeight,.1,1e3);b$1.position.set(3,3,3),b$1.lookAt(0,0,0),y(b$1);let E=watchEffect(()=>{h$1.value.length>=2&&(b$1.removeFromParent(),P(b$1),E?.())})};watch(()=>n.camera,(b$1,E)=>{b$1&&y(b$1),E&&(E.removeFromParent(),P(E))},{immediate:!0}),p$4.value||C$1()}),onUnmounted(_$1),(d,y)=>(openBlock(),createElementBlock(`canvas`,{ref_key:`canvas`,ref:s,"data-scene":a$1.value.uuid,class:normalizeClass(d.$attrs.class),"data-tres":`tresjs ${unref(jr).version}`,style:normalizeStyle({display:`block`,width:`100%`,height:`100%`,position:d.windowSize?`fixed`:`relative`,top:0,left:0,pointerEvents:`auto`,touchAction:`none`,...d.$attrs.style})},null,14,Gn))}}),Yn=[`TresCanvas`,`TresLeches`,`TresScene`],co={template:{compilerOptions:{isCustomElement:e$4=>e$4.startsWith(`Tres`)&&!Yn.includes(e$4)||e$4===`primitive`}}},{logWarning:qn}=Q$1();var St$1=class extends Line{constructor(t$1,r$1){let n=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o=new BufferGeometry;o.setAttribute(`position`,new Float32BufferAttribute(n,3)),o.computeBoundingSphere();let l=new LineBasicMaterial({fog:!1});super(o,l),this.light=t$1,this.color=r$1,this.type=`RectAreaLightHelper`;let s=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a$1=new BufferGeometry;a$1.setAttribute(`position`,new Float32BufferAttribute(s,3)),a$1.computeBoundingSphere(),this.add(new Mesh(a$1,new MeshBasicMaterial({side:BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);let t$1=this.material.color,r$1=Math.max(t$1.r,t$1.g,t$1.b);r$1>1&&t$1.multiplyScalar(1/r$1),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}};const{logWarning:nt}=Q$1();let se,F;const Kn={DirectionalLight:DirectionalLightHelper,PointLight:PointLightHelper,SpotLight:SpotLightHelper,HemisphereLight:HemisphereLightHelper,RectAreaLight:St$1},fo={mounted:e$4=>{if(!e$4.isLight){nt(`${e$4.type} is not a light`);return}se=Kn[e$4.type],e$4.parent.add(new se(e$4,1,e$4.color.getHex()))},updated:e$4=>{F=e$4.parent.children.find(t$1=>t$1 instanceof se),!(F instanceof St$1)&&F.update()},unmounted:e$4=>{if(!e$4.isLight){nt(`${e$4.type} is not a light`);return}F=e$4.parent.children.find(t$1=>t$1 instanceof se),F&&F.dispose&&F.dispose(),e$4.parent&&e$4.parent.remove(F)}},po={mounted:(e$4,t$1)=>{if(t$1.arg){console.log(`v-log:${t$1.arg}`,e$4[t$1.arg]);return}console.log(`v-log`,e$4)}},mo={install(e$4){e$4.component(`TresCanvas`,Vn)}};var require_nprogress=__commonJSMin(((exports,module)=>{(function(root$3,factory){typeof define==`function`&&define.amd?define(factory):typeof exports==`object`?module.exports=factory():root$3.NProgress=factory()})(exports,function(){var NProgress$1={};NProgress$1.version=`0.2.0`;var Settings=NProgress$1.settings={minimum:.08,easing:`ease`,positionUsing:``,speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:`[role="bar"]`,spinnerSelector:`[role="spinner"]`,parent:`body`,template:`
`};NProgress$1.configure=function(options$1){var key$2,value$1;for(key$2 in options$1)value$1=options$1[key$2],value$1!==void 0&&options$1.hasOwnProperty(key$2)&&(Settings[key$2]=value$1);return this},NProgress$1.status=null,NProgress$1.set=function(n){var started=NProgress$1.isStarted();n=clamp$8(n,Settings.minimum,1),NProgress$1.status=n===1?null:n;var progress$1=NProgress$1.render(!started),bar=progress$1.querySelector(Settings.barSelector),speed=Settings.speed,ease=Settings.easing;return progress$1.offsetWidth,queue$1(function(next){Settings.positionUsing===``&&(Settings.positionUsing=NProgress$1.getPositioningCSS()),css(bar,barPositionCSS(n,speed,ease)),n===1?(css(progress$1,{transition:`none`,opacity:1}),progress$1.offsetWidth,setTimeout(function(){css(progress$1,{transition:`all `+speed+`ms linear`,opacity:0}),setTimeout(function(){NProgress$1.remove(),next()},speed)},speed)):setTimeout(next,speed)}),this},NProgress$1.isStarted=function(){return typeof NProgress$1.status==`number`},NProgress$1.start=function(){NProgress$1.status||NProgress$1.set(0);var work=function(){setTimeout(function(){NProgress$1.status&&(NProgress$1.trickle(),work())},Settings.trickleSpeed)};return Settings.trickle&&work(),this},NProgress$1.done=function(force){return!force&&!NProgress$1.status?this:NProgress$1.inc(.3+.5*Math.random()).set(1)},NProgress$1.inc=function(amount){var n=NProgress$1.status;return n?(typeof amount!=`number`&&(amount=(1-n)*clamp$8(Math.random()*n,.1,.95)),n=clamp$8(n+amount,0,.994),NProgress$1.set(n)):NProgress$1.start()},NProgress$1.trickle=function(){return NProgress$1.inc(Math.random()*Settings.trickleRate)},(function(){var initial=0,current=0;NProgress$1.promise=function($promise){return!$promise||$promise.state()===`resolved`?this:(current===0&&NProgress$1.start(),initial++,current++,$promise.always(function(){current--,current===0?(initial=0,NProgress$1.done()):NProgress$1.set((initial-current)/initial)}),this)}})(),NProgress$1.render=function(fromStart){if(NProgress$1.isRendered())return document.getElementById(`nprogress`);addClass(document.documentElement,`nprogress-busy`);var progress$1=document.createElement(`div`);progress$1.id=`nprogress`,progress$1.innerHTML=Settings.template;var bar=progress$1.querySelector(Settings.barSelector),perc=fromStart?`-100`:toBarPerc(NProgress$1.status||0),parent=document.querySelector(Settings.parent),spinner;return css(bar,{transition:`all 0 linear`,transform:`translate3d(`+perc+`%,0,0)`}),Settings.showSpinner||(spinner=progress$1.querySelector(Settings.spinnerSelector),spinner&&removeElement(spinner)),parent!=document.body&&addClass(parent,`nprogress-custom-parent`),parent.appendChild(progress$1),progress$1},NProgress$1.remove=function(){removeClass(document.documentElement,`nprogress-busy`),removeClass(document.querySelector(Settings.parent),`nprogress-custom-parent`);var progress$1=document.getElementById(`nprogress`);progress$1&&removeElement(progress$1)},NProgress$1.isRendered=function(){return!!document.getElementById(`nprogress`)},NProgress$1.getPositioningCSS=function(){var bodyStyle=document.body.style,vendorPrefix=`WebkitTransform`in bodyStyle?`Webkit`:`MozTransform`in bodyStyle?`Moz`:`msTransform`in bodyStyle?`ms`:`OTransform`in bodyStyle?`O`:``;return vendorPrefix+`Perspective`in bodyStyle?`translate3d`:vendorPrefix+`Transform`in bodyStyle?`translate`:`margin`};function clamp$8(n,min$1,max$1){return nmax$1?max$1:n}function toBarPerc(n){return(-1+n)*100}function barPositionCSS(n,speed,ease){var barCSS;return barCSS=Settings.positionUsing===`translate3d`?{transform:`translate3d(`+toBarPerc(n)+`%,0,0)`}:Settings.positionUsing===`translate`?{transform:`translate(`+toBarPerc(n)+`%,0)`}:{"margin-left":toBarPerc(n)+`%`},barCSS.transition=`all `+speed+`ms `+ease,barCSS}var queue$1=(function(){var pending=[];function next(){var fn$5=pending.shift();fn$5&&fn$5(next)}return function(fn$5){pending.push(fn$5),pending.length==1&&next()}})(),css=(function(){var cssPrefixes=[`Webkit`,`O`,`Moz`,`ms`],cssProps={};function camelCase(string$4){return string$4.replace(/^-ms-/,`ms-`).replace(/-([\da-z])/gi,function(match,letter){return letter.toUpperCase()})}function getVendorProp(name$2){var style=document.body.style;if(name$2 in style)return name$2;for(var i=cssPrefixes.length,capName=name$2.charAt(0).toUpperCase()+name$2.slice(1),vendorName;i--;)if(vendorName=cssPrefixes[i]+capName,vendorName in style)return vendorName;return name$2}function getStyleProp(name$2){return name$2=camelCase(name$2),cssProps[name$2]||(cssProps[name$2]=getVendorProp(name$2))}function applyCss(element$3,prop,value$1){prop=getStyleProp(prop),element$3.style[prop]=value$1}return function(element$3,properties){var args=arguments,prop,value$1;if(args.length==2)for(prop in properties)value$1=properties[prop],value$1!==void 0&&properties.hasOwnProperty(prop)&&applyCss(element$3,prop,value$1);else applyCss(element$3,args[1],args[2])}})();function hasClass(element$3,name$2){var list$2=typeof element$3==`string`?element$3:classList(element$3);return list$2.indexOf(` `+name$2+` `)>=0}function addClass(element$3,name$2){var oldList=classList(element$3),newList=oldList+name$2;hasClass(oldList,name$2)||(element$3.className=newList.substring(1))}function removeClass(element$3,name$2){var oldList=classList(element$3),newList;hasClass(element$3,name$2)&&(newList=oldList.replace(` `+name$2+` `,` `),element$3.className=newList.substring(1,newList.length-1))}function classList(element$3){return(` `+(element$3.className||``)+` `).replace(/\s+/gi,` `)}function removeElement(element$3){element$3&&element$3.parentNode&&element$3.parentNode.removeChild(element$3)}return NProgress$1})}));const parents=new Set,coords=new WeakMap,siblings$1=new WeakMap,animations=new WeakMap,intersections=new WeakMap,intervals=new WeakMap,options=new WeakMap,debounces=new WeakMap,enabled=new WeakSet;let root$2,scrollX=0,scrollY=0;const TGT=`__aa_tgt`,DEL=`__aa_del`,NEW=`__aa_new`,handleMutations=mutations$1=>{let elements=getElements(mutations$1);elements&&elements.forEach(el=>animate$2(el))},handleResizes=entries=>{entries.forEach(entry=>{entry.target===root$2&&updateAllPos(),coords.has(entry.target)&&updatePos(entry.target)})};function observePosition(el){let oldObserver=intersections.get(el);oldObserver?.disconnect();let rect=coords.get(el),invocations=0,buffer$1=5;rect||(rect=getCoords(el),coords.set(el,rect));let{offsetWidth,offsetHeight}=root$2,rootMargins=[rect.top-buffer$1,offsetWidth-(rect.left+buffer$1+rect.width),offsetHeight-(rect.top+buffer$1+rect.height),rect.left-buffer$1],rootMargin=rootMargins.map(px$2=>`${-1*Math.floor(px$2)}px`).join(` `),observer=new IntersectionObserver(()=>{++invocations>1&&updatePos(el)},{root:root$2,threshold:1,rootMargin});observer.observe(el),intersections.set(el,observer)}function updatePos(el){clearTimeout(debounces.get(el));let optionsOrPlugin=getOptions(el),delay=isPlugin(optionsOrPlugin)?500:optionsOrPlugin.duration;debounces.set(el,setTimeout(async()=>{let currentAnimation=animations.get(el);try{await currentAnimation?.finished,coords.set(el,getCoords(el)),observePosition(el)}catch{}},delay))}function updateAllPos(){clearTimeout(debounces.get(root$2)),debounces.set(root$2,setTimeout(()=>{parents.forEach(parent=>forEach(parent,el=>lowPriority(()=>updatePos(el))))},100))}function poll(el){setTimeout(()=>{intervals.set(el,setInterval(()=>lowPriority(updatePos.bind(null,el)),2e3))},Math.round(2e3*Math.random()))}function lowPriority(callback){typeof requestIdleCallback==`function`?requestIdleCallback(()=>callback()):requestAnimationFrame(()=>callback())}let mutations,resize;const supportedBrowser=typeof window<`u`&&`ResizeObserver`in window;supportedBrowser&&(root$2=document.documentElement,mutations=new MutationObserver(handleMutations),resize=new ResizeObserver(handleResizes),window.addEventListener(`scroll`,()=>{scrollY=window.scrollY,scrollX=window.scrollX}),resize.observe(root$2));function getElements(mutations$1){let observedNodes=mutations$1.reduce((nodes,mutation)=>[...nodes,...Array.from(mutation.addedNodes),...Array.from(mutation.removedNodes)],[]),onlyCommentNodesObserved=observedNodes.every(node$1=>node$1.nodeName===`#comment`);return onlyCommentNodesObserved?!1:mutations$1.reduce((elements,mutation)=>{if(elements===!1)return!1;if(mutation.target instanceof Element){if(target(mutation.target),!elements.has(mutation.target)){elements.add(mutation.target);for(let i=0;icallback(parent,options.has(parent)));for(let i=0;icallback(child,options.has(child)))}}function getPluginTuple(pluginReturn){return Array.isArray(pluginReturn)?pluginReturn:[pluginReturn]}function isPlugin(config$1){return typeof config$1==`function`}function remain(el){let oldCoords=coords.get(el),newCoords=getCoords(el);if(!isEnabled(el))return coords.set(el,newCoords);let animation;if(!oldCoords)return;let pluginOrOptions=getOptions(el);if(typeof pluginOrOptions!=`function`){let deltaX=oldCoords.left-newCoords.left,deltaY=oldCoords.top-newCoords.top,[widthFrom,widthTo,heightFrom,heightTo]=getTransitionSizes(el,oldCoords,newCoords),start={transform:`translate(${deltaX}px, ${deltaY}px)`},end={transform:`translate(0, 0)`};widthFrom!==widthTo&&(start.width=`${widthFrom}px`,end.width=`${widthTo}px`),heightFrom!==heightTo&&(start.height=`${heightFrom}px`,end.height=`${heightTo}px`),animation=el.animate([start,end],{duration:pluginOrOptions.duration,easing:pluginOrOptions.easing})}else{let[keyframes$4]=getPluginTuple(pluginOrOptions(el,`remain`,oldCoords,newCoords));animation=new Animation(keyframes$4),animation.play()}animations.set(el,animation),coords.set(el,newCoords),animation.addEventListener(`finish`,updatePos.bind(null,el))}function add(el){NEW in el&&delete el[NEW];let newCoords=getCoords(el);coords.set(el,newCoords);let pluginOrOptions=getOptions(el);if(!isEnabled(el))return;let animation;if(typeof pluginOrOptions!=`function`)animation=el.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:pluginOrOptions.duration*1.5,easing:`ease-in`});else{let[keyframes$4]=getPluginTuple(pluginOrOptions(el,`add`,newCoords));animation=new Animation(keyframes$4),animation.play()}animations.set(el,animation),animation.addEventListener(`finish`,updatePos.bind(null,el))}function cleanUp(el,styles){var _a$2;el.remove(),coords.delete(el),siblings$1.delete(el),animations.delete(el),(_a$2=intersections.get(el))==null||_a$2.disconnect(),setTimeout(()=>{if(DEL in el&&delete el[DEL],Object.defineProperty(el,NEW,{value:!0,configurable:!0}),styles&&el instanceof HTMLElement)for(let style in styles)el.style[style]=``},0)}function remove$1(el){var _a$2;if(!siblings$1.has(el)||!coords.has(el))return;let[prev,next]=siblings$1.get(el);Object.defineProperty(el,DEL,{value:!0,configurable:!0});let finalX=window.scrollX,finalY=window.scrollY;if(next&&next.parentNode&&next.parentNode instanceof Element?next.parentNode.insertBefore(el,next):prev&&prev.parentNode?prev.parentNode.appendChild(el):(_a$2=getTarget(el))==null||_a$2.appendChild(el),!isEnabled(el))return cleanUp(el);let[top,left,width,height]=deletePosition(el),optionsOrPlugin=getOptions(el),oldCoords=coords.get(el);(finalX!==scrollX||finalY!==scrollY)&&adjustScroll(el,finalX,finalY,optionsOrPlugin);let animation,styleReset={position:`absolute`,top:`${top}px`,left:`${left}px`,width:`${width}px`,height:`${height}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!isPlugin(optionsOrPlugin))Object.assign(el.style,styleReset),animation=el.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:optionsOrPlugin.duration,easing:`ease-out`});else{let[keyframes$4,options$1]=getPluginTuple(optionsOrPlugin(el,`remove`,oldCoords));options$1?.styleReset!==!1&&(styleReset=options$1?.styleReset||styleReset,Object.assign(el.style,styleReset)),animation=new Animation(keyframes$4),animation.play()}animations.set(el,animation),animation.addEventListener(`finish`,cleanUp.bind(null,el,styleReset))}function adjustScroll(el,finalX,finalY,optionsOrPlugin){let scrollDeltaX=scrollX-finalX,scrollDeltaY=scrollY-finalY,scrollBefore=document.documentElement.style.scrollBehavior,scrollBehavior=getComputedStyle(root$2).scrollBehavior;if(scrollBehavior===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+scrollDeltaX,window.scrollY+scrollDeltaY),!el.parentElement)return;let parent=el.parentElement,lastHeight=parent.clientHeight,lastWidth=parent.clientWidth,startScroll=performance.now();function smoothScroll(){requestAnimationFrame(()=>{if(!isPlugin(optionsOrPlugin)){let deltaY=lastHeight-parent.clientHeight,deltaX=lastWidth-parent.clientWidth;startScroll+optionsOrPlugin.duration>performance.now()?(window.scrollTo({left:window.scrollX-deltaX,top:window.scrollY-deltaY}),lastHeight=parent.clientHeight,lastWidth=parent.clientWidth,smoothScroll()):document.documentElement.style.scrollBehavior=scrollBefore}})}smoothScroll()}function deletePosition(el){let oldCoords=coords.get(el),[width,,height]=getTransitionSizes(el,oldCoords,getCoords(el)),offsetParent=el.parentElement;for(;offsetParent&&(getComputedStyle(offsetParent).position===`static`||offsetParent instanceof HTMLBodyElement);)offsetParent=offsetParent.parentElement;offsetParent||=document.body;let parentStyles=getComputedStyle(offsetParent),parentCoords=coords.get(offsetParent)||getCoords(offsetParent),top=Math.round(oldCoords.top-parentCoords.top)-raw$2(parentStyles.borderTopWidth),left=Math.round(oldCoords.left-parentCoords.left)-raw$2(parentStyles.borderLeftWidth);return[top,left,width,height]}function autoAnimate(el,config$1={}){if(mutations&&resize){let mediaQuery=window.matchMedia(`(prefers-reduced-motion: reduce)`),isDisabledDueToReduceMotion=mediaQuery.matches&&!isPlugin(config$1)&&!config$1.disrespectUserMotionPreference;isDisabledDueToReduceMotion||(enabled.add(el),getComputedStyle(el).position===`static`&&Object.assign(el.style,{position:`relative`}),forEach(el,updatePos,poll,element$3=>resize?.observe(element$3)),isPlugin(config$1)?options.set(el,config$1):options.set(el,{duration:250,easing:`ease-in-out`,...config$1}),mutations.observe(el,{childList:!0}),parents.add(el))}return Object.freeze({parent:el,enable:()=>{enabled.add(el)},disable:()=>{enabled.delete(el)},isEnabled:()=>enabled.has(el)})}const vAutoAnimate={mounted:(el,binding)=>{autoAnimate(el,binding.value||{})},getSSRProps:()=>({})},vAutoAnimate$1=vAutoAnimate,autoAnimatePlugin={install(app){app.directive(`auto-animate`,vAutoAnimate$1)}};function isPlainObject$6(value$1){if(typeof value$1!=`object`||!value$1)return!1;let prototype=Object.getPrototypeOf(value$1);return prototype!==null&&prototype!==Object.prototype&&Object.getPrototypeOf(prototype)!==null||Symbol.iterator in value$1?!1:Symbol.toStringTag in value$1?Object.prototype.toString.call(value$1)===`[object Module]`:!0}function _defu(baseObject,defaults$1,namespace=`.`,merger){if(!isPlainObject$6(defaults$1))return _defu(baseObject,{},namespace,merger);let object$1=Object.assign({},defaults$1);for(let key$2 in baseObject){if(key$2===`__proto__`||key$2===`constructor`)continue;let value$1=baseObject[key$2];if(value$1==null||merger&&merger(object$1,key$2,value$1,namespace))continue;Array.isArray(value$1)&&Array.isArray(object$1[key$2])?object$1[key$2]=[...value$1,...object$1[key$2]]:isPlainObject$6(value$1)&&isPlainObject$6(object$1[key$2])?object$1[key$2]=_defu(value$1,object$1[key$2],(namespace?`${namespace}.`:``)+key$2.toString(),merger):object$1[key$2]=value$1}return object$1}function createDefu(merger){return(...arguments_)=>arguments_.reduce((p$4,c$3)=>_defu(p$4,c$3,``,merger),{})}const defu=createDefu(),defuFn=createDefu((object$1,key$2,currentValue)=>{if(object$1[key$2]!==void 0&&typeof currentValue==`function`)return object$1[key$2]=currentValue(object$1[key$2]),!0}),defuArrayFn=createDefu((object$1,key$2,currentValue)=>{if(Array.isArray(object$1[key$2])&&typeof currentValue==`function`)return object$1[key$2]=currentValue(object$1[key$2]),!0});function tryOnScopeDispose(fn$5){return getCurrentScope()?(onScopeDispose(fn$5),!0):!1}function createEventHook$1(){let fns=new Set,off=fn$5=>{fns.delete(fn$5)},clear=()=>{fns.clear()},on$1=fn$5=>{fns.add(fn$5);let offFn=()=>off(fn$5);return tryOnScopeDispose(offFn),{off:offFn}},trigger$1=(...args)=>Promise.all(Array.from(fns).map(fn$5=>fn$5(...args)));return{on:on$1,off,trigger:trigger$1,clear}}const localProvidedStateMap=new WeakMap,injectLocal=(...args)=>{var _a$2;let key$2=args[0],instance=(_a$2=getCurrentInstance())?.proxy;if(instance==null&&!hasInjectionContext())throw Error(`injectLocal must be called in setup`);return instance&&localProvidedStateMap.has(instance)&&key$2 in localProvidedStateMap.get(instance)?localProvidedStateMap.get(instance)[key$2]:inject(...args)},isClient$2=typeof window<`u`&&typeof document<`u`,isWorker=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,notNullish=val=>val!=null,toString$2=Object.prototype.toString,isObject$2=val=>toString$2.call(val)===`[object Object]`,noop$3=()=>{},hasOwn$2=(val,key$2)=>Object.prototype.hasOwnProperty.call(val,key$2);function toRef$1(...args){if(args.length!==1)return toRef(...args);let r$1=args[0];return typeof r$1==`function`?readonly$1(customRef(()=>({get:r$1,set:noop$3}))):ref(r$1)}function createFilterWrapper(filter$1,fn$5){function wrapper(...args){return new Promise((resolve$1,reject)=>{Promise.resolve(filter$1(()=>fn$5.apply(this,args),{fn:fn$5,thisArg:this,args})).then(resolve$1).catch(reject)})}return wrapper}const bypassFilter=invoke$1=>invoke$1();function debounceFilter(ms,options$1={}){let timer,maxTimer,lastRejector=noop$3,_clearTimeout=timer2=>{clearTimeout(timer2),lastRejector(),lastRejector=noop$3},lastInvoker,filter$1=invoke$1=>{let duration$2=toValue$1(ms),maxDuration$1=toValue$1(options$1.maxWait);return timer&&_clearTimeout(timer),duration$2<=0||maxDuration$1!==void 0&&maxDuration$1<=0?(maxTimer&&(_clearTimeout(maxTimer),maxTimer=void 0),Promise.resolve(invoke$1())):new Promise((resolve$1,reject)=>{lastRejector=options$1.rejectOnCancel?reject:resolve$1,lastInvoker=invoke$1,maxDuration$1&&!maxTimer&&(maxTimer=setTimeout(()=>{timer&&_clearTimeout(timer),maxTimer=void 0,resolve$1(lastInvoker())},maxDuration$1)),timer=setTimeout(()=>{maxTimer&&_clearTimeout(maxTimer),maxTimer=void 0,resolve$1(invoke$1())},duration$2)})};return filter$1}function throttleFilter(...args){let lastExec=0,timer,isLeading=!0,lastRejector=noop$3,lastValue,ms,trailing,leading,rejectOnCancel;!isRef(args[0])&&typeof args[0]==`object`?{delay:ms,trailing=!0,leading=!0,rejectOnCancel=!1}=args[0]:[ms,trailing=!0,leading=!0,rejectOnCancel=!1]=args;let clear=()=>{timer&&(clearTimeout(timer),timer=void 0,lastRejector(),lastRejector=noop$3)},filter$1=_invoke=>{let duration$2=toValue$1(ms),elapsed=Date.now()-lastExec,invoke$1=()=>lastValue=_invoke();return clear(),duration$2<=0?(lastExec=Date.now(),invoke$1()):(elapsed>duration$2&&(leading||!isLeading)?(lastExec=Date.now(),invoke$1()):trailing&&(lastValue=new Promise((resolve$1,reject)=>{lastRejector=rejectOnCancel?reject:resolve$1,timer=setTimeout(()=>{lastExec=Date.now(),isLeading=!0,resolve$1(invoke$1()),clear()},Math.max(0,duration$2-elapsed))})),!leading&&!timer&&(timer=setTimeout(()=>isLeading=!0,duration$2)),isLeading=!1,lastValue)};return filter$1}function pausableFilter(extendFilter=bypassFilter,options$1={}){let{initialState=`active`}=options$1,isActive=toRef$1(initialState===`active`);function pause(){isActive.value=!1}function resume(){isActive.value=!0}let eventFilter=(...args)=>{isActive.value&&extendFilter(...args)};return{isActive:readonly$1(isActive),pause,resume,eventFilter}}function promiseTimeout(ms,throwOnTimeout=!1,reason=`Timeout`){return new Promise((resolve$1,reject)=>{throwOnTimeout?setTimeout(()=>reject(reason),ms):setTimeout(resolve$1,ms)})}function createSingletonPromise(fn$5){let _promise;function wrapper(){return _promise||=fn$5(),_promise}return wrapper.reset=async()=>{let _prev=_promise;_promise=void 0,_prev&&await _prev},wrapper}function increaseWithUnit(target$1,delta){var _a$2;if(typeof target$1==`number`)return target$1+delta;let value$1=(_a$2=target$1.match(/^-?\d+\.?\d*/))?.[0]||``,unit=target$1.slice(value$1.length),result=Number.parseFloat(value$1)+delta;return Number.isNaN(result)?target$1:result+unit}function pxValue(px$2){return px$2.endsWith(`rem`)?Number.parseFloat(px$2)*16:Number.parseFloat(px$2)}function objectPick(obj,keys$3,omitUndefined=!1){return keys$3.reduce((n,k$3)=>(k$3 in obj&&(!omitUndefined||obj[k$3]!==void 0)&&(n[k$3]=obj[k$3]),n),{})}function toArray(value$1){return Array.isArray(value$1)?value$1:[value$1]}function cacheStringFunction(fn$5){let cache$1=Object.create(null);return str=>{let hit=cache$1[str];return hit||(cache$1[str]=fn$5(str))}}const hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(str=>str.replace(hyphenateRE,`-$1`).toLowerCase()),camelizeRE=/-(\w)/g,camelize$1=cacheStringFunction(str=>str.replace(camelizeRE,(_$1,c$3)=>c$3?c$3.toUpperCase():``));function getLifeCycleTarget(target$1){return target$1||getCurrentInstance()}function useDebounceFn(fn$5,ms=200,options$1={}){return createFilterWrapper(debounceFilter(ms,options$1),fn$5)}function refDebounced(value$1,ms=200,options$1={}){let debounced=ref(toValue$1(value$1)),updater=useDebounceFn(()=>{debounced.value=value$1.value},ms,options$1);return watch(value$1,()=>updater()),shallowReadonly(debounced)}function useThrottleFn(fn$5,ms=200,trailing=!1,leading=!0,rejectOnCancel=!1){return createFilterWrapper(throttleFilter(ms,trailing,leading,rejectOnCancel),fn$5)}function refThrottled(value$1,delay=200,trailing=!0,leading=!0){if(delay<=0)return value$1;let throttled=ref(toValue$1(value$1)),updater=useThrottleFn(()=>{throttled.value=value$1.value},delay,trailing,leading);return watch(value$1,()=>updater()),throttled}function watchWithFilter(source,cb$1,options$1={}){let{eventFilter=bypassFilter,...watchOptions}=options$1;return watch(source,createFilterWrapper(eventFilter,cb$1),watchOptions)}function watchPausable(source,cb$1,options$1={}){let{eventFilter:filter$1,initialState=`active`,...watchOptions}=options$1,{eventFilter,pause,resume,isActive}=pausableFilter(filter$1,{initialState}),stop$1=watchWithFilter(source,cb$1,{...watchOptions,eventFilter});return{stop:stop$1,pause,resume,isActive}}function toRefs$1(objectRef,options$1={}){if(!isRef(objectRef))return toRefs(objectRef);let result=Array.isArray(objectRef.value)?Array.from({length:objectRef.value.length}):{};for(let key$2 in objectRef.value)result[key$2]=customRef(()=>({get(){return objectRef.value[key$2]},set(v){var _a$2;let replaceRef=(_a$2=toValue$1(options$1.replaceRef))??!0;if(replaceRef)if(Array.isArray(objectRef.value)){let copy=[...objectRef.value];copy[key$2]=v,objectRef.value=copy}else{let newObject={...objectRef.value,[key$2]:v};Object.setPrototypeOf(newObject,Object.getPrototypeOf(objectRef.value)),objectRef.value=newObject}else objectRef.value[key$2]=v}}));return result}function tryOnMounted(fn$5,sync$2=!0,target$1){let instance=getLifeCycleTarget(target$1);instance?onMounted(fn$5,target$1):sync$2?fn$5():nextTick(fn$5)}function tryOnUnmounted(fn$5,target$1){let instance=getLifeCycleTarget(target$1);instance&&onUnmounted(fn$5,target$1)}function createUntil(r$1,isNot=!1){function toMatch(condition,{flush=`sync`,deep=!1,timeout,throwOnTimeout}={}){let stop$1=null,watcher=new Promise(resolve$1=>{stop$1=watch(r$1,v=>{condition(v)!==isNot&&(stop$1?stop$1():nextTick(()=>stop$1?.()),resolve$1(v))},{flush,deep,immediate:!0})}),promises=[watcher];return timeout!=null&&promises.push(promiseTimeout(timeout,throwOnTimeout).then(()=>toValue$1(r$1)).finally(()=>stop$1?.())),Promise.race(promises)}function toBe(value$1,options$1){if(!isRef(value$1))return toMatch(v=>v===value$1,options$1);let{flush=`sync`,deep=!1,timeout,throwOnTimeout}=options$1??{},stop$1=null,watcher=new Promise(resolve$1=>{stop$1=watch([r$1,value$1],([v1,v2])=>{isNot!==(v1===v2)&&(stop$1?stop$1():nextTick(()=>stop$1?.()),resolve$1(v1))},{flush,deep,immediate:!0})}),promises=[watcher];return timeout!=null&&promises.push(promiseTimeout(timeout,throwOnTimeout).then(()=>toValue$1(r$1)).finally(()=>(stop$1?.(),toValue$1(r$1)))),Promise.race(promises)}function toBeTruthy(options$1){return toMatch(v=>!!v,options$1)}function toBeNull(options$1){return toBe(null,options$1)}function toBeUndefined(options$1){return toBe(void 0,options$1)}function toBeNaN(options$1){return toMatch(Number.isNaN,options$1)}function toContains(value$1,options$1){return toMatch(v=>{let array$1=Array.from(v);return array$1.includes(value$1)||array$1.includes(toValue$1(value$1))},options$1)}function changed(options$1){return changedTimes(1,options$1)}function changedTimes(n=1,options$1){let count$1=-1;return toMatch(()=>(count$1+=1,count$1>=n),options$1)}if(Array.isArray(toValue$1(r$1))){let instance={toMatch,toContains,changed,changedTimes,get not(){return createUntil(r$1,!isNot)}};return instance}else{let instance={toMatch,toBe,toBeTruthy,toBeNull,toBeNaN,toBeUndefined,changed,changedTimes,get not(){return createUntil(r$1,!isNot)}};return instance}}function until(r$1){return createUntil(r$1)}function useTimeoutFn$1(cb$1,interval,options$1={}){let{immediate=!0,immediateCallback=!1}=options$1,isPending=shallowRef(!1),timer;function clear(){timer&&(clearTimeout(timer),timer=void 0)}function stop$1(){isPending.value=!1,clear()}function start(...args){immediateCallback&&cb$1(),clear(),isPending.value=!0,timer=setTimeout(()=>{isPending.value=!1,timer=void 0,cb$1(...args)},toValue$1(interval))}return immediate&&(isPending.value=!0,isClient$2&&start()),tryOnScopeDispose(stop$1),{isPending:shallowReadonly(isPending),start,stop:stop$1}}function watchDebounced(source,cb$1,options$1={}){let{debounce=0,maxWait=void 0,...watchOptions}=options$1;return watchWithFilter(source,cb$1,{...watchOptions,eventFilter:debounceFilter(debounce,{maxWait})})}function watchImmediate(source,cb$1,options$1){return watch(source,cb$1,{...options$1,immediate:!0})}function computedAsync(evaluationCallback,initialState,optionsOrRef){let options$1;options$1=isRef(optionsOrRef)?{evaluating:optionsOrRef}:optionsOrRef||{};let{lazy=!1,flush=`pre`,evaluating=void 0,shallow=!0,onError=noop$3}=options$1,started=shallowRef(!lazy),current=shallow?shallowRef(initialState):ref(initialState),counter=0;return watchEffect(async onInvalidate=>{if(!started.value)return;counter++;let counterAtBeginning=counter,hasFinished=!1;evaluating&&Promise.resolve().then(()=>{evaluating.value=!0});try{let result=await evaluationCallback(cancelCallback=>{onInvalidate(()=>{evaluating&&(evaluating.value=!1),hasFinished||cancelCallback()})});counterAtBeginning===counter&&(current.value=result)}catch(e$4){onError(e$4)}finally{evaluating&&counterAtBeginning===counter&&(evaluating.value=!1),hasFinished=!0}},{flush}),lazy?computed(()=>(started.value=!0,current.value)):current}const defaultWindow$1=isClient$2?window:void 0,defaultDocument=isClient$2?window.document:void 0,defaultNavigator=isClient$2?window.navigator:void 0,defaultLocation=isClient$2?window.location:void 0;function unrefElement(elRef){var _a$2;let plain=toValue$1(elRef);return(_a$2=plain?.$el)??plain}function useEventListener(...args){let cleanups=[],cleanup=()=>{cleanups.forEach(fn$5=>fn$5()),cleanups.length=0},register=(el,event,listener,options$1)=>(el.addEventListener(event,listener,options$1),()=>el.removeEventListener(event,listener,options$1)),firstParamTargets=computed(()=>{let test$1=toArray(toValue$1(args[0])).filter(e$4=>e$4!=null);return test$1.every(e$4=>typeof e$4!=`string`)?test$1:void 0}),stopWatch=watchImmediate(()=>{var _a$2,_b;return[(_b=(_a$2=firstParamTargets.value)?.map(e$4=>unrefElement(e$4)))??[defaultWindow$1].filter(e$4=>e$4!=null),toArray(toValue$1(firstParamTargets.value?args[1]:args[0])),toArray(unref(firstParamTargets.value?args[2]:args[1])),toValue$1(firstParamTargets.value?args[3]:args[2])]},([raw_targets,raw_events,raw_listeners,raw_options])=>{if(cleanup(),!raw_targets?.length||!raw_events?.length||!raw_listeners?.length)return;let optionsClone=isObject$2(raw_options)?{...raw_options}:raw_options;cleanups.push(...raw_targets.flatMap(el=>raw_events.flatMap(event=>raw_listeners.map(listener=>register(el,event,listener,optionsClone)))))},{flush:`post`}),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose(cleanup),stop$1}function useMounted$1(){let isMounted=shallowRef(!1),instance=getCurrentInstance();return instance&&onMounted(()=>{isMounted.value=!0},instance),isMounted}function useSupported(callback){let isMounted=useMounted$1();return computed(()=>(isMounted.value,!!callback()))}function useMutationObserver(target$1,callback,options$1={}){let{window:window$1=defaultWindow$1,...mutationOptions}=options$1,observer,isSupported=useSupported(()=>window$1&&`MutationObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let value$1=toValue$1(target$1),items=toArray(value$1).map(unrefElement).filter(notNullish);return new Set(items)}),stopWatch=watch(()=>targets.value,targets2=>{cleanup(),isSupported.value&&targets2.size&&(observer=new MutationObserver(callback),targets2.forEach(el=>observer.observe(el,mutationOptions)))},{immediate:!0,flush:`post`}),takeRecords=()=>observer?.takeRecords(),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose(stop$1),{isSupported,stop:stop$1,takeRecords}}const ssrWidthSymbol=Symbol(`vueuse-ssr-width`);function useSSRWidth(){let ssrWidth=hasInjectionContext()?injectLocal(ssrWidthSymbol,null):null;return typeof ssrWidth==`number`?ssrWidth:void 0}function useMediaQuery(query,options$1={}){let{window:window$1=defaultWindow$1,ssrWidth=useSSRWidth()}=options$1,isSupported=useSupported(()=>window$1&&`matchMedia`in window$1&&typeof window$1.matchMedia==`function`),ssrSupport=shallowRef(typeof ssrWidth==`number`),mediaQuery=shallowRef(),matches$1=shallowRef(!1),handler=event=>{matches$1.value=event.matches};return watchEffect(()=>{if(ssrSupport.value){ssrSupport.value=!isSupported.value;let queryStrings=toValue$1(query).split(`,`);matches$1.value=queryStrings.some(queryString=>{let not=queryString.includes(`not all`),minWidth=queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),maxWidth=queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),res=!!(minWidth||maxWidth);return minWidth&&res&&(res=ssrWidth>=pxValue(minWidth[1])),maxWidth&&res&&(res=ssrWidth<=pxValue(maxWidth[1])),not?!res:res});return}isSupported.value&&(mediaQuery.value=window$1.matchMedia(toValue$1(query)),matches$1.value=mediaQuery.value.matches)}),useEventListener(mediaQuery,`change`,handler,{passive:!0}),computed(()=>matches$1.value)}const breakpointsTailwind={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},breakpointsBootstrapV5={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},breakpointsVuetifyV2={xs:0,sm:600,md:960,lg:1264,xl:1904},breakpointsVuetifyV3={xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560},breakpointsVuetify=breakpointsVuetifyV2,breakpointsAntDesign={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},breakpointsQuasar={xs:0,sm:600,md:1024,lg:1440,xl:1920},breakpointsSematic={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560},breakpointsMasterCss={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},breakpointsPrimeFlex={sm:576,md:768,lg:992,xl:1200},breakpointsElement={xs:0,sm:768,md:992,lg:1200,xl:1920};function useBreakpoints(breakpoints,options$1={}){function getValue$2(k$3,delta){let v=toValue$1(breakpoints[toValue$1(k$3)]);return delta!=null&&(v=increaseWithUnit(v,delta)),typeof v==`number`&&(v=`${v}px`),v}let{window:window$1=defaultWindow$1,strategy=`min-width`,ssrWidth=useSSRWidth()}=options$1,ssrSupport=typeof ssrWidth==`number`,mounted=ssrSupport?shallowRef(!1):{value:!0};ssrSupport&&tryOnMounted(()=>mounted.value=!!window$1);function match(query,size$2){return!mounted.value&&ssrSupport?query===`min`?ssrWidth>=pxValue(size$2):ssrWidth<=pxValue(size$2):window$1?window$1.matchMedia(`(${query}-width: ${size$2})`).matches:!1}let greaterOrEqual=k$3=>useMediaQuery(()=>`(min-width: ${getValue$2(k$3)})`,options$1),smallerOrEqual=k$3=>useMediaQuery(()=>`(max-width: ${getValue$2(k$3)})`,options$1),shortcutMethods=Object.keys(breakpoints).reduce((shortcuts,k$3)=>(Object.defineProperty(shortcuts,k$3,{get:()=>strategy===`min-width`?greaterOrEqual(k$3):smallerOrEqual(k$3),enumerable:!0,configurable:!0}),shortcuts),{});function current(){let points=Object.keys(breakpoints).map(k$3=>[k$3,shortcutMethods[k$3],pxValue(getValue$2(k$3))]).sort((a$1,b$1)=>a$1[2]-b$1[2]);return computed(()=>points.filter(([,v])=>v.value).map(([k$3])=>k$3))}return Object.assign(shortcutMethods,{greaterOrEqual,smallerOrEqual,greater(k$3){return useMediaQuery(()=>`(min-width: ${getValue$2(k$3,.1)})`,options$1)},smaller(k$3){return useMediaQuery(()=>`(max-width: ${getValue$2(k$3,-.1)})`,options$1)},between(a$1,b$1){return useMediaQuery(()=>`(min-width: ${getValue$2(a$1)}) and (max-width: ${getValue$2(b$1,-.1)})`,options$1)},isGreater(k$3){return match(`min`,getValue$2(k$3,.1))},isGreaterOrEqual(k$3){return match(`min`,getValue$2(k$3))},isSmaller(k$3){return match(`max`,getValue$2(k$3,-.1))},isSmallerOrEqual(k$3){return match(`max`,getValue$2(k$3))},isInBetween(a$1,b$1){return match(`min`,getValue$2(a$1))&&match(`max`,getValue$2(b$1,-.1))},current,active(){let bps=current();return computed(()=>bps.value.length===0?``:bps.value.at(strategy===`min-width`?-1:0))}})}function usePermission(permissionDesc,options$1={}){let{controls=!1,navigator:navigator$1=defaultNavigator}=options$1,isSupported=useSupported(()=>navigator$1&&`permissions`in navigator$1),permissionStatus=shallowRef(),desc=typeof permissionDesc==`string`?{name:permissionDesc}:permissionDesc,state=shallowRef(),update=()=>{var _a$2,_b;state.value=(_b=(_a$2=permissionStatus.value)?.state)??`prompt`};useEventListener(permissionStatus,`change`,update,{passive:!0});let query=createSingletonPromise(async()=>{if(isSupported.value){if(!permissionStatus.value)try{permissionStatus.value=await navigator$1.permissions.query(desc)}catch{permissionStatus.value=void 0}finally{update()}if(controls)return toRaw(permissionStatus.value)}});return query(),controls?{state,isSupported,query}:state}function useClipboard(options$1={}){let{navigator:navigator$1=defaultNavigator,read=!1,source,copiedDuring=1500,legacy=!1}=options$1,isClipboardApiSupported=useSupported(()=>navigator$1&&`clipboard`in navigator$1),permissionRead=usePermission(`clipboard-read`),permissionWrite=usePermission(`clipboard-write`),isSupported=computed(()=>isClipboardApiSupported.value||legacy),text$5=shallowRef(``),copied=shallowRef(!1),timeout=useTimeoutFn$1(()=>copied.value=!1,copiedDuring,{immediate:!1});async function updateText(){let useLegacy=!(isClipboardApiSupported.value&&isAllowed(permissionRead.value));if(!useLegacy)try{text$5.value=await navigator$1.clipboard.readText()}catch{useLegacy=!0}useLegacy&&(text$5.value=legacyRead())}isSupported.value&&read&&useEventListener([`copy`,`cut`],updateText,{passive:!0});async function copy(value$1=toValue$1(source)){if(isSupported.value&&value$1!=null){let useLegacy=!(isClipboardApiSupported.value&&isAllowed(permissionWrite.value));if(!useLegacy)try{await navigator$1.clipboard.writeText(value$1)}catch{useLegacy=!0}useLegacy&&legacyCopy(value$1),text$5.value=value$1,copied.value=!0,timeout.start()}}function legacyCopy(value$1){let ta=document.createElement(`textarea`);ta.value=value$1??``,ta.style.position=`absolute`,ta.style.opacity=`0`,document.body.appendChild(ta),ta.select(),document.execCommand(`copy`),ta.remove()}function legacyRead(){var _a$2,_b,_c;return(_c=(_b=(_a$2=document==null?void 0:document.getSelection)?.call(document))?.toString())??``}function isAllowed(status){return status===`granted`||status===`prompt`}return{isSupported,text:text$5,copied,copy}}const _global$1=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},globalKey=`__vueuse_ssr_handlers__`,handlers$2=getHandlers();function getHandlers(){return globalKey in _global$1||(_global$1[globalKey]=_global$1[globalKey]||{}),_global$1[globalKey]}function getSSRHandler(key$2,fallback){return handlers$2[key$2]||fallback}function usePreferredDark(options$1){return useMediaQuery(`(prefers-color-scheme: dark)`,options$1)}function guessSerializerType(rawInit){return rawInit==null?`any`:rawInit instanceof Set?`set`:rawInit instanceof Map?`map`:rawInit instanceof Date?`date`:typeof rawInit==`boolean`?`boolean`:typeof rawInit==`string`?`string`:typeof rawInit==`object`?`object`:Number.isNaN(rawInit)?`any`:`number`}const StorageSerializers={boolean:{read:v=>v===`true`,write:v=>String(v)},object:{read:v=>JSON.parse(v),write:v=>JSON.stringify(v)},number:{read:v=>Number.parseFloat(v),write:v=>String(v)},any:{read:v=>v,write:v=>String(v)},string:{read:v=>v,write:v=>String(v)},map:{read:v=>new Map(JSON.parse(v)),write:v=>JSON.stringify(Array.from(v.entries()))},set:{read:v=>new Set(JSON.parse(v)),write:v=>JSON.stringify(Array.from(v))},date:{read:v=>new Date(v),write:v=>v.toISOString()}},customStorageEventName=`vueuse-storage`;function useStorage(key$2,defaults$1,storage,options$1={}){var _a$2;let{flush=`pre`,deep=!0,listenToStorageChanges=!0,writeDefaults=!0,mergeDefaults:mergeDefaults$1=!1,shallow,window:window$1=defaultWindow$1,eventFilter,onError=e$4=>{console.error(e$4)},initOnMounted}=options$1,data$12=(shallow?shallowRef:ref)(typeof defaults$1==`function`?defaults$1():defaults$1),keyComputed=computed(()=>toValue$1(key$2));if(!storage)try{storage=getSSRHandler(`getDefaultStorage`,()=>{var _a2;return(_a2=defaultWindow$1)?.localStorage})()}catch(e$4){onError(e$4)}if(!storage)return data$12;let rawInit=toValue$1(defaults$1),type=guessSerializerType(rawInit),serializer$1=(_a$2=options$1.serializer)??StorageSerializers[type],{pause:pauseWatch,resume:resumeWatch}=watchPausable(data$12,()=>write(data$12.value),{flush,deep,eventFilter});watch(keyComputed,()=>update(),{flush});let firstMounted=!1,onStorageEvent=ev=>{initOnMounted&&!firstMounted||update(ev)},onStorageCustomEvent=ev=>{initOnMounted&&!firstMounted||updateFromCustomEvent(ev)};window$1&&listenToStorageChanges&&(storage instanceof Storage?useEventListener(window$1,`storage`,onStorageEvent,{passive:!0}):useEventListener(window$1,customStorageEventName,onStorageCustomEvent)),initOnMounted?tryOnMounted(()=>{firstMounted=!0,update()}):update();function dispatchWriteEvent(oldValue,newValue){if(window$1){let payload={key:keyComputed.value,oldValue,newValue,storageArea:storage};window$1.dispatchEvent(storage instanceof Storage?new StorageEvent(`storage`,payload):new CustomEvent(customStorageEventName,{detail:payload}))}}function write(v){try{let oldValue=storage.getItem(keyComputed.value);if(v==null)dispatchWriteEvent(oldValue,null),storage.removeItem(keyComputed.value);else{let serialized=serializer$1.write(v);oldValue!==serialized&&(storage.setItem(keyComputed.value,serialized),dispatchWriteEvent(oldValue,serialized))}}catch(e$4){onError(e$4)}}function read(event){let rawValue=event?event.newValue:storage.getItem(keyComputed.value);if(rawValue==null)return writeDefaults&&rawInit!=null&&storage.setItem(keyComputed.value,serializer$1.write(rawInit)),rawInit;if(!event&&mergeDefaults$1){let value$1=serializer$1.read(rawValue);return typeof mergeDefaults$1==`function`?mergeDefaults$1(value$1,rawInit):type===`object`&&!Array.isArray(value$1)?{...rawInit,...value$1}:value$1}else if(typeof rawValue!=`string`)return rawValue;else return serializer$1.read(rawValue)}function update(event){if(!(event&&event.storageArea!==storage)){if(event&&event.key==null){data$12.value=rawInit;return}if(!(event&&event.key!==keyComputed.value)){pauseWatch();try{event?.newValue!==serializer$1.write(data$12.value)&&(data$12.value=read(event))}catch(e$4){onError(e$4)}finally{event?nextTick(resumeWatch):resumeWatch()}}}}function updateFromCustomEvent(event){update(event.detail)}return data$12}const CSS_DISABLE_TRANS=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function useColorMode(options$1={}){let{selector=`html`,attribute=`class`,initialValue=`auto`,window:window$1=defaultWindow$1,storage,storageKey=`vueuse-color-scheme`,listenToStorageChanges=!0,storageRef,emitAuto,disableTransition=!0}=options$1,modes$1={auto:``,light:`light`,dark:`dark`,...options$1.modes||{}},preferredDark=usePreferredDark({window:window$1}),system=computed(()=>preferredDark.value?`dark`:`light`),store=storageRef||(storageKey==null?toRef$1(initialValue):useStorage(storageKey,initialValue,storage,{window:window$1,listenToStorageChanges})),state=computed(()=>store.value===`auto`?system.value:store.value),updateHTMLAttrs=getSSRHandler(`updateHTMLAttrs`,(selector2,attribute2,value$1)=>{let el=typeof selector2==`string`?window$1?.document.querySelector(selector2):unrefElement(selector2);if(!el)return;let classesToAdd=new Set,classesToRemove=new Set,attributeToChange=null;if(attribute2===`class`){let current=value$1.split(/\s/g);Object.values(modes$1).flatMap(i=>(i||``).split(/\s/g)).filter(Boolean).forEach(v=>{current.includes(v)?classesToAdd.add(v):classesToRemove.add(v)})}else attributeToChange={key:attribute2,value:value$1};if(classesToAdd.size===0&&classesToRemove.size===0&&attributeToChange===null)return;let style;disableTransition&&(style=window$1.document.createElement(`style`),style.appendChild(document.createTextNode(CSS_DISABLE_TRANS)),window$1.document.head.appendChild(style));for(let c$3 of classesToAdd)el.classList.add(c$3);for(let c$3 of classesToRemove)el.classList.remove(c$3);attributeToChange&&el.setAttribute(attributeToChange.key,attributeToChange.value),disableTransition&&(window$1.getComputedStyle(style).opacity,document.head.removeChild(style))});function defaultOnChanged(mode){var _a$2;updateHTMLAttrs(selector,attribute,(_a$2=modes$1[mode])??mode)}function onChanged(mode){options$1.onChanged?options$1.onChanged(mode,defaultOnChanged):defaultOnChanged(mode)}watch(state,onChanged,{flush:`post`,immediate:!0}),tryOnMounted(()=>onChanged(state.value));let auto=computed({get(){return emitAuto?store.value:state.value},set(v){store.value=v}});return Object.assign(auto,{store,system,state})}function useCssVar(prop,target$1,options$1={}){let{window:window$1=defaultWindow$1,initialValue,observe=!1}=options$1,variable=shallowRef(initialValue),elRef=computed(()=>{var _a$2;return unrefElement(target$1)||(_a$2=window$1?.document)?.documentElement});function updateCssVar(){var _a$2;let key$2=toValue$1(prop),el=toValue$1(elRef);if(el&&window$1&&key$2){let value$1=(_a$2=window$1.getComputedStyle(el).getPropertyValue(key$2))?.trim();variable.value=value$1||variable.value||initialValue}}return observe&&useMutationObserver(elRef,updateCssVar,{attributeFilter:[`style`,`class`],window:window$1}),watch([elRef,()=>toValue$1(prop)],(_$1,old)=>{old[0]&&old[1]&&old[0].style.removeProperty(old[1]),updateCssVar()},{immediate:!0}),watch([variable,elRef],([val,el])=>{let raw_prop=toValue$1(prop);el?.style&&raw_prop&&(val==null?el.style.removeProperty(raw_prop):el.style.setProperty(raw_prop,val))},{immediate:!0}),variable}function useDark(options$1={}){let{valueDark=`dark`,valueLight=``}=options$1,mode=useColorMode({...options$1,onChanged:(mode2,defaultHandler)=>{var _a$2;options$1.onChanged?(_a$2=options$1.onChanged)==null||_a$2.call(options$1,mode2===`dark`,defaultHandler,mode2):defaultHandler(mode2)},modes:{dark:valueDark,light:valueLight}}),system=computed(()=>mode.system.value),isDark=computed({get(){return mode.value===`dark`},set(v){let modeVal=v?`dark`:`light`;system.value===modeVal?mode.value=`auto`:mode.value=modeVal}});return isDark}function useDevicesList(options$1={}){let{navigator:navigator$1=defaultNavigator,requestPermissions=!1,constraints={audio:!0,video:!0},onUpdated:onUpdated$1}=options$1,devices=ref([]),videoInputs=computed(()=>devices.value.filter(i=>i.kind===`videoinput`)),audioInputs=computed(()=>devices.value.filter(i=>i.kind===`audioinput`)),audioOutputs=computed(()=>devices.value.filter(i=>i.kind===`audiooutput`)),isSupported=useSupported(()=>navigator$1&&navigator$1.mediaDevices&&navigator$1.mediaDevices.enumerateDevices),permissionGranted=shallowRef(!1),stream;async function update(){isSupported.value&&(devices.value=await navigator$1.mediaDevices.enumerateDevices(),onUpdated$1?.(devices.value),stream)&&(stream.getTracks().forEach(t$1=>t$1.stop()),stream=null)}async function ensurePermissions(){let deviceName=constraints.video?`camera`:`microphone`;if(!isSupported.value)return!1;if(permissionGranted.value)return!0;let{state,query}=usePermission(deviceName,{controls:!0});if(await query(),state.value!==`granted`){let granted=!0;try{let allDevices=await navigator$1.mediaDevices.enumerateDevices(),hasCamera=allDevices.some(device=>device.kind===`videoinput`),hasMicrophone=allDevices.some(device=>device.kind===`audioinput`||device.kind===`audiooutput`);constraints.video=hasCamera?constraints.video:!1,constraints.audio=hasMicrophone?constraints.audio:!1,stream=await navigator$1.mediaDevices.getUserMedia(constraints)}catch{stream=null,granted=!1}update(),permissionGranted.value=granted}else permissionGranted.value=!0;return permissionGranted.value}return isSupported.value&&(requestPermissions&&ensurePermissions(),useEventListener(navigator$1.mediaDevices,`devicechange`,update,{passive:!0}),update()),{devices,ensurePermissions,permissionGranted,videoInputs,audioInputs,audioOutputs,isSupported}}function useResizeObserver(target$1,callback,options$1={}){let{window:window$1=defaultWindow$1,...observerOptions}=options$1,observer,isSupported=useSupported(()=>window$1&&`ResizeObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let _targets=toValue$1(target$1);return Array.isArray(_targets)?_targets.map(el=>unrefElement(el)):[unrefElement(_targets)]}),stopWatch=watch(targets,els=>{if(cleanup(),isSupported.value&&window$1){observer=new ResizeObserver(callback);for(let _el of els)_el&&observer.observe(_el,observerOptions)}},{immediate:!0,flush:`post`}),stop$1=()=>{cleanup(),stopWatch()};return tryOnScopeDispose(stop$1),{isSupported,stop:stop$1}}function useElementBounding(target$1,options$1={}){let{reset=!0,windowResize=!0,windowScroll=!0,immediate=!0,updateTiming=`sync`}=options$1,height=shallowRef(0),bottom=shallowRef(0),left=shallowRef(0),right=shallowRef(0),top=shallowRef(0),width=shallowRef(0),x$1=shallowRef(0),y=shallowRef(0);function recalculate(){let el=unrefElement(target$1);if(!el){reset&&(height.value=0,bottom.value=0,left.value=0,right.value=0,top.value=0,width.value=0,x$1.value=0,y.value=0);return}let rect=el.getBoundingClientRect();height.value=rect.height,bottom.value=rect.bottom,left.value=rect.left,right.value=rect.right,top.value=rect.top,width.value=rect.width,x$1.value=rect.x,y.value=rect.y}function update(){updateTiming===`sync`?recalculate():updateTiming===`next-frame`&&requestAnimationFrame(()=>recalculate())}return useResizeObserver(target$1,update),watch(()=>unrefElement(target$1),ele=>!ele&&update()),useMutationObserver(target$1,update,{attributeFilter:[`style`,`class`]}),windowScroll&&useEventListener(`scroll`,update,{capture:!0,passive:!0}),windowResize&&useEventListener(`resize`,update,{passive:!0}),tryOnMounted(()=>{immediate&&update()}),{height,bottom,left,right,top,width,x:x$1,y,update}}function useIntersectionObserver(target$1,callback,options$1={}){let{root:root$3,rootMargin=`0px`,threshold=0,window:window$1=defaultWindow$1,immediate=!0}=options$1,isSupported=useSupported(()=>window$1&&`IntersectionObserver`in window$1),targets=computed(()=>{let _target$1=toValue$1(target$1);return toArray(_target$1).map(unrefElement).filter(notNullish)}),cleanup=noop$3,isActive=shallowRef(immediate),stopWatch=isSupported.value?watch(()=>[targets.value,unrefElement(root$3),isActive.value],([targets2,root2])=>{if(cleanup(),!isActive.value||!targets2.length)return;let observer=new IntersectionObserver(callback,{root:unrefElement(root2),rootMargin,threshold});targets2.forEach(el=>el&&observer.observe(el)),cleanup=()=>{observer.disconnect(),cleanup=noop$3}},{immediate,flush:`post`}):noop$3,stop$1=()=>{cleanup(),stopWatch(),isActive.value=!1};return tryOnScopeDispose(stop$1),{isSupported,isActive,pause(){cleanup(),isActive.value=!1},resume(){isActive.value=!0},stop:stop$1}}const DEFAULT_OPTIONS={multiple:!0,accept:`*`,reset:!1,directory:!1};function prepareInitialFiles(files){if(!files)return null;if(files instanceof FileList)return files;let dt$3=new DataTransfer;for(let file of files)dt$3.items.add(file);return dt$3.files}function useFileDialog(options$1={}){let{document:document$3=defaultDocument}=options$1,files=ref(prepareInitialFiles(options$1.initialFiles)),{on:onChange,trigger:changeTrigger}=createEventHook$1(),{on:onCancel,trigger:cancelTrigger}=createEventHook$1(),inputRef=computed(()=>{var _a$2;let input=(_a$2=unrefElement(options$1.input))??(document$3?document$3.createElement(`input`):void 0);return input&&(input.type=`file`,input.onchange=event=>{let result=event.target;files.value=result.files,changeTrigger(files.value)},input.oncancel=()=>{cancelTrigger()}),input}),reset=()=>{files.value=null,inputRef.value&&inputRef.value.value&&(inputRef.value.value=``,changeTrigger(null))},applyOptions$1=options2=>{let el=inputRef.value;el&&(el.multiple=toValue$1(options2.multiple),el.accept=toValue$1(options2.accept),el.webkitdirectory=toValue$1(options2.directory),hasOwn$2(options2,`capture`))&&(el.capture=toValue$1(options2.capture))},open$1=localOptions=>{let el=inputRef.value;if(!el)return;let mergedOptions={...DEFAULT_OPTIONS,...options$1,...localOptions};applyOptions$1(mergedOptions),toValue$1(mergedOptions.reset)&&reset(),el.click()};return watchEffect(()=>{applyOptions$1(options$1)}),{files:readonly$1(files),open:open$1,reset,onCancel,onChange}}function useLocalStorage(key$2,initialValue,options$1={}){let{window:window$1=defaultWindow$1}=options$1;return useStorage(key$2,initialValue,window$1?.localStorage,options$1)}const UseMouseBuiltinExtractors={page:event=>[event.pageX,event.pageY],client:event=>[event.clientX,event.clientY],screen:event=>[event.screenX,event.screenY],movement:event=>event instanceof MouseEvent?[event.movementX,event.movementY]:null};function useMouse(options$1={}){let{type=`page`,touch=!0,resetOnTouchEnds=!1,initialValue={x:0,y:0},window:window$1=defaultWindow$1,target:target$1=window$1,scroll=!0,eventFilter}=options$1,_prevMouseEvent=null,_prevScrollX=0,_prevScrollY=0,x$1=shallowRef(initialValue.x),y=shallowRef(initialValue.y),sourceType=shallowRef(null),extractor=typeof type==`function`?type:UseMouseBuiltinExtractors[type],mouseHandler=event=>{let result=extractor(event);_prevMouseEvent=event,result&&([x$1.value,y.value]=result,sourceType.value=`mouse`),window$1&&(_prevScrollX=window$1.scrollX,_prevScrollY=window$1.scrollY)},touchHandler=event=>{if(event.touches.length>0){let result=extractor(event.touches[0]);result&&([x$1.value,y.value]=result,sourceType.value=`touch`)}},scrollHandler=()=>{if(!_prevMouseEvent||!window$1)return;let pos=extractor(_prevMouseEvent);_prevMouseEvent instanceof MouseEvent&&pos&&(x$1.value=pos[0]+window$1.scrollX-_prevScrollX,y.value=pos[1]+window$1.scrollY-_prevScrollY)},reset=()=>{x$1.value=initialValue.x,y.value=initialValue.y},mouseHandlerWrapper=eventFilter?event=>eventFilter(()=>mouseHandler(event),{}):event=>mouseHandler(event),touchHandlerWrapper=eventFilter?event=>eventFilter(()=>touchHandler(event),{}):event=>touchHandler(event),scrollHandlerWrapper=eventFilter?()=>eventFilter(()=>scrollHandler(),{}):()=>scrollHandler();if(target$1){let listenerOptions={passive:!0};useEventListener(target$1,[`mousemove`,`dragover`],mouseHandlerWrapper,listenerOptions),touch&&type!==`movement`&&(useEventListener(target$1,[`touchstart`,`touchmove`],touchHandlerWrapper,listenerOptions),resetOnTouchEnds&&useEventListener(target$1,`touchend`,reset,listenerOptions)),scroll&&type===`page`&&useEventListener(window$1,`scroll`,scrollHandlerWrapper,listenerOptions)}return{x:x$1,y,sourceType}}function useObjectUrl(object$1){let url=shallowRef(),release=()=>{url.value&&URL.revokeObjectURL(url.value),url.value=void 0};return watch(()=>toValue$1(object$1),newObject=>{release(),newObject&&(url.value=URL.createObjectURL(newObject))},{immediate:!0}),tryOnScopeDispose(release),readonly$1(url)}const defaultState={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},keys$1=Object.keys(defaultState);function usePointer(options$1={}){let{target:target$1=defaultWindow$1}=options$1,isInside=shallowRef(!1),state=ref(options$1.initialValue||{});Object.assign(state.value,defaultState,state.value);let handler=event=>{isInside.value=!0,!(options$1.pointerTypes&&!options$1.pointerTypes.includes(event.pointerType))&&(state.value=objectPick(event,keys$1,!1))};if(target$1){let listenerOptions={passive:!0};useEventListener(target$1,[`pointerdown`,`pointermove`,`pointerup`],handler,listenerOptions),useEventListener(target$1,`pointerleave`,()=>isInside.value=!1,listenerOptions)}return{...toRefs$1(state),isInside}}const topVarName=`--vueuse-safe-area-top`,rightVarName=`--vueuse-safe-area-right`,bottomVarName=`--vueuse-safe-area-bottom`,leftVarName=`--vueuse-safe-area-left`;function useScreenSafeArea(){let top=shallowRef(``),right=shallowRef(``),bottom=shallowRef(``),left=shallowRef(``);if(isClient$2){let topCssVar=useCssVar(topVarName),rightCssVar=useCssVar(rightVarName),bottomCssVar=useCssVar(bottomVarName),leftCssVar=useCssVar(leftVarName);topCssVar.value=`env(safe-area-inset-top, 0px)`,rightCssVar.value=`env(safe-area-inset-right, 0px)`,bottomCssVar.value=`env(safe-area-inset-bottom, 0px)`,leftCssVar.value=`env(safe-area-inset-left, 0px)`,tryOnMounted(update),useEventListener(`resize`,useDebounceFn(update),{passive:!0})}function update(){top.value=getValue(topVarName),right.value=getValue(rightVarName),bottom.value=getValue(bottomVarName),left.value=getValue(leftVarName)}return{top,right,bottom,left,update}}function getValue(position$2){return getComputedStyle(document.documentElement).getPropertyValue(position$2)}const DEFAULT_UNITS=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}],DEFAULT_MESSAGES={justNow:`just now`,past:n=>n.match(/\d/)?`${n} ago`:n,future:n=>n.match(/\d/)?`in ${n}`:n,month:(n,past)=>n===1?past?`last month`:`next month`:`${n} month${n>1?`s`:``}`,year:(n,past)=>n===1?past?`last year`:`next year`:`${n} year${n>1?`s`:``}`,day:(n,past)=>n===1?past?`yesterday`:`tomorrow`:`${n} day${n>1?`s`:``}`,week:(n,past)=>n===1?past?`last week`:`next week`:`${n} week${n>1?`s`:``}`,hour:n=>`${n} hour${n>1?`s`:``}`,minute:n=>`${n} minute${n>1?`s`:``}`,second:n=>`${n} second${n>1?`s`:``}`,invalid:``};function useUserMedia(options$1={}){var _a$2,_b;let enabled$1=shallowRef((_a$2=options$1.enabled)??!1),autoSwitch=shallowRef((_b=options$1.autoSwitch)??!0),constraints=ref(options$1.constraints),{navigator:navigator$1=defaultNavigator}=options$1,isSupported=useSupported(()=>{var _a2;return(_a2=navigator$1?.mediaDevices)?.getUserMedia}),stream=shallowRef();function getDeviceOptions(type){switch(type){case`video`:if(constraints.value)return constraints.value.video||!1;break;case`audio`:if(constraints.value)return constraints.value.audio||!1;break}}async function _start$1(){if(!(!isSupported.value||stream.value))return stream.value=await navigator$1.mediaDevices.getUserMedia({video:getDeviceOptions(`video`),audio:getDeviceOptions(`audio`)}),stream.value}function _stop(){var _a2;(_a2=stream.value)==null||_a2.getTracks().forEach(t$1=>t$1.stop()),stream.value=void 0}function stop$1(){_stop(),enabled$1.value=!1}async function start(){return await _start$1(),stream.value&&(enabled$1.value=!0),stream.value}async function restart(){return _stop(),await start()}return watch(enabled$1,v=>{v?_start$1():_stop()},{immediate:!0}),watch(constraints,()=>{autoSwitch.value&&stream.value&&restart()},{immediate:!0}),tryOnScopeDispose(()=>{stop$1()}),{isSupported,stream,start,stop:stop$1,restart,constraints,enabled:enabled$1,autoSwitch}}function useWebWorker(arg0,workerOptions,options$1){let{window:window$1=defaultWindow$1}=options$1??{},data$12=ref(null),worker=shallowRef(),post=(...args)=>{worker.value&&worker.value.postMessage(...args)},terminate=function(){worker.value&&worker.value.terminate()};return window$1&&(typeof arg0==`string`?worker.value=new Worker(arg0,workerOptions):typeof arg0==`function`?worker.value=arg0():worker.value=arg0,worker.value.onmessage=e$4=>{data$12.value=e$4.data},tryOnScopeDispose(()=>{worker.value&&worker.value.terminate()})),{data:data$12,post,terminate,worker}}function useWindowSize(options$1={}){let{window:window$1=defaultWindow$1,initialWidth=1/0,initialHeight=1/0,listenOrientation=!0,includeScrollbar=!0,type=`inner`}=options$1,width=shallowRef(initialWidth),height=shallowRef(initialHeight),update=()=>{if(window$1)if(type===`outer`)width.value=window$1.outerWidth,height.value=window$1.outerHeight;else if(type===`visual`&&window$1.visualViewport){let{width:visualViewportWidth,height:visualViewportHeight,scale:scale$1}=window$1.visualViewport;width.value=Math.round(visualViewportWidth*scale$1),height.value=Math.round(visualViewportHeight*scale$1)}else includeScrollbar?(width.value=window$1.innerWidth,height.value=window$1.innerHeight):(width.value=window$1.document.documentElement.clientWidth,height.value=window$1.document.documentElement.clientHeight)};update(),tryOnMounted(update);let listenerOptions={passive:!0};if(useEventListener(`resize`,update,listenerOptions),window$1&&type===`visual`&&window$1.visualViewport&&useEventListener(window$1.visualViewport,`resize`,update,listenerOptions),listenOrientation){let matches$1=useMediaQuery(`(orientation: portrait)`);watch(matches$1,()=>update())}return{width,height}}const defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<`u`?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<`u`?callback=>window.requestAnimationFrame(callback):callback=>setTimeout(()=>callback(getCurrentTime()),defaultTimestep);function createRenderStep(runNextFrame$1){let toRun=[],toRunNextFrame=[],numToRun=0,isProcessing$1=!1,flushNextFrame=!1,toKeepAlive=new WeakSet,step={schedule:(callback,keepAlive=!1,immediate=!1)=>{let addToCurrentFrame=immediate&&isProcessing$1,buffer$1=addToCurrentFrame?toRun:toRunNextFrame;return keepAlive&&toKeepAlive.add(callback),buffer$1.indexOf(callback)===-1&&(buffer$1.push(callback),addToCurrentFrame&&isProcessing$1&&(numToRun=toRun.length)),callback},cancel:callback=>{let index$1=toRunNextFrame.indexOf(callback);index$1!==-1&&toRunNextFrame.splice(index$1,1),toKeepAlive.delete(callback)},process:frameData=>{if(isProcessing$1){flushNextFrame=!0;return}if(isProcessing$1=!0,[toRun,toRunNextFrame]=[toRunNextFrame,toRun],toRunNextFrame.length=0,numToRun=toRun.length,numToRun)for(let i=0;i(acc[key$2]=createRenderStep(()=>runNextFrame=!0),acc),{}),sync$1=stepsOrder.reduce((acc,key$2)=>{let step=steps$1[key$2];return acc[key$2]=(process$1,keepAlive=!1,immediate=!1)=>(runNextFrame||startLoop(),step.schedule(process$1,keepAlive,immediate)),acc},{}),cancelSync=stepsOrder.reduce((acc,key$2)=>(acc[key$2]=steps$1[key$2].cancel,acc),{}),flushSync=stepsOrder.reduce((acc,key$2)=>(acc[key$2]=()=>steps$1[key$2].process(frame),acc),{}),processStep=stepId=>steps$1[stepId].process(frame),processFrame=timestamp$2=>{runNextFrame=!1,frame.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(timestamp$2-frame.timestamp,maxElapsed),1),frame.timestamp=timestamp$2,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=()=>frame;var es_default=sync$1;function __rest(s,e$4){var t$1={};for(var p$4 in s)Object.prototype.hasOwnProperty.call(s,p$4)&&e$4.indexOf(p$4)<0&&(t$1[p$4]=s[p$4]);if(s!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,p$4=Object.getOwnPropertySymbols(s);iMath.min(Math.max(v,min$1),max$1),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration:duration$2=800,bounce=.25,velocity=0,mass=1}){let envelope,derivative;warning(duration$2<=maxDuration*1e3,`Spring duration must be 10 seconds or less`);let dampingRatio=1-bounce;dampingRatio=clamp$3(minDamping,maxDamping,dampingRatio),duration$2=clamp$3(minDuration,maxDuration,duration$2/1e3),dampingRatio<1?(envelope=undampedFreq$1=>{let exponentialDecay=undampedFreq$1*dampingRatio,delta=exponentialDecay*duration$2,a$1=exponentialDecay-velocity,b$1=calcAngularFreq(undampedFreq$1,dampingRatio),c$3=Math.exp(-delta);return safeMin-a$1/b$1*c$3},derivative=undampedFreq$1=>{let exponentialDecay=undampedFreq$1*dampingRatio,delta=exponentialDecay*duration$2,d=delta*velocity+velocity,e$4=dampingRatio**2*undampedFreq$1**2*duration$2,f$2=Math.exp(-delta),g=calcAngularFreq(undampedFreq$1**2,dampingRatio),factor$1=-envelope(undampedFreq$1)+safeMin>0?-1:1;return factor$1*((d-e$4)*f$2)/g}):(envelope=undampedFreq$1=>{let a$1=Math.exp(-undampedFreq$1*duration$2),b$1=(undampedFreq$1-velocity)*duration$2+1;return-safeMin+a$1*b$1},derivative=undampedFreq$1=>{let a$1=Math.exp(-undampedFreq$1*duration$2),b$1=(velocity-undampedFreq$1)*(duration$2*duration$2);return a$1*b$1});let initialGuess=5/duration$2,undampedFreq=approximateRoot(envelope,derivative,initialGuess);if(duration$2*=1e3,isNaN(undampedFreq))return{stiffness:100,damping:10,duration:duration$2};{let stiffness=undampedFreq**2*mass;return{stiffness,damping:dampingRatio*2*Math.sqrt(mass*stiffness),duration:duration$2}}}const rootIterations=12;function approximateRoot(envelope,derivative,initialGuess){let result=initialGuess;for(let i=1;ioptions$1[key$2]!==void 0)}function getSpringOptions(options$1){let springOptions=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},options$1);if(!isSpringType(options$1,physicsKeys)&&isSpringType(options$1,durationKeys)){let derived=findSpring(options$1);springOptions=Object.assign(Object.assign(Object.assign({},springOptions),derived),{velocity:0,mass:1}),springOptions.isResolvedFromDuration=!0}return springOptions}function spring(_a$2){var{from=0,to:to$1=1,restSpeed=2,restDelta}=_a$2,options$1=__rest(_a$2,[`from`,`to`,`restSpeed`,`restDelta`]);let state={done:!1,value:from},{stiffness,damping,mass,velocity,duration:duration$2,isResolvedFromDuration}=getSpringOptions(options$1),resolveSpring=zero,resolveVelocity=zero;function createSpring(){let initialVelocity=velocity?-(velocity/1e3):0,initialDelta=to$1-from,dampingRatio=damping/(2*Math.sqrt(stiffness*mass)),undampedAngularFreq=Math.sqrt(stiffness/mass)/1e3;if(restDelta===void 0&&(restDelta=Math.min(Math.abs(to$1-from)/100,.4)),dampingRatio<1){let angularFreq=calcAngularFreq(undampedAngularFreq,dampingRatio);resolveSpring=t$1=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t$1);return to$1-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq*Math.sin(angularFreq*t$1)+initialDelta*Math.cos(angularFreq*t$1))},resolveVelocity=t$1=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t$1);return dampingRatio*undampedAngularFreq*envelope*(Math.sin(angularFreq*t$1)*(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq+initialDelta*Math.cos(angularFreq*t$1))-envelope*(Math.cos(angularFreq*t$1)*(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)-angularFreq*initialDelta*Math.sin(angularFreq*t$1))}}else if(dampingRatio===1)resolveSpring=t$1=>to$1-Math.exp(-undampedAngularFreq*t$1)*(initialDelta+(initialVelocity+undampedAngularFreq*initialDelta)*t$1);else{let dampedAngularFreq=undampedAngularFreq*Math.sqrt(dampingRatio*dampingRatio-1);resolveSpring=t$1=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t$1),freqForT=Math.min(dampedAngularFreq*t$1,300);return to$1-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)*Math.sinh(freqForT)+dampedAngularFreq*initialDelta*Math.cosh(freqForT))/dampedAngularFreq}}}return createSpring(),{next:t$1=>{let current=resolveSpring(t$1);if(isResolvedFromDuration)state.done=t$1>=duration$2;else{let currentVelocity=resolveVelocity(t$1)*1e3,isBelowVelocityThreshold=Math.abs(currentVelocity)<=restSpeed,isBelowDisplacementThreshold=Math.abs(to$1-current)<=restDelta;state.done=isBelowVelocityThreshold&&isBelowDisplacementThreshold}return state.value=state.done?to$1:current,state},flipTarget:()=>{velocity=-velocity,[from,to$1]=[to$1,from],createSpring()}}}spring.needsInterpolation=(a$1,b$1)=>typeof a$1==`string`||typeof b$1==`string`;const zero=_t$2=>0,progress=(from,to$1,value$1)=>{let toFromDifference=to$1-from;return toFromDifference===0?1:(value$1-from)/toFromDifference},mix=(from,to$1,progress$1)=>-progress$1*from+progress$1*to$1+from,clamp$4=(min$1,max$1)=>v=>Math.max(Math.min(v,max$1),min$1),sanitize=v=>v%1?Number(v.toFixed(5)):v,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$1(v){return typeof v==`string`}const number$4={test:v=>typeof v==`number`,parse:parseFloat,transform:v=>v},alpha=Object.assign(Object.assign({},number$4),{transform:clamp$4(0,1)}),scale=Object.assign(Object.assign({},number$4),{default:1}),createUnitType=unit=>({test:v=>isString$1(v)&&v.endsWith(unit)&&v.split(` `).length===1,parse:parseFloat,transform:v=>`${v}${unit}`}),degrees=createUnitType(`deg`),percent=createUnitType(`%`),px=createUnitType(`px`),vh=createUnitType(`vh`),vw=createUnitType(`vw`),progressPercentage=Object.assign(Object.assign({},percent),{parse:v=>percent.parse(v)/100,transform:v=>percent.transform(v*100)}),isColorString=(type,testProp)=>v=>!!(isString$1(v)&&singleColorRegex.test(v)&&v.startsWith(type)||testProp&&Object.prototype.hasOwnProperty.call(v,testProp)),splitColor=(aName,bName,cName)=>v=>{if(!isString$1(v))return v;let[a$1,b$1,c$3,alpha$1]=v.match(floatRegex);return{[aName]:parseFloat(a$1),[bName]:parseFloat(b$1),[cName]:parseFloat(c$3),alpha:alpha$1===void 0?1:parseFloat(alpha$1)}},hsla={test:isColorString(`hsl`,`hue`),parse:splitColor(`hue`,`saturation`,`lightness`),transform:({hue:hue$2,saturation,lightness,alpha:alpha$1=1})=>`hsla(`+Math.round(hue$2)+`, `+percent.transform(sanitize(saturation))+`, `+percent.transform(sanitize(lightness))+`, `+sanitize(alpha.transform(alpha$1))+`)`},clampRgbUnit=clamp$4(0,255),rgbUnit=Object.assign(Object.assign({},number$4),{transform:v=>Math.round(clampRgbUnit(v))}),rgba={test:isColorString(`rgb`,`red`),parse:splitColor(`red`,`green`,`blue`),transform:({red,green,blue,alpha:alpha$1=1})=>`rgba(`+rgbUnit.transform(red)+`, `+rgbUnit.transform(green)+`, `+rgbUnit.transform(blue)+`, `+sanitize(alpha.transform(alpha$1))+`)`};function parseHex$1(v){let r$1=``,g=``,b$1=``,a$1=``;return v.length>5?(r$1=v.substr(1,2),g=v.substr(3,2),b$1=v.substr(5,2),a$1=v.substr(7,2)):(r$1=v.substr(1,1),g=v.substr(2,1),b$1=v.substr(3,1),a$1=v.substr(4,1),r$1+=r$1,g+=g,b$1+=b$1,a$1+=a$1),{red:parseInt(r$1,16),green:parseInt(g,16),blue:parseInt(b$1,16),alpha:a$1?parseInt(a$1,16)/255:1}}const hex$1={test:isColorString(`#`),parse:parseHex$1,transform:rgba.transform},color$1={test:v=>rgba.test(v)||hex$1.test(v)||hsla.test(v),parse:v=>rgba.test(v)?rgba.parse(v):hsla.test(v)?hsla.parse(v):hex$1.parse(v),transform:v=>isString$1(v)?v:v.hasOwnProperty(`red`)?rgba.transform(v):hsla.transform(v)},colorToken="${c}",numberToken="${n}";function test(v){var _a$2,_b,_c,_d;return isNaN(v)&&isString$1(v)&&((_b=(_a$2=v.match(floatRegex))?.length)??0)+((_d=(_c=v.match(colorRegex))?.length)??0)>0}function analyse$1(v){typeof v==`number`&&(v=`${v}`);let values=[],numColors=0,colors=v.match(colorRegex);colors&&(numColors=colors.length,v=v.replace(colorRegex,colorToken),values.push(...colors.map(color$1.parse)));let numbers=v.match(floatRegex);return numbers&&(v=v.replace(floatRegex,numberToken),values.push(...numbers.map(number$4.parse))),{values,numColors,tokenised:v}}function parse$5(v){return analyse$1(v).values}function createTransformer$1(v){let{values,numColors,tokenised}=analyse$1(v),numValues=values.length;return v$1=>{let output=tokenised;for(let i=0;itypeof v==`number`?0:v;function getAnimatableNone$2(v){let parsed=parse$5(v),transformer=createTransformer$1(v);return transformer(parsed.map(convertNumbersToZero))}const complex={test,parse:parse$5,createTransformer:createTransformer$1,getAnimatableNone:getAnimatableNone$2},maxDefaults=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function applyDefaultFilter(v){let[name$2,value$1]=v.slice(0,-1).split(`(`);if(name$2===`drop-shadow`)return v;let[number$5]=value$1.match(floatRegex)||[];if(!number$5)return v;let unit=value$1.replace(number$5,``),defaultValue=maxDefaults.has(name$2)?1:0;return number$5!==value$1&&(defaultValue*=100),name$2+`(`+defaultValue+unit+`)`}const functionRegex=/([a-z-]*)\(.*?\)/g,filter=Object.assign(Object.assign({},complex),{getAnimatableNone:v=>{let functions=v.match(functionRegex);return functions?functions.map(applyDefaultFilter).join(` `):v}});function hueToRgb(p$4,q,t$1){return t$1<0&&(t$1+=1),t$1>1&&--t$1,t$1<1/6?p$4+(q-p$4)*6*t$1:t$1<1/2?q:t$1<2/3?p$4+(q-p$4)*(2/3-t$1)*6:p$4}function hslaToRgba({hue:hue$2,saturation,lightness,alpha:alpha$1}){hue$2/=360,saturation/=100,lightness/=100;let red=0,green=0,blue=0;if(!saturation)red=green=blue=lightness;else{let q=lightness<.5?lightness*(1+saturation):lightness+saturation-lightness*saturation,p$4=2*lightness-q;red=hueToRgb(p$4,q,hue$2+1/3),green=hueToRgb(p$4,q,hue$2),blue=hueToRgb(p$4,q,hue$2-1/3)}return{red:Math.round(red*255),green:Math.round(green*255),blue:Math.round(blue*255),alpha:alpha$1}}const mixLinearColor=(from,to$1,v)=>{let fromExpo=from*from,toExpo=to$1*to$1;return Math.sqrt(Math.max(0,v*(toExpo-fromExpo)+fromExpo))},colorTypes=[hex$1,rgba,hsla],getColorType=v=>colorTypes.find(type=>type.test(v)),notAnimatable=color$2=>`'${color$2}' is not an animatable color. Use the equivalent color code instead.`,mixColor=(from,to$1)=>{let fromColorType=getColorType(from),toColorType=getColorType(to$1);invariant(!!fromColorType,notAnimatable(from)),invariant(!!toColorType,notAnimatable(to$1));let fromColor=fromColorType.parse(from),toColor=toColorType.parse(to$1);fromColorType===hsla&&(fromColor=hslaToRgba(fromColor),fromColorType=rgba),toColorType===hsla&&(toColor=hslaToRgba(toColor),toColorType=rgba);let blended=Object.assign({},fromColor);return v=>{for(let key$2 in blended)key$2!==`alpha`&&(blended[key$2]=mixLinearColor(fromColor[key$2],toColor[key$2],v));return blended.alpha=mix(fromColor.alpha,toColor.alpha,v),fromColorType.transform(blended)}},isNum$1=v=>typeof v==`number`,combineFunctions=(a$1,b$1)=>v=>b$1(a$1(v)),pipe$1=(...transformers)=>transformers.reduce(combineFunctions);function getMixer(origin,target$1){return isNum$1(origin)?v=>mix(origin,target$1,v):color$1.test(origin)?mixColor(origin,target$1):mixComplex(origin,target$1)}const mixArray=(from,to$1)=>{let output=[...from],numValues=output.length,blendValue=from.map((fromThis,i)=>getMixer(fromThis,to$1[i]));return v=>{for(let i=0;i{let output=Object.assign(Object.assign({},origin),target$1),blendValue={};for(let key$2 in output)origin[key$2]!==void 0&&target$1[key$2]!==void 0&&(blendValue[key$2]=getMixer(origin[key$2],target$1[key$2]));return v=>{for(let key$2 in blendValue)output[key$2]=blendValue[key$2](v);return output}};function analyse(value$1){let parsed=complex.parse(value$1),numValues=parsed.length,numNumbers=0,numRGB=0,numHSL=0;for(let i=0;i{let template=complex.createTransformer(target$1),originStats=analyse(origin),targetStats=analyse(target$1),canInterpolate=originStats.numHSL===targetStats.numHSL&&originStats.numRGB===targetStats.numRGB&&originStats.numNumbers>=targetStats.numNumbers;return canInterpolate?pipe$1(mixArray(originStats.parsed,targetStats.parsed),template):(warning(!0,`Complex values '${origin}' and '${target$1}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),p$4=>`${p$4>0?target$1:origin}`)},mixNumber=(from,to$1)=>p$4=>mix(from,to$1,p$4);function detectMixerFactory(v){if(typeof v==`number`)return mixNumber;if(typeof v==`string`)return color$1.test(v)?mixColor:mixComplex;if(Array.isArray(v))return mixArray;if(typeof v==`object`)return mixObject}function createMixers(output,ease,customMixer){let mixers=[],mixerFactory=customMixer||detectMixerFactory(output[0]),numMixers=output.length-1;for(let i=0;imixer(progress(from,to$1,v))}function slowInterpolate(input,mixers){let inputLength=input.length,lastInputIndex=inputLength-1;return v=>{let mixerIndex=0,foundMixerIndex=!1;if(v<=input[0]?foundMixerIndex=!0:v>=input[lastInputIndex]&&(mixerIndex=lastInputIndex-1,foundMixerIndex=!0),!foundMixerIndex){let i=1;for(;iv||i===lastInputIndex);i++);mixerIndex=i-1}let progressInRange=progress(input[mixerIndex],input[mixerIndex+1],v);return mixers[mixerIndex](progressInRange)}}function interpolate$1(input,output,{clamp:isClamp=!0,ease,mixer}={}){let inputLength=input.length;invariant(inputLength===output.length,`Both input and output ranges must be the same length`),invariant(!ease||!Array.isArray(ease)||ease.length===inputLength-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),input[0]>input[inputLength-1]&&(input=[].concat(input),output=[].concat(output),input.reverse(),output.reverse());let mixers=createMixers(output,ease,mixer),interpolator=inputLength===2?fastInterpolate(input,mixers):slowInterpolate(input,mixers);return isClamp?v=>interpolator(clamp$3(input[0],input[inputLength-1],v)):interpolator}const reverseEasing=easing=>p$4=>1-easing(1-p$4),mirrorEasing=easing=>p$4=>p$4<=.5?easing(2*p$4)/2:(2-easing(2*(1-p$4)))/2,createExpoIn=power=>p$4=>p$4**+power,createBackIn=power=>p$4=>p$4*p$4*((power+1)*p$4-power),createAnticipate=power=>{let backEasing=createBackIn(power);return p$4=>(p$4*=2)<1?.5*backEasing(p$4):.5*(2-2**(-10*(p$4-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear$1=p$4=>p$4,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=p$4=>1-Math.sin(Math.acos(p$4)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca=4356/361,cb=35442/1805,cc=16061/1805,bounceOut=p$4=>{if(p$4===1||p$4===0)return p$4;let p2=p$4*p$4;return p$4p$4<.5?.5*(1-bounceOut(1-p$4*2)):.5*bounceOut(p$4*2-1)+.5;function defaultEasing(values,easing){return values.map(()=>easing||easeInOut).splice(0,values.length-1)}function defaultOffset(values){let numValues=values.length;return values.map((_value,i)=>i===0?0:i/(numValues-1))}function convertOffsetToTimes(offset$2,duration$2){return offset$2.map(o=>o*duration$2)}function keyframes$3({from=0,to:to$1=1,ease,offset:offset$2,duration:duration$2=300}){let state={done:!1,value:from},values=Array.isArray(to$1)?to$1:[from,to$1],times=convertOffsetToTimes(offset$2&&offset$2.length===values.length?offset$2:defaultOffset(values),duration$2);function createInterpolator(){return interpolate$1(times,values,{ease:Array.isArray(ease)?ease:defaultEasing(values,ease)})}let interpolator=createInterpolator();return{next:t$1=>(state.value=interpolator(t$1),state.done=t$1>=duration$2,state),flipTarget:()=>{values.reverse(),interpolator=createInterpolator()}}}function decay({velocity=0,from=0,power=.8,timeConstant=350,restDelta=.5,modifyTarget}){let state={done:!1,value:from},amplitude=power*velocity,ideal=from+amplitude,target$1=modifyTarget===void 0?ideal:modifyTarget(ideal);return target$1!==ideal&&(amplitude=target$1-from),{next:t$1=>{let delta=-amplitude*Math.exp(-t$1/timeConstant);return state.done=!(delta>restDelta||delta<-restDelta),state.value=state.done?target$1:target$1+delta,state},flipTarget:()=>{}}}const types={keyframes:keyframes$3,spring,decay};function detectAnimationFromOptions(config$1){if(Array.isArray(config$1.to))return keyframes$3;if(types[config$1.type])return types[config$1.type];let keys$3=new Set(Object.keys(config$1));return keys$3.has(`ease`)||keys$3.has(`duration`)&&!keys$3.has(`dampingRatio`)?keyframes$3:keys$3.has(`dampingRatio`)||keys$3.has(`stiffness`)||keys$3.has(`mass`)||keys$3.has(`damping`)||keys$3.has(`restSpeed`)||keys$3.has(`restDelta`)?spring:keyframes$3}function loopElapsed(elapsed,duration$2,delay=0){return elapsed-duration$2-delay}function reverseElapsed(elapsed,duration$2,delay=0,isForwardPlayback=!0){return isForwardPlayback?loopElapsed(duration$2+-elapsed,duration$2,delay):duration$2-(elapsed-duration$2)+delay}function hasRepeatDelayElapsed(elapsed,duration$2,delay,isForwardPlayback){return isForwardPlayback?elapsed>=duration$2+delay:elapsed<=-delay}const framesync=update=>{let passTimestamp=({delta})=>update(delta);return{start:()=>es_default.update(passTimestamp,!0),stop:()=>cancelSync.update(passTimestamp)}};function animate$1(_a$2){var _b,_c,{from,autoplay=!0,driver=framesync,elapsed=0,repeat:repeatMax=0,repeatType=`loop`,repeatDelay=0,onPlay,onStop,onComplete,onRepeat,onUpdate}=_a$2,options$1=__rest(_a$2,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:to$1}=options$1,driverControls,repeatCount=0,computedDuration=options$1.duration,latest,isComplete=!1,isForwardPlayback=!0,interpolateFromNumber,animator=detectAnimationFromOptions(options$1);(_c=(_b=animator).needsInterpolation)?.call(_b,from,to$1)&&(interpolateFromNumber=interpolate$1([0,100],[from,to$1],{clamp:!1}),from=0,to$1=100);let animation=animator(Object.assign(Object.assign({},options$1),{from,to:to$1}));function repeat(){repeatCount++,repeatType===`reverse`?(isForwardPlayback=repeatCount%2==0,elapsed=reverseElapsed(elapsed,computedDuration,repeatDelay,isForwardPlayback)):(elapsed=loopElapsed(elapsed,computedDuration,repeatDelay),repeatType===`mirror`&&animation.flipTarget()),isComplete=!1,onRepeat&&onRepeat()}function complete(){driverControls.stop(),onComplete&&onComplete()}function update(delta){if(isForwardPlayback||(delta=-delta),elapsed+=delta,!isComplete){let state=animation.next(Math.max(0,elapsed));latest=state.value,interpolateFromNumber&&(latest=interpolateFromNumber(latest)),isComplete=isForwardPlayback?state.done:elapsed<=0}onUpdate?.(latest),isComplete&&(repeatCount===0&&(computedDuration??=elapsed),repeatCount{onStop?.(),driverControls.stop()}}}function velocityPerSecond(velocity,frameDuration){return frameDuration?velocity*(1e3/frameDuration):0}function inertia({from=0,velocity=0,min:min$1,max:max$1,power=.8,timeConstant=750,bounceStiffness=500,bounceDamping=10,restDelta=1,modifyTarget,driver,onUpdate,onComplete,onStop}){let currentAnimation;function isOutOfBounds(v){return min$1!==void 0&&vmax$1}function boundaryNearest(v){return min$1===void 0?max$1:max$1===void 0||Math.abs(min$1-v){var _a$2;onUpdate?.(v),(_a$2=options$1.onUpdate)==null||_a$2.call(options$1,v)},onComplete,onStop}))}function startSpring(options$1){startAnimation(Object.assign({type:`spring`,stiffness:bounceStiffness,damping:bounceDamping,restDelta},options$1))}if(isOutOfBounds(from))startSpring({from,velocity,to:boundaryNearest(from)});else{let target$1=power*velocity+from;modifyTarget!==void 0&&(target$1=modifyTarget(target$1));let boundary=boundaryNearest(target$1),heading$1=boundary===min$1?-1:1,prev,current,checkBoundary=v=>{prev=current,current=v,velocity=velocityPerSecond(v-prev,getFrameData().delta),(heading$1===1&&v>boundary||heading$1===-1&&vcurrentAnimation?.stop()}}const a=(a1,a2)=>1-3*a2+3*a1,b=(a1,a2)=>3*a2-6*a1,c$2=a1=>3*a1,calcBezier$1=(t$1,a1,a2)=>((a(a1,a2)*t$1+b(a1,a2))*t$1+c$2(a1))*t$1,getSlope=(t$1,a1,a2)=>3*a(a1,a2)*t$1*t$1+2*b(a1,a2)*t$1+c$2(a1),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide$1(aX,aA,aB,mX1,mX2){let currentX,currentT,i=0;do currentT=aA+(aB-aA)/2,currentX=calcBezier$1(currentT,mX1,mX2)-aX,currentX>0?aB=currentT:aA=currentT;while(Math.abs(currentX)>subdivisionPrecision&&++i=newtonMinSlope?newtonRaphsonIterate(aX,guessForT,mX1,mX2):initialSlope===0?guessForT:binarySubdivide$1(aX,intervalStart,intervalStart+kSampleStepSize,mX1,mX2)}return t$1=>t$1===0||t$1===1?t$1:calcBezier$1(getTForX(t$1),mY1,mY2)}const __vite_import_meta_env__$1={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_TARGET_HUGGINGFACE_SPACE:`true`},motionState$1={};var SubscriptionManager$1=class{subscriptions=new Set;add(handler){return this.subscriptions.add(handler),()=>this.subscriptions.delete(handler)}notify(a$1,b$1,c$3){if(this.subscriptions.size)for(let handler of this.subscriptions)handler(a$1,b$1,c$3)}clear(){this.subscriptions.clear()}};function isFloat$1(value$1){return!Number.isNaN(Number.parseFloat(value$1))}var MotionValue$1=class{current;prev;timeDelta=0;lastUpdated=0;updateSubscribers=new SubscriptionManager$1;stopAnimation;canTrackVelocity=!1;constructor(init){this.prev=this.current=init,this.canTrackVelocity=isFloat$1(this.current)}onChange(subscription){return this.updateSubscribers.add(subscription)}clearListeners(){this.updateSubscribers.clear()}set(v){this.updateAndNotify(v)}updateAndNotify=v=>{this.prev=this.current,this.current=v;let{delta,timestamp:timestamp$2}=getFrameData();this.lastUpdated!==timestamp$2&&(this.timeDelta=delta,this.lastUpdated=timestamp$2),es_default.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)};get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}scheduleVelocityCheck=()=>es_default.postRender(this.velocityCheck);velocityCheck=({timestamp:timestamp$2})=>{this.canTrackVelocity||=isFloat$1(this.current),timestamp$2!==this.lastUpdated&&(this.prev=this.current)};start(animation){return this.stop(),new Promise(resolve$1=>{let{stop:stop$1}=animation(resolve$1);this.stopAnimation=stop$1}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}};function getMotionValue$1(init){return new MotionValue$1(init)}const{isArray:isArray$4}=Array;function useMotionValues$1(){let motionValues=ref({}),stop$1=keys$3=>{let destroyKey=key$2=>{motionValues.value[key$2]&&(motionValues.value[key$2].stop(),motionValues.value[key$2].destroy(),delete motionValues.value[key$2])};keys$3?isArray$4(keys$3)?keys$3.forEach(destroyKey):destroyKey(keys$3):Object.keys(motionValues.value).forEach(destroyKey)},get=(key$2,from,target$1)=>{if(motionValues.value[key$2])return motionValues.value[key$2];let motionValue=getMotionValue$1(from);return motionValue.onChange(v=>target$1[key$2]=v),motionValues.value[key$2]=motionValue,motionValue};return tryOnUnmounted(stop$1),{motionValues,get,stop:stop$1}}function isKeyframesTarget$1(v){return Array.isArray(v)}function underDampedSpring$1(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function criticallyDampedSpring$1(to$1){return{type:`spring`,stiffness:550,damping:to$1===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function overDampedSpring$1(to$1){return{type:`spring`,stiffness:550,damping:to$1===0?100:30,restDelta:.01,restSpeed:10}}function linearTween$1(){return{type:`keyframes`,ease:`linear`,duration:300}}function keyframes$2(values){return{type:`keyframes`,duration:800,values}}const defaultTransitions$1={default:overDampedSpring$1,x:underDampedSpring$1,y:underDampedSpring$1,z:underDampedSpring$1,rotate:underDampedSpring$1,rotateX:underDampedSpring$1,rotateY:underDampedSpring$1,rotateZ:underDampedSpring$1,scaleX:criticallyDampedSpring$1,scaleY:criticallyDampedSpring$1,scale:criticallyDampedSpring$1,backgroundColor:linearTween$1,color:linearTween$1,opacity:linearTween$1};function getDefaultTransition$1(valueKey,to$1){let transitionFactory;return transitionFactory=isKeyframesTarget$1(to$1)?keyframes$2:defaultTransitions$1[valueKey]||defaultTransitions$1.default,{to:to$1,...transitionFactory(to$1)}}const int$2={...number$4,transform:Math.round},valueTypes$2={color:color$1,backgroundColor:color$1,outlineColor:color$1,fill:color$1,stroke:color$1,borderColor:color$1,borderTopColor:color$1,borderRightColor:color$1,borderBottomColor:color$1,borderLeftColor:color$1,borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int$2,filter,WebkitFilter:filter,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int$2},getValueType$1=key$2=>valueTypes$2[key$2];function getValueAsType$1(value$1,type){return type&&typeof value$1==`number`&&type.transform?type.transform(value$1):value$1}function getAnimatableNone$1(key$2,value$1){let defaultValueType=getValueType$1(key$2);return defaultValueType!==filter&&(defaultValueType=complex),defaultValueType.getAnimatableNone?defaultValueType.getAnimatableNone(value$1):void 0}const easingLookup$1={linear:linear$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate,bounceIn,bounceInOut,bounceOut};function easingDefinitionToFunction$1(definition$29){if(Array.isArray(definition$29)){let[x1,y1,x2,y2]=definition$29;return cubicBezier$1(x1,y1,x2,y2)}else if(typeof definition$29==`string`)return easingLookup$1[definition$29];return definition$29}function isEasingArray$1(ease){return Array.isArray(ease)&&typeof ease[0]!=`number`}function isAnimatable$1(key$2,value$1){return key$2===`zIndex`?!1:!!(typeof value$1==`number`||Array.isArray(value$1)||typeof value$1==`string`&&complex.test(value$1)&&!value$1.startsWith(`url(`))}function hydrateKeyframes$1(options$1){return Array.isArray(options$1.to)&&options$1.to[0]===null&&(options$1.to=[...options$1.to],options$1.to[0]=options$1.from),options$1}function convertTransitionToAnimationOptions$1({ease,times,delay,...transition}){let options$1={...transition};return times&&(options$1.offset=times),ease&&(options$1.ease=isEasingArray$1(ease)?ease.map(easingDefinitionToFunction$1):easingDefinitionToFunction$1(ease)),delay&&(options$1.elapsed=-delay),options$1}function getPopmotionAnimationOptions$1(transition,options$1,key$2){return Array.isArray(options$1.to)&&(transition.duration||=800),hydrateKeyframes$1(options$1),!isTransitionDefined$1(transition)&&(transition={...transition,...getDefaultTransition$1(key$2,options$1.to)}),{...options$1,...convertTransitionToAnimationOptions$1(transition)}}function isTransitionDefined$1({delay,repeat,repeatType,repeatDelay,from,...transition}){return!!Object.keys(transition).length}function getValueTransition$1(transition,key$2){return transition[key$2]||transition.default||transition}function getAnimation$1(key$2,value$1,target$1,transition,onComplete){let valueTransition=getValueTransition$1(transition,key$2),origin=valueTransition.from===null||valueTransition.from===void 0?value$1.get():valueTransition.from,isTargetAnimatable=isAnimatable$1(key$2,target$1);origin===`none`&&isTargetAnimatable&&typeof target$1==`string`&&(origin=getAnimatableNone$1(key$2,target$1));let isOriginAnimatable=isAnimatable$1(key$2,origin);function start(complete){let options$1={from:origin,to:target$1,velocity:transition.velocity?transition.velocity:value$1.getVelocity(),onUpdate:v=>value$1.set(v)};return valueTransition.type===`inertia`||valueTransition.type===`decay`?inertia({...options$1,...valueTransition}):animate$1({...getPopmotionAnimationOptions$1(valueTransition,options$1,key$2),onUpdate:v=>{options$1.onUpdate(v),valueTransition.onUpdate&&valueTransition.onUpdate(v)},onComplete:()=>{onComplete&&onComplete(),complete&&complete()}})}function set(complete){return value$1.set(target$1),onComplete&&onComplete(),complete&&complete(),{stop:()=>{}}}return!isOriginAnimatable||!isTargetAnimatable||valueTransition.type===!1?set:start}function useMotionTransitions$1(){let{motionValues,stop:stop$1,get}=useMotionValues$1(),push$1=(key$2,value$1,target$1,transition={},onComplete)=>{let from=target$1[key$2],motionValue=get(key$2,from,target$1);if(transition&&transition.immediate){motionValue.set(value$1);return}let animation=getAnimation$1(key$2,motionValue,value$1,transition,onComplete);motionValue.start(animation)};return{motionValues,stop:stop$1,push:push$1}}function useMotionControls$1(motionProperties,variants={},{motionValues,push:push$1,stop:stop$1}=useMotionTransitions$1()){let _variants=unref(variants),isAnimating=ref(!1);watch(motionValues,newVal=>{isAnimating.value=Object.values(newVal).filter(value$1=>value$1.isAnimating()).length>0},{immediate:!0,deep:!0});let getVariantFromKey=variant=>{if(!_variants||!_variants[variant])throw Error(`The variant ${variant} does not exist.`);return _variants[variant]},apply$2=variant=>{typeof variant==`string`&&(variant=getVariantFromKey(variant));let animations$1=Object.entries(variant).map(([key$2,value$1])=>key$2===`transition`?void 0:new Promise(resolve$1=>push$1(key$2,value$1,motionProperties,variant.transition||getDefaultTransition$1(key$2,variant[key$2]),resolve$1))).filter(Boolean);async function waitForComplete(){await Promise.all(animations$1),variant.transition?.onComplete?.()}return Promise.all([waitForComplete()])},set=variant=>{let variantData=isObject$2(variant)?variant:getVariantFromKey(variant);Object.entries(variantData).forEach(([key$2,value$1])=>{key$2!==`transition`&&push$1(key$2,value$1,motionProperties,{immediate:!0})})},leave=async done=>{let leaveVariant;if(_variants&&(_variants.leave&&(leaveVariant=_variants.leave),!_variants.leave&&_variants.initial&&(leaveVariant=_variants.initial)),!leaveVariant){done();return}await apply$2(leaveVariant),done()};return{isAnimating,apply:apply$2,set,leave,stop:stop$1}}const isBrowser$3=typeof window<`u`,supportsPointerEvents$1=()=>isBrowser$3&&(window.onpointerdown===null||__vite_import_meta_env__$1?.TEST),supportsTouchEvents$1=()=>isBrowser$3&&(window.ontouchstart===null||__vite_import_meta_env__$1?.TEST),supportsMouseEvents$1=()=>isBrowser$3&&(window.onmousedown===null||__vite_import_meta_env__$1?.TEST);function registerEventListeners$1({target:target$1,state,variants,apply:apply$2}){let _variants=unref(variants),hovered=ref(!1),tapped=ref(!1),focused=ref(!1),mutableKeys=computed(()=>{let result=[...Object.keys(state.value||{})];return _variants?(_variants.hovered&&(result=[...result,...Object.keys(_variants.hovered)]),_variants.tapped&&(result=[...result,...Object.keys(_variants.tapped)]),_variants.focused&&(result=[...result,...Object.keys(_variants.focused)]),result):result}),computedProperties=computed(()=>{let result={};for(let key$2 in Object.assign(result,state.value),hovered.value&&_variants.hovered&&Object.assign(result,_variants.hovered),tapped.value&&_variants.tapped&&Object.assign(result,_variants.tapped),focused.value&&_variants.focused&&Object.assign(result,_variants.focused),result)mutableKeys.value.includes(key$2)||delete result[key$2];return result});_variants.hovered&&(useEventListener(target$1,`mouseenter`,()=>hovered.value=!0),useEventListener(target$1,`mouseleave`,()=>{hovered.value=!1,tapped.value=!1})),_variants.tapped&&(supportsMouseEvents$1()&&(useEventListener(target$1,`mousedown`,()=>tapped.value=!0),useEventListener(target$1,`mouseup`,()=>tapped.value=!1)),supportsPointerEvents$1()&&(useEventListener(target$1,`pointerdown`,()=>tapped.value=!0),useEventListener(target$1,`pointerup`,()=>tapped.value=!1)),supportsTouchEvents$1()&&(useEventListener(target$1,`touchstart`,()=>tapped.value=!0),useEventListener(target$1,`touchend`,()=>tapped.value=!1))),_variants.focused&&(useEventListener(target$1,`focus`,()=>focused.value=!0),useEventListener(target$1,`blur`,()=>focused.value=!1)),watch([hovered,tapped,focused],()=>{apply$2(computedProperties.value)})}function registerLifeCycleHooks$1({set,target:target$1,variants,variant}){let _variants=unref(variants);watch(()=>target$1,()=>{_variants&&(_variants.initial&&(set(`initial`),variant.value=`initial`),_variants.enter&&(variant.value=`enter`))},{immediate:!0,flush:`pre`})}function registerVariantsSync$1({state,apply:apply$2}){watch(state,newVal=>{newVal&&apply$2(newVal)},{immediate:!0})}function registerVisibilityHooks$1({target:target$1,variants,variant}){let _variants=unref(variants);_variants&&(_variants.visible||_variants.visibleOnce)&&useIntersectionObserver(target$1,([{isIntersecting}])=>{_variants.visible?isIntersecting?variant.value=`visible`:variant.value=`initial`:_variants.visibleOnce&&(isIntersecting&&variant.value!==`visibleOnce`?variant.value=`visibleOnce`:variant.value||=`initial`)})}function useMotionFeatures$1(instance,options$1={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){options$1.lifeCycleHooks&®isterLifeCycleHooks$1(instance),options$1.syncVariants&®isterVariantsSync$1(instance),options$1.visibilityHooks&®isterVisibilityHooks$1(instance),options$1.eventListeners&®isterEventListeners$1(instance)}function reactiveStyle$1(props={}){let state=reactive({...props}),style=ref({});return watch(state,()=>{let result={};for(let[key$2,value$1]of Object.entries(state)){let valueType=getValueType$1(key$2),valueAsType=getValueAsType$1(value$1,valueType);result[key$2]=valueAsType}style.value=result},{immediate:!0,deep:!0}),{state,style}}function usePermissiveTarget$1(target$1,onTarget){watch(()=>unrefElement(target$1),el=>{el&&onTarget(el)},{immediate:!0})}const translateAlias$1={x:`translateX`,y:`translateY`,z:`translateZ`};function reactiveTransform$1(props={},enableHardwareAcceleration=!0){let state=reactive({...props}),transform$2=ref(``);return watch(state,newVal=>{let result=``,hasHardwareAcceleration=!1;if(enableHardwareAcceleration&&(newVal.x||newVal.y||newVal.z)){let str=[newVal.x||0,newVal.y||0,newVal.z||0].map(val=>getValueAsType$1(val,px)).join(`,`);result+=`translate3d(${str}) `,hasHardwareAcceleration=!0}for(let[key$2,value$1]of Object.entries(newVal)){if(enableHardwareAcceleration&&(key$2===`x`||key$2===`y`||key$2===`z`))continue;let valueType=getValueType$1(key$2),valueAsType=getValueAsType$1(value$1,valueType);result+=`${translateAlias$1[key$2]||key$2}(${valueAsType}) `}enableHardwareAcceleration&&!hasHardwareAcceleration&&(result+=`translateZ(0px) `),transform$2.value=result.trim()},{immediate:!0,deep:!0}),{state,transform:transform$2}}const transformAxes$1=[``,`X`,`Y`,`Z`],order$2=[`perspective`,`translate`,`scale`,`rotate`,`skew`],transformProps$1=[`transformPerspective`,`x`,`y`,`z`];order$2.forEach(operationKey=>{transformAxes$1.forEach(axesKey=>{let key$2=operationKey+axesKey;transformProps$1.push(key$2)})});const transformPropSet$1=new Set(transformProps$1);function isTransformProp$1(key$2){return transformPropSet$1.has(key$2)}const transformOriginProps$1=new Set([`originX`,`originY`,`originZ`]);function isTransformOriginProp$1(key$2){return transformOriginProps$1.has(key$2)}function splitValues$1(variant){let transform$2={},style={};return Object.entries(variant).forEach(([key$2,value$1])=>{isTransformProp$1(key$2)||isTransformOriginProp$1(key$2)?transform$2[key$2]=value$1:style[key$2]=value$1}),{transform:transform$2,style}}function variantToStyle$1(variant){let{transform:_transform,style:_style}=splitValues$1(variant),{transform:transform$2}=reactiveTransform$1(_transform),{style}=reactiveStyle$1(_style);return transform$2.value&&(style.value.transform=transform$2.value),style.value}function useElementStyle$1(target$1,onInit){let _cache$1,_target$1,{state,style}=reactiveStyle$1();return usePermissiveTarget$1(target$1,el=>{_target$1=el;for(let key$2 of Object.keys(valueTypes$2)){if(el.style[key$2]===null||el.style[key$2]===``||isTransformProp$1(key$2)||isTransformOriginProp$1(key$2))continue;state[key$2]=el.style[key$2]}_cache$1&&Object.entries(_cache$1).forEach(([key$2,value$1])=>el.style[key$2]=value$1),onInit&&onInit(state)}),watch(style,newVal=>{if(!_target$1){_cache$1=newVal;return}for(let key$2 in newVal)_target$1.style[key$2]=newVal[key$2]},{immediate:!0}),{style:state}}function parseTransform$1(transform$2){let transforms=transform$2.trim().split(/\) |\)/);if(transforms.length===1)return{};let parseValues=value$1=>value$1.endsWith(`px`)||value$1.endsWith(`deg`)?Number.parseFloat(value$1):Number.isNaN(Number(value$1))?Number(value$1):value$1;return transforms.reduce((acc,transform2)=>{if(!transform2)return acc;let[name$2,transformValue]=transform2.split(`(`),valueArray=transformValue.split(`,`),values=valueArray.map(val=>parseValues(val.endsWith(`)`)?val.replace(`)`,``):val.trim())),value$1=values.length===1?values[0]:values;return{...acc,[name$2]:value$1}},{})}function stateFromTransform$1(state,transform$2){Object.entries(parseTransform$1(transform$2)).forEach(([key$2,value$1])=>{let axes=[`x`,`y`,`z`];if(key$2===`translate3d`){if(value$1===0){axes.forEach(axis=>state[axis]=0);return}value$1.forEach((axisValue,index$1)=>state[axes[index$1]]=axisValue);return}if(value$1=Number.parseFloat(`${value$1}`),key$2===`translateX`){state.x=value$1;return}if(key$2===`translateY`){state.y=value$1;return}if(key$2===`translateZ`){state.z=value$1;return}state[key$2]=value$1})}function useElementTransform$1(target$1,onInit){let _cache$1,_target$1,{state,transform:transform$2}=reactiveTransform$1();return usePermissiveTarget$1(target$1,el=>{_target$1=el,el.style.transform&&stateFromTransform$1(state,el.style.transform),_cache$1&&(el.style.transform=_cache$1),onInit&&onInit(state)}),watch(transform$2,newValue=>{if(!_target$1){_cache$1=newValue;return}_target$1.style.transform=newValue},{immediate:!0}),{transform:state}}function objectEntries$1(obj){return Object.entries(obj)}function useMotionProperties$1(target$1,defaultValues){let motionProperties=reactive({}),apply$2=values=>Object.entries(values).forEach(([key$2,value$1])=>motionProperties[key$2]=value$1),{style}=useElementStyle$1(target$1,apply$2),{transform:transform$2}=useElementTransform$1(target$1,apply$2);return watch(motionProperties,newVal=>{objectEntries$1(newVal).forEach(([key$2,value$1])=>{let target2=isTransformProp$1(key$2)?transform$2:style;target2[key$2]&&target2[key$2]===value$1||(target2[key$2]=value$1)})},{immediate:!0,deep:!0}),usePermissiveTarget$1(target$1,()=>defaultValues&&apply$2(defaultValues)),{motionProperties,style,transform:transform$2}}function useMotionVariants$1(variants={}){let _variants=unref(variants),variant=ref(),state=computed(()=>{if(variant.value)return _variants[variant.value]});return{state,variant}}function useMotion$1(target$1,variants={},options$1){let{motionProperties}=useMotionProperties$1(target$1),{variant,state}=useMotionVariants$1(variants),controls=useMotionControls$1(motionProperties,variants),instance={target:target$1,variant,variants,state,motionProperties,...controls};return useMotionFeatures$1(instance,options$1),instance}const transitionKeys$1=[`delay`,`duration`],directivePropsKeys$1=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...transitionKeys$1];function isTransitionKey$1(val){return transitionKeys$1.includes(val)}function resolveVariants$1(node$1,variantsRef){let target$1=node$1.props?node$1.props:node$1.data&&node$1.data.attrs?node$1.data.attrs:{};if(target$1){target$1.variants&&isObject$2(target$1.variants)&&(variantsRef.value={...variantsRef.value,...target$1.variants});for(let key$2 of directivePropsKeys$1){if(!target$1||!target$1[key$2])continue;if(isTransitionKey$1(key$2)&&typeof target$1[key$2]==`number`){for(let variantKey of[`enter`,`visible`,`visibleOnce`]){let variantConfig=variantsRef.value[variantKey];if(variantConfig==null)continue;variantConfig.transition??={},variantConfig.transition[key$2]=target$1[key$2]}continue}if(isObject$2(target$1[key$2])){let prop=target$1[key$2];key$2===`visible-once`&&(key$2=`visibleOnce`),variantsRef.value[key$2]=prop}}}}function directive$1(variants,isPreset=!1){let register=(el,binding,node$1)=>{let key$2=binding.value&&typeof binding.value==`string`?binding.value:node$1.key;key$2&&motionState$1[key$2]&&motionState$1[key$2].stop();let variantsObject=isPreset?structuredClone(toRaw(variants)||{}):variants||{},variantsRef=ref(variantsObject);typeof binding.value==`object`&&(variantsRef.value=binding.value),resolveVariants$1(node$1,variantsRef);let motionOptions={eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1},motionInstance=useMotion$1(el,variantsRef,motionOptions);el.motionInstance=motionInstance,key$2&&(motionState$1[key$2]=motionInstance)},mounted=(el,_binding,_node)=>{el.motionInstance&®isterVisibilityHooks$1(el.motionInstance)};return{created:register,mounted,getSSRProps(binding,node$1){let{initial:bindingInitial}=binding.value||node$1&&node$1?.props||{};bindingInitial=unref(bindingInitial);let initial=defu({},variants?.initial||{},bindingInitial||{});if(!initial||Object.keys(initial).length===0)return;let style=variantToStyle$1(initial);return{style}}}}const fade$1={initial:{opacity:0},enter:{opacity:1}},fadeVisible$1={initial:{opacity:0},visible:{opacity:1}},fadeVisibleOnce$1={initial:{opacity:0},visibleOnce:{opacity:1}},pop$1={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},popVisible$1={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},popVisibleOnce$1={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},rollLeft$1={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollVisibleLeft$1={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceLeft$1={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollRight$1={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollVisibleRight$1={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceRight$1={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollTop$1={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleTop$1={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleOnceTop$1={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollBottom$1={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleBottom$1={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleOnceBottom$1={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},slideLeft$1={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},slideVisibleLeft$1={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceLeft$1={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},slideRight$1={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},slideVisibleRight$1={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceRight$1={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},slideTop$1={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},slideVisibleTop$1={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},slideVisibleOnceTop$1={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},slideBottom$1={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},slideVisibleBottom$1={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},slideVisibleOnceBottom$1={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},presets$1={__proto__:null,fade:fade$1,fadeVisible:fadeVisible$1,fadeVisibleOnce:fadeVisibleOnce$1,pop:pop$1,popVisible:popVisible$1,popVisibleOnce:popVisibleOnce$1,rollBottom:rollBottom$1,rollLeft:rollLeft$1,rollRight:rollRight$1,rollTop:rollTop$1,rollVisibleBottom:rollVisibleBottom$1,rollVisibleLeft:rollVisibleLeft$1,rollVisibleOnceBottom:rollVisibleOnceBottom$1,rollVisibleOnceLeft:rollVisibleOnceLeft$1,rollVisibleOnceRight:rollVisibleOnceRight$1,rollVisibleOnceTop:rollVisibleOnceTop$1,rollVisibleRight:rollVisibleRight$1,rollVisibleTop:rollVisibleTop$1,slideBottom:slideBottom$1,slideLeft:slideLeft$1,slideRight:slideRight$1,slideTop:slideTop$1,slideVisibleBottom:slideVisibleBottom$1,slideVisibleLeft:slideVisibleLeft$1,slideVisibleOnceBottom:slideVisibleOnceBottom$1,slideVisibleOnceLeft:slideVisibleOnceLeft$1,slideVisibleOnceRight:slideVisibleOnceRight$1,slideVisibleOnceTop:slideVisibleOnceTop$1,slideVisibleRight:slideVisibleRight$1,slideVisibleTop:slideVisibleTop$1};function slugify$1(str){let a$1=`àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;`,b$1=`aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------`,p$4=new RegExp(a$1.split(``).join(`|`),`g`);return str.toString().replace(/[A-Z]/g,s=>`-${s}`).toLowerCase().replace(/\s+/g,`-`).replace(p$4,c$3=>b$1.charAt(a$1.indexOf(c$3))).replace(/&/g,`-and-`).replace(/[^\w\-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+/,``).replace(/-+$/,``)}const CUSTOM_PRESETS$1=Symbol(``),MotionComponentProps$1={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function isObject$4(val){return Object.prototype.toString.call(val)===`[object Object]`}function clone$2(v){if(Array.isArray(v))return v.map(clone$2);if(isObject$4(v)){let res={};for(let key$2 in v)res[key$2]=clone$2(v[key$2]);return res}return v}function setupMotionComponent$1(props){let instances=reactive({}),customPresets=inject(CUSTOM_PRESETS$1,{}),preset=computed(()=>props.preset==null?{}:customPresets!=null&&props.preset in customPresets?structuredClone(toRaw(customPresets)[props.preset]):props.preset in presets$1?structuredClone(presets$1[props.preset]):{}),propsConfig=computed(()=>({initial:props.initial,enter:props.enter,leave:props.leave,visible:props.visible,visibleOnce:props.visibleOnce,hovered:props.hovered,tapped:props.tapped,focused:props.focused}));function applyTransitionHelpers(config$1,values){for(let transitionKey of[`delay`,`duration`]){if(values[transitionKey]==null)continue;let transitionValueParsed=Number.parseInt(values[transitionKey]);for(let variantKey of[`enter`,`visible`,`visibleOnce`]){let variantConfig=config$1[variantKey];if(variantConfig==null)continue;variantConfig.transition??={},variantConfig.transition[transitionKey]=transitionValueParsed}}return config$1}let motionConfig=computed(()=>{let config$1=defu({},propsConfig.value,preset.value,props.variants||{});return applyTransitionHelpers({...config$1},props)});function setNodeInstance(node$1,index$1,style){node$1.props??={},node$1.props.style??={},node$1.props.style={...node$1.props.style,...style};let elementMotionConfig=applyTransitionHelpers(clone$2(motionConfig.value),node$1.props);return node$1.props.onVnodeMounted=({el})=>{instances[index$1]=useMotion$1(el,elementMotionConfig)},node$1.props.onVnodeUpdated=({el})=>{let styles=variantToStyle$1(instances[index$1].state);for(let[key$2,val]of Object.entries(styles))el.style[key$2]=val},node$1}return{motionConfig,setNodeInstance}}const MotionComponent$1=defineComponent({name:`Motion`,props:{...MotionComponentProps$1,is:{type:[String,Object],default:`div`}},setup(props){let slots=useSlots(),{motionConfig,setNodeInstance}=setupMotionComponent$1(props);return()=>{let style=variantToStyle$1(motionConfig.value.initial||{}),node$1=h(props.is,void 0,slots);return setNodeInstance(node$1,0,style),node$1}}}),MotionGroupComponent$1=defineComponent({name:`MotionGroup`,props:{...MotionComponentProps$1,is:{type:[String,Object],required:!1}},setup(props){let slots=useSlots(),{motionConfig,setNodeInstance}=setupMotionComponent$1(props);return()=>{let style=variantToStyle$1(motionConfig.value.initial||{}),nodes=slots.default?.()||[];for(let i=0;iactivePinia=pinia$1,getActivePinia=()=>hasInjectionContext()&&inject(piniaSymbol)||activePinia,piniaSymbol=Symbol();function isPlainObject$5(o){return o&&typeof o==`object`&&Object.prototype.toString.call(o)===`[object Object]`&&typeof o.toJSON!=`function`}var MutationType;(function(MutationType$1){MutationType$1.direct=`direct`,MutationType$1.patchObject=`patch object`,MutationType$1.patchFunction=`patch function`})(MutationType||={});const IS_CLIENT=typeof window<`u`,_global=(()=>typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null})();function bom(blob,{autoBom=!1}={}){return autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)?new Blob([``,blob],{type:blob.type}):blob}function download(url,name$2,opts){let xhr=new XMLHttpRequest;xhr.open(`GET`,url),xhr.responseType=`blob`,xhr.onload=function(){saveAs(xhr.response,name$2,opts)},xhr.onerror=function(){console.error(`could not download file`)},xhr.send()}function corsEnabled(url){let xhr=new XMLHttpRequest;xhr.open(`HEAD`,url,!1);try{xhr.send()}catch{}return xhr.status>=200&&xhr.status<=299}function click(node$1){try{node$1.dispatchEvent(new MouseEvent(`click`))}catch{let evt=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});node$1.dispatchEvent(evt)}}const _navigator=typeof navigator==`object`?navigator:{userAgent:``},isMacOSWebView=(()=>/Macintosh/.test(_navigator.userAgent)&&/AppleWebKit/.test(_navigator.userAgent)&&!/Safari/.test(_navigator.userAgent))(),saveAs=IS_CLIENT?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!isMacOSWebView?downloadSaveAs:`msSaveOrOpenBlob`in _navigator?msSaveAs:fileSaverSaveAs:()=>{};function downloadSaveAs(blob,name$2=`download`,opts){let a$1=document.createElement(`a`);a$1.download=name$2,a$1.rel=`noopener`,typeof blob==`string`?(a$1.href=blob,a$1.origin===location.origin?click(a$1):corsEnabled(a$1.href)?download(blob,name$2,opts):(a$1.target=`_blank`,click(a$1))):(a$1.href=URL.createObjectURL(blob),setTimeout(function(){URL.revokeObjectURL(a$1.href)},4e4),setTimeout(function(){click(a$1)},0))}function msSaveAs(blob,name$2=`download`,opts){if(typeof blob==`string`)if(corsEnabled(blob))download(blob,name$2,opts);else{let a$1=document.createElement(`a`);a$1.href=blob,a$1.target=`_blank`,setTimeout(function(){click(a$1)})}else navigator.msSaveOrOpenBlob(bom(blob,opts),name$2)}function fileSaverSaveAs(blob,name$2,opts,popup){if(popup||=open(``,`_blank`),popup&&(popup.document.title=popup.document.body.innerText=`downloading...`),typeof blob==`string`)return download(blob,name$2,opts);let force=blob.type===`application/octet-stream`,isSafari=/constructor/i.test(String(_global.HTMLElement))||`safari`in _global,isChromeIOS=/CriOS\/[\d]+/.test(navigator.userAgent);if((isChromeIOS||force&&isSafari||isMacOSWebView)&&typeof FileReader<`u`){let reader=new FileReader;reader.onloadend=function(){let url=reader.result;if(typeof url!=`string`)throw popup=null,Error(`Wrong reader.result type`);url=isChromeIOS?url:url.replace(/^data:[^;]*;/,`data:attachment/file;`),popup?popup.location.href=url:location.assign(url),popup=null},reader.readAsDataURL(blob)}else{let url=URL.createObjectURL(blob);popup?popup.location.assign(url):location.href=url,popup=null,setTimeout(function(){URL.revokeObjectURL(url)},4e4)}}const componentStateTypes=[],MUTATIONS_LAYER_ID=`pinia:mutations`,INSPECTOR_ID=`pinia`,{assign:assign$1$1}=Object,getStoreType=id=>`🍍 `+id;function createPinia(){let scope$1=effectScope(!0),state=scope$1.run(()=>ref({})),_p=[],toBeInstalled=[],pinia$1=markRaw({install(app){setActivePinia(pinia$1),pinia$1._a=app,app.provide(piniaSymbol,pinia$1),app.config.globalProperties.$pinia=pinia$1,toBeInstalled.forEach(plugin=>_p.push(plugin)),toBeInstalled=[]},use(plugin){return this._a?_p.push(plugin):toBeInstalled.push(plugin),this},_p,_a:null,_e:scope$1,_s:new Map,state});return pinia$1}const noop$2=()=>{};function addSubscription(subscriptions,callback,detached,onCleanup=noop$2){subscriptions.push(callback);let removeSubscription=()=>{let idx=subscriptions.indexOf(callback);idx>-1&&(subscriptions.splice(idx,1),onCleanup())};return!detached&&getCurrentScope()&&onScopeDispose(removeSubscription),removeSubscription}function triggerSubscriptions(subscriptions,...args){subscriptions.slice().forEach(callback=>{callback(...args)})}const fallbackRunWithContext=fn$5=>fn$5(),ACTION_MARKER=Symbol(),ACTION_NAME=Symbol();function mergeReactiveObjects(target$1,patchToApply){for(let key$2 in target$1 instanceof Map&&patchToApply instanceof Map?patchToApply.forEach((value$1,key$2)=>target$1.set(key$2,value$1)):target$1 instanceof Set&&patchToApply instanceof Set&&patchToApply.forEach(target$1.add,target$1),patchToApply){if(!patchToApply.hasOwnProperty(key$2))continue;let subPatch=patchToApply[key$2],targetValue=target$1[key$2];isPlainObject$5(targetValue)&&isPlainObject$5(subPatch)&&target$1.hasOwnProperty(key$2)&&!isRef(subPatch)&&!isReactive(subPatch)?target$1[key$2]=mergeReactiveObjects(targetValue,subPatch):target$1[key$2]=subPatch}return target$1}const skipHydrateSymbol=Symbol();function shouldHydrate(obj){return!isPlainObject$5(obj)||!Object.prototype.hasOwnProperty.call(obj,skipHydrateSymbol)}const{assign:assign$2}=Object;function isComputed(o){return!!(isRef(o)&&o.effect)}function createOptionsStore(id,options$1,pinia$1,hot){let{state,actions,getters}=options$1,initialState=pinia$1.state.value[id],store;function setup(){initialState||(pinia$1.state.value[id]=state?state():{});let localState=toRefs(pinia$1.state.value[id]);return assign$2(localState,actions,Object.keys(getters||{}).reduce((computedGetters,name$2)=>(computedGetters[name$2]=markRaw(computed(()=>{setActivePinia(pinia$1);let store$1=pinia$1._s.get(id);return getters[name$2].call(store$1,store$1)})),computedGetters),{}))}return store=createSetupStore(id,setup,options$1,pinia$1,hot,!0),store}function createSetupStore($id,setup,options$1={},pinia$1,hot,isOptionsStore){let scope$1,optionsForPlugin=assign$2({actions:{}},options$1),$subscribeOptions={deep:!0},isListening,isSyncListening,subscriptions=[],actionSubscriptions=[],debuggerEvents,initialState=pinia$1.state.value[$id];!isOptionsStore&&!initialState&&(pinia$1.state.value[$id]={});let hotState=ref({}),activeListener;function $patch(partialStateOrMutator){let subscriptionMutation;isListening=isSyncListening=!1,typeof partialStateOrMutator==`function`?(partialStateOrMutator(pinia$1.state.value[$id]),subscriptionMutation={type:MutationType.patchFunction,storeId:$id,events:debuggerEvents}):(mergeReactiveObjects(pinia$1.state.value[$id],partialStateOrMutator),subscriptionMutation={type:MutationType.patchObject,payload:partialStateOrMutator,storeId:$id,events:debuggerEvents});let myListenerId=activeListener=Symbol();nextTick().then(()=>{activeListener===myListenerId&&(isListening=!0)}),isSyncListening=!0,triggerSubscriptions(subscriptions,subscriptionMutation,pinia$1.state.value[$id])}let $reset=isOptionsStore?function(){let{state}=options$1,newState=state?state():{};this.$patch($state=>{assign$2($state,newState)})}:noop$2;function $dispose(){scope$1.stop(),subscriptions=[],actionSubscriptions=[],pinia$1._s.delete($id)}let action=(fn$5,name$2=``)=>{if(ACTION_MARKER in fn$5)return fn$5[ACTION_NAME]=name$2,fn$5;let wrappedAction=function(){setActivePinia(pinia$1);let args=Array.from(arguments),afterCallbackList=[],onErrorCallbackList=[];function after(callback){afterCallbackList.push(callback)}function onError(callback){onErrorCallbackList.push(callback)}triggerSubscriptions(actionSubscriptions,{args,name:wrappedAction[ACTION_NAME],store,after,onError});let ret;try{ret=fn$5.apply(this&&this.$id===$id?this:store,args)}catch(error){throw triggerSubscriptions(onErrorCallbackList,error),error}return ret instanceof Promise?ret.then(value$1=>(triggerSubscriptions(afterCallbackList,value$1),value$1)).catch(error=>(triggerSubscriptions(onErrorCallbackList,error),Promise.reject(error))):(triggerSubscriptions(afterCallbackList,ret),ret)};return wrappedAction[ACTION_MARKER]=!0,wrappedAction[ACTION_NAME]=name$2,wrappedAction},partialStore={_p:pinia$1,$id,$onAction:addSubscription.bind(null,actionSubscriptions),$patch,$reset,$subscribe(callback,options$2={}){let removeSubscription=addSubscription(subscriptions,callback,options$2.detached,()=>stopWatcher()),stopWatcher=scope$1.run(()=>watch(()=>pinia$1.state.value[$id],state=>{(options$2.flush===`sync`?isSyncListening:isListening)&&callback({storeId:$id,type:MutationType.direct,events:debuggerEvents},state)},assign$2({},$subscribeOptions,options$2)));return removeSubscription},$dispose},store=reactive(partialStore);pinia$1._s.set($id,store);let runWithContext=pinia$1._a&&pinia$1._a.runWithContext||fallbackRunWithContext,setupStore=runWithContext(()=>pinia$1._e.run(()=>(scope$1=effectScope()).run(()=>setup({action}))));for(let key$2 in setupStore){let prop=setupStore[key$2];if(isRef(prop)&&!isComputed(prop)||isReactive(prop))isOptionsStore||(initialState&&shouldHydrate(prop)&&(isRef(prop)?prop.value=initialState[key$2]:mergeReactiveObjects(prop,initialState[key$2])),pinia$1.state.value[$id][key$2]=prop);else if(typeof prop==`function`){let actionValue=action(prop,key$2);setupStore[key$2]=actionValue,optionsForPlugin.actions[key$2]=prop}}return assign$2(store,setupStore),assign$2(toRaw(store),setupStore),Object.defineProperty(store,`$state`,{get:()=>pinia$1.state.value[$id],set:state=>{$patch($state=>{assign$2($state,state)})}}),pinia$1._p.forEach(extender=>{assign$2(store,scope$1.run(()=>extender({store,app:pinia$1._a,pinia:pinia$1,options:optionsForPlugin})))}),initialState&&isOptionsStore&&options$1.hydrate&&options$1.hydrate(store.$state,initialState),isListening=!0,isSyncListening=!0,store} /*! #__NO_SIDE_EFFECTS__ */ -function defineStore(id,setup,setupOptions){let options$1,isSetupStore=typeof setup==`function`;options$1=isSetupStore?setupOptions:setup;function useStore(pinia$1,hot){let hasContext=hasInjectionContext();pinia$1||=hasContext?inject(piniaSymbol,null):null,pinia$1&&setActivePinia(pinia$1),pinia$1=activePinia,!pinia$1._s.has(id)&&(isSetupStore?createSetupStore(id,setup,options$1,pinia$1):createOptionsStore(id,options$1,pinia$1));let store=pinia$1._s.get(id);return store}return useStore.$id=id,useStore}function storeToRefs(store){let rawStore=toRaw(store),refs={};for(let key$2 in rawStore){let value$1=rawStore[key$2];value$1.effect?refs[key$2]=computed({get:()=>store[key$2],set(value$2){store[key$2]=value$2}}):(isRef(value$1)||isReactive(value$1))&&(refs[key$2]=toRef(store,key$2))}return refs}const scriptRel=`modulepreload`,assetsURL=function(dep){return`/`+dep},seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let links=document.getElementsByTagName(`link`),cspNonceMeta=document.querySelector(`meta[property=csp-nonce]`),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(`nonce`);function allSettled(promises$2){return Promise.all(promises$2.map(p$1$1=>Promise.resolve(p$1$1).then(value$1=>({status:`fulfilled`,value:value$1}),reason=>({status:`rejected`,reason}))))}promise=allSettled(deps.map(dep=>{if(dep=assetsURL(dep,importerUrl),dep in seen)return;seen[dep]=!0;let isCss=dep.endsWith(`.css`),cssSelector=isCss?`[rel="stylesheet"]`:``,isBaseRelative=!!importerUrl;if(isBaseRelative)for(let i$1=links.length-1;i$1>=0;i$1--){let link$1$1=links[i$1];if(link$1$1.href===dep&&(!isCss||link$1$1.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;let link$1=document.createElement(`link`);if(link$1.rel=isCss?`stylesheet`:scriptRel,isCss||(link$1.as=`script`),link$1.crossOrigin=``,link$1.href=dep,cspNonce&&link$1.setAttribute(`nonce`,cspNonce),document.head.appendChild(link$1),isCss)return new Promise((res,rej)=>{link$1.addEventListener(`load`,res),link$1.addEventListener(`error`,()=>rej(Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){let e$1$1=new Event(`vite:preloadError`,{cancelable:!0});if(e$1$1.payload=err$2,window.dispatchEvent(e$1$1),!e$1$1.defaultPrevented)throw err$2}return promise.then(res=>{for(let item of res||[]){if(item.status!==`rejected`)continue;handlePreloadError(item.reason)}return baseModule().catch(handlePreloadError)})},setupLayouts=routes$1=>{let layouts={},modules=Object.assign({"/src/layouts/default.vue":()=>__vitePreload(()=>import(`./default-DkdbeVDA.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>__vitePreload(()=>import(`./home-YPkPvYfc.js`),[]),"/src/layouts/plain.vue":()=>__vitePreload(()=>import(`./plain-CAqIfj7b.js`),[]),"/src/layouts/settings.vue":()=>__vitePreload(()=>import(`./settings-XapIzgYq.js`),__vite__mapDeps([3,1,2,4])),"/src/layouts/stage.vue":()=>__vitePreload(()=>import(`./stage-DXskS9T5.js`),[])});Object.entries(modules).forEach(([name$2,module$1])=>{let key$2=name$2.replace(`/src/layouts/`,``).replace(`.vue`,``);layouts[key$2]=module$1});function deepSetupLayout(routes$2,top=!0){return routes$2.map(route=>{if(route.children?.length>0&&(route.children=deepSetupLayout(route.children,!1)),top){let skipLayout=!route.component&&route.children?.find(r$1=>(r$1.path===``||r$1.path===`/`)&&r$1.meta?.isLayout);if(skipLayout)return route;if(route.meta?.layout!==!1)return{path:route.path,component:layouts[route.meta?.layout||`default`],children:route.path===`/`?[route]:[{...route,path:``}],meta:{isLayout:!0}}}return route.meta?.layout?{path:route.path,component:layouts[route.meta?.layout],children:[{...route,path:``}],meta:{isLayout:!0}}:route})}return deepSetupLayout(routes$1)},isBrowser$2=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}const assign$1=Object.assign;function applyToParams(fn$5,params){let newParams={};for(let key$2 in params){let value$1=params[key$2];newParams[key$2]=isArray$3(value$1)?value$1.map(fn$5):fn$5(value$1)}return newParams}const noop$1=()=>{},isArray$3=Array.isArray,HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text$5){return encodeURI(``+text$5).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text$5){return commonEncode(text$5).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text$5){return commonEncode(text$5).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text$5){return encodeQueryValue(text$5).replace(EQUAL_RE,`%3D`)}function encodePath(text$5){return commonEncode(text$5).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text$5){return text$5==null?``:encodePath(text$5).replace(SLASH_RE,`%2F`)}function decode$1(text$5){try{return decodeURIComponent(``+text$5)}catch{}return``+text$5}const TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return hashPos=0&&(searchPos=-1),searchPos>-1&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos+1,hashPos>-1?hashPos:location$1.length),query=parseQuery$1(searchString)),hashPos>-1&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+(searchString&&`?`)+searchString+hash,path,query,hash:decode$1(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$1,b$1){let aLastIndex=a$1.matched.length-1,bLastIndex=b$1.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$1.matched[aLastIndex],b$1.matched[bLastIndex])&&isSameRouteLocationParams(a$1.params,b$1.params)&&stringifyQuery$1(a$1.query)===stringifyQuery$1(b$1.query)&&a$1.hash===b$1.hash}function isSameRouteRecord(a$1,b$1){return(a$1.aliasOf||a$1)===(b$1.aliasOf||b$1)}function isSameRouteLocationParams(a$1,b$1){if(Object.keys(a$1).length!==Object.keys(b$1).length)return!1;for(let key$2 in a$1)if(!isSameRouteLocationParamsValue(a$1[key$2],b$1[key$2]))return!1;return!0}function isSameRouteLocationParamsValue(a$1,b$1){return isArray$3(a$1)?isEquivalentArray(a$1,b$1):isArray$3(b$1)?isEquivalentArray(b$1,a$1):a$1===b$1}function isEquivalentArray(a$1,b$1){return isArray$3(b$1)?a$1.length===b$1.length&&a$1.every((value$1,i)=>value$1===b$1[i]):a$1.length===1&&a$1[0]===b$1}function resolveRelativePath(to$1,from){if(to$1.startsWith(`/`))return to$1;if(!to$1)return from;let fromSegments=from.split(`/`),toSegments=to$1.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position$2=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position$2--;else break;return fromSegments.slice(0,position$2).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}const START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var NavigationType;(function(NavigationType$1){NavigationType$1.pop=`pop`,NavigationType$1.push=`push`})(NavigationType||={});var NavigationDirection;(function(NavigationDirection$1){NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``})(NavigationDirection||={});function normalizeBase(base){if(!base)if(isBrowser$2){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}const BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}const computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position$2){let scrollToOptions;if(`el`in position$2){let positionEl=position$2.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position$2)}else scrollToOptions=position$2;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){let position$2=history.state?history.state.position-delta:-1;return position$2+path}const scrollPositions=new Map;function saveScrollPosition(key$2,scrollPosition){scrollPositions.set(key$2,scrollPosition)}function getSavedScrollPosition(key$2){let scroll=scrollPositions.get(key$2);return scrollPositions.delete(key$2),scroll}let createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}let path=stripBase(pathname,base);return path+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to$1=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to$1,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to$1);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index$1=listeners.indexOf(callback);index$1>-1&&listeners.splice(index$1,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){let{history:history$1}=window;history$1.state&&history$1.replaceState(assign$1({},history$1.state,{scroll:computeScrollPosition()}),``)}function destroy(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`beforeunload`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`beforeunload`,beforeUnloadListener,{passive:!0}),{pauseListeners,listen,destroy}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to$1,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to$1:createBaseLocation()+base+to$1;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to$1,data$12){let state=assign$1({},history$1.state,buildState(historyState.value.back,to$1,historyState.value.forward,!0),data$12,{position:historyState.value.position});changeLocation(to$1,state,!0),currentLocation.value=to$1}function push$1(to$1,data$12){let currentState=assign$1({},historyState.value,history$1.state,{forward:to$1,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0);let state=assign$1({},buildState(currentLocation.value,to$1,null),{position:currentState.position+1},data$12);changeLocation(to$1,state,!1),currentLocation.value=to$1}return{location:currentLocation,state:historyState,push:push$1,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign$1({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,!base.includes(`#`)&&(base+=`#`),createWebHistory(base)}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name$2){return typeof name$2==`string`||typeof name$2==`symbol`}const NavigationFailureSymbol=Symbol(``);var NavigationFailureType;(function(NavigationFailureType$1){NavigationFailureType$1[NavigationFailureType$1.aborted=4]=`aborted`,NavigationFailureType$1[NavigationFailureType$1.cancelled=8]=`cancelled`,NavigationFailureType$1[NavigationFailureType$1.duplicated=16]=`duplicated`})(NavigationFailureType||={});function createRouterError(type,params){return assign$1(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}const BASE_PARAM_PATTERN=`[^/]+?`,BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(segments,extraOptions){let options$1=assign$1({},BASE_PATH_PARSER_OPTIONS,extraOptions),score=[],pattern=options$1.start?`^`:``,keys$3=[];for(let segment of segments){let segmentScores=segment.length?[]:[90];options$1.strict&&!segment.length&&(pattern+=`/`);for(let tokenIndex=0;tokenIndexb$1.length?b$1.length===1&&b$1[0]===80?1:-1:0}function comparePathParserScore(a$1,b$1){let i=0,aScore=a$1.score,bScore=b$1.score;for(;i0&&last[last.length-1]<0}const ROOT_TOKEN={type:0,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message$1){throw Error(`ERR (${state})/"${buffer$1}": ${message$1}`)}let state=0,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&(state===0?segment.push({type:0,value:buffer$1}):state===1||state===2||state===3?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:1,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),buffer$1=``)}function addCharToBuffer(){buffer$1+=char}for(;i{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index$1=matchers.indexOf(matcherRef);index$1>-1&&(matchers.splice(index$1,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index$1=findInsertionIndex(matcher,matchers);matchers.splice(index$1,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name$2;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(1,{location:location$1});name$2=matcher.record.name,params=assign$1(paramsFromLocation(currentLocation.params,matcher.keys.filter(k$3=>!k$3.optional).concat(matcher.parent?matcher.parent.keys.filter(k$3=>k$3.optional):[]).map(k$3=>k$3.name)),location$1.params&¶msFromLocation(location$1.params,matcher.keys.map(k$3=>k$3.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m=>m.re.test(path)),matcher&&(params=matcher.parse(path),name$2=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path)),!matcher)throw createRouterError(1,{location:location$1,currentLocation});name$2=matcher.record.name,params=assign$1({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name:name$2,path,params,matched,meta:mergeMetaFields(matched)}}routes$1.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function paramsFromLocation(params,keys$3){let newParams={};for(let key$2 of keys$3)key$2 in params&&(newParams[key$2]=params[key$2]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name$2 in record.components)propsObject[name$2]=typeof props==`object`?props[name$2]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign$1(meta,record.meta),{})}function mergeOptions(defaults$1,partialOptions){let options$1={};for(let key$2 in defaults$1)options$1[key$2]=key$2 in partialOptions?partialOptions[key$2]:defaults$1[key$2];return options$1}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1,sortOrder=comparePathParserScore(matcher,matchers[mid]);sortOrder<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let hasLeadingIM=search$1[0]===`?`,searchParams=(hasLeadingIM?search$1.slice(1):search$1).split(`&`);for(let i=0;iv&&encodeQueryValue(v)):[value$1&&encodeQueryValue(value$1)];values.forEach(value$2=>{value$2!==void 0&&(search$1+=(search$1.length?`&`:``)+key$2,value$2!=null&&(search$1+=`=`+value$2))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key$2 in query){let value$1=query[key$2];value$1!==void 0&&(normalizedQuery[key$2]=isArray$3(value$1)?value$1.map(v=>v==null?null:``+v):value$1==null?value$1:``+value$1)}return normalizedQuery}const matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$3=[];function add$1(handler){return handlers$3.push(handler),()=>{let i=handlers$3.indexOf(handler);i>-1&&handlers$3.splice(i,1)}}function reset(){handlers$3=[]}return{add:add$1,list:()=>handlers$3.slice(),reset}}function guardToPromiseFn(guard,to$1,from,record,name$2,runWithContext=fn$5=>fn$5()){let enterCallbackArray=record&&(record.enterCallbacks[name$2]=record.enterCallbacks[name$2]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid$1=>{valid$1===!1?reject(createRouterError(4,{from,to:to$1})):valid$1 instanceof Error?reject(valid$1):isRouteLocation(valid$1)?reject(createRouterError(2,{from:to$1,to:valid$1})):(enterCallbackArray&&record.enterCallbacks[name$2]===enterCallbackArray&&typeof valid$1==`function`&&enterCallbackArray.push(valid$1),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name$2],to$1,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to$1,from,runWithContext=fn$5=>fn$5()){let guards=[];for(let record of matched)for(let name$2 in record.components){let rawComponent=record.components[name$2];if(guardType!==`beforeRouteEnter`&&!record.instances[name$2])continue;if(isRouteComponent(rawComponent)){let options$1=rawComponent.__vccOpts||rawComponent,guard=options$1[guardType];guard&&guards.push(guardToPromiseFn(guard,to$1,from,record,name$2,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name$2}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name$2]=resolved,record.components[name$2]=resolvedComponent;let options$1=resolvedComponent.__vccOpts||resolvedComponent,guard=options$1[guardType];return guard&&guardToPromiseFn(guard,to$1,from,record,name$2,runWithContext)()}))}}return guards}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),route=computed(()=>{let to$1=unref(props.to);return router$1.resolve(to$1)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index$1=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index$1>-1)return index$1;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index$1}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate(e$4={}){if(guardEvent(e$4)){let p$4=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$4),p$4}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}const RouterLinkImpl=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link$1=reactive(useLink(props)),{options:options$1}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options$1.linkActiveClass,`router-link-active`)]:link$1.isActive,[getLinkClass(props.exactActiveClass,options$1.linkExactActiveClass,`router-link-exact-active`)]:link$1.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link$1));return props.custom?children:h(`a`,{"aria-current":link$1.isExactActive?props.ariaCurrentValue:null,href:link$1.href,onClick:link$1.navigate,class:elClass.value},children)}}}),RouterLink=RouterLinkImpl;function guardEvent(e$4){if(!(e$4.metaKey||e$4.altKey||e$4.ctrlKey||e$4.shiftKey)&&!e$4.defaultPrevented&&!(e$4.button!==void 0&&e$4.button!==0)){if(e$4.currentTarget&&e$4.currentTarget.getAttribute){let target$1=e$4.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target$1))return}return e$4.preventDefault&&e$4.preventDefault(),!0}}function includesParams(outer,inner){for(let key$2 in inner){let innerValue=inner[key$2],outerValue=outer[key$2];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray$3(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value$1,i)=>value$1!==outerValue[i]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}const getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance,to$1,name$2],[oldInstance,from,oldName])=>{to$1&&(to$1.instances[name$2]=instance,from&&from!==to$1&&instance&&instance===oldInstance&&(to$1.leaveGuards.size||(to$1.leaveGuards=from.leaveGuards),to$1.updateGuards.size||(to$1.updateGuards=from.updateGuards))),instance&&to$1&&(!from||!isSameRouteRecord(to$1,from)||!oldInstance)&&(to$1.enterCallbacks[name$2]||[]).forEach(callback=>callback(instance))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],routeProps=routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,onVnodeUnmounted=vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},component=h(ViewComponent,assign$1({},routeProps,attrs,{onVnodeUnmounted,ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data$12){if(!slot)return null;let slotContent=slot(data$12);return slotContent.length===1?slotContent[0]:slotContent}const RouterView=RouterViewImpl;function createRouter(options$1){let matcher=createRouterMatcher(options$1.routes,options$1),parseQuery$1=options$1.parseQuery||parseQuery,stringifyQuery$1=options$1.stringifyQuery||stringifyQuery,routerHistory=options$1.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser$2&&options$1.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams$1=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode$1);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name$2){let recordMatcher=matcher.getRecordMatcher(name$2);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name$2){return!!matcher.getRecordMatcher(name$2)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign$1({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign$1(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode$1(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign$1({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign$1({},rawLocation.params);for(let key$2 in targetParams)targetParams[key$2]??delete targetParams[key$2];matcherLocation=assign$1({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams$1(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign$1({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign$1({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to$1){return typeof to$1==`string`?parseURL(parseQuery$1,to$1,currentRoute.value.path):assign$1({},to$1)}function checkCanceledNavigation(to$1,from){if(pendingLocation!==to$1)return createRouterError(8,{from,to:to$1})}function push$1(to$1){return pushWithRedirect(to$1)}function replace(to$1){return push$1(assign$1(locationAsObject(to$1),{replace:!0}))}function handleRedirectRecord(to$1){let lastMatched=to$1.matched[to$1.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to$1):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign$1({query:to$1.query,hash:to$1.hash,params:newTargetLocation.path==null?to$1.params:{}},newTargetLocation)}}function pushWithRedirect(to$1,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to$1),from=currentRoute.value,data$12=to$1.state,force=to$1.force,replace$1=to$1.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation);if(shouldRedirect)return pushWithRedirect(assign$1(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign$1({},data$12,shouldRedirect.state):data$12,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(16,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,2)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,2))return pushWithRedirect(assign$1({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign$1({},data$12,failure$1.to.state):data$12,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data$12);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to$1,from){let error=checkCanceledNavigation(to$1,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn$5){let app=installedApps.values().next().value;return app&&typeof app.runWithContext==`function`?app.runWithContext(fn$5):fn$5()}function navigate(to$1,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to$1,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to$1,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$1,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to$1,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to$1,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to$1,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$1,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray$3(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to$1,from));else guards.push(guardToPromiseFn(record.beforeEnter,to$1,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to$1.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to$1,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to$1,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to$1,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to$1,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data$12){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser$2?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign$1({scroll:isFirstNavigation&&state&&state.scroll},data$12)):routerHistory.push(toLocation.fullPath,data$12)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to$1,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to$1),shouldRedirect=handleRedirectRecord(toLocation);if(shouldRedirect){pushWithRedirect(assign$1(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser$2&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate(toLocation,from).catch(error=>isNavigationFailure(error,12)?error:isNavigationFailure(error,2)?(pushWithRedirect(assign$1(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,20)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,8)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,20)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to$1,from){markAsReady(error);let list$2=errorListeners.list();return list$2.length?list$2.forEach(handler=>handler(error,to$1,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$2,reject)=>{readyHandlers.add([resolve$2,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$2,reject])=>err?reject(err):resolve$2()),readyHandlers.reset()),err}function handleScroll(to$1,from,isPush,isFirstNavigation){let{scrollBehavior}=options$1;if(!isBrowser$2||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to$1.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to$1,from,scrollPosition)).then(position$2=>position$2&&scrollToPosition(position$2)).catch(err=>triggerError(err,to$1,from))}let go=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options:options$1,push:push$1,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app){let router$2=this;app.component(`RouterLink`,RouterLink),app.component(`RouterView`,RouterView),app.config.globalProperties.$router=router$2,Object.defineProperty(app.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser$2&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push$1(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key$2 in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key$2,{get:()=>currentRoute.value[key$2],enumerable:!0});app.provide(routerKey,router$2),app.provide(routeLocationKey,shallowReactive(reactiveRoute)),app.provide(routerViewLocationKey,currentRoute);let unmountApp=app.unmount;installedApps.add(app),app.unmount=function(){installedApps.delete(app),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function extractChangingRecords(to$1,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to$1.matched.length);for(let i=0;iisSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to$1.matched[i];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}const routes=[{path:`/`,name:`IndexScenePage`,component:()=>__vitePreload(()=>import(`./pages-DCVmkLmw.js`),__vite__mapDeps([5,6,1,2,7,8,9,10,11,12,4])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>__vitePreload(()=>import(`./_...all_-Czwo4IOt.js`),[])},{path:`/audio`,name:`/audio`,component:()=>__vitePreload(()=>import(`./audio-DFFpt6Vn.js`),[])},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>__vitePreload(()=>import(`./audio-record-OOMepqWr.js`),[])},{path:`background-gradient-blending`,name:`/devtools/background-gradient-blending`,component:()=>__vitePreload(()=>import(`./background-gradient-blending-BBSUXTlB.js`),__vite__mapDeps([13,4,14,15]))},{path:`background-remove`,name:`/devtools/background-remove`,component:()=>__vitePreload(()=>import(`./background-remove-0JZi3Enw.js`),__vite__mapDeps([16,17,18]))},{path:`chat`,name:`/devtools/chat`,component:()=>__vitePreload(()=>import(`./chat-D1aTQy3Z.js`),[])},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>__vitePreload(()=>import(`./gesture-circle-uev4Cm8I.js`),__vite__mapDeps([19,12])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>__vitePreload(()=>import(`./image-D4na5vq2.js`),__vite__mapDeps([20,21]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>__vitePreload(()=>import(`./polaroid-D7wvNIY_.js`),__vite__mapDeps([22,7,8,9]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>__vitePreload(()=>import(`./vibrant-BBcDcY4H.js`),__vite__mapDeps([23,14,18]))}]},{path:`/queue`,name:`/queue`,component:()=>__vitePreload(()=>import(`./queue-B8eo5pBS.js`),[])},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>__vitePreload(()=>import(`./settings-DZLC48Fg.js`),__vite__mapDeps([24,12,25])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>__vitePreload(()=>import(`./airi-card-Dt8lnkmS.js`),__vite__mapDeps([26,12,27,28,29,30,31,32,33,18])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>__vitePreload(()=>import(`./CardCreate-DNezsN8h.js`),__vite__mapDeps([34,27]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>__vitePreload(()=>import(`./CardCreationDialog-zZ6xk9W3.js`),__vite__mapDeps([35,28,29,30]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>__vitePreload(()=>import(`./CardDetailDialog-h5b58PK2.js`),__vite__mapDeps([36,31,32,29]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>__vitePreload(()=>import(`./CardListItem-DcGJophG.js`),__vite__mapDeps([37,33]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>__vitePreload(()=>import(`./DeleteCardDialog-emOJOrss.js`),__vite__mapDeps([38,32,29]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>__vitePreload(()=>import(`./appearance--O06LEpn.js`),__vite__mapDeps([39,12])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>__vitePreload(()=>import(`./color-scheme-CG_WOyF8.js`),__vite__mapDeps([40,12,41])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>__vitePreload(()=>import(`./developer-HmG7Pz8z.js`),__vite__mapDeps([42,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>__vitePreload(()=>import(`./general-a1pJgmhe.js`),__vite__mapDeps([43,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>__vitePreload(()=>import(`./memory-Cz1bx8kl.js`),__vite__mapDeps([44,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>__vitePreload(()=>import(`./models-FPOqD7a1.js`),__vite__mapDeps([45,12,25,46,7,8,9,14])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>__vitePreload(()=>import(`./modules-Butv2iNA.js`),__vite__mapDeps([47,12,25,46])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>__vitePreload(()=>import(`./consciousness-CcGtuK1e.js`),__vite__mapDeps([48,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>__vitePreload(()=>import(`./hearing-6WR66KfG.js`),__vite__mapDeps([49,12,17])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>__vitePreload(()=>import(`./memory-long-term-aOPg0SoZ.js`),__vite__mapDeps([50,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>__vitePreload(()=>import(`./memory-short-term-3rd3oGvN.js`),__vite__mapDeps([51,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>__vitePreload(()=>import(`./speech-CKJ0G9iZ.js`),__vite__mapDeps([52,12,10,53])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>__vitePreload(()=>import(`./providers-piPjwyiC.js`),__vite__mapDeps([54,12,25,46])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>__vitePreload(()=>import(`./alibaba-cloud-model-studio-CQtjyEa_.js`),__vite__mapDeps([55,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>__vitePreload(()=>import(`./anthropic-B5Rr8xN4.js`),__vite__mapDeps([56,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/azure-ai-foundry`,component:()=>__vitePreload(()=>import(`./azure-ai-foundry-BUeB-9vc.js`),__vite__mapDeps([57,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>__vitePreload(()=>import(`./cloudflare-workers-ai-BXiaJYup.js`),__vite__mapDeps([58,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>__vitePreload(()=>import(`./deepseek-BlcTFZgO.js`),__vite__mapDeps([59,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>__vitePreload(()=>import(`./elevenlabs-Bjs_ey_R.js`),__vite__mapDeps([60,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>__vitePreload(()=>import(`./featherless-ai-s6uvg7Qq.js`),__vite__mapDeps([61,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>__vitePreload(()=>import(`./fireworks-ai-CO6L0o7G.js`),__vite__mapDeps([62,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>__vitePreload(()=>import(`./google-generative-ai-D1AeaCUG.js`),__vite__mapDeps([63,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>__vitePreload(()=>import(`./microsoft-speech-bW0zpaDE.js`),__vite__mapDeps([64,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>__vitePreload(()=>import(`./mistral-ai-BtAe5JTJ.js`),__vite__mapDeps([65,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>__vitePreload(()=>import(`./moonshot-ai-BTmYBRPo.js`),__vite__mapDeps([66,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>__vitePreload(()=>import(`./novita-ai-DrCt992g.js`),__vite__mapDeps([67,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>__vitePreload(()=>import(`./ollama-DRW2bGA7.js`),__vite__mapDeps([68,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>__vitePreload(()=>import(`./openai-CgMQRKzs.js`),__vite__mapDeps([69,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>__vitePreload(()=>import(`./openai-audio-speech-BJXomLm7.js`),__vite__mapDeps([70,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>__vitePreload(()=>import(`./openai-audio-transcription-CNjeZbT4.js`),__vite__mapDeps([71,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>__vitePreload(()=>import(`./openrouter-ai-Db66h2nl.js`),__vite__mapDeps([72,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2`,name:`/settings/providers/player2`,component:()=>__vitePreload(()=>import(`./player2-eDuFfc86.js`),__vite__mapDeps([73,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/player2-speech`,component:()=>__vitePreload(()=>import(`./player2-speech-66bux_II.js`),__vite__mapDeps([74,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>__vitePreload(()=>import(`./together-ai-DECvdY-v.js`),__vite__mapDeps([75,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>__vitePreload(()=>import(`./volcengine-BXLg-lBL.js`),__vite__mapDeps([76,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>__vitePreload(()=>import(`./xai-2cc0qIXE.js`),__vite__mapDeps([77,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>__vitePreload(()=>import(`./scene-D_ELFQMq.js`),__vite__mapDeps([78,12,25,46])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`StageScenePage`,component:()=>__vitePreload(()=>import(`./stage-BZBO0dUM.js`),__vite__mapDeps([79,6,1,2,7,8,9,10,11,12,4])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>__vitePreload(()=>import(`./filter-message-NvdjEGfA.js`),__vite__mapDeps([80,10,53]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>__vitePreload(()=>import(`./delays-BTktspbJ.js`),__vite__mapDeps([81,10,53]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>__vitePreload(()=>import(`./emotions-Dirlka9n.js`),__vite__mapDeps([82,10,53]))},{path:`messages`,name:`/test/queues/messages`,component:()=>__vitePreload(()=>import(`./messages-OFTKTDnc.js`),__vite__mapDeps([83,10,53]))}]}]}];var BidirectionalTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`BidirectionalTransition`,props:{fromClass:{},activeClass:{},toClass:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(Transition,{"enter-from-class":_ctx.fromClass,"enter-active-class":_ctx.activeClass,"enter-to-class":_ctx.toClass,"leave-from-class":_ctx.toClass,"leave-active-class":_ctx.activeClass,"leave-to-class":_ctx.fromClass},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`enter-from-class`,`enter-active-class`,`enter-to-class`,`leave-from-class`,`leave-active-class`,`leave-to-class`]))}}),BidirectionalTransition_default=BidirectionalTransition_vue_vue_type_script_setup_true_lang_default;const closed=`0px`;var TransitionVertical_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TransitionVertical`,props:{duration:{default:250},easingEnter:{default:`ease-in-out`},easingLeave:{default:`ease-in-out`},opacityClosed:{default:0},opacityOpened:{default:1}},setup(__props){let props=__props;function getElementStyle(element$3){return{height:element$3.style.height,width:element$3.style.width,position:element$3.style.position,visibility:element$3.style.visibility,overflow:element$3.style.overflow,paddingTop:element$3.style.paddingTop,paddingBottom:element$3.style.paddingBottom,borderTopWidth:element$3.style.borderTopWidth,borderBottomWidth:element$3.style.borderBottomWidth,marginTop:element$3.style.marginTop,marginBottom:element$3.style.marginBottom}}function prepareElement(element$3,initialStyle){let{width}=getComputedStyle(element$3);element$3.style.width=width,element$3.style.position=`absolute`,element$3.style.visibility=`hidden`,element$3.style.height=``;let{height}=getComputedStyle(element$3);return element$3.style.width=initialStyle.width,element$3.style.position=initialStyle.position,element$3.style.visibility=initialStyle.visibility,element$3.style.height=closed,element$3.style.overflow=`hidden`,initialStyle.height&&initialStyle.height!==closed?initialStyle.height:height}function animateTransition(element$3,initialStyle,done,keyframes$4,options$1){let animation=element$3.animate(keyframes$4,options$1);element$3.style.height=initialStyle.height,animation.onfinish=()=>{element$3.style.overflow=initialStyle.overflow,done()}}function getEnterKeyframes(height,initialStyle){return[{height:closed,opacity:props.opacityClosed,paddingTop:closed,paddingBottom:closed,borderTopWidth:closed,borderBottomWidth:closed,marginTop:closed,marginBottom:closed},{height,opacity:props.opacityOpened,paddingTop:initialStyle.paddingTop,paddingBottom:initialStyle.paddingBottom,borderTopWidth:initialStyle.borderTopWidth,borderBottomWidth:initialStyle.borderBottomWidth,marginTop:initialStyle.marginTop,marginBottom:initialStyle.marginBottom}]}function enterTransition(element$3,done){let HTMLElement$1=element$3,initialStyle=getElementStyle(HTMLElement$1),height=prepareElement(HTMLElement$1,initialStyle),keyframes$4=getEnterKeyframes(height,initialStyle),options$1={duration:props.duration,easing:props.easingEnter};animateTransition(HTMLElement$1,initialStyle,done,keyframes$4,options$1)}function leaveTransition(element$3,done){let HTMLElement$1=element$3,initialStyle=getElementStyle(HTMLElement$1),{height}=getComputedStyle(HTMLElement$1);HTMLElement$1.style.height=height,HTMLElement$1.style.overflow=`hidden`;let keyframes$4=getEnterKeyframes(height,initialStyle).reverse(),options$1={duration:props.duration,easing:props.easingLeave};animateTransition(HTMLElement$1,initialStyle,done,keyframes$4,options$1)}return(_ctx,_cache$1)=>(openBlock(),createBlock(Transition,{css:!1,onEnter:enterTransition,onLeave:leaveTransition},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3}))}}),TransitionVertical_default=TransitionVertical_vue_vue_type_script_setup_true_lang_default;function serialize$1(o){return typeof o==`string`?`'${o}'`:new c$1().serialize(o)}const c$1=function(){class o{#t=new Map;compare(t$1,r$1){let e$4=typeof t$1,n=typeof r$1;return e$4===`string`&&n===`string`?t$1.localeCompare(r$1):e$4===`number`&&n===`number`?t$1-r$1:String.prototype.localeCompare.call(this.serialize(t$1,!0),this.serialize(r$1,!0))}serialize(t$1,r$1){if(t$1===null)return`null`;switch(typeof t$1){case`string`:return r$1?t$1:`'${t$1}'`;case`bigint`:return`${t$1}n`;case`object`:return this.$object(t$1);case`function`:return this.$function(t$1)}return String(t$1)}serializeObject(t$1){let r$1=Object.prototype.toString.call(t$1);if(r$1!==`[object Object]`)return this.serializeBuiltInType(r$1.length<10?`unknown:${r$1}`:r$1.slice(8,-1),t$1);let e$4=t$1.constructor,n=e$4===Object||e$4===void 0?``:e$4.name;if(n!==``&&globalThis[n]===e$4)return this.serializeBuiltInType(n,t$1);if(typeof t$1.toJSON==`function`){let i=t$1.toJSON();return n+(typeof i==`object`&&i?this.$object(i):`(${this.serialize(i)})`)}return this.serializeObjectEntries(n,Object.entries(t$1))}serializeBuiltInType(t$1,r$1){let e$4=this[`$`+t$1];if(e$4)return e$4.call(this,r$1);if(typeof r$1?.entries==`function`)return this.serializeObjectEntries(t$1,r$1.entries());throw Error(`Cannot serialize ${t$1}`)}serializeObjectEntries(t$1,r$1){let e$4=Array.from(r$1).sort((i,a$1)=>this.compare(i[0],a$1[0])),n=`${t$1}{`;for(let i=0;ithis.compare(r$1,e$4)))}`}$Map(t$1){return this.serializeObjectEntries(`Map`,t$1.entries())}}for(let s of[`Error`,`RegExp`,`URL`])o.prototype[`$`+s]=function(t$1){return`${s}(${t$1})`};for(let s of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])o.prototype[`$`+s]=function(t$1){return`${s}[${t$1.join(`,`)}]`};for(let s of[`BigInt64Array`,`BigUint64Array`])o.prototype[`$`+s]=function(t$1){return`${s}[${t$1.join(`n,`)}${t$1.length>0?`n`:``}]`};return o}();function isEqual(object1,object2){return object1===object2||serialize$1(object1)===serialize$1(object2)}function findValuesBetween(array$1,start,end){let startIndex=array$1.findIndex(i=>isEqual(i,start)),endIndex=array$1.findIndex(i=>isEqual(i,end));if(startIndex===-1||endIndex===-1)return[];let[minIndex,maxIndex]=[startIndex,endIndex].sort((a$1,b$1)=>a$1-b$1);return array$1.slice(minIndex,maxIndex+1)}function createContext(providerComponentName,contextName){let symbolDescription=typeof providerComponentName==`string`&&!contextName?`${providerComponentName}Context`:contextName,injectionKey=Symbol(symbolDescription),injectContext=fallback=>{let context$1=inject(injectionKey,fallback);if(context$1||context$1===null)return context$1;throw Error(`Injection \`${injectionKey.toString()}\` not found. Component must be used within ${Array.isArray(providerComponentName)?`one of the following components: ${providerComponentName.join(`, `)}`:`\`${providerComponentName}\``}`)},provideContext=contextValue=>(provide(injectionKey,contextValue),contextValue);return[injectContext,provideContext]}function getActiveElement(){let activeElement=document.activeElement;if(activeElement==null)return null;for(;activeElement!=null&&activeElement.shadowRoot!=null&&activeElement.shadowRoot.activeElement!=null;)activeElement=activeElement.shadowRoot.activeElement;return activeElement}function handleAndDispatchCustomEvent(name$2,handler,detail){let target$1=detail.originalEvent.target,event=new CustomEvent(name$2,{bubbles:!1,cancelable:!0,detail});handler&&target$1.addEventListener(name$2,handler,{once:!0}),target$1.dispatchEvent(event)}function renderSlotFragments(children){return children?children.flatMap(child=>child.type===Fragment?renderSlotFragments(child.children):[child]):[]}const[injectConfigProviderContext,provideConfigProviderContext]=createContext(`ConfigProvider`),useBodyLockStackCount=createSharedComposable(()=>{let map=ref(new Map),initialOverflow=ref(),locked=computed(()=>{for(let value$1 of map.value.values())if(value$1)return!0;return!1}),context$1=injectConfigProviderContext({scrollBody:ref(!0)}),stopTouchMoveListener=null,resetBodyStyle=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,document.body.style.pointerEvents=``,document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=initialOverflow.value??``,isIOS&&stopTouchMoveListener?.(),initialOverflow.value=void 0};return watch(locked,(val,oldVal)=>{if(!isClient$1)return;if(!val){oldVal&&resetBodyStyle();return}initialOverflow.value===void 0&&(initialOverflow.value=document.body.style.overflow);let verticalScrollbarWidth=window.innerWidth-document.documentElement.clientWidth,defaultConfig={padding:verticalScrollbarWidth,margin:0},config$1=context$1.scrollBody?.value?typeof context$1.scrollBody.value==`object`?defu({padding:context$1.scrollBody.value.padding===!0?verticalScrollbarWidth:context$1.scrollBody.value.padding,margin:context$1.scrollBody.value.margin===!0?verticalScrollbarWidth:context$1.scrollBody.value.margin},defaultConfig):defaultConfig:{padding:0,margin:0};verticalScrollbarWidth>0&&(document.body.style.paddingRight=typeof config$1.padding==`number`?`${config$1.padding}px`:String(config$1.padding),document.body.style.marginRight=typeof config$1.margin==`number`?`${config$1.margin}px`:String(config$1.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${verticalScrollbarWidth}px`),document.body.style.overflow=`hidden`),isIOS&&(stopTouchMoveListener=useEventListener$1(document,`touchmove`,e$4=>preventDefault(e$4),{passive:!1})),nextTick(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})},{immediate:!0,flush:`sync`}),map});function useBodyScrollLock(initialState){let id=Math.random().toString(36).substring(2,7),map=useBodyLockStackCount();map.value.set(id,initialState??!1);let locked=computed({get:()=>map.value.get(id)??!1,set:value$1=>map.value.set(id,value$1)});return tryOnBeforeUnmount(()=>{map.value.delete(id)}),locked}function checkOverflowScroll(ele){let style=window.getComputedStyle(ele);if(style.overflowX===`scroll`||style.overflowY===`scroll`||style.overflowX===`auto`&&ele.clientWidth1?!0:(e$4.preventDefault&&e$4.cancelable&&e$4.preventDefault(),!1)}function useDirection(dir){let context$1=injectConfigProviderContext({dir:ref(`ltr`)});return computed(()=>dir?.value||context$1.dir?.value||`ltr`)}function useEmitAsProps(emit$1){let vm=getCurrentInstance(),events=vm?.type.emits,result={};return events?.length||console.warn(`No emitted event found. Please check component: ${vm?.type.__name}`),events?.forEach(ev=>{result[toHandlerKey(camelize(ev))]=(...arg)=>emit$1(ev,...arg)}),result}function useFilter(options$1){let computedOptions=computed(()=>unref(options$1)),collator=computed(()=>new Intl.Collator(`en`,{usage:`search`,...computedOptions.value})),startsWith=(string$4,substring)=>substring.length===0?!0:(string$4=string$4.normalize(`NFC`),substring=substring.normalize(`NFC`),collator.value.compare(string$4.slice(0,substring.length),substring)===0),endsWith=(string$4,substring)=>substring.length===0?!0:(string$4=string$4.normalize(`NFC`),substring=substring.normalize(`NFC`),collator.value.compare(string$4.slice(-substring.length),substring)===0),contains=(string$4,substring)=>{if(substring.length===0)return!0;string$4=string$4.normalize(`NFC`),substring=substring.normalize(`NFC`);let scan=0,sliceLen=substring.length;for(;scan+sliceLen<=string$4.length;scan++){let slice=string$4.slice(scan,scan+sliceLen);if(collator.value.compare(substring,slice)===0)return!0}return!1};return{startsWith,endsWith,contains}}function useFormControl(el){return computed(()=>toValue$2(el)?!!unrefElement$1(el)?.closest(`form`):!0)}function useForwardExpose(){let instance=getCurrentInstance(),currentRef=ref(),currentElement=computed(()=>[`#text`,`#comment`].includes(currentRef.value?.$el.nodeName)?currentRef.value?.$el.nextElementSibling:unrefElement$1(currentRef)),localExpose=Object.assign({},instance.exposed),ret={};for(let key$2 in instance.props)Object.defineProperty(ret,key$2,{enumerable:!0,configurable:!0,get:()=>instance.props[key$2]});if(Object.keys(localExpose).length>0)for(let key$2 in localExpose)Object.defineProperty(ret,key$2,{enumerable:!0,configurable:!0,get:()=>localExpose[key$2]});Object.defineProperty(ret,`$el`,{enumerable:!0,configurable:!0,get:()=>instance.vnode.el}),instance.exposed=ret;function forwardRef(ref$1){currentRef.value=ref$1,ref$1&&(Object.defineProperty(ret,`$el`,{enumerable:!0,configurable:!0,get:()=>ref$1 instanceof Element?ref$1:ref$1.$el}),instance.exposed=ret)}return{forwardRef,currentRef,currentElement}}function useForwardProps(props){let vm=getCurrentInstance(),defaultProps=Object.keys(vm?.type.props??{}).reduce((prev,curr)=>{let defaultValue=(vm?.type.props[curr]).default;return defaultValue!==void 0&&(prev[curr]=defaultValue),prev},{}),refProps=toRef(props);return computed(()=>{let preservedProps={},assignedProps=vm?.vnode.props??{};return Object.keys(assignedProps).forEach(key$2=>{preservedProps[camelize(key$2)]=assignedProps[key$2]}),Object.keys({...defaultProps,...preservedProps}).reduce((prev,curr)=>(refProps.value[curr]!==void 0&&(prev[curr]=refProps.value[curr]),prev),{})})}function useForwardPropsEmits(props,emit$1){let parsedProps=useForwardProps(props),emitsAsProps=emit$1?useEmitAsProps(emit$1):{};return computed(()=>({...parsedProps.value,...emitsAsProps}))}function useGraceArea(triggerElement,containerElement){let isPointerInTransit=refAutoReset(!1,300),pointerGraceArea=ref(null),pointerExit=createEventHook();function handleRemoveGraceArea(){pointerGraceArea.value=null,isPointerInTransit.value=!1}function handleCreateGraceArea(event,hoverTarget){let currentTarget=event.currentTarget,exitPoint={x:event.clientX,y:event.clientY},exitSide=getExitSideFromRect(exitPoint,currentTarget.getBoundingClientRect()),paddedExitPoints=getPaddedExitPoints(exitPoint,exitSide),hoverTargetPoints=getPointsFromRect(hoverTarget.getBoundingClientRect()),graceArea=getHull([...paddedExitPoints,...hoverTargetPoints]);pointerGraceArea.value=graceArea,isPointerInTransit.value=!0}return watchEffect(cleanupFn=>{if(triggerElement.value&&containerElement.value){let handleTriggerLeave=event=>handleCreateGraceArea(event,containerElement.value),handleContentLeave=event=>handleCreateGraceArea(event,triggerElement.value);triggerElement.value.addEventListener(`pointerleave`,handleTriggerLeave),containerElement.value.addEventListener(`pointerleave`,handleContentLeave),cleanupFn(()=>{triggerElement.value?.removeEventListener(`pointerleave`,handleTriggerLeave),containerElement.value?.removeEventListener(`pointerleave`,handleContentLeave)})}}),watchEffect(cleanupFn=>{if(pointerGraceArea.value){let handleTrackPointerGrace=event=>{if(!pointerGraceArea.value||!(event.target instanceof HTMLElement))return;let target$1=event.target,pointerPosition={x:event.clientX,y:event.clientY},hasEnteredTarget=triggerElement.value?.contains(target$1)||containerElement.value?.contains(target$1),isPointerOutsideGraceArea=!isPointInPolygon(pointerPosition,pointerGraceArea.value),isAnotherGraceAreaTrigger=!!target$1.closest(`[data-grace-area-trigger]`);hasEnteredTarget?handleRemoveGraceArea():(isPointerOutsideGraceArea||isAnotherGraceAreaTrigger)&&(handleRemoveGraceArea(),pointerExit.trigger())};triggerElement.value?.ownerDocument.addEventListener(`pointermove`,handleTrackPointerGrace),cleanupFn(()=>triggerElement.value?.ownerDocument.removeEventListener(`pointermove`,handleTrackPointerGrace))}}),{isPointerInTransit,onPointerExit:pointerExit.on}}function getExitSideFromRect(point$3,rect){let top=Math.abs(rect.top-point$3.y),bottom=Math.abs(rect.bottom-point$3.y),right=Math.abs(rect.right-point$3.x),left=Math.abs(rect.left-point$3.x);switch(Math.min(top,bottom,right,left)){case left:return`left`;case right:return`right`;case top:return`top`;case bottom:return`bottom`;default:throw Error(`unreachable`)}}function getPaddedExitPoints(exitPoint,exitSide,padding=5){let paddedExitPoints=[];switch(exitSide){case`top`:paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y+padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case`bottom`:paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y-padding});break;case`left`:paddedExitPoints.push({x:exitPoint.x+padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case`right`:paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x-padding,y:exitPoint.y+padding});break}return paddedExitPoints}function getPointsFromRect(rect){let{top,right,bottom,left}=rect;return[{x:left,y:top},{x:right,y:top},{x:right,y:bottom},{x:left,y:bottom}]}function isPointInPolygon(point$3,polygon){let{x:x$1,y}=point$3,inside=!1;for(let i=0,j$1=polygon.length-1;iy!=yj>y&&x$1<(xj-xi)*(y-yi)/(yj-yi)+xi;intersect$1&&(inside=!inside)}return inside}function getHull(points){let newPoints=points.slice();return newPoints.sort((a$1,b$1)=>a$1.xb$1.x?1:a$1.yb$1.y?1:0),getHullPresorted(newPoints)}function getHullPresorted(points){if(points.length<=1)return points.slice();let upperHull=[];for(let i=0;i=2;){let q=upperHull[upperHull.length-1],r$1=upperHull[upperHull.length-2];if((q.x-r$1.x)*(p$4.y-r$1.y)>=(q.y-r$1.y)*(p$4.x-r$1.x))upperHull.pop();else break}upperHull.push(p$4)}upperHull.pop();let lowerHull=[];for(let i=points.length-1;i>=0;i--){let p$4=points[i];for(;lowerHull.length>=2;){let q=lowerHull[lowerHull.length-1],r$1=lowerHull[lowerHull.length-2];if((q.x-r$1.x)*(p$4.y-r$1.y)>=(q.y-r$1.y)*(p$4.x-r$1.x))lowerHull.pop();else break}lowerHull.push(p$4)}return lowerHull.pop(),upperHull.length===1&&lowerHull.length===1&&upperHull[0].x===lowerHull[0].x&&upperHull[0].y===lowerHull[0].y?upperHull:upperHull.concat(lowerHull)}var getDefaultParent=function(originalTarget){if(typeof document>`u`)return null;var sampleTarget=Array.isArray(originalTarget)?originalTarget[0]:originalTarget;return sampleTarget.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(node$1){return node$1&&(node$1.host||unwrapHost(node$1.parentNode))},correctTargets=function(parent,targets){return targets.map(function(target$1){if(parent.contains(target$1))return target$1;var correctedTarget=unwrapHost(target$1);return correctedTarget&&parent.contains(correctedTarget)?correctedTarget:(console.error(`aria-hidden`,target$1,`in not contained inside`,parent,`. Doing nothing`),null)}).filter(function(x$1){return!!x$1})},applyAttributeToOthers=function(originalTarget,parentNode,markerName,controlAttribute){var targets=correctTargets(parentNode,Array.isArray(originalTarget)?originalTarget:[originalTarget]);markerMap[markerName]||(markerMap[markerName]=new WeakMap);var markerCounter=markerMap[markerName],hiddenNodes=[],elementsToKeep=new Set,elementsToStop=new Set(targets),keep=function(el){!el||elementsToKeep.has(el)||(elementsToKeep.add(el),keep(el.parentNode))};targets.forEach(keep);var deep=function(parent){!parent||elementsToStop.has(parent)||Array.prototype.forEach.call(parent.children,function(node$1){if(elementsToKeep.has(node$1))deep(node$1);else try{var attr=node$1.getAttribute(controlAttribute),alreadyHidden=attr!==null&&attr!==`false`,counterValue=(counterMap.get(node$1)||0)+1,markerValue=(markerCounter.get(node$1)||0)+1;counterMap.set(node$1,counterValue),markerCounter.set(node$1,markerValue),hiddenNodes.push(node$1),counterValue===1&&alreadyHidden&&uncontrolledNodes.set(node$1,!0),markerValue===1&&node$1.setAttribute(markerName,`true`),alreadyHidden||node$1.setAttribute(controlAttribute,`true`)}catch(e$4){console.error(`aria-hidden: cannot operate on `,node$1,e$4)}})};return deep(parentNode),elementsToKeep.clear(),lockCount++,function(){hiddenNodes.forEach(function(node$1){var counterValue=counterMap.get(node$1)-1,markerValue=markerCounter.get(node$1)-1;counterMap.set(node$1,counterValue),markerCounter.set(node$1,markerValue),counterValue||(uncontrolledNodes.has(node$1)||node$1.removeAttribute(controlAttribute),uncontrolledNodes.delete(node$1)),markerValue||node$1.removeAttribute(markerName)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(originalTarget,parentNode,markerName){markerName===void 0&&(markerName=`data-aria-hidden`);var targets=Array.from(Array.isArray(originalTarget)?originalTarget:[originalTarget]),activeParentNode=parentNode||getDefaultParent(originalTarget);return activeParentNode?(targets.push.apply(targets,Array.from(activeParentNode.querySelectorAll(`[aria-live]`))),applyAttributeToOthers(targets,activeParentNode,markerName,`aria-hidden`)):function(){return null}};function useHideOthers(target$1){let undo;watch(()=>unrefElement$1(target$1),el=>{el?undo=hideOthers(el):undo&&undo()}),onUnmounted(()=>{undo&&undo()})}let count=0;function useId(deterministicId,prefix=`reka`){if(deterministicId)return deterministicId;if(`useId`in vue_runtime_esm_bundler_exports)return`${prefix}-${useId$1?.()}`;let configProviderContext=injectConfigProviderContext({useId:void 0});return configProviderContext.useId?`${prefix}-${configProviderContext.useId()}`:`${prefix}-${++count}`}function useKbd(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}function useSize(element$3){let size$2=ref(),width=computed(()=>size$2.value?.width??0),height=computed(()=>size$2.value?.height??0);return onMounted(()=>{let el=unrefElement$1(element$3);if(el){size$2.value={width:el.offsetWidth,height:el.offsetHeight};let resizeObserver=new ResizeObserver(entries=>{if(!Array.isArray(entries)||!entries.length)return;let entry=entries[0],width$1,height$1;if(`borderBoxSize`in entry){let borderSizeEntry=entry.borderBoxSize,borderSize=Array.isArray(borderSizeEntry)?borderSizeEntry[0]:borderSizeEntry;width$1=borderSize.inlineSize,height$1=borderSize.blockSize}else width$1=el.offsetWidth,height$1=el.offsetHeight;size$2.value={width:width$1,height:height$1}});return resizeObserver.observe(el,{box:`border-box`}),()=>resizeObserver.unobserve(el)}else size$2.value=void 0}),{width,height}}function useStateMachine(initialState,machine){let state=ref(initialState);function reducer(event){let nextState=machine[state.value][event];return nextState??state.value}let dispatch=event=>{state.value=reducer(event)};return{state,dispatch}}function useTypeahead(callback){let search$1=refAutoReset(``,1e3),handleTypeaheadSearch=(key$2,items)=>{if(search$1.value+=key$2,callback)callback(key$2);else{let currentItem=getActiveElement(),itemsWithTextValue=items.map(item=>({...item,textValue:item.value?.textValue??item.ref.textContent?.trim()??``})),currentMatch=itemsWithTextValue.find(item=>item.ref===currentItem),values=itemsWithTextValue.map(item=>item.textValue),nextMatch=getNextMatch(values,search$1.value,currentMatch?.textValue),newItem=itemsWithTextValue.find(item=>item.textValue===nextMatch);return newItem&&newItem.ref.focus(),newItem?.ref}},resetTypeahead=()=>{search$1.value=``};return{search:search$1,handleTypeaheadSearch,resetTypeahead}}function wrapArray(array$1,startIndex){return array$1.map((_$1,index$1)=>array$1[(startIndex+index$1)%array$1.length])}function getNextMatch(values,search$1,currentMatch){let isRepeated=search$1.length>1&&Array.from(search$1).every(char=>char===search$1[0]),normalizedSearch=isRepeated?search$1[0]:search$1,currentMatchIndex=currentMatch?values.indexOf(currentMatch):-1,wrappedValues=wrapArray(values,Math.max(currentMatchIndex,0)),excludeCurrentMatch=normalizedSearch.length===1;excludeCurrentMatch&&(wrappedValues=wrappedValues.filter(v=>v!==currentMatch));let nextMatch=wrappedValues.find(value$1=>value$1.toLowerCase().startsWith(normalizedSearch.toLowerCase()));return nextMatch===currentMatch?void 0:nextMatch}function usePresence(present,node$1){let stylesRef=ref({}),prevAnimationNameRef=ref(`none`),prevPresentRef=ref(present),initialState=present.value?`mounted`:`unmounted`,timeoutId,ownerWindow=node$1.value?.ownerDocument.defaultView??defaultWindow,{state,dispatch}=useStateMachine(initialState,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),dispatchCustomEvent=name$2=>{if(isClient$1){let customEvent=new CustomEvent(name$2,{bubbles:!1,cancelable:!1});node$1.value?.dispatchEvent(customEvent)}};watch(present,async(currentPresent,prevPresent)=>{let hasPresentChanged=prevPresent!==currentPresent;if(await nextTick(),hasPresentChanged){let prevAnimationName=prevAnimationNameRef.value,currentAnimationName=getAnimationName(node$1.value);if(currentPresent)dispatch(`MOUNT`),dispatchCustomEvent(`enter`),currentAnimationName===`none`&&dispatchCustomEvent(`after-enter`);else if(currentAnimationName===`none`||currentAnimationName===`undefined`||stylesRef.value?.display===`none`)dispatch(`UNMOUNT`),dispatchCustomEvent(`leave`),dispatchCustomEvent(`after-leave`);else{let isAnimating=prevAnimationName!==currentAnimationName;prevPresent&&isAnimating?(dispatch(`ANIMATION_OUT`),dispatchCustomEvent(`leave`)):(dispatch(`UNMOUNT`),dispatchCustomEvent(`after-leave`))}}},{immediate:!0});let handleAnimationEnd=event=>{let currentAnimationName=getAnimationName(node$1.value),isCurrentAnimation=currentAnimationName.includes(event.animationName),directionName=state.value===`mounted`?`enter`:`leave`;if(event.target===node$1.value&&isCurrentAnimation&&(dispatchCustomEvent(`after-${directionName}`),dispatch(`ANIMATION_END`),!prevPresentRef.value)){let currentFillMode=node$1.value.style.animationFillMode;node$1.value.style.animationFillMode=`forwards`,timeoutId=ownerWindow?.setTimeout(()=>{node$1.value?.style.animationFillMode===`forwards`&&(node$1.value.style.animationFillMode=currentFillMode)})}event.target===node$1.value&¤tAnimationName===`none`&&dispatch(`ANIMATION_END`)},handleAnimationStart=event=>{event.target===node$1.value&&(prevAnimationNameRef.value=getAnimationName(node$1.value))},watcher=watch(node$1,(newNode,oldNode)=>{newNode?(stylesRef.value=getComputedStyle(newNode),newNode.addEventListener(`animationstart`,handleAnimationStart),newNode.addEventListener(`animationcancel`,handleAnimationEnd),newNode.addEventListener(`animationend`,handleAnimationEnd)):(dispatch(`ANIMATION_END`),timeoutId!==void 0&&ownerWindow?.clearTimeout(timeoutId),oldNode?.removeEventListener(`animationstart`,handleAnimationStart),oldNode?.removeEventListener(`animationcancel`,handleAnimationEnd),oldNode?.removeEventListener(`animationend`,handleAnimationEnd))},{immediate:!0}),stateWatcher=watch(state,()=>{let currentAnimationName=getAnimationName(node$1.value);prevAnimationNameRef.value=state.value===`mounted`?currentAnimationName:`none`});onUnmounted(()=>{watcher(),stateWatcher()});let isPresent=computed(()=>[`mounted`,`unmountSuspended`].includes(state.value));return{isPresent}}function getAnimationName(node$1){return node$1&&getComputedStyle(node$1).animationName||`none`}var Presence_default=defineComponent({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(props,{slots,expose}){let{present,forceMount}=toRefs(props),node$1=ref(),{isPresent}=usePresence(present,node$1);expose({present:isPresent});let children=slots.default({present:isPresent.value});children=renderSlotFragments(children||[]);let instance=getCurrentInstance();if(children&&children?.length>1){let componentName=instance?.parent?.type.name?`<${instance.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${componentName}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(line=>` - ${line}`).join(` +function defineStore(id,setup,setupOptions){let options$1,isSetupStore=typeof setup==`function`;options$1=isSetupStore?setupOptions:setup;function useStore(pinia$1,hot){let hasContext=hasInjectionContext();pinia$1||=hasContext?inject(piniaSymbol,null):null,pinia$1&&setActivePinia(pinia$1),pinia$1=activePinia,!pinia$1._s.has(id)&&(isSetupStore?createSetupStore(id,setup,options$1,pinia$1):createOptionsStore(id,options$1,pinia$1));let store=pinia$1._s.get(id);return store}return useStore.$id=id,useStore}function storeToRefs(store){let rawStore=toRaw(store),refs={};for(let key$2 in rawStore){let value$1=rawStore[key$2];value$1.effect?refs[key$2]=computed({get:()=>store[key$2],set(value$2){store[key$2]=value$2}}):(isRef(value$1)||isReactive(value$1))&&(refs[key$2]=toRef(store,key$2))}return refs}const scriptRel=`modulepreload`,assetsURL=function(dep){return`/`+dep},seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let links=document.getElementsByTagName(`link`),cspNonceMeta=document.querySelector(`meta[property=csp-nonce]`),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(`nonce`);function allSettled(promises$2){return Promise.all(promises$2.map(p$1$1=>Promise.resolve(p$1$1).then(value$1=>({status:`fulfilled`,value:value$1}),reason=>({status:`rejected`,reason}))))}promise=allSettled(deps.map(dep=>{if(dep=assetsURL(dep,importerUrl),dep in seen)return;seen[dep]=!0;let isCss=dep.endsWith(`.css`),cssSelector=isCss?`[rel="stylesheet"]`:``,isBaseRelative=!!importerUrl;if(isBaseRelative)for(let i$1=links.length-1;i$1>=0;i$1--){let link$1$1=links[i$1];if(link$1$1.href===dep&&(!isCss||link$1$1.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;let link$1=document.createElement(`link`);if(link$1.rel=isCss?`stylesheet`:scriptRel,isCss||(link$1.as=`script`),link$1.crossOrigin=``,link$1.href=dep,cspNonce&&link$1.setAttribute(`nonce`,cspNonce),document.head.appendChild(link$1),isCss)return new Promise((res,rej)=>{link$1.addEventListener(`load`,res),link$1.addEventListener(`error`,()=>rej(Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){let e$1$1=new Event(`vite:preloadError`,{cancelable:!0});if(e$1$1.payload=err$2,window.dispatchEvent(e$1$1),!e$1$1.defaultPrevented)throw err$2}return promise.then(res=>{for(let item of res||[]){if(item.status!==`rejected`)continue;handlePreloadError(item.reason)}return baseModule().catch(handlePreloadError)})},setupLayouts=routes$1=>{let layouts={},modules=Object.assign({"/src/layouts/default.vue":()=>__vitePreload(()=>import(`./default-CKyRS7eC.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>__vitePreload(()=>import(`./home-QHat2eLA.js`),[]),"/src/layouts/plain.vue":()=>__vitePreload(()=>import(`./plain-7iQYbl-w.js`),[]),"/src/layouts/settings.vue":()=>__vitePreload(()=>import(`./settings-DJ0YDc_8.js`),__vite__mapDeps([3,1,2,4])),"/src/layouts/stage.vue":()=>__vitePreload(()=>import(`./stage-C66qPyvu.js`),[])});Object.entries(modules).forEach(([name$2,module$1])=>{let key$2=name$2.replace(`/src/layouts/`,``).replace(`.vue`,``);layouts[key$2]=module$1});function deepSetupLayout(routes$2,top=!0){return routes$2.map(route=>{if(route.children?.length>0&&(route.children=deepSetupLayout(route.children,!1)),top){let skipLayout=!route.component&&route.children?.find(r$1=>(r$1.path===``||r$1.path===`/`)&&r$1.meta?.isLayout);if(skipLayout)return route;if(route.meta?.layout!==!1)return{path:route.path,component:layouts[route.meta?.layout||`default`],children:route.path===`/`?[route]:[{...route,path:``}],meta:{isLayout:!0}}}return route.meta?.layout?{path:route.path,component:layouts[route.meta?.layout],children:[{...route,path:``}],meta:{isLayout:!0}}:route})}return deepSetupLayout(routes$1)},isBrowser$2=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}const assign$1=Object.assign;function applyToParams(fn$5,params){let newParams={};for(let key$2 in params){let value$1=params[key$2];newParams[key$2]=isArray$3(value$1)?value$1.map(fn$5):fn$5(value$1)}return newParams}const noop$1=()=>{},isArray$3=Array.isArray,HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text$5){return encodeURI(``+text$5).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text$5){return commonEncode(text$5).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text$5){return commonEncode(text$5).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text$5){return encodeQueryValue(text$5).replace(EQUAL_RE,`%3D`)}function encodePath(text$5){return commonEncode(text$5).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text$5){return text$5==null?``:encodePath(text$5).replace(SLASH_RE,`%2F`)}function decode$1(text$5){try{return decodeURIComponent(``+text$5)}catch{}return``+text$5}const TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return hashPos=0&&(searchPos=-1),searchPos>-1&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos+1,hashPos>-1?hashPos:location$1.length),query=parseQuery$1(searchString)),hashPos>-1&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+(searchString&&`?`)+searchString+hash,path,query,hash:decode$1(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$1,b$1){let aLastIndex=a$1.matched.length-1,bLastIndex=b$1.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$1.matched[aLastIndex],b$1.matched[bLastIndex])&&isSameRouteLocationParams(a$1.params,b$1.params)&&stringifyQuery$1(a$1.query)===stringifyQuery$1(b$1.query)&&a$1.hash===b$1.hash}function isSameRouteRecord(a$1,b$1){return(a$1.aliasOf||a$1)===(b$1.aliasOf||b$1)}function isSameRouteLocationParams(a$1,b$1){if(Object.keys(a$1).length!==Object.keys(b$1).length)return!1;for(let key$2 in a$1)if(!isSameRouteLocationParamsValue(a$1[key$2],b$1[key$2]))return!1;return!0}function isSameRouteLocationParamsValue(a$1,b$1){return isArray$3(a$1)?isEquivalentArray(a$1,b$1):isArray$3(b$1)?isEquivalentArray(b$1,a$1):a$1===b$1}function isEquivalentArray(a$1,b$1){return isArray$3(b$1)?a$1.length===b$1.length&&a$1.every((value$1,i)=>value$1===b$1[i]):a$1.length===1&&a$1[0]===b$1}function resolveRelativePath(to$1,from){if(to$1.startsWith(`/`))return to$1;if(!to$1)return from;let fromSegments=from.split(`/`),toSegments=to$1.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position$2=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position$2--;else break;return fromSegments.slice(0,position$2).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}const START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var NavigationType;(function(NavigationType$1){NavigationType$1.pop=`pop`,NavigationType$1.push=`push`})(NavigationType||={});var NavigationDirection;(function(NavigationDirection$1){NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``})(NavigationDirection||={});function normalizeBase(base){if(!base)if(isBrowser$2){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}const BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}const computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position$2){let scrollToOptions;if(`el`in position$2){let positionEl=position$2.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position$2)}else scrollToOptions=position$2;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){let position$2=history.state?history.state.position-delta:-1;return position$2+path}const scrollPositions=new Map;function saveScrollPosition(key$2,scrollPosition){scrollPositions.set(key$2,scrollPosition)}function getSavedScrollPosition(key$2){let scroll=scrollPositions.get(key$2);return scrollPositions.delete(key$2),scroll}let createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}let path=stripBase(pathname,base);return path+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to$1=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to$1,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to$1);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index$1=listeners.indexOf(callback);index$1>-1&&listeners.splice(index$1,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){let{history:history$1}=window;history$1.state&&history$1.replaceState(assign$1({},history$1.state,{scroll:computeScrollPosition()}),``)}function destroy(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`beforeunload`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`beforeunload`,beforeUnloadListener,{passive:!0}),{pauseListeners,listen,destroy}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to$1,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to$1:createBaseLocation()+base+to$1;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to$1,data$12){let state=assign$1({},history$1.state,buildState(historyState.value.back,to$1,historyState.value.forward,!0),data$12,{position:historyState.value.position});changeLocation(to$1,state,!0),currentLocation.value=to$1}function push$1(to$1,data$12){let currentState=assign$1({},historyState.value,history$1.state,{forward:to$1,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0);let state=assign$1({},buildState(currentLocation.value,to$1,null),{position:currentState.position+1},data$12);changeLocation(to$1,state,!1),currentLocation.value=to$1}return{location:currentLocation,state:historyState,push:push$1,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign$1({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,!base.includes(`#`)&&(base+=`#`),createWebHistory(base)}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name$2){return typeof name$2==`string`||typeof name$2==`symbol`}const NavigationFailureSymbol=Symbol(``);var NavigationFailureType;(function(NavigationFailureType$1){NavigationFailureType$1[NavigationFailureType$1.aborted=4]=`aborted`,NavigationFailureType$1[NavigationFailureType$1.cancelled=8]=`cancelled`,NavigationFailureType$1[NavigationFailureType$1.duplicated=16]=`duplicated`})(NavigationFailureType||={});function createRouterError(type,params){return assign$1(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}const BASE_PARAM_PATTERN=`[^/]+?`,BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(segments,extraOptions){let options$1=assign$1({},BASE_PATH_PARSER_OPTIONS,extraOptions),score=[],pattern=options$1.start?`^`:``,keys$3=[];for(let segment of segments){let segmentScores=segment.length?[]:[90];options$1.strict&&!segment.length&&(pattern+=`/`);for(let tokenIndex=0;tokenIndexb$1.length?b$1.length===1&&b$1[0]===80?1:-1:0}function comparePathParserScore(a$1,b$1){let i=0,aScore=a$1.score,bScore=b$1.score;for(;i0&&last[last.length-1]<0}const ROOT_TOKEN={type:0,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message$1){throw Error(`ERR (${state})/"${buffer$1}": ${message$1}`)}let state=0,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&(state===0?segment.push({type:0,value:buffer$1}):state===1||state===2||state===3?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:1,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),buffer$1=``)}function addCharToBuffer(){buffer$1+=char}for(;i{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index$1=matchers.indexOf(matcherRef);index$1>-1&&(matchers.splice(index$1,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index$1=findInsertionIndex(matcher,matchers);matchers.splice(index$1,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name$2;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(1,{location:location$1});name$2=matcher.record.name,params=assign$1(paramsFromLocation(currentLocation.params,matcher.keys.filter(k$3=>!k$3.optional).concat(matcher.parent?matcher.parent.keys.filter(k$3=>k$3.optional):[]).map(k$3=>k$3.name)),location$1.params&¶msFromLocation(location$1.params,matcher.keys.map(k$3=>k$3.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m=>m.re.test(path)),matcher&&(params=matcher.parse(path),name$2=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path)),!matcher)throw createRouterError(1,{location:location$1,currentLocation});name$2=matcher.record.name,params=assign$1({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name:name$2,path,params,matched,meta:mergeMetaFields(matched)}}routes$1.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function paramsFromLocation(params,keys$3){let newParams={};for(let key$2 of keys$3)key$2 in params&&(newParams[key$2]=params[key$2]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name$2 in record.components)propsObject[name$2]=typeof props==`object`?props[name$2]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign$1(meta,record.meta),{})}function mergeOptions(defaults$1,partialOptions){let options$1={};for(let key$2 in defaults$1)options$1[key$2]=key$2 in partialOptions?partialOptions[key$2]:defaults$1[key$2];return options$1}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1,sortOrder=comparePathParserScore(matcher,matchers[mid]);sortOrder<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let hasLeadingIM=search$1[0]===`?`,searchParams=(hasLeadingIM?search$1.slice(1):search$1).split(`&`);for(let i=0;iv&&encodeQueryValue(v)):[value$1&&encodeQueryValue(value$1)];values.forEach(value$2=>{value$2!==void 0&&(search$1+=(search$1.length?`&`:``)+key$2,value$2!=null&&(search$1+=`=`+value$2))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key$2 in query){let value$1=query[key$2];value$1!==void 0&&(normalizedQuery[key$2]=isArray$3(value$1)?value$1.map(v=>v==null?null:``+v):value$1==null?value$1:``+value$1)}return normalizedQuery}const matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$3=[];function add$1(handler){return handlers$3.push(handler),()=>{let i=handlers$3.indexOf(handler);i>-1&&handlers$3.splice(i,1)}}function reset(){handlers$3=[]}return{add:add$1,list:()=>handlers$3.slice(),reset}}function guardToPromiseFn(guard,to$1,from,record,name$2,runWithContext=fn$5=>fn$5()){let enterCallbackArray=record&&(record.enterCallbacks[name$2]=record.enterCallbacks[name$2]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid$1=>{valid$1===!1?reject(createRouterError(4,{from,to:to$1})):valid$1 instanceof Error?reject(valid$1):isRouteLocation(valid$1)?reject(createRouterError(2,{from:to$1,to:valid$1})):(enterCallbackArray&&record.enterCallbacks[name$2]===enterCallbackArray&&typeof valid$1==`function`&&enterCallbackArray.push(valid$1),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name$2],to$1,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to$1,from,runWithContext=fn$5=>fn$5()){let guards=[];for(let record of matched)for(let name$2 in record.components){let rawComponent=record.components[name$2];if(guardType!==`beforeRouteEnter`&&!record.instances[name$2])continue;if(isRouteComponent(rawComponent)){let options$1=rawComponent.__vccOpts||rawComponent,guard=options$1[guardType];guard&&guards.push(guardToPromiseFn(guard,to$1,from,record,name$2,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name$2}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name$2]=resolved,record.components[name$2]=resolvedComponent;let options$1=resolvedComponent.__vccOpts||resolvedComponent,guard=options$1[guardType];return guard&&guardToPromiseFn(guard,to$1,from,record,name$2,runWithContext)()}))}}return guards}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),route=computed(()=>{let to$1=unref(props.to);return router$1.resolve(to$1)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index$1=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index$1>-1)return index$1;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index$1}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate(e$4={}){if(guardEvent(e$4)){let p$4=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$4),p$4}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}const RouterLinkImpl=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link$1=reactive(useLink(props)),{options:options$1}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options$1.linkActiveClass,`router-link-active`)]:link$1.isActive,[getLinkClass(props.exactActiveClass,options$1.linkExactActiveClass,`router-link-exact-active`)]:link$1.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link$1));return props.custom?children:h(`a`,{"aria-current":link$1.isExactActive?props.ariaCurrentValue:null,href:link$1.href,onClick:link$1.navigate,class:elClass.value},children)}}}),RouterLink=RouterLinkImpl;function guardEvent(e$4){if(!(e$4.metaKey||e$4.altKey||e$4.ctrlKey||e$4.shiftKey)&&!e$4.defaultPrevented&&!(e$4.button!==void 0&&e$4.button!==0)){if(e$4.currentTarget&&e$4.currentTarget.getAttribute){let target$1=e$4.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target$1))return}return e$4.preventDefault&&e$4.preventDefault(),!0}}function includesParams(outer,inner){for(let key$2 in inner){let innerValue=inner[key$2],outerValue=outer[key$2];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray$3(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value$1,i)=>value$1!==outerValue[i]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}const getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance,to$1,name$2],[oldInstance,from,oldName])=>{to$1&&(to$1.instances[name$2]=instance,from&&from!==to$1&&instance&&instance===oldInstance&&(to$1.leaveGuards.size||(to$1.leaveGuards=from.leaveGuards),to$1.updateGuards.size||(to$1.updateGuards=from.updateGuards))),instance&&to$1&&(!from||!isSameRouteRecord(to$1,from)||!oldInstance)&&(to$1.enterCallbacks[name$2]||[]).forEach(callback=>callback(instance))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],routeProps=routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,onVnodeUnmounted=vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},component=h(ViewComponent,assign$1({},routeProps,attrs,{onVnodeUnmounted,ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data$12){if(!slot)return null;let slotContent=slot(data$12);return slotContent.length===1?slotContent[0]:slotContent}const RouterView=RouterViewImpl;function createRouter(options$1){let matcher=createRouterMatcher(options$1.routes,options$1),parseQuery$1=options$1.parseQuery||parseQuery,stringifyQuery$1=options$1.stringifyQuery||stringifyQuery,routerHistory=options$1.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser$2&&options$1.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams$1=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode$1);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name$2){let recordMatcher=matcher.getRecordMatcher(name$2);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name$2){return!!matcher.getRecordMatcher(name$2)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign$1({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign$1(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode$1(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign$1({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign$1({},rawLocation.params);for(let key$2 in targetParams)targetParams[key$2]??delete targetParams[key$2];matcherLocation=assign$1({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams$1(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign$1({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign$1({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to$1){return typeof to$1==`string`?parseURL(parseQuery$1,to$1,currentRoute.value.path):assign$1({},to$1)}function checkCanceledNavigation(to$1,from){if(pendingLocation!==to$1)return createRouterError(8,{from,to:to$1})}function push$1(to$1){return pushWithRedirect(to$1)}function replace(to$1){return push$1(assign$1(locationAsObject(to$1),{replace:!0}))}function handleRedirectRecord(to$1){let lastMatched=to$1.matched[to$1.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to$1):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign$1({query:to$1.query,hash:to$1.hash,params:newTargetLocation.path==null?to$1.params:{}},newTargetLocation)}}function pushWithRedirect(to$1,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to$1),from=currentRoute.value,data$12=to$1.state,force=to$1.force,replace$1=to$1.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation);if(shouldRedirect)return pushWithRedirect(assign$1(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign$1({},data$12,shouldRedirect.state):data$12,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(16,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,2)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,2))return pushWithRedirect(assign$1({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign$1({},data$12,failure$1.to.state):data$12,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data$12);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to$1,from){let error=checkCanceledNavigation(to$1,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn$5){let app=installedApps.values().next().value;return app&&typeof app.runWithContext==`function`?app.runWithContext(fn$5):fn$5()}function navigate(to$1,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to$1,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to$1,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$1,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to$1,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to$1,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to$1,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$1,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray$3(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to$1,from));else guards.push(guardToPromiseFn(record.beforeEnter,to$1,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to$1.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to$1,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to$1,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to$1,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to$1,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data$12){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser$2?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign$1({scroll:isFirstNavigation&&state&&state.scroll},data$12)):routerHistory.push(toLocation.fullPath,data$12)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to$1,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to$1),shouldRedirect=handleRedirectRecord(toLocation);if(shouldRedirect){pushWithRedirect(assign$1(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser$2&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate(toLocation,from).catch(error=>isNavigationFailure(error,12)?error:isNavigationFailure(error,2)?(pushWithRedirect(assign$1(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,20)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,8)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,20)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to$1,from){markAsReady(error);let list$2=errorListeners.list();return list$2.length?list$2.forEach(handler=>handler(error,to$1,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$2,reject)=>{readyHandlers.add([resolve$2,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$2,reject])=>err?reject(err):resolve$2()),readyHandlers.reset()),err}function handleScroll(to$1,from,isPush,isFirstNavigation){let{scrollBehavior}=options$1;if(!isBrowser$2||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to$1.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to$1,from,scrollPosition)).then(position$2=>position$2&&scrollToPosition(position$2)).catch(err=>triggerError(err,to$1,from))}let go=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options:options$1,push:push$1,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app){let router$2=this;app.component(`RouterLink`,RouterLink),app.component(`RouterView`,RouterView),app.config.globalProperties.$router=router$2,Object.defineProperty(app.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser$2&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push$1(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key$2 in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key$2,{get:()=>currentRoute.value[key$2],enumerable:!0});app.provide(routerKey,router$2),app.provide(routeLocationKey,shallowReactive(reactiveRoute)),app.provide(routerViewLocationKey,currentRoute);let unmountApp=app.unmount;installedApps.add(app),app.unmount=function(){installedApps.delete(app),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function extractChangingRecords(to$1,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to$1.matched.length);for(let i=0;iisSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to$1.matched[i];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}const routes=[{path:`/`,name:`IndexScenePage`,component:()=>__vitePreload(()=>import(`./pages-CjjKzga2.js`),__vite__mapDeps([5,6,1,2,7,8,9,10,11,12,4])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>__vitePreload(()=>import(`./_...all_-DNDgokJ1.js`),[])},{path:`/audio`,name:`/audio`,component:()=>__vitePreload(()=>import(`./audio-C2yPudG-.js`),[])},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>__vitePreload(()=>import(`./audio-record-DlZD02-W.js`),[])},{path:`background-gradient-blending`,name:`/devtools/background-gradient-blending`,component:()=>__vitePreload(()=>import(`./background-gradient-blending-CykJ-DB6.js`),__vite__mapDeps([13,4,14,15]))},{path:`background-remove`,name:`/devtools/background-remove`,component:()=>__vitePreload(()=>import(`./background-remove-fLURqKXM.js`),__vite__mapDeps([16,17,18]))},{path:`chat`,name:`/devtools/chat`,component:()=>__vitePreload(()=>import(`./chat-DL9i4zaS.js`),[])},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>__vitePreload(()=>import(`./gesture-circle-BOzZAIEv.js`),__vite__mapDeps([19,12])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>__vitePreload(()=>import(`./image-26XCOKEz.js`),__vite__mapDeps([20,21]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>__vitePreload(()=>import(`./polaroid-BoV0pdO1.js`),__vite__mapDeps([22,7,8,9]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>__vitePreload(()=>import(`./vibrant-LsjL0AjJ.js`),__vite__mapDeps([23,14,18]))}]},{path:`/queue`,name:`/queue`,component:()=>__vitePreload(()=>import(`./queue-D90evycf.js`),[])},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>__vitePreload(()=>import(`./settings-BayMzedR.js`),__vite__mapDeps([24,12,25])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>__vitePreload(()=>import(`./airi-card-BaqHfUxO.js`),__vite__mapDeps([26,12,27,28,29,30,31,32,33,18])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>__vitePreload(()=>import(`./CardCreate-D1L2CNWh.js`),__vite__mapDeps([34,27]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>__vitePreload(()=>import(`./CardCreationDialog-DVYMLoWa.js`),__vite__mapDeps([35,28,29,30]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>__vitePreload(()=>import(`./CardDetailDialog-CTDWU09J.js`),__vite__mapDeps([36,31,32,29]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>__vitePreload(()=>import(`./CardListItem-CK8o7jg4.js`),__vite__mapDeps([37,33]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>__vitePreload(()=>import(`./DeleteCardDialog-BMk3CSBA.js`),__vite__mapDeps([38,32,29]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>__vitePreload(()=>import(`./appearance-Bqk97F-6.js`),__vite__mapDeps([39,12])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>__vitePreload(()=>import(`./color-scheme-gSwocc3L.js`),__vite__mapDeps([40,12,41])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>__vitePreload(()=>import(`./developer-BGgZf27o.js`),__vite__mapDeps([42,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>__vitePreload(()=>import(`./general-CQDJm-ty.js`),__vite__mapDeps([43,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>__vitePreload(()=>import(`./memory-CrPU-NEp.js`),__vite__mapDeps([44,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>__vitePreload(()=>import(`./models-BM2HFRNH.js`),__vite__mapDeps([45,12,25,46,7,8,9,14])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>__vitePreload(()=>import(`./modules-D6tOd0hQ.js`),__vite__mapDeps([47,12,25,46])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>__vitePreload(()=>import(`./consciousness-D-mOgB0P.js`),__vite__mapDeps([48,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>__vitePreload(()=>import(`./hearing-GzHWsAjD.js`),__vite__mapDeps([49,12,17])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>__vitePreload(()=>import(`./memory-long-term-DCk6zf2R.js`),__vite__mapDeps([50,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>__vitePreload(()=>import(`./memory-short-term-DvyQeTmq.js`),__vite__mapDeps([51,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>__vitePreload(()=>import(`./speech-Bn9l8ac1.js`),__vite__mapDeps([52,12,10,53])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>__vitePreload(()=>import(`./providers-BRImID3U.js`),__vite__mapDeps([54,12,25,46])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>__vitePreload(()=>import(`./alibaba-cloud-model-studio-u_KMUc3I.js`),__vite__mapDeps([55,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>__vitePreload(()=>import(`./anthropic-BljXHKAw.js`),__vite__mapDeps([56,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/azure-ai-foundry`,component:()=>__vitePreload(()=>import(`./azure-ai-foundry-CmnN_e4a.js`),__vite__mapDeps([57,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>__vitePreload(()=>import(`./cloudflare-workers-ai-DH8y1cuF.js`),__vite__mapDeps([58,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>__vitePreload(()=>import(`./deepseek-DJ4XOLdP.js`),__vite__mapDeps([59,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>__vitePreload(()=>import(`./elevenlabs-CIJ-36gn.js`),__vite__mapDeps([60,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>__vitePreload(()=>import(`./featherless-ai-5Km5myH_.js`),__vite__mapDeps([61,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>__vitePreload(()=>import(`./fireworks-ai-B-as3TcQ.js`),__vite__mapDeps([62,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>__vitePreload(()=>import(`./google-generative-ai-BJ5FqLIb.js`),__vite__mapDeps([63,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>__vitePreload(()=>import(`./microsoft-speech-Bko6hWlU.js`),__vite__mapDeps([64,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>__vitePreload(()=>import(`./mistral-ai-teLdtiwv.js`),__vite__mapDeps([65,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>__vitePreload(()=>import(`./moonshot-ai-u73XFCFi.js`),__vite__mapDeps([66,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>__vitePreload(()=>import(`./novita-ai-7ipBHksn.js`),__vite__mapDeps([67,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>__vitePreload(()=>import(`./ollama-CuqQePdH.js`),__vite__mapDeps([68,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>__vitePreload(()=>import(`./openai-B9sunSqD.js`),__vite__mapDeps([69,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>__vitePreload(()=>import(`./openai-audio-speech-CbGH6VQ3.js`),__vite__mapDeps([70,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>__vitePreload(()=>import(`./openai-audio-transcription-BiCtqKwn.js`),__vite__mapDeps([71,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>__vitePreload(()=>import(`./openrouter-ai-C4TWeOIO.js`),__vite__mapDeps([72,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2`,name:`/settings/providers/player2`,component:()=>__vitePreload(()=>import(`./player2-ClAVJB5x.js`),__vite__mapDeps([73,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/player2-speech`,component:()=>__vitePreload(()=>import(`./player2-speech-BP2h--1L.js`),__vite__mapDeps([74,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>__vitePreload(()=>import(`./together-ai-6XPxX9Zr.js`),__vite__mapDeps([75,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>__vitePreload(()=>import(`./volcengine-BQiNcwbw.js`),__vite__mapDeps([76,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>__vitePreload(()=>import(`./xai-CK1EupZF.js`),__vite__mapDeps([77,12])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>__vitePreload(()=>import(`./scene-DQODToDR.js`),__vite__mapDeps([78,12,25,46])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`StageScenePage`,component:()=>__vitePreload(()=>import(`./stage-5LZVOFch.js`),__vite__mapDeps([79,6,1,2,7,8,9,10,11,12,4])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>__vitePreload(()=>import(`./filter-message-DeoOY8to.js`),__vite__mapDeps([80,10,53]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>__vitePreload(()=>import(`./delays-6S4zxQEt.js`),__vite__mapDeps([81,10,53]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>__vitePreload(()=>import(`./emotions-BEnYe8CF.js`),__vite__mapDeps([82,10,53]))},{path:`messages`,name:`/test/queues/messages`,component:()=>__vitePreload(()=>import(`./messages-DlXkV5Rk.js`),__vite__mapDeps([83,10,53]))}]}]}];var BidirectionalTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`BidirectionalTransition`,props:{fromClass:{},activeClass:{},toClass:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(Transition,{"enter-from-class":_ctx.fromClass,"enter-active-class":_ctx.activeClass,"enter-to-class":_ctx.toClass,"leave-from-class":_ctx.toClass,"leave-active-class":_ctx.activeClass,"leave-to-class":_ctx.fromClass},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`enter-from-class`,`enter-active-class`,`enter-to-class`,`leave-from-class`,`leave-active-class`,`leave-to-class`]))}}),BidirectionalTransition_default=BidirectionalTransition_vue_vue_type_script_setup_true_lang_default;const closed=`0px`;var TransitionVertical_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TransitionVertical`,props:{duration:{default:250},easingEnter:{default:`ease-in-out`},easingLeave:{default:`ease-in-out`},opacityClosed:{default:0},opacityOpened:{default:1}},setup(__props){let props=__props;function getElementStyle(element$3){return{height:element$3.style.height,width:element$3.style.width,position:element$3.style.position,visibility:element$3.style.visibility,overflow:element$3.style.overflow,paddingTop:element$3.style.paddingTop,paddingBottom:element$3.style.paddingBottom,borderTopWidth:element$3.style.borderTopWidth,borderBottomWidth:element$3.style.borderBottomWidth,marginTop:element$3.style.marginTop,marginBottom:element$3.style.marginBottom}}function prepareElement(element$3,initialStyle){let{width}=getComputedStyle(element$3);element$3.style.width=width,element$3.style.position=`absolute`,element$3.style.visibility=`hidden`,element$3.style.height=``;let{height}=getComputedStyle(element$3);return element$3.style.width=initialStyle.width,element$3.style.position=initialStyle.position,element$3.style.visibility=initialStyle.visibility,element$3.style.height=closed,element$3.style.overflow=`hidden`,initialStyle.height&&initialStyle.height!==closed?initialStyle.height:height}function animateTransition(element$3,initialStyle,done,keyframes$4,options$1){let animation=element$3.animate(keyframes$4,options$1);element$3.style.height=initialStyle.height,animation.onfinish=()=>{element$3.style.overflow=initialStyle.overflow,done()}}function getEnterKeyframes(height,initialStyle){return[{height:closed,opacity:props.opacityClosed,paddingTop:closed,paddingBottom:closed,borderTopWidth:closed,borderBottomWidth:closed,marginTop:closed,marginBottom:closed},{height,opacity:props.opacityOpened,paddingTop:initialStyle.paddingTop,paddingBottom:initialStyle.paddingBottom,borderTopWidth:initialStyle.borderTopWidth,borderBottomWidth:initialStyle.borderBottomWidth,marginTop:initialStyle.marginTop,marginBottom:initialStyle.marginBottom}]}function enterTransition(element$3,done){let HTMLElement$1=element$3,initialStyle=getElementStyle(HTMLElement$1),height=prepareElement(HTMLElement$1,initialStyle),keyframes$4=getEnterKeyframes(height,initialStyle),options$1={duration:props.duration,easing:props.easingEnter};animateTransition(HTMLElement$1,initialStyle,done,keyframes$4,options$1)}function leaveTransition(element$3,done){let HTMLElement$1=element$3,initialStyle=getElementStyle(HTMLElement$1),{height}=getComputedStyle(HTMLElement$1);HTMLElement$1.style.height=height,HTMLElement$1.style.overflow=`hidden`;let keyframes$4=getEnterKeyframes(height,initialStyle).reverse(),options$1={duration:props.duration,easing:props.easingLeave};animateTransition(HTMLElement$1,initialStyle,done,keyframes$4,options$1)}return(_ctx,_cache$1)=>(openBlock(),createBlock(Transition,{css:!1,onEnter:enterTransition,onLeave:leaveTransition},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3}))}}),TransitionVertical_default=TransitionVertical_vue_vue_type_script_setup_true_lang_default;function serialize$1(o){return typeof o==`string`?`'${o}'`:new c$1().serialize(o)}const c$1=function(){class o{#t=new Map;compare(t$1,r$1){let e$4=typeof t$1,n=typeof r$1;return e$4===`string`&&n===`string`?t$1.localeCompare(r$1):e$4===`number`&&n===`number`?t$1-r$1:String.prototype.localeCompare.call(this.serialize(t$1,!0),this.serialize(r$1,!0))}serialize(t$1,r$1){if(t$1===null)return`null`;switch(typeof t$1){case`string`:return r$1?t$1:`'${t$1}'`;case`bigint`:return`${t$1}n`;case`object`:return this.$object(t$1);case`function`:return this.$function(t$1)}return String(t$1)}serializeObject(t$1){let r$1=Object.prototype.toString.call(t$1);if(r$1!==`[object Object]`)return this.serializeBuiltInType(r$1.length<10?`unknown:${r$1}`:r$1.slice(8,-1),t$1);let e$4=t$1.constructor,n=e$4===Object||e$4===void 0?``:e$4.name;if(n!==``&&globalThis[n]===e$4)return this.serializeBuiltInType(n,t$1);if(typeof t$1.toJSON==`function`){let i=t$1.toJSON();return n+(typeof i==`object`&&i?this.$object(i):`(${this.serialize(i)})`)}return this.serializeObjectEntries(n,Object.entries(t$1))}serializeBuiltInType(t$1,r$1){let e$4=this[`$`+t$1];if(e$4)return e$4.call(this,r$1);if(typeof r$1?.entries==`function`)return this.serializeObjectEntries(t$1,r$1.entries());throw Error(`Cannot serialize ${t$1}`)}serializeObjectEntries(t$1,r$1){let e$4=Array.from(r$1).sort((i,a$1)=>this.compare(i[0],a$1[0])),n=`${t$1}{`;for(let i=0;ithis.compare(r$1,e$4)))}`}$Map(t$1){return this.serializeObjectEntries(`Map`,t$1.entries())}}for(let s of[`Error`,`RegExp`,`URL`])o.prototype[`$`+s]=function(t$1){return`${s}(${t$1})`};for(let s of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])o.prototype[`$`+s]=function(t$1){return`${s}[${t$1.join(`,`)}]`};for(let s of[`BigInt64Array`,`BigUint64Array`])o.prototype[`$`+s]=function(t$1){return`${s}[${t$1.join(`n,`)}${t$1.length>0?`n`:``}]`};return o}();function isEqual(object1,object2){return object1===object2||serialize$1(object1)===serialize$1(object2)}function findValuesBetween(array$1,start,end){let startIndex=array$1.findIndex(i=>isEqual(i,start)),endIndex=array$1.findIndex(i=>isEqual(i,end));if(startIndex===-1||endIndex===-1)return[];let[minIndex,maxIndex]=[startIndex,endIndex].sort((a$1,b$1)=>a$1-b$1);return array$1.slice(minIndex,maxIndex+1)}function createContext(providerComponentName,contextName){let symbolDescription=typeof providerComponentName==`string`&&!contextName?`${providerComponentName}Context`:contextName,injectionKey=Symbol(symbolDescription),injectContext=fallback=>{let context$1=inject(injectionKey,fallback);if(context$1||context$1===null)return context$1;throw Error(`Injection \`${injectionKey.toString()}\` not found. Component must be used within ${Array.isArray(providerComponentName)?`one of the following components: ${providerComponentName.join(`, `)}`:`\`${providerComponentName}\``}`)},provideContext=contextValue=>(provide(injectionKey,contextValue),contextValue);return[injectContext,provideContext]}function getActiveElement(){let activeElement=document.activeElement;if(activeElement==null)return null;for(;activeElement!=null&&activeElement.shadowRoot!=null&&activeElement.shadowRoot.activeElement!=null;)activeElement=activeElement.shadowRoot.activeElement;return activeElement}function handleAndDispatchCustomEvent(name$2,handler,detail){let target$1=detail.originalEvent.target,event=new CustomEvent(name$2,{bubbles:!1,cancelable:!0,detail});handler&&target$1.addEventListener(name$2,handler,{once:!0}),target$1.dispatchEvent(event)}function renderSlotFragments(children){return children?children.flatMap(child=>child.type===Fragment?renderSlotFragments(child.children):[child]):[]}const[injectConfigProviderContext,provideConfigProviderContext]=createContext(`ConfigProvider`),useBodyLockStackCount=createSharedComposable(()=>{let map=ref(new Map),initialOverflow=ref(),locked=computed(()=>{for(let value$1 of map.value.values())if(value$1)return!0;return!1}),context$1=injectConfigProviderContext({scrollBody:ref(!0)}),stopTouchMoveListener=null,resetBodyStyle=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,document.body.style.pointerEvents=``,document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=initialOverflow.value??``,isIOS&&stopTouchMoveListener?.(),initialOverflow.value=void 0};return watch(locked,(val,oldVal)=>{if(!isClient$1)return;if(!val){oldVal&&resetBodyStyle();return}initialOverflow.value===void 0&&(initialOverflow.value=document.body.style.overflow);let verticalScrollbarWidth=window.innerWidth-document.documentElement.clientWidth,defaultConfig={padding:verticalScrollbarWidth,margin:0},config$1=context$1.scrollBody?.value?typeof context$1.scrollBody.value==`object`?defu({padding:context$1.scrollBody.value.padding===!0?verticalScrollbarWidth:context$1.scrollBody.value.padding,margin:context$1.scrollBody.value.margin===!0?verticalScrollbarWidth:context$1.scrollBody.value.margin},defaultConfig):defaultConfig:{padding:0,margin:0};verticalScrollbarWidth>0&&(document.body.style.paddingRight=typeof config$1.padding==`number`?`${config$1.padding}px`:String(config$1.padding),document.body.style.marginRight=typeof config$1.margin==`number`?`${config$1.margin}px`:String(config$1.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${verticalScrollbarWidth}px`),document.body.style.overflow=`hidden`),isIOS&&(stopTouchMoveListener=useEventListener$1(document,`touchmove`,e$4=>preventDefault(e$4),{passive:!1})),nextTick(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})},{immediate:!0,flush:`sync`}),map});function useBodyScrollLock(initialState){let id=Math.random().toString(36).substring(2,7),map=useBodyLockStackCount();map.value.set(id,initialState??!1);let locked=computed({get:()=>map.value.get(id)??!1,set:value$1=>map.value.set(id,value$1)});return tryOnBeforeUnmount(()=>{map.value.delete(id)}),locked}function checkOverflowScroll(ele){let style=window.getComputedStyle(ele);if(style.overflowX===`scroll`||style.overflowY===`scroll`||style.overflowX===`auto`&&ele.clientWidth1?!0:(e$4.preventDefault&&e$4.cancelable&&e$4.preventDefault(),!1)}function useDirection(dir){let context$1=injectConfigProviderContext({dir:ref(`ltr`)});return computed(()=>dir?.value||context$1.dir?.value||`ltr`)}function useEmitAsProps(emit$1){let vm=getCurrentInstance(),events=vm?.type.emits,result={};return events?.length||console.warn(`No emitted event found. Please check component: ${vm?.type.__name}`),events?.forEach(ev=>{result[toHandlerKey(camelize(ev))]=(...arg)=>emit$1(ev,...arg)}),result}function useFilter(options$1){let computedOptions=computed(()=>unref(options$1)),collator=computed(()=>new Intl.Collator(`en`,{usage:`search`,...computedOptions.value})),startsWith=(string$4,substring)=>substring.length===0?!0:(string$4=string$4.normalize(`NFC`),substring=substring.normalize(`NFC`),collator.value.compare(string$4.slice(0,substring.length),substring)===0),endsWith=(string$4,substring)=>substring.length===0?!0:(string$4=string$4.normalize(`NFC`),substring=substring.normalize(`NFC`),collator.value.compare(string$4.slice(-substring.length),substring)===0),contains=(string$4,substring)=>{if(substring.length===0)return!0;string$4=string$4.normalize(`NFC`),substring=substring.normalize(`NFC`);let scan=0,sliceLen=substring.length;for(;scan+sliceLen<=string$4.length;scan++){let slice=string$4.slice(scan,scan+sliceLen);if(collator.value.compare(substring,slice)===0)return!0}return!1};return{startsWith,endsWith,contains}}function useFormControl(el){return computed(()=>toValue$2(el)?!!unrefElement$1(el)?.closest(`form`):!0)}function useForwardExpose(){let instance=getCurrentInstance(),currentRef=ref(),currentElement=computed(()=>[`#text`,`#comment`].includes(currentRef.value?.$el.nodeName)?currentRef.value?.$el.nextElementSibling:unrefElement$1(currentRef)),localExpose=Object.assign({},instance.exposed),ret={};for(let key$2 in instance.props)Object.defineProperty(ret,key$2,{enumerable:!0,configurable:!0,get:()=>instance.props[key$2]});if(Object.keys(localExpose).length>0)for(let key$2 in localExpose)Object.defineProperty(ret,key$2,{enumerable:!0,configurable:!0,get:()=>localExpose[key$2]});Object.defineProperty(ret,`$el`,{enumerable:!0,configurable:!0,get:()=>instance.vnode.el}),instance.exposed=ret;function forwardRef(ref$1){currentRef.value=ref$1,ref$1&&(Object.defineProperty(ret,`$el`,{enumerable:!0,configurable:!0,get:()=>ref$1 instanceof Element?ref$1:ref$1.$el}),instance.exposed=ret)}return{forwardRef,currentRef,currentElement}}function useForwardProps(props){let vm=getCurrentInstance(),defaultProps=Object.keys(vm?.type.props??{}).reduce((prev,curr)=>{let defaultValue=(vm?.type.props[curr]).default;return defaultValue!==void 0&&(prev[curr]=defaultValue),prev},{}),refProps=toRef(props);return computed(()=>{let preservedProps={},assignedProps=vm?.vnode.props??{};return Object.keys(assignedProps).forEach(key$2=>{preservedProps[camelize(key$2)]=assignedProps[key$2]}),Object.keys({...defaultProps,...preservedProps}).reduce((prev,curr)=>(refProps.value[curr]!==void 0&&(prev[curr]=refProps.value[curr]),prev),{})})}function useForwardPropsEmits(props,emit$1){let parsedProps=useForwardProps(props),emitsAsProps=emit$1?useEmitAsProps(emit$1):{};return computed(()=>({...parsedProps.value,...emitsAsProps}))}function useGraceArea(triggerElement,containerElement){let isPointerInTransit=refAutoReset(!1,300),pointerGraceArea=ref(null),pointerExit=createEventHook();function handleRemoveGraceArea(){pointerGraceArea.value=null,isPointerInTransit.value=!1}function handleCreateGraceArea(event,hoverTarget){let currentTarget=event.currentTarget,exitPoint={x:event.clientX,y:event.clientY},exitSide=getExitSideFromRect(exitPoint,currentTarget.getBoundingClientRect()),paddedExitPoints=getPaddedExitPoints(exitPoint,exitSide),hoverTargetPoints=getPointsFromRect(hoverTarget.getBoundingClientRect()),graceArea=getHull([...paddedExitPoints,...hoverTargetPoints]);pointerGraceArea.value=graceArea,isPointerInTransit.value=!0}return watchEffect(cleanupFn=>{if(triggerElement.value&&containerElement.value){let handleTriggerLeave=event=>handleCreateGraceArea(event,containerElement.value),handleContentLeave=event=>handleCreateGraceArea(event,triggerElement.value);triggerElement.value.addEventListener(`pointerleave`,handleTriggerLeave),containerElement.value.addEventListener(`pointerleave`,handleContentLeave),cleanupFn(()=>{triggerElement.value?.removeEventListener(`pointerleave`,handleTriggerLeave),containerElement.value?.removeEventListener(`pointerleave`,handleContentLeave)})}}),watchEffect(cleanupFn=>{if(pointerGraceArea.value){let handleTrackPointerGrace=event=>{if(!pointerGraceArea.value||!(event.target instanceof HTMLElement))return;let target$1=event.target,pointerPosition={x:event.clientX,y:event.clientY},hasEnteredTarget=triggerElement.value?.contains(target$1)||containerElement.value?.contains(target$1),isPointerOutsideGraceArea=!isPointInPolygon(pointerPosition,pointerGraceArea.value),isAnotherGraceAreaTrigger=!!target$1.closest(`[data-grace-area-trigger]`);hasEnteredTarget?handleRemoveGraceArea():(isPointerOutsideGraceArea||isAnotherGraceAreaTrigger)&&(handleRemoveGraceArea(),pointerExit.trigger())};triggerElement.value?.ownerDocument.addEventListener(`pointermove`,handleTrackPointerGrace),cleanupFn(()=>triggerElement.value?.ownerDocument.removeEventListener(`pointermove`,handleTrackPointerGrace))}}),{isPointerInTransit,onPointerExit:pointerExit.on}}function getExitSideFromRect(point$3,rect){let top=Math.abs(rect.top-point$3.y),bottom=Math.abs(rect.bottom-point$3.y),right=Math.abs(rect.right-point$3.x),left=Math.abs(rect.left-point$3.x);switch(Math.min(top,bottom,right,left)){case left:return`left`;case right:return`right`;case top:return`top`;case bottom:return`bottom`;default:throw Error(`unreachable`)}}function getPaddedExitPoints(exitPoint,exitSide,padding=5){let paddedExitPoints=[];switch(exitSide){case`top`:paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y+padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case`bottom`:paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y-padding});break;case`left`:paddedExitPoints.push({x:exitPoint.x+padding,y:exitPoint.y-padding},{x:exitPoint.x+padding,y:exitPoint.y+padding});break;case`right`:paddedExitPoints.push({x:exitPoint.x-padding,y:exitPoint.y-padding},{x:exitPoint.x-padding,y:exitPoint.y+padding});break}return paddedExitPoints}function getPointsFromRect(rect){let{top,right,bottom,left}=rect;return[{x:left,y:top},{x:right,y:top},{x:right,y:bottom},{x:left,y:bottom}]}function isPointInPolygon(point$3,polygon){let{x:x$1,y}=point$3,inside=!1;for(let i=0,j$1=polygon.length-1;iy!=yj>y&&x$1<(xj-xi)*(y-yi)/(yj-yi)+xi;intersect$1&&(inside=!inside)}return inside}function getHull(points){let newPoints=points.slice();return newPoints.sort((a$1,b$1)=>a$1.xb$1.x?1:a$1.yb$1.y?1:0),getHullPresorted(newPoints)}function getHullPresorted(points){if(points.length<=1)return points.slice();let upperHull=[];for(let i=0;i=2;){let q=upperHull[upperHull.length-1],r$1=upperHull[upperHull.length-2];if((q.x-r$1.x)*(p$4.y-r$1.y)>=(q.y-r$1.y)*(p$4.x-r$1.x))upperHull.pop();else break}upperHull.push(p$4)}upperHull.pop();let lowerHull=[];for(let i=points.length-1;i>=0;i--){let p$4=points[i];for(;lowerHull.length>=2;){let q=lowerHull[lowerHull.length-1],r$1=lowerHull[lowerHull.length-2];if((q.x-r$1.x)*(p$4.y-r$1.y)>=(q.y-r$1.y)*(p$4.x-r$1.x))lowerHull.pop();else break}lowerHull.push(p$4)}return lowerHull.pop(),upperHull.length===1&&lowerHull.length===1&&upperHull[0].x===lowerHull[0].x&&upperHull[0].y===lowerHull[0].y?upperHull:upperHull.concat(lowerHull)}var getDefaultParent=function(originalTarget){if(typeof document>`u`)return null;var sampleTarget=Array.isArray(originalTarget)?originalTarget[0]:originalTarget;return sampleTarget.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(node$1){return node$1&&(node$1.host||unwrapHost(node$1.parentNode))},correctTargets=function(parent,targets){return targets.map(function(target$1){if(parent.contains(target$1))return target$1;var correctedTarget=unwrapHost(target$1);return correctedTarget&&parent.contains(correctedTarget)?correctedTarget:(console.error(`aria-hidden`,target$1,`in not contained inside`,parent,`. Doing nothing`),null)}).filter(function(x$1){return!!x$1})},applyAttributeToOthers=function(originalTarget,parentNode,markerName,controlAttribute){var targets=correctTargets(parentNode,Array.isArray(originalTarget)?originalTarget:[originalTarget]);markerMap[markerName]||(markerMap[markerName]=new WeakMap);var markerCounter=markerMap[markerName],hiddenNodes=[],elementsToKeep=new Set,elementsToStop=new Set(targets),keep=function(el){!el||elementsToKeep.has(el)||(elementsToKeep.add(el),keep(el.parentNode))};targets.forEach(keep);var deep=function(parent){!parent||elementsToStop.has(parent)||Array.prototype.forEach.call(parent.children,function(node$1){if(elementsToKeep.has(node$1))deep(node$1);else try{var attr=node$1.getAttribute(controlAttribute),alreadyHidden=attr!==null&&attr!==`false`,counterValue=(counterMap.get(node$1)||0)+1,markerValue=(markerCounter.get(node$1)||0)+1;counterMap.set(node$1,counterValue),markerCounter.set(node$1,markerValue),hiddenNodes.push(node$1),counterValue===1&&alreadyHidden&&uncontrolledNodes.set(node$1,!0),markerValue===1&&node$1.setAttribute(markerName,`true`),alreadyHidden||node$1.setAttribute(controlAttribute,`true`)}catch(e$4){console.error(`aria-hidden: cannot operate on `,node$1,e$4)}})};return deep(parentNode),elementsToKeep.clear(),lockCount++,function(){hiddenNodes.forEach(function(node$1){var counterValue=counterMap.get(node$1)-1,markerValue=markerCounter.get(node$1)-1;counterMap.set(node$1,counterValue),markerCounter.set(node$1,markerValue),counterValue||(uncontrolledNodes.has(node$1)||node$1.removeAttribute(controlAttribute),uncontrolledNodes.delete(node$1)),markerValue||node$1.removeAttribute(markerName)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(originalTarget,parentNode,markerName){markerName===void 0&&(markerName=`data-aria-hidden`);var targets=Array.from(Array.isArray(originalTarget)?originalTarget:[originalTarget]),activeParentNode=parentNode||getDefaultParent(originalTarget);return activeParentNode?(targets.push.apply(targets,Array.from(activeParentNode.querySelectorAll(`[aria-live]`))),applyAttributeToOthers(targets,activeParentNode,markerName,`aria-hidden`)):function(){return null}};function useHideOthers(target$1){let undo;watch(()=>unrefElement$1(target$1),el=>{el?undo=hideOthers(el):undo&&undo()}),onUnmounted(()=>{undo&&undo()})}let count=0;function useId(deterministicId,prefix=`reka`){if(deterministicId)return deterministicId;if(`useId`in vue_runtime_esm_bundler_exports)return`${prefix}-${useId$1?.()}`;let configProviderContext=injectConfigProviderContext({useId:void 0});return configProviderContext.useId?`${prefix}-${configProviderContext.useId()}`:`${prefix}-${++count}`}function useKbd(){return{ALT:`Alt`,ARROW_DOWN:`ArrowDown`,ARROW_LEFT:`ArrowLeft`,ARROW_RIGHT:`ArrowRight`,ARROW_UP:`ArrowUp`,BACKSPACE:`Backspace`,CAPS_LOCK:`CapsLock`,CONTROL:`Control`,DELETE:`Delete`,END:`End`,ENTER:`Enter`,ESCAPE:`Escape`,F1:`F1`,F10:`F10`,F11:`F11`,F12:`F12`,F2:`F2`,F3:`F3`,F4:`F4`,F5:`F5`,F6:`F6`,F7:`F7`,F8:`F8`,F9:`F9`,HOME:`Home`,META:`Meta`,PAGE_DOWN:`PageDown`,PAGE_UP:`PageUp`,SHIFT:`Shift`,SPACE:` `,TAB:`Tab`,CTRL:`Control`,ASTERISK:`*`,SPACE_CODE:`Space`}}function useSize(element$3){let size$2=ref(),width=computed(()=>size$2.value?.width??0),height=computed(()=>size$2.value?.height??0);return onMounted(()=>{let el=unrefElement$1(element$3);if(el){size$2.value={width:el.offsetWidth,height:el.offsetHeight};let resizeObserver=new ResizeObserver(entries=>{if(!Array.isArray(entries)||!entries.length)return;let entry=entries[0],width$1,height$1;if(`borderBoxSize`in entry){let borderSizeEntry=entry.borderBoxSize,borderSize=Array.isArray(borderSizeEntry)?borderSizeEntry[0]:borderSizeEntry;width$1=borderSize.inlineSize,height$1=borderSize.blockSize}else width$1=el.offsetWidth,height$1=el.offsetHeight;size$2.value={width:width$1,height:height$1}});return resizeObserver.observe(el,{box:`border-box`}),()=>resizeObserver.unobserve(el)}else size$2.value=void 0}),{width,height}}function useStateMachine(initialState,machine){let state=ref(initialState);function reducer(event){let nextState=machine[state.value][event];return nextState??state.value}let dispatch=event=>{state.value=reducer(event)};return{state,dispatch}}function useTypeahead(callback){let search$1=refAutoReset(``,1e3),handleTypeaheadSearch=(key$2,items)=>{if(search$1.value+=key$2,callback)callback(key$2);else{let currentItem=getActiveElement(),itemsWithTextValue=items.map(item=>({...item,textValue:item.value?.textValue??item.ref.textContent?.trim()??``})),currentMatch=itemsWithTextValue.find(item=>item.ref===currentItem),values=itemsWithTextValue.map(item=>item.textValue),nextMatch=getNextMatch(values,search$1.value,currentMatch?.textValue),newItem=itemsWithTextValue.find(item=>item.textValue===nextMatch);return newItem&&newItem.ref.focus(),newItem?.ref}},resetTypeahead=()=>{search$1.value=``};return{search:search$1,handleTypeaheadSearch,resetTypeahead}}function wrapArray(array$1,startIndex){return array$1.map((_$1,index$1)=>array$1[(startIndex+index$1)%array$1.length])}function getNextMatch(values,search$1,currentMatch){let isRepeated=search$1.length>1&&Array.from(search$1).every(char=>char===search$1[0]),normalizedSearch=isRepeated?search$1[0]:search$1,currentMatchIndex=currentMatch?values.indexOf(currentMatch):-1,wrappedValues=wrapArray(values,Math.max(currentMatchIndex,0)),excludeCurrentMatch=normalizedSearch.length===1;excludeCurrentMatch&&(wrappedValues=wrappedValues.filter(v=>v!==currentMatch));let nextMatch=wrappedValues.find(value$1=>value$1.toLowerCase().startsWith(normalizedSearch.toLowerCase()));return nextMatch===currentMatch?void 0:nextMatch}function usePresence(present,node$1){let stylesRef=ref({}),prevAnimationNameRef=ref(`none`),prevPresentRef=ref(present),initialState=present.value?`mounted`:`unmounted`,timeoutId,ownerWindow=node$1.value?.ownerDocument.defaultView??defaultWindow,{state,dispatch}=useStateMachine(initialState,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),dispatchCustomEvent=name$2=>{if(isClient$1){let customEvent=new CustomEvent(name$2,{bubbles:!1,cancelable:!1});node$1.value?.dispatchEvent(customEvent)}};watch(present,async(currentPresent,prevPresent)=>{let hasPresentChanged=prevPresent!==currentPresent;if(await nextTick(),hasPresentChanged){let prevAnimationName=prevAnimationNameRef.value,currentAnimationName=getAnimationName(node$1.value);if(currentPresent)dispatch(`MOUNT`),dispatchCustomEvent(`enter`),currentAnimationName===`none`&&dispatchCustomEvent(`after-enter`);else if(currentAnimationName===`none`||currentAnimationName===`undefined`||stylesRef.value?.display===`none`)dispatch(`UNMOUNT`),dispatchCustomEvent(`leave`),dispatchCustomEvent(`after-leave`);else{let isAnimating=prevAnimationName!==currentAnimationName;prevPresent&&isAnimating?(dispatch(`ANIMATION_OUT`),dispatchCustomEvent(`leave`)):(dispatch(`UNMOUNT`),dispatchCustomEvent(`after-leave`))}}},{immediate:!0});let handleAnimationEnd=event=>{let currentAnimationName=getAnimationName(node$1.value),isCurrentAnimation=currentAnimationName.includes(event.animationName),directionName=state.value===`mounted`?`enter`:`leave`;if(event.target===node$1.value&&isCurrentAnimation&&(dispatchCustomEvent(`after-${directionName}`),dispatch(`ANIMATION_END`),!prevPresentRef.value)){let currentFillMode=node$1.value.style.animationFillMode;node$1.value.style.animationFillMode=`forwards`,timeoutId=ownerWindow?.setTimeout(()=>{node$1.value?.style.animationFillMode===`forwards`&&(node$1.value.style.animationFillMode=currentFillMode)})}event.target===node$1.value&¤tAnimationName===`none`&&dispatch(`ANIMATION_END`)},handleAnimationStart=event=>{event.target===node$1.value&&(prevAnimationNameRef.value=getAnimationName(node$1.value))},watcher=watch(node$1,(newNode,oldNode)=>{newNode?(stylesRef.value=getComputedStyle(newNode),newNode.addEventListener(`animationstart`,handleAnimationStart),newNode.addEventListener(`animationcancel`,handleAnimationEnd),newNode.addEventListener(`animationend`,handleAnimationEnd)):(dispatch(`ANIMATION_END`),timeoutId!==void 0&&ownerWindow?.clearTimeout(timeoutId),oldNode?.removeEventListener(`animationstart`,handleAnimationStart),oldNode?.removeEventListener(`animationcancel`,handleAnimationEnd),oldNode?.removeEventListener(`animationend`,handleAnimationEnd))},{immediate:!0}),stateWatcher=watch(state,()=>{let currentAnimationName=getAnimationName(node$1.value);prevAnimationNameRef.value=state.value===`mounted`?currentAnimationName:`none`});onUnmounted(()=>{watcher(),stateWatcher()});let isPresent=computed(()=>[`mounted`,`unmountSuspended`].includes(state.value));return{isPresent}}function getAnimationName(node$1){return node$1&&getComputedStyle(node$1).animationName||`none`}var Presence_default=defineComponent({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(props,{slots,expose}){let{present,forceMount}=toRefs(props),node$1=ref(),{isPresent}=usePresence(present,node$1);expose({present:isPresent});let children=slots.default({present:isPresent.value});children=renderSlotFragments(children||[]);let instance=getCurrentInstance();if(children&&children?.length>1){let componentName=instance?.parent?.type.name?`<${instance.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${componentName}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(line=>` - ${line}`).join(` `)].join(` `))}return()=>forceMount.value||present.value||isPresent.value?h(slots.default({present:isPresent.value})[0],{ref:v=>{let el=unrefElement$1(v);return el?.hasAttribute===void 0||(el?.hasAttribute(`data-reka-popper-content-wrapper`)?node$1.value=el.firstElementChild:node$1.value=el),el}}):null}});const Slot=defineComponent({name:`PrimitiveSlot`,inheritAttrs:!1,setup(_$1,{attrs,slots}){return()=>{if(!slots.default)return null;let children=renderSlotFragments(slots.default()),firstNonCommentChildrenIndex=children.findIndex(child=>child.type!==Comment);if(firstNonCommentChildrenIndex===-1)return children;let firstNonCommentChildren=children[firstNonCommentChildrenIndex];delete firstNonCommentChildren.props?.ref;let mergedProps=firstNonCommentChildren.props?mergeProps(attrs,firstNonCommentChildren.props):attrs,cloned=cloneVNode({...firstNonCommentChildren,props:{}},mergedProps);return children.length===1?cloned:(children[firstNonCommentChildrenIndex]=cloned,children)}}}),SELF_CLOSING_TAGS=[`area`,`img`,`input`],Primitive=defineComponent({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(props,{attrs,slots}){let asTag=props.asChild?`template`:props.as;return typeof asTag==`string`&&SELF_CLOSING_TAGS.includes(asTag)?()=>h(asTag,attrs):asTag===`template`?()=>h(Slot,attrs,{default:slots.default}):()=>h(props.as,attrs,{default:slots.default})}});function usePrimitiveElement(){let primitiveElement=ref(),currentElement=computed(()=>[`#text`,`#comment`].includes(primitiveElement.value?.$el.nodeName)?primitiveElement.value?.$el.nextElementSibling:unrefElement$1(primitiveElement));return{primitiveElement,currentElement}}const[injectDialogRootContext,provideDialogRootContext]=createContext(`DialogRoot`);var DialogRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,open$1=useVModel(props,`open`,emit$1,{defaultValue:props.defaultOpen,passive:props.open===void 0}),triggerElement=ref(),contentElement=ref(),{modal}=toRefs(props);return provideDialogRootContext({open:open$1,modal,openModal:()=>{open$1.value=!0},onOpenChange:value$1=>{open$1.value=value$1},onOpenToggle:()=>{open$1.value=!open$1.value},contentId:``,titleId:``,descriptionId:``,triggerElement,contentElement}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`,{open:unref(open$1),close:()=>open$1.value=!1})}}),DialogRoot_default=DialogRoot_vue_vue_type_script_setup_true_lang_default;const POINTER_DOWN_OUTSIDE=`dismissableLayer.pointerDownOutside`,FOCUS_OUTSIDE=`dismissableLayer.focusOutside`;function isLayerExist(layerElement,targetElement){let targetLayer=targetElement.closest(`[data-dismissable-layer]`),mainLayer=layerElement.dataset.dismissableLayer===``?layerElement:layerElement.querySelector(`[data-dismissable-layer]`),nodeList=Array.from(layerElement.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(targetLayer&&(mainLayer===targetLayer||nodeList.indexOf(mainLayer){});return watchEffect(cleanupFn=>{if(!isClient$1||!toValue$1(enabled$1))return;let handlePointerDown=async event=>{let target$1=event.target;if(!(!element$3?.value||!target$1)){if(isLayerExist(element$3.value,target$1)){isPointerInsideDOMTree.value=!1;return}if(event.target&&!isPointerInsideDOMTree.value){let eventDetail={originalEvent:event};function handleAndDispatchPointerDownOutsideEvent(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,onPointerDownOutside,eventDetail)}event.pointerType===`touch`?(ownerDocument.removeEventListener(`click`,handleClickRef.value),handleClickRef.value=handleAndDispatchPointerDownOutsideEvent,ownerDocument.addEventListener(`click`,handleClickRef.value,{once:!0})):handleAndDispatchPointerDownOutsideEvent()}else ownerDocument.removeEventListener(`click`,handleClickRef.value);isPointerInsideDOMTree.value=!1}},timerId$1=window.setTimeout(()=>{ownerDocument.addEventListener(`pointerdown`,handlePointerDown)},0);cleanupFn(()=>{window.clearTimeout(timerId$1),ownerDocument.removeEventListener(`pointerdown`,handlePointerDown),ownerDocument.removeEventListener(`click`,handleClickRef.value)})}),{onPointerDownCapture:()=>{toValue$1(enabled$1)&&(isPointerInsideDOMTree.value=!0)}}}function useFocusOutside(onFocusOutside,element$3,enabled$1=!0){let ownerDocument=element$3?.value?.ownerDocument??globalThis?.document,isFocusInsideDOMTree=ref(!1);return watchEffect(cleanupFn=>{if(!isClient$1||!toValue$1(enabled$1))return;let handleFocus=async event=>{if(!element$3?.value)return;await nextTick(),await nextTick();let target$1=event.target;if(!(!element$3.value||!target$1||isLayerExist(element$3.value,target$1))&&event.target&&!isFocusInsideDOMTree.value){let eventDetail={originalEvent:event};handleAndDispatchCustomEvent(FOCUS_OUTSIDE,onFocusOutside,eventDetail)}};ownerDocument.addEventListener(`focusin`,handleFocus),cleanupFn(()=>ownerDocument.removeEventListener(`focusin`,handleFocus))}),{onFocusCapture:()=>{toValue$1(enabled$1)&&(isFocusInsideDOMTree.value=!0)},onBlurCapture:()=>{toValue$1(enabled$1)&&(isFocusInsideDOMTree.value=!1)}}}const context=reactive({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set});var DismissableLayer_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,{forwardRef,currentElement:layerElement}=useForwardExpose(),ownerDocument=computed(()=>layerElement.value?.ownerDocument??globalThis.document),layers=computed(()=>context.layersRoot),index$1=computed(()=>layerElement.value?Array.from(layers.value).indexOf(layerElement.value):-1),isBodyPointerEventsDisabled=computed(()=>context.layersWithOutsidePointerEventsDisabled.size>0),isPointerEventsEnabled=computed(()=>{let localLayers=Array.from(layers.value),[highestLayerWithOutsidePointerEventsDisabled]=[...context.layersWithOutsidePointerEventsDisabled].slice(-1),highestLayerWithOutsidePointerEventsDisabledIndex=localLayers.indexOf(highestLayerWithOutsidePointerEventsDisabled);return index$1.value>=highestLayerWithOutsidePointerEventsDisabledIndex}),pointerDownOutside=usePointerDownOutside(async event=>{let isPointerDownOnBranch=[...context.branches].some(branch=>branch?.contains(event.target));!isPointerEventsEnabled.value||isPointerDownOnBranch||(emits(`pointerDownOutside`,event),emits(`interactOutside`,event),await nextTick(),event.defaultPrevented||emits(`dismiss`))},layerElement),focusOutside=useFocusOutside(event=>{let isFocusInBranch=[...context.branches].some(branch=>branch?.contains(event.target));isFocusInBranch||(emits(`focusOutside`,event),emits(`interactOutside`,event),event.defaultPrevented||emits(`dismiss`))},layerElement);onKeyStroke(`Escape`,event=>{let isHighestLayer=index$1.value===layers.value.size-1;isHighestLayer&&(emits(`escapeKeyDown`,event),event.defaultPrevented||emits(`dismiss`))});let originalBodyPointerEvents;return watchEffect(cleanupFn=>{layerElement.value&&(props.disableOutsidePointerEvents&&(context.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=ownerDocument.value.body.style.pointerEvents,ownerDocument.value.body.style.pointerEvents=`none`),context.layersWithOutsidePointerEventsDisabled.add(layerElement.value)),layers.value.add(layerElement.value),cleanupFn(()=>{props.disableOutsidePointerEvents&&context.layersWithOutsidePointerEventsDisabled.size===1&&(ownerDocument.value.body.style.pointerEvents=originalBodyPointerEvents)}))}),watchEffect(cleanupFn=>{cleanupFn(()=>{layerElement.value&&(layers.value.delete(layerElement.value),context.layersWithOutsidePointerEventsDisabled.delete(layerElement.value))})}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{ref:unref(forwardRef),"as-child":_ctx.asChild,as:_ctx.as,"data-dismissable-layer":``,style:normalizeStyle({pointerEvents:isBodyPointerEventsDisabled.value?isPointerEventsEnabled.value?`auto`:`none`:void 0}),onFocusCapture:unref(focusOutside).onFocusCapture,onBlurCapture:unref(focusOutside).onBlurCapture,onPointerdownCapture:unref(pointerDownOutside).onPointerDownCapture},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),DismissableLayer_default=DismissableLayer_vue_vue_type_script_setup_true_lang_default;const useFocusStackState=createGlobalState(()=>{let stack$1=ref([]);return stack$1});function createFocusScopesStack(){let stack$1=useFocusStackState();return{add(focusScope){let activeFocusScope=stack$1.value[0];focusScope!==activeFocusScope&&activeFocusScope?.pause(),stack$1.value=arrayRemove(stack$1.value,focusScope),stack$1.value.unshift(focusScope)},remove(focusScope){stack$1.value=arrayRemove(stack$1.value,focusScope),stack$1.value[0]?.resume()}}}function arrayRemove(array$1,item){let updatedArray=[...array$1],index$1=updatedArray.indexOf(item);return index$1!==-1&&updatedArray.splice(index$1,1),updatedArray}function removeLinks(items){return items.filter(item=>item.tagName!==`A`)}const AUTOFOCUS_ON_MOUNT=`focusScope.autoFocusOnMount`,AUTOFOCUS_ON_UNMOUNT=`focusScope.autoFocusOnUnmount`,EVENT_OPTIONS={bubbles:!1,cancelable:!0};function focusFirst(candidates,{select=!1}={}){let previouslyFocusedElement=getActiveElement();for(let candidate of candidates)if(focus(candidate,{select}),getActiveElement()!==previouslyFocusedElement)return!0}function getTabbableEdges(container){let candidates=getTabbableCandidates(container),first=findVisible(candidates,container),last=findVisible(candidates.reverse(),container);return[first,last]}function getTabbableCandidates(container){let nodes=[],walker=document.createTreeWalker(container,NodeFilter.SHOW_ELEMENT,{acceptNode:node$1=>{let isHiddenInput=node$1.tagName===`INPUT`&&node$1.type===`hidden`;return node$1.disabled||node$1.hidden||isHiddenInput?NodeFilter.FILTER_SKIP:node$1.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;walker.nextNode();)nodes.push(walker.currentNode);return nodes}function findVisible(elements,container){for(let element$3 of elements)if(!isHidden(element$3,{upTo:container}))return element$3}function isHidden(node$1,{upTo}){if(getComputedStyle(node$1).visibility===`hidden`)return!0;for(;node$1;){if(upTo!==void 0&&node$1===upTo)return!1;if(getComputedStyle(node$1).display===`none`)return!0;node$1=node$1.parentElement}return!1}function isSelectableInput(element$3){return element$3 instanceof HTMLInputElement&&`select`in element$3}function focus(element$3,{select=!1}={}){if(element$3&&element$3.focus){let previouslyFocusedElement=getActiveElement();element$3.focus({preventScroll:!0}),element$3!==previouslyFocusedElement&&isSelectableInput(element$3)&&select&&element$3.select()}}var FocusScope_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,{currentRef,currentElement}=useForwardExpose(),lastFocusedElementRef=ref(null),focusScopesStack=createFocusScopesStack(),focusScope=reactive({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});watchEffect(cleanupFn=>{if(!isClient$1)return;let container=currentElement.value;if(!props.trapped)return;function handleFocusIn(event){if(focusScope.paused||!container)return;let target$1=event.target;container.contains(target$1)?lastFocusedElementRef.value=target$1:focus(lastFocusedElementRef.value,{select:!0})}function handleFocusOut(event){if(focusScope.paused||!container)return;let relatedTarget=event.relatedTarget;relatedTarget!==null&&(container.contains(relatedTarget)||focus(lastFocusedElementRef.value,{select:!0}))}function handleMutations$1(mutations$1){let isLastFocusedElementExist=container.contains(lastFocusedElementRef.value);isLastFocusedElementExist||focus(container)}document.addEventListener(`focusin`,handleFocusIn),document.addEventListener(`focusout`,handleFocusOut);let mutationObserver=new MutationObserver(handleMutations$1);container&&mutationObserver.observe(container,{childList:!0,subtree:!0}),cleanupFn(()=>{document.removeEventListener(`focusin`,handleFocusIn),document.removeEventListener(`focusout`,handleFocusOut),mutationObserver.disconnect()})}),watchEffect(async cleanupFn=>{let container=currentElement.value;if(await nextTick(),!container)return;focusScopesStack.add(focusScope);let previouslyFocusedElement=getActiveElement(),hasFocusedCandidate=container.contains(previouslyFocusedElement);if(!hasFocusedCandidate){let mountEvent=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);container.addEventListener(AUTOFOCUS_ON_MOUNT,ev=>emits(`mountAutoFocus`,ev)),container.dispatchEvent(mountEvent),mountEvent.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(container)),{select:!0}),getActiveElement()===previouslyFocusedElement&&focus(container))}cleanupFn(()=>{container.removeEventListener(AUTOFOCUS_ON_MOUNT,ev=>emits(`mountAutoFocus`,ev));let unmountEvent=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS),unmountEventHandler=ev=>{emits(`unmountAutoFocus`,ev)};container.addEventListener(AUTOFOCUS_ON_UNMOUNT,unmountEventHandler),container.dispatchEvent(unmountEvent),setTimeout(()=>{unmountEvent.defaultPrevented||focus(previouslyFocusedElement??document.body,{select:!0}),container.removeEventListener(AUTOFOCUS_ON_UNMOUNT,unmountEventHandler),focusScopesStack.remove(focusScope)},0)})});function handleKeyDown(event){if(!props.loop&&!props.trapped||focusScope.paused)return;let isTabKey=event.key===`Tab`&&!event.altKey&&!event.ctrlKey&&!event.metaKey,focusedElement=getActiveElement();if(isTabKey&&focusedElement){let container=event.currentTarget,[first,last]=getTabbableEdges(container),hasTabbableElementsInside=first&&last;hasTabbableElementsInside?!event.shiftKey&&focusedElement===last?(event.preventDefault(),props.loop&&focus(first,{select:!0})):event.shiftKey&&focusedElement===first&&(event.preventDefault(),props.loop&&focus(last,{select:!0})):focusedElement===container&&event.preventDefault()}}return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{ref_key:`currentRef`,ref:currentRef,tabindex:`-1`,"as-child":_ctx.asChild,as:_ctx.as,onKeydown:handleKeyDown},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),FocusScope_default=FocusScope_vue_vue_type_script_setup_true_lang_default;const SELECTION_KEYS=[`Enter`,` `],FIRST_KEYS=[`ArrowDown`,`PageUp`,`Home`],LAST_KEYS=[`ArrowUp`,`PageDown`,`End`],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS,`ArrowRight`],rtl:[...SELECTION_KEYS,`ArrowLeft`]};function getOpenState(open$1){return open$1?`open`:`closed`}var DialogContentImpl_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectDialogRootContext(),{forwardRef,currentElement:contentElement}=useForwardExpose();return rootContext.titleId||=useId(void 0,`reka-dialog-title`),rootContext.descriptionId||=useId(void 0,`reka-dialog-description`),onMounted(()=>{rootContext.contentElement=contentElement,getActiveElement()!==document.body&&(rootContext.triggerElement.value=getActiveElement())}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FocusScope_default),{"as-child":``,loop:``,trapped:props.trapFocus,onMountAutoFocus:_cache$1[5]||=$event=>emits(`openAutoFocus`,$event),onUnmountAutoFocus:_cache$1[6]||=$event=>emits(`closeAutoFocus`,$event)},{default:withCtx(()=>[createVNode(unref(DismissableLayer_default),mergeProps({id:unref(rootContext).contentId,ref:unref(forwardRef),as:_ctx.as,"as-child":_ctx.asChild,"disable-outside-pointer-events":_ctx.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":unref(rootContext).descriptionId,"aria-labelledby":unref(rootContext).titleId,"data-state":unref(getOpenState)(unref(rootContext).open.value)},_ctx.$attrs,{onDismiss:_cache$1[0]||=$event=>unref(rootContext).onOpenChange(!1),onEscapeKeyDown:_cache$1[1]||=$event=>emits(`escapeKeyDown`,$event),onFocusOutside:_cache$1[2]||=$event=>emits(`focusOutside`,$event),onInteractOutside:_cache$1[3]||=$event=>emits(`interactOutside`,$event),onPointerDownOutside:_cache$1[4]||=$event=>emits(`pointerDownOutside`,$event)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`]))}}),DialogContentImpl_default=DialogContentImpl_vue_vue_type_script_setup_true_lang_default,DialogContentModal_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectDialogRootContext(),emitsAsProps=useEmitAsProps(emits),{forwardRef,currentElement}=useForwardExpose();return useHideOthers(currentElement),(_ctx,_cache$1)=>(openBlock(),createBlock(DialogContentImpl_default,mergeProps({...props,...unref(emitsAsProps)},{ref:unref(forwardRef),"trap-focus":unref(rootContext).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:_cache$1[0]||=event=>{event.defaultPrevented||(event.preventDefault(),unref(rootContext).triggerElement.value?.focus())},onPointerDownOutside:_cache$1[1]||=event=>{let originalEvent=event.detail.originalEvent,ctrlLeftClick=originalEvent.button===0&&originalEvent.ctrlKey===!0,isRightClick=originalEvent.button===2||ctrlLeftClick;isRightClick&&event.preventDefault()},onFocusOutside:_cache$1[2]||=event=>{event.preventDefault()}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),DialogContentModal_default=DialogContentModal_vue_vue_type_script_setup_true_lang_default,DialogContentNonModal_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,emitsAsProps=useEmitAsProps(emits);useForwardExpose();let rootContext=injectDialogRootContext(),hasInteractedOutsideRef=ref(!1),hasPointerDownOutsideRef=ref(!1);return(_ctx,_cache$1)=>(openBlock(),createBlock(DialogContentImpl_default,mergeProps({...props,...unref(emitsAsProps)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:_cache$1[0]||=event=>{event.defaultPrevented||(hasInteractedOutsideRef.value||unref(rootContext).triggerElement.value?.focus(),event.preventDefault()),hasInteractedOutsideRef.value=!1,hasPointerDownOutsideRef.value=!1},onInteractOutside:_cache$1[1]||=event=>{event.defaultPrevented||(hasInteractedOutsideRef.value=!0,event.detail.originalEvent.type===`pointerdown`&&(hasPointerDownOutsideRef.value=!0));let target$1=event.target,targetIsTrigger=unref(rootContext).triggerElement.value?.contains(target$1);targetIsTrigger&&event.preventDefault(),event.detail.originalEvent.type===`focusin`&&hasPointerDownOutsideRef.value&&event.preventDefault()}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),DialogContentNonModal_default=DialogContentNonModal_vue_vue_type_script_setup_true_lang_default,DialogContent_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectDialogRootContext(),emitsAsProps=useEmitAsProps(emits),{forwardRef}=useForwardExpose();return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Presence_default),{present:_ctx.forceMount||unref(rootContext).open.value},{default:withCtx(()=>[unref(rootContext).modal.value?(openBlock(),createBlock(DialogContentModal_default,mergeProps({key:0,ref:unref(forwardRef)},{...props,...unref(emitsAsProps),..._ctx.$attrs}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16)):(openBlock(),createBlock(DialogContentNonModal_default,mergeProps({key:1,ref:unref(forwardRef)},{...props,...unref(emitsAsProps),..._ctx.$attrs}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),DialogContent_default=DialogContent_vue_vue_type_script_setup_true_lang_default,DialogOverlayImpl_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let rootContext=injectDialogRootContext();return useBodyScrollLock(!0),useForwardExpose(),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{as:_ctx.as,"as-child":_ctx.asChild,"data-state":unref(rootContext).open.value?`open`:`closed`,style:{"pointer-events":`auto`}},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),DialogOverlayImpl_default=DialogOverlayImpl_vue_vue_type_script_setup_true_lang_default,DialogOverlay_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let rootContext=injectDialogRootContext(),{forwardRef}=useForwardExpose();return(_ctx,_cache$1)=>unref(rootContext)?.modal.value?(openBlock(),createBlock(unref(Presence_default),{key:0,present:_ctx.forceMount||unref(rootContext).open.value},{default:withCtx(()=>[createVNode(DialogOverlayImpl_default,mergeProps(_ctx.$attrs,{ref:unref(forwardRef),as:_ctx.as,"as-child":_ctx.asChild}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`as`,`as-child`])]),_:3},8,[`present`])):createCommentVNode(`v-if`,!0)}}),DialogOverlay_default=DialogOverlay_vue_vue_type_script_setup_true_lang_default,Teleport_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Teleport`,props:{to:{type:null,required:!1,default:`body`},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(__props){let isMounted=useMounted();return(_ctx,_cache$1)=>unref(isMounted)||_ctx.forceMount?(openBlock(),createBlock(Teleport,{key:0,to:_ctx.to,disabled:_ctx.disabled,defer:_ctx.defer},[renderSlot(_ctx.$slots,`default`)],8,[`to`,`disabled`,`defer`])):createCommentVNode(`v-if`,!0)}}),Teleport_default=Teleport_vue_vue_type_script_setup_true_lang_default,DialogPortal_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(__props){let props=__props;return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Teleport_default),normalizeProps(guardReactiveProps(props)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),DialogPortal_default=DialogPortal_vue_vue_type_script_setup_true_lang_default;const ITEM_DATA_ATTR=`data-reka-collection-item`;function useCollection(options$1={}){let{key:key$2=``,isProvider=!1}=options$1,injectionKey=`${key$2}CollectionProvider`,context$1;if(isProvider){let itemMap=ref(new Map),collectionRef=ref();context$1={collectionRef,itemMap},provide(injectionKey,context$1)}else context$1=inject(injectionKey);let getItems=(includeDisabledItem=!1)=>{let collectionNode=context$1.collectionRef.value;if(!collectionNode)return[];let orderedNodes=Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)),items=Array.from(context$1.itemMap.value.values()),orderedItems=items.sort((a$1,b$1)=>orderedNodes.indexOf(a$1.ref)-orderedNodes.indexOf(b$1.ref));return includeDisabledItem?orderedItems:orderedItems.filter(i=>i.ref.dataset.disabled!==``)},CollectionSlot=defineComponent({name:`CollectionSlot`,setup(_$1,{slots}){let{primitiveElement,currentElement}=usePrimitiveElement();return watch(currentElement,()=>{context$1.collectionRef.value=currentElement.value}),()=>h(Slot,{ref:primitiveElement},slots)}}),CollectionItem=defineComponent({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(props,{slots,attrs}){let{primitiveElement,currentElement}=usePrimitiveElement();return watchEffect(cleanupFn=>{if(currentElement.value){let key$1$1=markRaw(currentElement.value);context$1.itemMap.value.set(key$1$1,{ref:currentElement.value,value:props.value}),cleanupFn(()=>context$1.itemMap.value.delete(key$1$1))}}),()=>h(Slot,{...attrs,[ITEM_DATA_ATTR]:``,ref:primitiveElement},slots)}}),reactiveItems=computed(()=>Array.from(context$1.itemMap.value.values())),itemMapSize=computed(()=>context$1.itemMap.value.size);return{getItems,reactiveItems,itemMapSize,CollectionSlot,CollectionItem}}const MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function getDirectionAwareKey(key$2,dir){return dir===`rtl`?key$2===`ArrowLeft`?`ArrowRight`:key$2===`ArrowRight`?`ArrowLeft`:key$2:key$2}function getFocusIntent(event,orientation,dir){let key$2=getDirectionAwareKey(event.key,dir);if(!(orientation===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(key$2))&&!(orientation===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(key$2)))return MAP_KEY_TO_FOCUS_INTENT[key$2]}var VisuallyHidden_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{as:_ctx.as,"as-child":_ctx.asChild,"aria-hidden":_ctx.feature===`focusable`?`true`:void 0,"data-hidden":_ctx.feature===`fully-hidden`?``:void 0,tabindex:_ctx.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`}},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),VisuallyHidden_default=VisuallyHidden_vue_vue_type_script_setup_true_lang_default,VisuallyHiddenInputBubble_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(__props){let props=__props,{primitiveElement,currentElement}=usePrimitiveElement(),valueState=computed(()=>props.checked??props.value);return watch(valueState,(cur,prev)=>{if(!currentElement.value)return;let input=currentElement.value,inputProto=window.HTMLInputElement.prototype,descriptor=Object.getOwnPropertyDescriptor(inputProto,`value`),setValue$1=descriptor.set;if(setValue$1&&cur!==prev){let inputEvent=new Event(`input`,{bubbles:!0}),changeEvent=new Event(`change`,{bubbles:!0});setValue$1.call(input,cur),input.dispatchEvent(inputEvent),input.dispatchEvent(changeEvent)}}),(_ctx,_cache$1)=>(openBlock(),createBlock(VisuallyHidden_default,mergeProps({ref_key:`primitiveElement`,ref:primitiveElement},{...props,..._ctx.$attrs},{as:`input`}),null,16))}}),VisuallyHiddenInputBubble_default=VisuallyHiddenInputBubble_vue_vue_type_script_setup_true_lang_default,VisuallyHiddenInput_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(__props){let props=__props,isFormArrayEmptyAndRequired=computed(()=>typeof props.value==`object`&&Array.isArray(props.value)&&props.value.length===0&&props.required),parsedValue=computed(()=>typeof props.value==`string`||typeof props.value==`number`||typeof props.value==`boolean`||props.value===null||props.value===void 0?[{name:props.name,value:props.value}]:typeof props.value==`object`&&Array.isArray(props.value)?props.value.flatMap((obj,index$1)=>typeof obj==`object`?Object.entries(obj).map(([key$2,value$1])=>({name:`${props.name}[${index$1}][${key$2}]`,value:value$1})):{name:`${props.name}[${index$1}]`,value:obj}):props.value!==null&&typeof props.value==`object`&&!Array.isArray(props.value)?Object.entries(props.value).map(([key$2,value$1])=>({name:`${props.name}[${key$2}]`,value:value$1})):[]);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createCommentVNode(` We render single input if it's required `),isFormArrayEmptyAndRequired.value?(openBlock(),createBlock(VisuallyHiddenInputBubble_default,mergeProps({key:_ctx.name},{...props,..._ctx.$attrs},{name:_ctx.name,value:_ctx.value}),null,16,[`name`,`value`])):(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(parsedValue.value,parsed=>(openBlock(),createBlock(VisuallyHiddenInputBubble_default,mergeProps({key:parsed.name},{ref_for:!0},{...props,..._ctx.$attrs},{name:parsed.name,value:parsed.value}),null,16,[`name`,`value`]))),128))],2112))}}),VisuallyHiddenInput_default=VisuallyHiddenInput_vue_vue_type_script_setup_true_lang_default;const[injectPopperRootContext,providePopperRootContext]=createContext(`PopperRoot`);var PopperRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`PopperRoot`,setup(__props){let anchor=ref();return providePopperRootContext({anchor,onAnchorChange:element$3=>anchor.value=element$3}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`)}}),PopperRoot_default=PopperRoot_vue_vue_type_script_setup_true_lang_default,PopperAnchor_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let props=__props,{forwardRef,currentElement}=useForwardExpose(),rootContext=injectPopperRootContext();return watchPostEffect(()=>{rootContext.onAnchorChange(props.reference??currentElement.value)}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{ref:unref(forwardRef),as:_ctx.as,"as-child":_ctx.asChild},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}}),PopperAnchor_default=PopperAnchor_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$52={key:0,d:`M0 0L6 6L12 0`},_hoisted_2$34={key:1,d:`M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0`};var Arrow_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Arrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(__props){let props=__props;return useForwardExpose(),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),mergeProps(props,{width:_ctx.width,height:_ctx.height,viewBox:_ctx.asChild?void 0:`0 0 12 6`,preserveAspectRatio:_ctx.asChild?void 0:`none`}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},()=>[_ctx.rounded?(openBlock(),createElementBlock(`path`,_hoisted_2$34)):(openBlock(),createElementBlock(`path`,_hoisted_1$52))])]),_:3},16,[`width`,`height`,`viewBox`,`preserveAspectRatio`]))}}),Arrow_default=Arrow_vue_vue_type_script_setup_true_lang_default;function isNotNull(value$1){return value$1!==null}function transformOrigin(options$1){return{name:`transformOrigin`,options:options$1,fn(data$12){let{placement,rects,middlewareData}=data$12,cannotCenterArrow=middlewareData.arrow?.centerOffset!==0,isArrowHidden=cannotCenterArrow,arrowWidth=isArrowHidden?0:options$1.arrowWidth,arrowHeight=isArrowHidden?0:options$1.arrowHeight,[placedSide,placedAlign]=getSideAndAlignFromPlacement(placement),noArrowAlign={start:`0%`,center:`50%`,end:`100%`}[placedAlign],arrowXCenter=(middlewareData.arrow?.x??0)+arrowWidth/2,arrowYCenter=(middlewareData.arrow?.y??0)+arrowHeight/2,x$1=``,y=``;return placedSide===`bottom`?(x$1=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y=`${-arrowHeight}px`):placedSide===`top`?(x$1=isArrowHidden?noArrowAlign:`${arrowXCenter}px`,y=`${rects.floating.height+arrowHeight}px`):placedSide===`right`?(x$1=`${-arrowHeight}px`,y=isArrowHidden?noArrowAlign:`${arrowYCenter}px`):placedSide===`left`&&(x$1=`${rects.floating.width+arrowHeight}px`,y=isArrowHidden?noArrowAlign:`${arrowYCenter}px`),{data:{x:x$1,y}}}}}function getSideAndAlignFromPlacement(placement){let[side,align=`center`]=placement.split(`-`);return[side,align]}const sides=[`top`,`right`,`bottom`,`left`],min=Math.min,max=Math.max,round$2=Math.round,floor$1=Math.floor,createCoords=v=>({x:v,y:v}),oppositeSideMap={left:`right`,right:`left`,bottom:`top`,top:`bottom`},oppositeAlignmentMap={start:`end`,end:`start`};function clamp$2(start,value$1,end){return max(start,min(value$1,end))}function evaluate(value$1,param){return typeof value$1==`function`?value$1(param):value$1}function getSide(placement){return placement.split(`-`)[0]}function getAlignment(placement){return placement.split(`-`)[1]}function getOppositeAxis(axis){return axis===`x`?`y`:`x`}function getAxisLength(axis){return axis===`y`?`height`:`width`}function getSideAxis(placement){return[`top`,`bottom`].includes(getSide(placement))?`y`:`x`}function getAlignmentAxis(placement){return getOppositeAxis(getSideAxis(placement))}function getAlignmentSides(placement,rects,rtl){rtl===void 0&&(rtl=!1);let alignment=getAlignment(placement),alignmentAxis=getAlignmentAxis(placement),length=getAxisLength(alignmentAxis),mainAlignmentSide=alignmentAxis===`x`?alignment===(rtl?`end`:`start`)?`right`:`left`:alignment===`start`?`bottom`:`top`;return rects.reference[length]>rects.floating[length]&&(mainAlignmentSide=getOppositePlacement(mainAlignmentSide)),[mainAlignmentSide,getOppositePlacement(mainAlignmentSide)]}function getExpandedPlacements(placement){let oppositePlacement=getOppositePlacement(placement);return[getOppositeAlignmentPlacement(placement),oppositePlacement,getOppositeAlignmentPlacement(oppositePlacement)]}function getOppositeAlignmentPlacement(placement){return placement.replace(/start|end/g,alignment=>oppositeAlignmentMap[alignment])}function getSideList(side,isStart,rtl){let lr=[`left`,`right`],rl=[`right`,`left`],tb=[`top`,`bottom`],bt$2=[`bottom`,`top`];switch(side){case`top`:case`bottom`:return rtl?isStart?rl:lr:isStart?lr:rl;case`left`:case`right`:return isStart?tb:bt$2;default:return[]}}function getOppositeAxisPlacements(placement,flipAlignment,direction,rtl){let alignment=getAlignment(placement),list$2=getSideList(getSide(placement),direction===`start`,rtl);return alignment&&(list$2=list$2.map(side=>side+`-`+alignment),flipAlignment&&(list$2=list$2.concat(list$2.map(getOppositeAlignmentPlacement)))),list$2}function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,side=>oppositeSideMap[side])}function expandPaddingObject(padding){return{top:0,right:0,bottom:0,left:0,...padding}}function getPaddingObject(padding){return typeof padding==`number`?{top:padding,right:padding,bottom:padding,left:padding}:expandPaddingObject(padding)}function rectToClientRect(rect){let{x:x$1,y,width,height}=rect;return{width,height,top:y,left:x$1,right:x$1+width,bottom:y+height,x:x$1,y}}function computeCoordsFromPlacement(_ref,placement,rtl){let{reference,floating}=_ref,sideAxis=getSideAxis(placement),alignmentAxis=getAlignmentAxis(placement),alignLength=getAxisLength(alignmentAxis),side=getSide(placement),isVertical=sideAxis===`y`,commonX=reference.x+reference.width/2-floating.width/2,commonY=reference.y+reference.height/2-floating.height/2,commonAlign=reference[alignLength]/2-floating[alignLength]/2,coords$1;switch(side){case`top`:coords$1={x:commonX,y:reference.y-floating.height};break;case`bottom`:coords$1={x:commonX,y:reference.y+reference.height};break;case`right`:coords$1={x:reference.x+reference.width,y:commonY};break;case`left`:coords$1={x:reference.x-floating.width,y:commonY};break;default:coords$1={x:reference.x,y:reference.y}}switch(getAlignment(placement)){case`start`:coords$1[alignmentAxis]-=commonAlign*(rtl&&isVertical?-1:1);break;case`end`:coords$1[alignmentAxis]+=commonAlign*(rtl&&isVertical?-1:1);break}return coords$1}const computePosition$1=async(reference,floating,config$1)=>{let{placement=`bottom`,strategy=`absolute`,middleware=[],platform:platform$1}=config$1,validMiddleware=middleware.filter(Boolean),rtl=await(platform$1.isRTL==null?void 0:platform$1.isRTL(floating)),rects=await platform$1.getElementRects({reference,floating,strategy}),{x:x$1,y}=computeCoordsFromPlacement(rects,placement,rtl),statefulPlacement=placement,middlewareData={},resetCount=0;for(let i=0;i({name:`arrow`,options:options$1,async fn(state){let{x:x$1,y,placement,rects,platform:platform$1,elements,middlewareData}=state,{element:element$3,padding=0}=evaluate(options$1,state)||{};if(element$3==null)return{};let paddingObject=getPaddingObject(padding),coords$1={x:x$1,y},axis=getAlignmentAxis(placement),length=getAxisLength(axis),arrowDimensions=await platform$1.getDimensions(element$3),isYAxis=axis===`y`,minProp=isYAxis?`top`:`left`,maxProp=isYAxis?`bottom`:`right`,clientProp=isYAxis?`clientHeight`:`clientWidth`,endDiff=rects.reference[length]+rects.reference[axis]-coords$1[axis]-rects.floating[length],startDiff=coords$1[axis]-rects.reference[axis],arrowOffsetParent=await(platform$1.getOffsetParent==null?void 0:platform$1.getOffsetParent(element$3)),clientSize=arrowOffsetParent?arrowOffsetParent[clientProp]:0;(!clientSize||!await(platform$1.isElement==null?void 0:platform$1.isElement(arrowOffsetParent)))&&(clientSize=elements.floating[clientProp]||rects.floating[length]);let centerToReference=endDiff/2-startDiff/2,largestPossiblePadding=clientSize/2-arrowDimensions[length]/2-1,minPadding=min(paddingObject[minProp],largestPossiblePadding),maxPadding=min(paddingObject[maxProp],largestPossiblePadding),min$1=minPadding,max$1=clientSize-arrowDimensions[length]-maxPadding,center=clientSize/2-arrowDimensions[length]/2+centerToReference,offset$2=clamp$2(min$1,center,max$1),shouldAddOffset=!middlewareData.arrow&&getAlignment(placement)!=null&¢er!==offset$2&&rects.reference[length]/2-(centerside$1<=0)){var _middlewareData$flip2,_overflowsData$filter;let nextIndex=((_middlewareData$flip2=middlewareData.flip)?.index||0)+1,nextPlacement=placements$1[nextIndex];if(nextPlacement)return{data:{index:nextIndex,overflows:overflowsData},reset:{placement:nextPlacement}};let resetPlacement=(_overflowsData$filter=overflowsData.filter(d=>d.overflows[0]<=0).sort((a$1,b$1)=>a$1.overflows[1]-b$1.overflows[1])[0])?.placement;if(!resetPlacement)switch(fallbackStrategy){case`bestFit`:{var _overflowsData$filter2;let placement$1=(_overflowsData$filter2=overflowsData.filter(d=>{if(hasFallbackAxisSideDirection){let currentSideAxis=getSideAxis(d.placement);return currentSideAxis===initialSideAxis||currentSideAxis===`y`}return!0}).map(d=>[d.placement,d.overflows.filter(overflow$1=>overflow$1>0).reduce((acc,overflow$1)=>acc+overflow$1,0)]).sort((a$1,b$1)=>a$1[1]-b$1[1])[0])?.[0];placement$1&&(resetPlacement=placement$1);break}case`initialPlacement`:resetPlacement=initialPlacement;break}if(placement!==resetPlacement)return{reset:{placement:resetPlacement}}}return{}}}};function getSideOffsets(overflow,rect){return{top:overflow.top-rect.height,right:overflow.right-rect.width,bottom:overflow.bottom-rect.height,left:overflow.left-rect.width}}function isAnySideFullyClipped(overflow){return sides.some(side=>overflow[side]>=0)}const hide$1=function(options$1){return options$1===void 0&&(options$1={}),{name:`hide`,options:options$1,async fn(state){let{rects}=state,{strategy=`referenceHidden`,...detectOverflowOptions}=evaluate(options$1,state);switch(strategy){case`referenceHidden`:{let overflow=await detectOverflow$1(state,{...detectOverflowOptions,elementContext:`reference`}),offsets=getSideOffsets(overflow,rects.reference);return{data:{referenceHiddenOffsets:offsets,referenceHidden:isAnySideFullyClipped(offsets)}}}case`escaped`:{let overflow=await detectOverflow$1(state,{...detectOverflowOptions,altBoundary:!0}),offsets=getSideOffsets(overflow,rects.floating);return{data:{escapedOffsets:offsets,escaped:isAnySideFullyClipped(offsets)}}}default:return{}}}}};async function convertValueToCoords(state,options$1){let{placement,platform:platform$1,elements}=state,rtl=await(platform$1.isRTL==null?void 0:platform$1.isRTL(elements.floating)),side=getSide(placement),alignment=getAlignment(placement),isVertical=getSideAxis(placement)===`y`,mainAxisMulti=[`left`,`top`].includes(side)?-1:1,crossAxisMulti=rtl&&isVertical?-1:1,rawValue=evaluate(options$1,state),{mainAxis,crossAxis,alignmentAxis}=typeof rawValue==`number`?{mainAxis:rawValue,crossAxis:0,alignmentAxis:null}:{mainAxis:rawValue.mainAxis||0,crossAxis:rawValue.crossAxis||0,alignmentAxis:rawValue.alignmentAxis};return alignment&&typeof alignmentAxis==`number`&&(crossAxis=alignment===`end`?alignmentAxis*-1:alignmentAxis),isVertical?{x:crossAxis*crossAxisMulti,y:mainAxis*mainAxisMulti}:{x:mainAxis*mainAxisMulti,y:crossAxis*crossAxisMulti}}const offset$1=function(options$1){return options$1===void 0&&(options$1=0),{name:`offset`,options:options$1,async fn(state){var _middlewareData$offse,_middlewareData$arrow;let{x:x$1,y,placement,middlewareData}=state,diffCoords=await convertValueToCoords(state,options$1);return placement===(_middlewareData$offse=middlewareData.offset)?.placement&&(_middlewareData$arrow=middlewareData.arrow)!=null&&_middlewareData$arrow.alignmentOffset?{}:{x:x$1+diffCoords.x,y:y+diffCoords.y,data:{...diffCoords,placement}}}}},shift$1=function(options$1){return options$1===void 0&&(options$1={}),{name:`shift`,options:options$1,async fn(state){let{x:x$1,y,placement}=state,{mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!1,limiter={fn:_ref=>{let{x:x$2,y:y$1}=_ref;return{x:x$2,y:y$1}}},...detectOverflowOptions}=evaluate(options$1,state),coords$1={x:x$1,y},overflow=await detectOverflow$1(state,detectOverflowOptions),crossAxis=getSideAxis(getSide(placement)),mainAxis=getOppositeAxis(crossAxis),mainAxisCoord=coords$1[mainAxis],crossAxisCoord=coords$1[crossAxis];if(checkMainAxis){let minSide=mainAxis===`y`?`top`:`left`,maxSide=mainAxis===`y`?`bottom`:`right`,min$1=mainAxisCoord+overflow[minSide],max$1=mainAxisCoord-overflow[maxSide];mainAxisCoord=clamp$2(min$1,mainAxisCoord,max$1)}if(checkCrossAxis){let minSide=crossAxis===`y`?`top`:`left`,maxSide=crossAxis===`y`?`bottom`:`right`,min$1=crossAxisCoord+overflow[minSide],max$1=crossAxisCoord-overflow[maxSide];crossAxisCoord=clamp$2(min$1,crossAxisCoord,max$1)}let limitedCoords=limiter.fn({...state,[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord});return{...limitedCoords,data:{x:limitedCoords.x-x$1,y:limitedCoords.y-y,enabled:{[mainAxis]:checkMainAxis,[crossAxis]:checkCrossAxis}}}}}},limitShift$1=function(options$1){return options$1===void 0&&(options$1={}),{options:options$1,fn(state){let{x:x$1,y,placement,rects,middlewareData}=state,{offset:offset$2=0,mainAxis:checkMainAxis=!0,crossAxis:checkCrossAxis=!0}=evaluate(options$1,state),coords$1={x:x$1,y},crossAxis=getSideAxis(placement),mainAxis=getOppositeAxis(crossAxis),mainAxisCoord=coords$1[mainAxis],crossAxisCoord=coords$1[crossAxis],rawOffset=evaluate(offset$2,state),computedOffset=typeof rawOffset==`number`?{mainAxis:rawOffset,crossAxis:0}:{mainAxis:0,crossAxis:0,...rawOffset};if(checkMainAxis){let len=mainAxis===`y`?`height`:`width`,limitMin=rects.reference[mainAxis]-rects.floating[len]+computedOffset.mainAxis,limitMax=rects.reference[mainAxis]+rects.reference[len]-computedOffset.mainAxis;mainAxisCoordlimitMax&&(mainAxisCoord=limitMax)}if(checkCrossAxis){var _middlewareData$offse,_middlewareData$offse2;let len=mainAxis===`y`?`width`:`height`,isOriginSide=[`top`,`left`].includes(getSide(placement)),limitMin=rects.reference[crossAxis]-rects.floating[len]+(isOriginSide&&(_middlewareData$offse=middlewareData.offset)?.[crossAxis]||0)+(isOriginSide?0:computedOffset.crossAxis),limitMax=rects.reference[crossAxis]+rects.reference[len]+(isOriginSide?0:(_middlewareData$offse2=middlewareData.offset)?.[crossAxis]||0)-(isOriginSide?computedOffset.crossAxis:0);crossAxisCoordlimitMax&&(crossAxisCoord=limitMax)}return{[mainAxis]:mainAxisCoord,[crossAxis]:crossAxisCoord}}}},size$1=function(options$1){return options$1===void 0&&(options$1={}),{name:`size`,options:options$1,async fn(state){var _state$middlewareData,_state$middlewareData2;let{placement,rects,platform:platform$1,elements}=state,{apply:apply$2=()=>{},...detectOverflowOptions}=evaluate(options$1,state),overflow=await detectOverflow$1(state,detectOverflowOptions),side=getSide(placement),alignment=getAlignment(placement),isYAxis=getSideAxis(placement)===`y`,{width,height}=rects.floating,heightSide,widthSide;side===`top`||side===`bottom`?(heightSide=side,widthSide=alignment===(await(platform$1.isRTL==null?void 0:platform$1.isRTL(elements.floating))?`start`:`end`)?`left`:`right`):(widthSide=side,heightSide=alignment===`end`?`top`:`bottom`);let maximumClippingHeight=height-overflow.top-overflow.bottom,maximumClippingWidth=width-overflow.left-overflow.right,overflowAvailableHeight=min(height-overflow[heightSide],maximumClippingHeight),overflowAvailableWidth=min(width-overflow[widthSide],maximumClippingWidth),noShift=!state.middlewareData.shift,availableHeight=overflowAvailableHeight,availableWidth=overflowAvailableWidth;if((_state$middlewareData=state.middlewareData.shift)!=null&&_state$middlewareData.enabled.x&&(availableWidth=maximumClippingWidth),(_state$middlewareData2=state.middlewareData.shift)!=null&&_state$middlewareData2.enabled.y&&(availableHeight=maximumClippingHeight),noShift&&!alignment){let xMin=max(overflow.left,0),xMax=max(overflow.right,0),yMin=max(overflow.top,0),yMax=max(overflow.bottom,0);isYAxis?availableWidth=width-2*(xMin!==0||xMax!==0?xMin+xMax:max(overflow.left,overflow.right)):availableHeight=height-2*(yMin!==0||yMax!==0?yMin+yMax:max(overflow.top,overflow.bottom))}await apply$2({...state,availableWidth,availableHeight});let nextDimensions=await platform$1.getDimensions(elements.floating);return width!==nextDimensions.width||height!==nextDimensions.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<`u`}function getNodeName(node$1){return isNode(node$1)?(node$1.nodeName||``).toLowerCase():`#document`}function getWindow(node$1){var _node$ownerDocument;return(node$1==null||(_node$ownerDocument=node$1.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node$1){var _ref;return(_ref=(isNode(node$1)?node$1.ownerDocument:node$1.document)||window.document)?.documentElement}function isNode(value$1){return hasWindow()?value$1 instanceof Node||value$1 instanceof getWindow(value$1).Node:!1}function isElement(value$1){return hasWindow()?value$1 instanceof Element||value$1 instanceof getWindow(value$1).Element:!1}function isHTMLElement(value$1){return hasWindow()?value$1 instanceof HTMLElement||value$1 instanceof getWindow(value$1).HTMLElement:!1}function isShadowRoot(value$1){return!hasWindow()||typeof ShadowRoot>`u`?!1:value$1 instanceof ShadowRoot||value$1 instanceof getWindow(value$1).ShadowRoot}function isOverflowElement(element$3){let{overflow,overflowX,overflowY,display}=getComputedStyle$1(element$3);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&![`inline`,`contents`].includes(display)}function isTableElement(element$3){return[`table`,`td`,`th`].includes(getNodeName(element$3))}function isTopLayer(element$3){return[`:popover-open`,`:modal`].some(selector=>{try{return element$3.matches(selector)}catch{return!1}})}function isContainingBlock(elementOrCss){let webkit=isWebKit(),css=isElement(elementOrCss)?getComputedStyle$1(elementOrCss):elementOrCss;return[`transform`,`translate`,`scale`,`rotate`,`perspective`].some(value$1=>css[value$1]?css[value$1]!==`none`:!1)||(css.containerType?css.containerType!==`normal`:!1)||!webkit&&(css.backdropFilter?css.backdropFilter!==`none`:!1)||!webkit&&(css.filter?css.filter!==`none`:!1)||[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`].some(value$1=>(css.willChange||``).includes(value$1))||[`paint`,`layout`,`strict`,`content`].some(value$1=>(css.contain||``).includes(value$1))}function getContainingBlock(element$3){let currentNode=getParentNode(element$3);for(;isHTMLElement(currentNode)&&!isLastTraversableNode(currentNode);){if(isContainingBlock(currentNode))return currentNode;if(isTopLayer(currentNode))return null;currentNode=getParentNode(currentNode)}return null}function isWebKit(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}function isLastTraversableNode(node$1){return[`html`,`body`,`#document`].includes(getNodeName(node$1))}function getComputedStyle$1(element$3){return getWindow(element$3).getComputedStyle(element$3)}function getNodeScroll(element$3){return isElement(element$3)?{scrollLeft:element$3.scrollLeft,scrollTop:element$3.scrollTop}:{scrollLeft:element$3.scrollX,scrollTop:element$3.scrollY}}function getParentNode(node$1){if(getNodeName(node$1)===`html`)return node$1;let result=node$1.assignedSlot||node$1.parentNode||isShadowRoot(node$1)&&node$1.host||getDocumentElement(node$1);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node$1){let parentNode=getParentNode(node$1);return isLastTraversableNode(parentNode)?node$1.ownerDocument?node$1.ownerDocument.body:node$1.body:isHTMLElement(parentNode)&&isOverflowElement(parentNode)?parentNode:getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node$1,list$2,traverseIframes){var _node$ownerDocument2;list$2===void 0&&(list$2=[]),traverseIframes===void 0&&(traverseIframes=!0);let scrollableAncestor=getNearestOverflowAncestor(node$1),isBody=scrollableAncestor===(_node$ownerDocument2=node$1.ownerDocument)?.body,win$1=getWindow(scrollableAncestor);if(isBody){let frameElement=getFrameElement(win$1);return list$2.concat(win$1,win$1.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list$2.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win$1){return win$1.parent&&Object.getPrototypeOf(win$1.parent)?win$1.frameElement:null}function getCssDimensions(element$3){let css=getComputedStyle$1(element$3),width=parseFloat(css.width)||0,height=parseFloat(css.height)||0,hasOffset=isHTMLElement(element$3),offsetWidth=hasOffset?element$3.offsetWidth:width,offsetHeight=hasOffset?element$3.offsetHeight:height,shouldFallback=round$2(width)!==offsetWidth||round$2(height)!==offsetHeight;return shouldFallback&&(width=offsetWidth,height=offsetHeight),{width,height,$:shouldFallback}}function unwrapElement$1(element$3){return isElement(element$3)?element$3:element$3.contextElement}function getScale(element$3){let domElement=unwrapElement$1(element$3);if(!isHTMLElement(domElement))return createCoords(1);let rect=domElement.getBoundingClientRect(),{width,height,$}=getCssDimensions(domElement),x$1=($?round$2(rect.width):rect.width)/width,y=($?round$2(rect.height):rect.height)/height;return(!x$1||!Number.isFinite(x$1))&&(x$1=1),(!y||!Number.isFinite(y))&&(y=1),{x:x$1,y}}const noOffsets=createCoords(0);function getVisualOffsets(element$3){let win$1=getWindow(element$3);return!isWebKit()||!win$1.visualViewport?noOffsets:{x:win$1.visualViewport.offsetLeft,y:win$1.visualViewport.offsetTop}}function shouldAddVisualOffsets(element$3,isFixed,floatingOffsetParent){return isFixed===void 0&&(isFixed=!1),!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element$3)?!1:isFixed}function getBoundingClientRect(element$3,includeScale,isFixedStrategy,offsetParent){includeScale===void 0&&(includeScale=!1),isFixedStrategy===void 0&&(isFixedStrategy=!1);let clientRect=element$3.getBoundingClientRect(),domElement=unwrapElement$1(element$3),scale$1=createCoords(1);includeScale&&(offsetParent?isElement(offsetParent)&&(scale$1=getScale(offsetParent)):scale$1=getScale(element$3));let visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0),x$1=(clientRect.left+visualOffsets.x)/scale$1.x,y=(clientRect.top+visualOffsets.y)/scale$1.y,width=clientRect.width/scale$1.x,height=clientRect.height/scale$1.y;if(domElement){let win$1=getWindow(domElement),offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent,currentWin=win$1,currentIFrame=getFrameElement(currentWin);for(;currentIFrame&&offsetParent&&offsetWin!==currentWin;){let iframeScale=getScale(currentIFrame),iframeRect=currentIFrame.getBoundingClientRect(),css=getComputedStyle$1(currentIFrame),left=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x,top=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x$1*=iframeScale.x,y*=iframeScale.y,width*=iframeScale.x,height*=iframeScale.y,x$1+=left,y+=top,currentWin=getWindow(currentIFrame),currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width,height,x:x$1,y})}function getWindowScrollBarX(element$3,rect){let leftScroll=getNodeScroll(element$3).scrollLeft;return rect?rect.left+leftScroll:getBoundingClientRect(getDocumentElement(element$3)).left+leftScroll}function getHTMLOffset(documentElement,scroll,ignoreScrollbarX){ignoreScrollbarX===void 0&&(ignoreScrollbarX=!1);let htmlRect=documentElement.getBoundingClientRect(),x$1=htmlRect.left+scroll.scrollLeft-(ignoreScrollbarX?0:getWindowScrollBarX(documentElement,htmlRect)),y=htmlRect.top+scroll.scrollTop;return{x:x$1,y}}function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements,rect,offsetParent,strategy}=_ref,isFixed=strategy===`fixed`,documentElement=getDocumentElement(offsetParent),topLayer=elements?isTopLayer(elements.floating):!1;if(offsetParent===documentElement||topLayer&&isFixed)return rect;let scroll={scrollLeft:0,scrollTop:0},scale$1=createCoords(1),offsets=createCoords(0),isOffsetParentAnElement=isHTMLElement(offsetParent);if((isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)&&((getNodeName(offsetParent)!==`body`||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isHTMLElement(offsetParent))){let offsetRect=getBoundingClientRect(offsetParent);scale$1=getScale(offsetParent),offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}let htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll,!0):createCoords(0);return{width:rect.width*scale$1.x,height:rect.height*scale$1.y,x:rect.x*scale$1.x-scroll.scrollLeft*scale$1.x+offsets.x+htmlOffset.x,y:rect.y*scale$1.y-scroll.scrollTop*scale$1.y+offsets.y+htmlOffset.y}}function getClientRects(element$3){return Array.from(element$3.getClientRects())}function getDocumentRect(element$3){let html$5=getDocumentElement(element$3),scroll=getNodeScroll(element$3),body$2=element$3.ownerDocument.body,width=max(html$5.scrollWidth,html$5.clientWidth,body$2.scrollWidth,body$2.clientWidth),height=max(html$5.scrollHeight,html$5.clientHeight,body$2.scrollHeight,body$2.clientHeight),x$1=-scroll.scrollLeft+getWindowScrollBarX(element$3),y=-scroll.scrollTop;return getComputedStyle$1(body$2).direction===`rtl`&&(x$1+=max(html$5.clientWidth,body$2.clientWidth)-width),{width,height,x:x$1,y}}function getViewportRect(element$3,strategy){let win$1=getWindow(element$3),html$5=getDocumentElement(element$3),visualViewport=win$1.visualViewport,width=html$5.clientWidth,height=html$5.clientHeight,x$1=0,y=0;if(visualViewport){width=visualViewport.width,height=visualViewport.height;let visualViewportBased=isWebKit();(!visualViewportBased||visualViewportBased&&strategy===`fixed`)&&(x$1=visualViewport.offsetLeft,y=visualViewport.offsetTop)}return{width,height,x:x$1,y}}function getInnerBoundingClientRect(element$3,strategy){let clientRect=getBoundingClientRect(element$3,!0,strategy===`fixed`),top=clientRect.top+element$3.clientTop,left=clientRect.left+element$3.clientLeft,scale$1=isHTMLElement(element$3)?getScale(element$3):createCoords(1),width=element$3.clientWidth*scale$1.x,height=element$3.clientHeight*scale$1.y,x$1=left*scale$1.x,y=top*scale$1.y;return{width,height,x:x$1,y}}function getClientRectFromClippingAncestor(element$3,clippingAncestor,strategy){let rect;if(clippingAncestor===`viewport`)rect=getViewportRect(element$3,strategy);else if(clippingAncestor===`document`)rect=getDocumentRect(getDocumentElement(element$3));else if(isElement(clippingAncestor))rect=getInnerBoundingClientRect(clippingAncestor,strategy);else{let visualOffsets=getVisualOffsets(element$3);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}function hasFixedPositionAncestor(element$3,stopNode){let parentNode=getParentNode(element$3);return parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)?!1:getComputedStyle$1(parentNode).position===`fixed`||hasFixedPositionAncestor(parentNode,stopNode)}function getClippingElementAncestors(element$3,cache$1){let cachedResult=cache$1.get(element$3);if(cachedResult)return cachedResult;let result=getOverflowAncestors(element$3,[],!1).filter(el=>isElement(el)&&getNodeName(el)!==`body`),currentContainingBlockComputedStyle=null,elementIsFixed=getComputedStyle$1(element$3).position===`fixed`,currentNode=elementIsFixed?getParentNode(element$3):element$3;for(;isElement(currentNode)&&!isLastTraversableNode(currentNode);){let computedStyle=getComputedStyle$1(currentNode),currentNodeIsContaining=isContainingBlock(currentNode);!currentNodeIsContaining&&computedStyle.position===`fixed`&&(currentContainingBlockComputedStyle=null);let shouldDropCurrentNode=elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position===`static`&&!!currentContainingBlockComputedStyle&&[`absolute`,`fixed`].includes(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element$3,currentNode);shouldDropCurrentNode?result=result.filter(ancestor=>ancestor!==currentNode):currentContainingBlockComputedStyle=computedStyle,currentNode=getParentNode(currentNode)}return cache$1.set(element$3,result),result}function getClippingRect(_ref){let{element:element$3,boundary,rootBoundary,strategy}=_ref,elementClippingAncestors=boundary===`clippingAncestors`?isTopLayer(element$3)?[]:getClippingElementAncestors(element$3,this._c):[].concat(boundary),clippingAncestors=[...elementClippingAncestors,rootBoundary],firstClippingAncestor=clippingAncestors[0],clippingRect=clippingAncestors.reduce((accRect,clippingAncestor)=>{let rect=getClientRectFromClippingAncestor(element$3,clippingAncestor,strategy);return accRect.top=max(rect.top,accRect.top),accRect.right=min(rect.right,accRect.right),accRect.bottom=min(rect.bottom,accRect.bottom),accRect.left=max(rect.left,accRect.left),accRect},getClientRectFromClippingAncestor(element$3,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}function getDimensions(element$3){let{width,height}=getCssDimensions(element$3);return{width,height}}function getRectRelativeToOffsetParent(element$3,offsetParent,strategy){let isOffsetParentAnElement=isHTMLElement(offsetParent),documentElement=getDocumentElement(offsetParent),isFixed=strategy===`fixed`,rect=getBoundingClientRect(element$3,!0,isFixed,offsetParent),scroll={scrollLeft:0,scrollTop:0},offsets=createCoords(0);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed)if((getNodeName(offsetParent)!==`body`||isOverflowElement(documentElement))&&(scroll=getNodeScroll(offsetParent)),isOffsetParentAnElement){let offsetRect=getBoundingClientRect(offsetParent,!0,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft,offsets.y=offsetRect.y+offsetParent.clientTop}else documentElement&&(offsets.x=getWindowScrollBarX(documentElement));let htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0),x$1=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x,y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x:x$1,y,width:rect.width,height:rect.height}}function isStaticPositioned(element$3){return getComputedStyle$1(element$3).position===`static`}function getTrueOffsetParent(element$3,polyfill){if(!isHTMLElement(element$3)||getComputedStyle$1(element$3).position===`fixed`)return null;if(polyfill)return polyfill(element$3);let rawOffsetParent=element$3.offsetParent;return getDocumentElement(element$3)===rawOffsetParent&&(rawOffsetParent=rawOffsetParent.ownerDocument.body),rawOffsetParent}function getOffsetParent(element$3,polyfill){let win$1=getWindow(element$3);if(isTopLayer(element$3))return win$1;if(!isHTMLElement(element$3)){let svgOffsetParent=getParentNode(element$3);for(;svgOffsetParent&&!isLastTraversableNode(svgOffsetParent);){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent))return svgOffsetParent;svgOffsetParent=getParentNode(svgOffsetParent)}return win$1}let offsetParent=getTrueOffsetParent(element$3,polyfill);for(;offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent);)offsetParent=getTrueOffsetParent(offsetParent,polyfill);return offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)?win$1:offsetParent||getContainingBlock(element$3)||win$1}const getElementRects=async function(data$12){let getOffsetParentFn=this.getOffsetParent||getOffsetParent,getDimensionsFn=this.getDimensions,floatingDimensions=await getDimensionsFn(data$12.floating);return{reference:getRectRelativeToOffsetParent(data$12.reference,await getOffsetParentFn(data$12.floating),data$12.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}};function isRTL(element$3){return getComputedStyle$1(element$3).direction===`rtl`}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(a$1,b$1){return a$1.x===b$1.x&&a$1.y===b$1.y&&a$1.width===b$1.width&&a$1.height===b$1.height}function observeMove(element$3,onMove){let io$1=null,timeoutId,root$3=getDocumentElement(element$3);function cleanup(){var _io;clearTimeout(timeoutId),(_io=io$1)==null||_io.disconnect(),io$1=null}function refresh(skip,threshold){skip===void 0&&(skip=!1),threshold===void 0&&(threshold=1),cleanup();let elementRectForRootMargin=element$3.getBoundingClientRect(),{left,top,width,height}=elementRectForRootMargin;if(skip||onMove(),!width||!height)return;let insetTop=floor$1(top),insetRight=floor$1(root$3.clientWidth-(left+width)),insetBottom=floor$1(root$3.clientHeight-(top+height)),insetLeft=floor$1(left),rootMargin=-insetTop+`px `+-insetRight+`px `+-insetBottom+`px `+-insetLeft+`px`,options$1={rootMargin,threshold:max(0,min(1,threshold))||1},isFirstUpdate=!0;function handleObserve(entries){let ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate)return refresh();ratio?refresh(!1,ratio):timeoutId=setTimeout(()=>{refresh(!1,1e-7)},1e3)}ratio===1&&!rectsAreEqual(elementRectForRootMargin,element$3.getBoundingClientRect())&&refresh(),isFirstUpdate=!1}try{io$1=new IntersectionObserver(handleObserve,{...options$1,root:root$3.ownerDocument})}catch{io$1=new IntersectionObserver(handleObserve,options$1)}io$1.observe(element$3)}return refresh(!0),cleanup}function autoUpdate(reference,floating,update,options$1){options$1===void 0&&(options$1={});let{ancestorScroll=!0,ancestorResize=!0,elementResize=typeof ResizeObserver==`function`,layoutShift=typeof IntersectionObserver==`function`,animationFrame=!1}=options$1,referenceEl=unwrapElement$1(reference),ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.addEventListener(`scroll`,update,{passive:!0}),ancestorResize&&ancestor.addEventListener(`resize`,update)});let cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null,reobserveFrame=-1,resizeObserver=null;elementResize&&(resizeObserver=new ResizeObserver(_ref=>{let[firstEntry]=_ref;firstEntry&&firstEntry.target===referenceEl&&resizeObserver&&(resizeObserver.unobserve(floating),cancelAnimationFrame(reobserveFrame),reobserveFrame=requestAnimationFrame(()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)})),update()}),referenceEl&&!animationFrame&&resizeObserver.observe(referenceEl),resizeObserver.observe(floating));let frameId,prevRefRect=animationFrame?getBoundingClientRect(reference):null;animationFrame&&frameLoop();function frameLoop(){let nextRefRect=getBoundingClientRect(reference);prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)&&update(),prevRefRect=nextRefRect,frameId=requestAnimationFrame(frameLoop)}return update(),()=>{var _resizeObserver2;ancestors.forEach(ancestor=>{ancestorScroll&&ancestor.removeEventListener(`scroll`,update),ancestorResize&&ancestor.removeEventListener(`resize`,update)}),cleanupIo?.(),(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect(),resizeObserver=null,animationFrame&&cancelAnimationFrame(frameId)}}const offset=offset$1,shift=shift$1,flip=flip$1,size=size$1,hide=hide$1,arrow$1=arrow$2,limitShift=limitShift$1,computePosition=(reference,floating,options$1)=>{let cache$1=new Map,mergedOptions={platform,...options$1},platformWithCache={...mergedOptions.platform,_c:cache$1};return computePosition$1(reference,floating,{...mergedOptions,platform:platformWithCache})};function isComponentPublicInstance(target$1){return typeof target$1==`object`&&!!target$1&&`$el`in target$1}function unwrapElement(target$1){if(isComponentPublicInstance(target$1)){let element$3=target$1.$el;return isNode(element$3)&&getNodeName(element$3)===`#comment`?null:element$3}return target$1}function toValue(source){return typeof source==`function`?source():unref(source)}function arrow(options$1){return{name:`arrow`,options:options$1,fn(args){let element$3=unwrapElement(toValue(options$1.element));return element$3==null?{}:arrow$1({element:element$3,padding:options$1.padding}).fn(args)}}}function getDPR(element$3){if(typeof window>`u`)return 1;let win$1=element$3.ownerDocument.defaultView||window;return win$1.devicePixelRatio||1}function roundByDPR(element$3,value$1){let dpr=getDPR(element$3);return Math.round(value$1*dpr)/dpr}function useFloating(reference,floating,options$1){options$1===void 0&&(options$1={});let whileElementsMountedOption=options$1.whileElementsMounted,openOption=computed(()=>{var _toValue;return(_toValue=toValue(options$1.open))??!0}),middlewareOption=computed(()=>toValue(options$1.middleware)),placementOption=computed(()=>{var _toValue2;return(_toValue2=toValue(options$1.placement))??`bottom`}),strategyOption=computed(()=>{var _toValue3;return(_toValue3=toValue(options$1.strategy))??`absolute`}),transformOption=computed(()=>{var _toValue4;return(_toValue4=toValue(options$1.transform))??!0}),referenceElement=computed(()=>unwrapElement(reference.value)),floatingElement=computed(()=>unwrapElement(floating.value)),x$1=ref(0),y=ref(0),strategy=ref(strategyOption.value),placement=ref(placementOption.value),middlewareData=shallowRef({}),isPositioned=ref(!1),floatingStyles=computed(()=>{let initialStyles={position:strategy.value,left:`0`,top:`0`};if(!floatingElement.value)return initialStyles;let xVal=roundByDPR(floatingElement.value,x$1.value),yVal=roundByDPR(floatingElement.value,y.value);return transformOption.value?{...initialStyles,transform:`translate(`+xVal+`px, `+yVal+`px)`,...getDPR(floatingElement.value)>=1.5&&{willChange:`transform`}}:{position:strategy.value,left:xVal+`px`,top:yVal+`px`}}),whileElementsMountedCleanup;function update(){if(referenceElement.value==null||floatingElement.value==null)return;let open$1=openOption.value;computePosition(referenceElement.value,floatingElement.value,{middleware:middlewareOption.value,placement:placementOption.value,strategy:strategyOption.value}).then(position$2=>{x$1.value=position$2.x,y.value=position$2.y,strategy.value=position$2.strategy,placement.value=position$2.placement,middlewareData.value=position$2.middlewareData,isPositioned.value=open$1!==!1})}function cleanup(){typeof whileElementsMountedCleanup==`function`&&(whileElementsMountedCleanup(),whileElementsMountedCleanup=void 0)}function attach(){if(cleanup(),whileElementsMountedOption===void 0){update();return}if(referenceElement.value!=null&&floatingElement.value!=null){whileElementsMountedCleanup=whileElementsMountedOption(referenceElement.value,floatingElement.value,update);return}}function reset(){openOption.value||(isPositioned.value=!1)}return watch([middlewareOption,placementOption,strategyOption,openOption],update,{flush:`sync`}),watch([referenceElement,floatingElement],attach,{flush:`sync`}),watch(openOption,reset,{flush:`sync`}),getCurrentScope()&&onScopeDispose(cleanup),{x:shallowReadonly(x$1),y:shallowReadonly(y),strategy:shallowReadonly(strategy),placement:shallowReadonly(placement),middlewareData:shallowReadonly(middlewareData),isPositioned:shallowReadonly(isPositioned),floatingStyles,update}}const PopperContentPropsDefaultValue={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[injectPopperContentContext,providePopperContentContext]=createContext(`PopperContent`);var PopperContent_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`PopperContent`,props:mergeDefaults({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...PopperContentPropsDefaultValue}),emits:[`placed`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectPopperRootContext(),{forwardRef,currentElement:contentElement}=useForwardExpose(),floatingRef=ref(),arrow$1$1=ref(),{width:arrowWidth,height:arrowHeight}=useSize(arrow$1$1),desiredPlacement=computed(()=>props.side+(props.align===`center`?``:`-${props.align}`)),collisionPadding=computed(()=>typeof props.collisionPadding==`number`?props.collisionPadding:{top:0,right:0,bottom:0,left:0,...props.collisionPadding}),boundary=computed(()=>Array.isArray(props.collisionBoundary)?props.collisionBoundary:[props.collisionBoundary]),detectOverflowOptions=computed(()=>({padding:collisionPadding.value,boundary:boundary.value.filter(isNotNull),altBoundary:boundary.value.length>0})),flipOptions=computed(()=>({mainAxis:props.sideFlip,crossAxis:props.alignFlip})),computedMiddleware=computedEager(()=>[offset({mainAxis:props.sideOffset+arrowHeight.value,alignmentAxis:props.alignOffset}),props.prioritizePosition&&props.avoidCollisions&&flip({...detectOverflowOptions.value,...flipOptions.value}),props.avoidCollisions&&shift({mainAxis:!0,crossAxis:!!props.prioritizePosition,limiter:props.sticky===`partial`?limitShift():void 0,...detectOverflowOptions.value}),!props.prioritizePosition&&props.avoidCollisions&&flip({...detectOverflowOptions.value,...flipOptions.value}),size({...detectOverflowOptions.value,apply:({elements,rects,availableWidth,availableHeight})=>{let{width:anchorWidth,height:anchorHeight}=rects.reference,contentStyle=elements.floating.style;contentStyle.setProperty(`--reka-popper-available-width`,`${availableWidth}px`),contentStyle.setProperty(`--reka-popper-available-height`,`${availableHeight}px`),contentStyle.setProperty(`--reka-popper-anchor-width`,`${anchorWidth}px`),contentStyle.setProperty(`--reka-popper-anchor-height`,`${anchorHeight}px`)}}),arrow$1$1.value&&arrow({element:arrow$1$1.value,padding:props.arrowPadding}),transformOrigin({arrowWidth:arrowWidth.value,arrowHeight:arrowHeight.value}),props.hideWhenDetached&&hide({strategy:`referenceHidden`,...detectOverflowOptions.value})]),reference=computed(()=>props.reference??rootContext.anchor.value),{floatingStyles,placement,isPositioned,middlewareData,update}=useFloating(reference,floatingRef,{strategy:props.positionStrategy,placement:desiredPlacement,whileElementsMounted:(...args)=>{let cleanup=autoUpdate(...args,{layoutShift:!props.disableUpdateOnLayoutShift,animationFrame:props.updatePositionStrategy===`always`});return cleanup},middleware:computedMiddleware}),placedSide=computed(()=>getSideAndAlignFromPlacement(placement.value)[0]),placedAlign=computed(()=>getSideAndAlignFromPlacement(placement.value)[1]);watchPostEffect(()=>{isPositioned.value&&emits(`placed`)});let cannotCenterArrow=computed(()=>middlewareData.value.arrow?.centerOffset!==0),contentZIndex=ref(``);watchEffect(()=>{contentElement.value&&(contentZIndex.value=window.getComputedStyle(contentElement.value).zIndex)});let arrowX=computed(()=>middlewareData.value.arrow?.x??0),arrowY=computed(()=>middlewareData.value.arrow?.y??0);return providePopperContentContext({placedSide,onArrowChange:element$3=>arrow$1$1.value=element$3,arrowX,arrowY,shouldHideArrow:cannotCenterArrow}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{ref_key:`floatingRef`,ref:floatingRef,"data-reka-popper-content-wrapper":``,style:normalizeStyle({...unref(floatingStyles),transform:unref(isPositioned)?unref(floatingStyles).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:contentZIndex.value,"--reka-popper-transform-origin":[unref(middlewareData).transformOrigin?.x,unref(middlewareData).transformOrigin?.y].join(` `),...unref(middlewareData).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[createVNode(unref(Primitive),mergeProps({ref:unref(forwardRef)},_ctx.$attrs,{"as-child":props.asChild,as:_ctx.as,"data-side":placedSide.value,"data-align":placedAlign.value,style:{animation:unref(isPositioned)?void 0:`none`}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])],4))}}),PopperContent_default=PopperContent_vue_vue_type_script_setup_true_lang_default;const OPPOSITE_SIDE={top:`bottom`,right:`left`,bottom:`top`,left:`right`};var PopperArrow_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`PopperArrow`,props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(__props){let{forwardRef}=useForwardExpose(),contentContext=injectPopperContentContext(),baseSide=computed(()=>OPPOSITE_SIDE[contentContext.placedSide.value]);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`span`,{ref:el=>{unref(contentContext).onArrowChange(el)},style:normalizeStyle({position:`absolute`,left:unref(contentContext).arrowX?.value?`${unref(contentContext).arrowX?.value}px`:void 0,top:unref(contentContext).arrowY?.value?`${unref(contentContext).arrowY?.value}px`:void 0,[baseSide.value]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[unref(contentContext).placedSide.value],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[unref(contentContext).placedSide.value],visibility:unref(contentContext).shouldHideArrow.value?`hidden`:void 0})},[createVNode(Arrow_default,mergeProps(_ctx.$attrs,{ref:unref(forwardRef),style:{display:`block`},as:_ctx.as,"as-child":_ctx.asChild,rounded:_ctx.rounded,width:_ctx.width,height:_ctx.height}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`as`,`as-child`,`rounded`,`width`,`height`])],4))}}),PopperArrow_default=PopperArrow_vue_vue_type_script_setup_true_lang_default,ComboboxAnchor_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let{forwardRef}=useForwardExpose();return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(PopperAnchor_default),{"as-child":``,reference:_ctx.reference},{default:withCtx(()=>[createVNode(unref(Primitive),mergeProps({ref:unref(forwardRef),"as-child":_ctx.asChild,as:_ctx.as},_ctx.$attrs),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`as-child`,`as`])]),_:3},8,[`reference`]))}}),ComboboxAnchor_default=ComboboxAnchor_vue_vue_type_script_setup_true_lang_default;function valueComparator(value$1,currentValue,comparator){return value$1===void 0?!1:Array.isArray(value$1)?value$1.some(val=>compare(val,currentValue,comparator)):compare(value$1,currentValue,comparator)}function compare(value$1,currentValue,comparator){return value$1===void 0||currentValue===void 0?!1:typeof value$1==`string`?value$1===currentValue:typeof comparator==`function`?comparator(value$1,currentValue):typeof comparator==`string`?value$1?.[comparator]===currentValue?.[comparator]:isEqual(value$1,currentValue)}const[injectListboxRootContext,provideListboxRootContext]=createContext(`ListboxRoot`);var ListboxRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ListboxRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:`vertical`},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1,default:`toggle`},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`highlight`,`entryFocus`,`leave`],setup(__props,{expose:__expose,emit:__emit}){let props=__props,emits=__emit,{multiple,highlightOnHover,orientation,disabled,selectionBehavior,dir:propDir}=toRefs(props),{getItems}=useCollection({isProvider:!0}),{handleTypeaheadSearch}=useTypeahead(),{primitiveElement,currentElement}=usePrimitiveElement(),kbd=useKbd(),dir=useDirection(propDir),isFormControl=useFormControl(currentElement),firstValue=ref(),isUserAction=ref(!1),focusable=ref(!0),modelValue=useVModel(props,`modelValue`,emits,{defaultValue:props.defaultValue??(multiple.value?[]:void 0),passive:props.modelValue===void 0,deep:!0});function onValueChange(val){if(isUserAction.value=!0,props.multiple){let modelArray=Array.isArray(modelValue.value)?[...modelValue.value]:[],index$1=modelArray.findIndex(i=>compare(i,val,props.by));props.selectionBehavior===`toggle`?(index$1===-1?modelArray.push(val):modelArray.splice(index$1,1),modelValue.value=modelArray):(modelValue.value=[val],firstValue.value=val)}else props.selectionBehavior===`toggle`&&compare(modelValue.value,val,props.by)?modelValue.value=void 0:modelValue.value=val;setTimeout(()=>{isUserAction.value=!1},1)}let highlightedElement=ref(null),previousElement=ref(null),isVirtual=ref(!1),isComposing=ref(!1),virtualFocusHook=createEventHook(),virtualKeydownHook=createEventHook(),virtualHighlightHook=createEventHook();function getCollectionItem(){return getItems().map(i=>i.ref).filter(i=>i.dataset.disabled!==``)}function changeHighlight(el,scrollIntoView=!0){if(!el)return;highlightedElement.value=el,focusable.value&&highlightedElement.value.focus(),scrollIntoView&&highlightedElement.value.scrollIntoView({block:`nearest`});let highlightedItem=getItems().find(i=>i.ref===el);emits(`highlight`,highlightedItem)}function highlightItem(value$1){if(isVirtual.value)virtualHighlightHook.trigger(value$1);else{let item=getItems().find(i=>compare(i.value,value$1,props.by));item&&(highlightedElement.value=item.ref,changeHighlight(item.ref))}}function onKeydownEnter(event){highlightedElement.value&&highlightedElement.value.isConnected&&(event.preventDefault(),event.stopPropagation(),isComposing.value||highlightedElement.value.click())}function onKeydownTypeAhead(event){if(focusable.value){if(isUserAction.value=!0,isVirtual.value)virtualKeydownHook.trigger(event);else{let isMetaKey=event.altKey||event.ctrlKey||event.metaKey;if(isMetaKey&&event.key===`a`&&multiple.value){let collection=getItems(),values=collection.map(i=>i.value);modelValue.value=[...values],event.preventDefault(),changeHighlight(collection[collection.length-1].ref)}else if(!isMetaKey){let el=handleTypeaheadSearch(event.key,getItems());el&&changeHighlight(el)}}setTimeout(()=>{isUserAction.value=!1},1)}}function onCompositionStart$1(){isComposing.value=!0}function onCompositionEnd$1(){nextTick(()=>{isComposing.value=!1})}function highlightFirstItem(){nextTick(()=>{let event=new KeyboardEvent(`keydown`,{key:`PageUp`});onKeydownNavigation(event)})}function onLeave(event){let el=highlightedElement.value;el?.isConnected&&(previousElement.value=el),highlightedElement.value=null,emits(`leave`,event)}function onEnter(event){let entryFocusEvent=new CustomEvent(`listbox.entryFocus`,{bubbles:!1,cancelable:!0});if(event.currentTarget?.dispatchEvent(entryFocusEvent),emits(`entryFocus`,entryFocusEvent),!entryFocusEvent.defaultPrevented)if(previousElement.value)changeHighlight(previousElement.value);else{let el=getCollectionItem()?.[0];changeHighlight(el)}}function onKeydownNavigation(event){let intent=getFocusIntent(event,orientation.value,dir.value);if(!intent)return;let collection=getCollectionItem();if(highlightedElement.value){if(intent===`last`)collection.reverse();else if(intent===`prev`||intent===`next`){intent===`prev`&&collection.reverse();let currentIndex=collection.indexOf(highlightedElement.value);collection=collection.slice(currentIndex+1)}handleMultipleReplace(event,collection[0])}if(collection.length){let index$1=!highlightedElement.value&&intent===`prev`?collection.length-1:0;changeHighlight(collection[index$1])}if(isVirtual.value)return virtualKeydownHook.trigger(event)}function handleMultipleReplace(event,targetEl){if(isVirtual.value||props.selectionBehavior!==`replace`||!multiple.value||!Array.isArray(modelValue.value))return;let isMetaKey=event.altKey||event.ctrlKey||event.metaKey;if(!(isMetaKey&&!event.shiftKey)&&event.shiftKey){let collection=getItems().filter(i=>i.ref.dataset.disabled!==``),lastValue=collection.find(i=>i.ref===targetEl)?.value;if(event.key===kbd.END?lastValue=collection[collection.length-1].value:event.key===kbd.HOME&&(lastValue=collection[0].value),!lastValue||!firstValue.value)return;let values=findValuesBetween(collection.map(i=>i.value),firstValue.value,lastValue);modelValue.value=values}}async function highlightSelected(event){if(await nextTick(),isVirtual.value)virtualFocusHook.trigger(event);else{let collection=getCollectionItem(),item=collection.find(i=>i.dataset.state===`checked`);item?changeHighlight(item):collection.length&&changeHighlight(collection[0])}}return watch(modelValue,()=>{isUserAction.value||nextTick(()=>{highlightSelected()})},{immediate:!0,deep:!0}),__expose({highlightedElement,highlightItem,highlightFirstItem,highlightSelected,getItems}),provideListboxRootContext({modelValue,onValueChange,multiple,orientation,dir,disabled,highlightOnHover,highlightedElement,isVirtual,virtualFocusHook,virtualKeydownHook,virtualHighlightHook,by:props.by,firstValue,selectionBehavior,focusable,onLeave,onEnter,changeHighlight,onKeydownEnter,onKeydownNavigation,onKeydownTypeAhead,onCompositionStart:onCompositionStart$1,onCompositionEnd:onCompositionEnd$1,highlightFirstItem}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{ref_key:`primitiveElement`,ref:primitiveElement,as:_ctx.as,"as-child":_ctx.asChild,dir:unref(dir),"data-disabled":unref(disabled)?``:void 0,onPointerleave:onLeave,onFocusout:_cache$1[0]||=async event=>{let target$1=event.relatedTarget||event.target;await nextTick(),highlightedElement.value&&unref(currentElement)&&!unref(currentElement).contains(target$1)&&onLeave(event)}},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{modelValue:unref(modelValue)}),unref(isFormControl)&&_ctx.name?(openBlock(),createBlock(unref(VisuallyHiddenInput_default),{key:0,name:_ctx.name,value:unref(modelValue),disabled:unref(disabled),required:_ctx.required},null,8,[`name`,`value`,`disabled`,`required`])):createCommentVNode(`v-if`,!0)]),_:3},8,[`as`,`as-child`,`dir`,`data-disabled`]))}}),ListboxRoot_default=ListboxRoot_vue_vue_type_script_setup_true_lang_default,ListboxContent_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ListboxContent`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let{CollectionSlot}=useCollection(),rootContext=injectListboxRootContext(),isClickFocus=refAutoReset(!1,10);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(CollectionSlot),null,{default:withCtx(()=>[createVNode(unref(Primitive),{role:`listbox`,as:_ctx.as,"as-child":_ctx.asChild,tabindex:unref(rootContext).focusable.value?unref(rootContext).highlightedElement.value?`-1`:`0`:void 0,"aria-orientation":unref(rootContext).orientation.value,"aria-multiselectable":!!unref(rootContext).multiple.value,"data-orientation":unref(rootContext).orientation.value,onMousedown:_cache$1[0]||=withModifiers($event=>isClickFocus.value=!0,[`left`]),onFocus:_cache$1[1]||=ev=>{unref(isClickFocus)||unref(rootContext).onEnter(ev)},onKeydown:[_cache$1[2]||=withKeys(withModifiers(event=>{unref(rootContext).focusable.value&&unref(rootContext).onKeydownNavigation(event)},[`prevent`]),[`down`,`up`,`left`,`right`,`home`,`end`]),withKeys(unref(rootContext).onKeydownEnter,[`enter`]),unref(rootContext).onKeydownTypeAhead]},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`as`,`as-child`,`tabindex`,`aria-orientation`,`aria-multiselectable`,`data-orientation`,`onKeydown`])]),_:3}))}}),ListboxContent_default=ListboxContent_vue_vue_type_script_setup_true_lang_default,ListboxFilter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ListboxFilter`,props:{modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,modelValue=useVModel(props,`modelValue`,emits,{defaultValue:``,passive:props.modelValue===void 0}),rootContext=injectListboxRootContext(),{primitiveElement,currentElement}=usePrimitiveElement(),disabled=computed(()=>props.disabled||rootContext.disabled.value||!1),activedescendant=ref();return watchSyncEffect(()=>activedescendant.value=rootContext.highlightedElement.value?.id),onMounted(()=>{rootContext.focusable.value=!1,setTimeout(()=>{props.autoFocus&¤tElement.value?.focus()},1)}),onUnmounted(()=>{rootContext.focusable.value=!0}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{ref_key:`primitiveElement`,ref:primitiveElement,as:_ctx.as,"as-child":_ctx.asChild,value:unref(modelValue),disabled:disabled.value?``:void 0,"data-disabled":disabled.value?``:void 0,"aria-disabled":disabled.value??void 0,"aria-activedescendant":activedescendant.value,type:`text`,onKeydown:[withKeys(withModifiers(unref(rootContext).onKeydownNavigation,[`prevent`]),[`down`,`up`,`home`,`end`]),withKeys(unref(rootContext).onKeydownEnter,[`enter`])],onInput:_cache$1[0]||=event=>{modelValue.value=event.target.value,unref(rootContext).highlightFirstItem()},onCompositionstart:unref(rootContext).onCompositionStart,onCompositionend:unref(rootContext).onCompositionEnd},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{modelValue:unref(modelValue)})]),_:3},8,[`as`,`as-child`,`value`,`disabled`,`data-disabled`,`aria-disabled`,`aria-activedescendant`,`onKeydown`,`onCompositionstart`,`onCompositionend`]))}}),ListboxFilter_default=ListboxFilter_vue_vue_type_script_setup_true_lang_default;const[injectListboxGroupContext,provideListboxGroupContext]=createContext(`ListboxGroup`);var ListboxGroup_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ListboxGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let props=__props,id=useId(void 0,`reka-listbox-group`);return provideListboxGroupContext({id}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),mergeProps({role:`group`},props,{"aria-labelledby":unref(id)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),ListboxGroup_default=ListboxGroup_vue_vue_type_script_setup_true_lang_default;const LISTBOX_SELECT=`listbox.select`,[injectListboxItemContext,provideListboxItemContext]=createContext(`ListboxItem`);var ListboxItem_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ListboxItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,id=useId(void 0,`reka-listbox-item`),{CollectionItem}=useCollection(),{forwardRef,currentElement}=useForwardExpose(),rootContext=injectListboxRootContext(),isHighlighted=computed(()=>currentElement.value===rootContext.highlightedElement.value),isSelected=computed(()=>valueComparator(rootContext.modelValue.value,props.value,rootContext.by)),disabled=computed(()=>rootContext.disabled.value||props.disabled);async function handleSelect(ev){emits(`select`,ev),!ev?.defaultPrevented&&!disabled.value&&ev&&(rootContext.onValueChange(props.value),rootContext.changeHighlight(currentElement.value))}function handleSelectCustomEvent(ev){let eventDetail={originalEvent:ev,value:props.value};handleAndDispatchCustomEvent(LISTBOX_SELECT,handleSelect,eventDetail)}return provideListboxItemContext({isSelected}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(CollectionItem),{value:_ctx.value},{default:withCtx(()=>[withMemo([isHighlighted.value,isSelected.value],()=>createVNode(unref(Primitive),mergeProps({id:unref(id)},_ctx.$attrs,{ref:unref(forwardRef),role:`option`,tabindex:unref(rootContext).focusable.value?isHighlighted.value?`0`:`-1`:-1,"aria-selected":isSelected.value,as:_ctx.as,"as-child":_ctx.asChild,disabled:disabled.value?``:void 0,"data-disabled":disabled.value?``:void 0,"data-highlighted":isHighlighted.value?``:void 0,"data-state":isSelected.value?`checked`:`unchecked`,onClick:handleSelectCustomEvent,onKeydown:withKeys(withModifiers(handleSelectCustomEvent,[`prevent`]),[`space`]),onPointermove:_cache$1[0]||=event=>{unref(rootContext).highlightedElement.value!==unref(currentElement)&&(unref(rootContext).highlightOnHover.value?unref(rootContext).changeHighlight(unref(currentElement),!1):unref(rootContext).focusable.value||unref(rootContext).changeHighlight(unref(currentElement),!1))}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`id`,`tabindex`,`aria-selected`,`as`,`as-child`,`disabled`,`data-disabled`,`data-highlighted`,`data-state`,`onKeydown`]),_cache$1,1)]),_:3},8,[`value`]))}}),ListboxItem_default=ListboxItem_vue_vue_type_script_setup_true_lang_default,ListboxItemIndicator_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ListboxItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(__props){let props=__props;useForwardExpose();let itemContext=injectListboxItemContext();return(_ctx,_cache$1)=>unref(itemContext).isSelected.value?(openBlock(),createBlock(unref(Primitive),mergeProps({key:0,"aria-hidden":`true`},props),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16)):createCommentVNode(`v-if`,!0)}}),ListboxItemIndicator_default=ListboxItemIndicator_vue_vue_type_script_setup_true_lang_default;const[injectComboboxRootContext,provideComboboxRootContext]=createContext(`ComboboxRoot`);var ComboboxRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},openOnFocus:{type:Boolean,required:!1,default:!1},openOnClick:{type:Boolean,required:!1,default:!1},ignoreFilter:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`highlight`,`update:open`],setup(__props,{expose:__expose,emit:__emit}){let props=__props,emits=__emit,{primitiveElement,currentElement:parentElement}=usePrimitiveElement(),{multiple,disabled,ignoreFilter,resetSearchTermOnSelect,openOnFocus,openOnClick,dir:propDir}=toRefs(props),dir=useDirection(propDir),modelValue=useVModel(props,`modelValue`,emits,{defaultValue:props.defaultValue??(multiple.value?[]:void 0),passive:props.modelValue===void 0,deep:!0}),open$1=useVModel(props,`open`,emits,{defaultValue:props.defaultOpen,passive:props.open===void 0});async function onOpenChange(val){open$1.value=val,filterSearch.value=``,val?(await nextTick(),primitiveElement.value?.highlightSelected(),isUserInputted.value=!0):isUserInputted.value=!1,inputElement.value?.focus(),setTimeout(()=>{!val&&props.resetSearchTermOnBlur&&resetSearchTerm.trigger()},1)}let resetSearchTerm=createEventHook(),isUserInputted=ref(!1),isVirtual=ref(!1),inputElement=ref(),triggerElement=ref(),highlightedElement=computed(()=>primitiveElement.value?.highlightedElement??void 0),allItems=ref(new Map),allGroups=ref(new Map),{contains}=useFilter({sensitivity:`base`}),filterSearch=ref(``),filterState=computed(oldValue=>{if(!filterSearch.value||props.ignoreFilter||isVirtual.value)return{count:allItems.value.size,items:oldValue?.items??new Map,groups:oldValue?.groups??new Set(allGroups.value.keys())};let itemCount=0,filteredItems=new Map,filteredGroups=new Set;for(let[id,value$1]of allItems.value){let score=contains(value$1,filterSearch.value);filteredItems.set(id,score?1:0),score&&itemCount++}for(let[groupId,group]of allGroups.value)for(let itemId of group)if(filteredItems.get(itemId)>0){filteredGroups.add(groupId);break}return{count:itemCount,items:filteredItems,groups:filteredGroups}}),inst=getCurrentInstance();return onMounted(()=>{inst?.exposed&&(inst.exposed.highlightItem=primitiveElement.value?.highlightItem,inst.exposed.highlightFirstItem=primitiveElement.value?.highlightFirstItem,inst.exposed.highlightSelected=primitiveElement.value?.highlightSelected)}),__expose({filtered:filterState,highlightedElement,highlightItem:primitiveElement.value?.highlightItem,highlightFirstItem:primitiveElement.value?.highlightFirstItem,highlightSelected:primitiveElement.value?.highlightSelected}),provideComboboxRootContext({modelValue,multiple,disabled,open:open$1,onOpenChange,contentId:``,isUserInputted,isVirtual,inputElement,highlightedElement,onInputElementChange:val=>inputElement.value=val,triggerElement,onTriggerElementChange:val=>triggerElement.value=val,parentElement,resetSearchTermOnSelect,onResetSearchTerm:resetSearchTerm.on,allItems,allGroups,filterSearch,filterState,ignoreFilter,openOnFocus,openOnClick}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(PopperRoot_default),null,{default:withCtx(()=>[createVNode(unref(ListboxRoot_default),mergeProps({ref_key:`primitiveElement`,ref:primitiveElement},_ctx.$attrs,{modelValue:unref(modelValue),"onUpdate:modelValue":_cache$1[0]||=$event=>isRef(modelValue)?modelValue.value=$event:null,style:{pointerEvents:unref(open$1)?`auto`:void 0},as:_ctx.as,"as-child":_ctx.asChild,dir:unref(dir),multiple:unref(multiple),name:_ctx.name,required:_ctx.required,disabled:unref(disabled),"highlight-on-hover":!0,by:props.by,onHighlight:_cache$1[1]||=$event=>emits(`highlight`,$event)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{open:unref(open$1),modelValue:unref(modelValue)})]),_:3},16,[`modelValue`,`style`,`as`,`as-child`,`dir`,`multiple`,`name`,`required`,`disabled`,`by`])]),_:3}))}}),ComboboxRoot_default=ComboboxRoot_vue_vue_type_script_setup_true_lang_default;const[injectComboboxContentContext,provideComboboxContentContext]=createContext(`ComboboxContent`);var ComboboxContentImpl_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxContentImpl`,props:{position:{type:String,required:!1,default:`inline`},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,{position:position$2}=toRefs(props),rootContext=injectComboboxRootContext(),{forwardRef,currentElement}=useForwardExpose();useBodyScrollLock(props.bodyLock),useHideOthers(rootContext.parentElement);let pickedProps=computed(()=>props.position===`popper`?props:{}),forwardedProps=useForwardProps(pickedProps.value),popperStyle={boxSizing:`border-box`,"--reka-combobox-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-combobox-content-available-width":`var(--reka-popper-available-width)`,"--reka-combobox-content-available-height":`var(--reka-popper-available-height)`,"--reka-combobox-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-combobox-trigger-height":`var(--reka-popper-anchor-height)`};provideComboboxContentContext({position:position$2});let isInputWithinContent=ref(!1);return onMounted(()=>{rootContext.inputElement.value&&(isInputWithinContent.value=currentElement.value.contains(rootContext.inputElement.value),isInputWithinContent.value&&rootContext.inputElement.value.focus())}),onUnmounted(()=>{isInputWithinContent.value&&rootContext.triggerElement.value?.focus()}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ListboxContent_default),{"as-child":``},{default:withCtx(()=>[createVNode(unref(DismissableLayer_default),{"as-child":``,"disable-outside-pointer-events":_ctx.disableOutsidePointerEvents,onDismiss:_cache$1[0]||=$event=>unref(rootContext).onOpenChange(!1),onFocusOutside:_cache$1[1]||=ev=>{unref(rootContext).parentElement.value?.contains(ev.target)&&ev.preventDefault(),emits(`focusOutside`,ev)},onInteractOutside:_cache$1[2]||=$event=>emits(`interactOutside`,$event),onEscapeKeyDown:_cache$1[3]||=$event=>emits(`escapeKeyDown`,$event),onPointerDownOutside:_cache$1[4]||=ev=>{unref(rootContext).parentElement.value?.contains(ev.target)&&ev.preventDefault(),emits(`pointerDownOutside`,ev)}},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(position$2)===`popper`?unref(PopperContent_default):unref(Primitive)),mergeProps({..._ctx.$attrs,...unref(forwardedProps)},{id:unref(rootContext).contentId,ref:unref(forwardRef),"data-state":unref(rootContext).open.value?`open`:`closed`,style:{display:`flex`,flexDirection:`column`,outline:`none`,...unref(position$2)===`popper`?popperStyle:{}}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`id`,`data-state`,`style`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3}))}}),ComboboxContentImpl_default=ComboboxContentImpl_vue_vue_type_script_setup_true_lang_default,ComboboxContent_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,forwarded=useForwardPropsEmits(props,emits),{forwardRef}=useForwardExpose(),rootContext=injectComboboxRootContext();return rootContext.contentId||=useId(void 0,`reka-combobox-content`),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Presence_default),{present:_ctx.forceMount||unref(rootContext).open.value},{default:withCtx(()=>[createVNode(ComboboxContentImpl_default,mergeProps({...unref(forwarded),..._ctx.$attrs},{ref:unref(forwardRef)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16)]),_:3},8,[`present`]))}}),ComboboxContent_default=ComboboxContent_vue_vue_type_script_setup_true_lang_default,ComboboxEmpty_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxEmpty`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let props=__props,rootContext=injectComboboxRootContext(),isRender=computed(()=>rootContext.ignoreFilter.value?rootContext.allItems.value.size===0:rootContext.filterState.value.count===0);return(_ctx,_cache$1)=>isRender.value?(openBlock(),createBlock(unref(Primitive),normalizeProps(mergeProps({key:0},props)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},()=>[_cache$1[0]||=createTextVNode(`No options`)])]),_:3},16)):createCommentVNode(`v-if`,!0)}}),ComboboxEmpty_default=ComboboxEmpty_vue_vue_type_script_setup_true_lang_default;const[injectComboboxGroupContext,provideComboboxGroupContext]=createContext(`ComboboxGroup`);var ComboboxGroup_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let props=__props,id=useId(void 0,`reka-combobox-group`),rootContext=injectComboboxRootContext(),isRender=computed(()=>rootContext.ignoreFilter.value?!0:rootContext.filterSearch.value?rootContext.filterState.value.groups.has(id):!0),context$1=provideComboboxGroupContext({id,labelId:``});return onMounted(()=>{rootContext.allGroups.value.has(id)||rootContext.allGroups.value.set(id,new Set)}),onUnmounted(()=>{rootContext.allGroups.value.delete(id)}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ListboxGroup_default),mergeProps({id:unref(id),"aria-labelledby":unref(context$1).labelId},props,{hidden:isRender.value?void 0:!0}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`,`hidden`]))}}),ComboboxGroup_default=ComboboxGroup_vue_vue_type_script_setup_true_lang_default,ComboboxInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxInput`,props:{displayValue:{type:Function,required:!1},modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectComboboxRootContext(),listboxContext=injectListboxRootContext(),{primitiveElement,currentElement}=usePrimitiveElement(),modelValue=useVModel(props,`modelValue`,emits,{passive:props.modelValue===void 0});onMounted(()=>{currentElement.value&&rootContext.onInputElementChange(currentElement.value)});function handleKeyDown(ev){rootContext.open.value||rootContext.onOpenChange(!0)}function handleInput(event){let target$1=event.target;rootContext.open.value?rootContext.filterSearch.value=target$1.value:(rootContext.onOpenChange(!0),nextTick(()=>{target$1.value&&(rootContext.filterSearch.value=target$1.value,listboxContext.highlightFirstItem())}))}function handleFocus(){rootContext.openOnFocus.value&&!rootContext.open.value&&rootContext.onOpenChange(!0)}function handleClick(){rootContext.openOnClick.value&&!rootContext.open.value&&rootContext.onOpenChange(!0)}function resetSearchTerm(){let rootModelValue=rootContext.modelValue.value;props.displayValue?modelValue.value=props.displayValue(rootModelValue):!rootContext.multiple.value&&rootModelValue&&!Array.isArray(rootModelValue)?typeof rootModelValue==`object`?modelValue.value=``:modelValue.value=rootModelValue.toString():modelValue.value=``,nextTick(()=>{modelValue.value=modelValue.value})}return rootContext.onResetSearchTerm(()=>{resetSearchTerm()}),watch(rootContext.modelValue,async()=>{!rootContext.isUserInputted.value&&rootContext.resetSearchTermOnSelect.value&&resetSearchTerm()},{immediate:!0,deep:!0}),watch(rootContext.filterState,()=>{rootContext.isVirtual.value||listboxContext.highlightFirstItem()}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ListboxFilter_default),{ref_key:`primitiveElement`,ref:primitiveElement,modelValue:unref(modelValue),"onUpdate:modelValue":_cache$1[0]||=$event=>isRef(modelValue)?modelValue.value=$event:null,as:_ctx.as,"as-child":_ctx.asChild,"auto-focus":_ctx.autoFocus,disabled:_ctx.disabled,"aria-expanded":unref(rootContext).open.value,"aria-controls":unref(rootContext).contentId,"aria-autocomplete":`list`,role:`combobox`,autocomplete:`off`,onClick:handleClick,onInput:handleInput,onKeydown:withKeys(withModifiers(handleKeyDown,[`prevent`]),[`down`,`up`]),onFocus:handleFocus},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`modelValue`,`as`,`as-child`,`auto-focus`,`disabled`,`aria-expanded`,`aria-controls`,`onKeydown`]))}}),ComboboxInput_default=ComboboxInput_vue_vue_type_script_setup_true_lang_default,ComboboxItem_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxItem`,props:{textValue:{type:String,required:!1},value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,id=useId(void 0,`reka-combobox-item`),rootContext=injectComboboxRootContext(),groupContext=injectComboboxGroupContext(null),{primitiveElement,currentElement}=usePrimitiveElement();if(props.value===``)throw Error(`A must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder.`);let isRender=computed(()=>{if(rootContext.isVirtual.value||rootContext.ignoreFilter.value||!rootContext.filterSearch.value)return!0;{let filteredCurrentItem=rootContext.filterState.value.items.get(id);return filteredCurrentItem===void 0?!0:filteredCurrentItem>0}});return onMounted(()=>{rootContext.allItems.value.set(id,props.textValue||currentElement.value.textContent||currentElement.value.innerText);let groupId=groupContext?.id;groupId&&(rootContext.allGroups.value.has(groupId)?rootContext.allGroups.value.get(groupId)?.add(id):rootContext.allGroups.value.set(groupId,new Set([id])))}),onUnmounted(()=>{rootContext.allItems.value.delete(id)}),(_ctx,_cache$1)=>isRender.value?(openBlock(),createBlock(unref(ListboxItem_default),mergeProps({key:0},props,{id:unref(id),ref_key:`primitiveElement`,ref:primitiveElement,disabled:unref(rootContext).disabled.value||_ctx.disabled,onSelect:_cache$1[0]||=event=>{emits(`select`,event),!event.defaultPrevented&&!unref(rootContext).multiple.value&&!_ctx.disabled&&!unref(rootContext).disabled.value&&(event.preventDefault(),unref(rootContext).onOpenChange(!1),unref(rootContext).modelValue.value=props.value)}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{},()=>[createTextVNode(toDisplayString(_ctx.value),1)])]),_:3},16,[`id`,`disabled`])):createCommentVNode(`v-if`,!0)}}),ComboboxItem_default=ComboboxItem_vue_vue_type_script_setup_true_lang_default,ComboboxItemIndicator_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(__props){let props=__props;return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ListboxItemIndicator_default),normalizeProps(guardReactiveProps(props)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),ComboboxItemIndicator_default=ComboboxItemIndicator_vue_vue_type_script_setup_true_lang_default,ComboboxLabel_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxLabel`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(__props){let props=__props;useForwardExpose();let groupContext=injectComboboxGroupContext({id:``,labelId:``});return groupContext.labelId||=useId(void 0,`reka-combobox-group-label`),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),mergeProps(props,{id:unref(groupContext).labelId}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`id`]))}}),ComboboxLabel_default=ComboboxLabel_vue_vue_type_script_setup_true_lang_default,ComboboxSeparator_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let props=__props;return useForwardExpose(),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),mergeProps(props,{"aria-hidden":`true`}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),ComboboxSeparator_default=ComboboxSeparator_vue_vue_type_script_setup_true_lang_default,ComboboxTrigger_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(__props){let props=__props,{forwardRef,currentElement}=useForwardExpose(),rootContext=injectComboboxRootContext(),disabled=computed(()=>props.disabled||rootContext.disabled.value||!1);return onMounted(()=>{currentElement.value&&rootContext.onTriggerElementChange(currentElement.value)}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),mergeProps(props,{ref:unref(forwardRef),type:_ctx.as===`button`?`button`:void 0,tabindex:`-1`,"aria-label":`Show popup`,"aria-haspopup":`listbox`,"aria-expanded":unref(rootContext).open.value,"aria-controls":unref(rootContext).contentId,"data-state":unref(rootContext).open.value?`open`:`closed`,disabled:disabled.value,"data-disabled":disabled.value?``:void 0,"aria-disabled":disabled.value??void 0,onClick:_cache$1[0]||=$event=>unref(rootContext).onOpenChange(!unref(rootContext).open.value)}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`aria-disabled`]))}}),ComboboxTrigger_default=ComboboxTrigger_vue_vue_type_script_setup_true_lang_default;function useNonce(nonce){let context$1=injectConfigProviderContext({nonce:ref()});return computed(()=>nonce?.value||context$1.nonce?.value)}var ComboboxViewport_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ComboboxViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(__props){let props=__props,{forwardRef}=useForwardExpose(),{nonce:propNonce}=toRefs(props),nonce=useNonce(propNonce),rootContext=injectComboboxRootContext();return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(Primitive),mergeProps({..._ctx.$attrs,...props},{ref:unref(forwardRef),"data-reka-combobox-viewport":``,role:`presentation`,style:{position:`relative`,flex:unref(rootContext).isVirtual.value?void 0:1,overflow:`auto`}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`style`]),createVNode(unref(Primitive),{as:`style`,nonce:unref(nonce)},{default:withCtx(()=>_cache$1[0]||=[createTextVNode(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-combobox-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-combobox-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),ComboboxViewport_default=ComboboxViewport_vue_vue_type_script_setup_true_lang_default;const[injectSwitchRootContext,provideSwitchRootContext]=createContext(`SwitchRoot`);var SwitchRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SwitchRoot`,props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,{disabled}=toRefs(props),modelValue=useVModel(props,`modelValue`,emit$1,{defaultValue:props.defaultValue,passive:props.modelValue===void 0});function toggleCheck(){disabled.value||(modelValue.value=!modelValue.value)}let{forwardRef,currentElement}=useForwardExpose(),isFormControl=useFormControl(currentElement),ariaLabel=computed(()=>props.id&¤tElement.value?document.querySelector(`[for="${props.id}"]`)?.innerText:void 0);return provideSwitchRootContext({modelValue,toggleCheck,disabled}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),mergeProps(_ctx.$attrs,{id:_ctx.id,ref:unref(forwardRef),role:`switch`,type:_ctx.as===`button`?`button`:void 0,value:_ctx.value,"aria-label":_ctx.$attrs[`aria-label`]||ariaLabel.value,"aria-checked":unref(modelValue),"aria-required":_ctx.required,"data-state":unref(modelValue)?`checked`:`unchecked`,"data-disabled":unref(disabled)?``:void 0,"as-child":_ctx.asChild,as:_ctx.as,disabled:unref(disabled),onClick:toggleCheck,onKeydown:withKeys(withModifiers(toggleCheck,[`prevent`]),[`enter`])}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{modelValue:unref(modelValue)}),unref(isFormControl)&&_ctx.name?(openBlock(),createBlock(unref(VisuallyHiddenInput_default),{key:0,type:`checkbox`,name:_ctx.name,disabled:unref(disabled),required:_ctx.required,value:_ctx.value,checked:!!unref(modelValue)},null,8,[`name`,`disabled`,`required`,`value`,`checked`])):createCommentVNode(`v-if`,!0)]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]))}}),SwitchRoot_default=SwitchRoot_vue_vue_type_script_setup_true_lang_default,SwitchThumb_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(__props){let rootContext=injectSwitchRootContext();return useForwardExpose(),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Primitive),{"data-state":unref(rootContext).modelValue?.value?`checked`:`unchecked`,"data-disabled":unref(rootContext).disabled.value?``:void 0,"as-child":_ctx.asChild,as:_ctx.as},{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),SwitchThumb_default=SwitchThumb_vue_vue_type_script_setup_true_lang_default,TooltipArrow_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(__props){let props=__props;return useForwardExpose(),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(PopperArrow_default),normalizeProps(guardReactiveProps(props)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),TooltipArrow_default=TooltipArrow_vue_vue_type_script_setup_true_lang_default;const[injectTooltipProviderContext,provideTooltipProviderContext]=createContext(`TooltipProvider`);var TooltipProvider_vue_vue_type_script_setup_true_lang_default=defineComponent({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(__props){let props=__props,{delayDuration,skipDelayDuration,disableHoverableContent,disableClosingTrigger,ignoreNonKeyboardFocus,disabled}=toRefs(props);useForwardExpose();let isOpenDelayed=ref(!0),isPointerInTransitRef=ref(!1),{start:startTimer,stop:clearTimer}=useTimeoutFn(()=>{isOpenDelayed.value=!0},skipDelayDuration,{immediate:!1});return provideTooltipProviderContext({isOpenDelayed,delayDuration,onOpen(){clearTimer(),isOpenDelayed.value=!1},onClose(){startTimer()},isPointerInTransitRef,disableHoverableContent,disableClosingTrigger,disabled,ignoreNonKeyboardFocus}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`)}}),TooltipProvider_default=TooltipProvider_vue_vue_type_script_setup_true_lang_default;const TOOLTIP_OPEN=`tooltip.open`,[injectTooltipRootContext,provideTooltipRootContext]=createContext(`TooltipRoot`);var TooltipRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit;useForwardExpose();let providerContext=injectTooltipProviderContext(),disableHoverableContent=computed(()=>props.disableHoverableContent??providerContext.disableHoverableContent.value),disableClosingTrigger=computed(()=>props.disableClosingTrigger??providerContext.disableClosingTrigger.value),disableTooltip=computed(()=>props.disabled??providerContext.disabled.value),delayDuration=computed(()=>props.delayDuration??providerContext.delayDuration.value),ignoreNonKeyboardFocus=computed(()=>props.ignoreNonKeyboardFocus??providerContext.ignoreNonKeyboardFocus.value),open$1=useVModel(props,`open`,emit$1,{defaultValue:props.defaultOpen,passive:props.open===void 0});watch(open$1,isOpen=>{providerContext.onClose&&(isOpen?(providerContext.onOpen(),document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN))):providerContext.onClose())});let wasOpenDelayedRef=ref(!1),trigger$1=ref(),stateAttribute=computed(()=>open$1.value?wasOpenDelayedRef.value?`delayed-open`:`instant-open`:`closed`),{start:startTimer,stop:clearTimer}=useTimeoutFn(()=>{wasOpenDelayedRef.value=!0,open$1.value=!0},delayDuration,{immediate:!1});function handleOpen(){clearTimer(),wasOpenDelayedRef.value=!1,open$1.value=!0}function handleClose(){clearTimer(),open$1.value=!1}function handleDelayedOpen(){startTimer()}return provideTooltipRootContext({contentId:``,open:open$1,stateAttribute,trigger:trigger$1,onTriggerChange(el){trigger$1.value=el},onTriggerEnter(){providerContext.isOpenDelayed.value?handleDelayedOpen():handleOpen()},onTriggerLeave(){disableHoverableContent.value?handleClose():clearTimer()},onOpen:handleOpen,onClose:handleClose,disableHoverableContent,disableClosingTrigger,disabled:disableTooltip,ignoreNonKeyboardFocus}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(PopperRoot_default),null,{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`,{open:unref(open$1)})]),_:3}))}}),TooltipRoot_default=TooltipRoot_vue_vue_type_script_setup_true_lang_default,TooltipContentImpl_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:`top`},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:`center`},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:`partial`},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectTooltipRootContext(),{forwardRef}=useForwardExpose(),slot=useSlots(),defaultSlot=computed(()=>slot.default?.({})),ariaLabel=computed(()=>{if(props.ariaLabel)return props.ariaLabel;let content$2=``;function recursiveTextSearch(node$1){typeof node$1.children==`string`&&node$1.type!==Comment?content$2+=node$1.children:Array.isArray(node$1.children)&&node$1.children.forEach(child=>recursiveTextSearch(child))}return defaultSlot.value?.forEach(node$1=>recursiveTextSearch(node$1)),content$2}),popperContentProps=computed(()=>{let{ariaLabel:_$1,...restProps}=props;return restProps});return onMounted(()=>{useEventListener$1(window,`scroll`,event=>{let target$1=event.target;target$1?.contains(rootContext.trigger.value)&&rootContext.onClose()}),useEventListener$1(window,TOOLTIP_OPEN,rootContext.onClose)}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(DismissableLayer_default),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:_cache$1[0]||=$event=>emits(`escapeKeyDown`,$event),onPointerDownOutside:_cache$1[1]||=event=>{unref(rootContext).disableClosingTrigger.value&&unref(rootContext).trigger.value?.contains(event.target)&&event.preventDefault(),emits(`pointerDownOutside`,event)},onFocusOutside:_cache$1[2]||=withModifiers(()=>{},[`prevent`]),onDismiss:_cache$1[3]||=$event=>unref(rootContext).onClose()},{default:withCtx(()=>[createVNode(unref(PopperContent_default),mergeProps({ref:unref(forwardRef),"data-state":unref(rootContext).stateAttribute.value},{..._ctx.$attrs,...popperContentProps.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`),createVNode(unref(VisuallyHidden_default),{id:unref(rootContext).contentId,role:`tooltip`},{default:withCtx(()=>[createTextVNode(toDisplayString(ariaLabel.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),TooltipContentImpl_default=TooltipContentImpl_vue_vue_type_script_setup_true_lang_default,TooltipContentHoverable_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(__props){let props=__props,forwardedProps=useForwardProps(props),{forwardRef,currentElement}=useForwardExpose(),{trigger:trigger$1,onClose}=injectTooltipRootContext(),providerContext=injectTooltipProviderContext(),{isPointerInTransit,onPointerExit}=useGraceArea(trigger$1,currentElement);return providerContext.isPointerInTransitRef=isPointerInTransit,onPointerExit(()=>{onClose()}),(_ctx,_cache$1)=>(openBlock(),createBlock(TooltipContentImpl_default,mergeProps({ref:unref(forwardRef)},unref(forwardedProps)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),TooltipContentHoverable_default=TooltipContentHoverable_vue_vue_type_script_setup_true_lang_default,TooltipContent_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:`top`},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(__props,{emit:__emit}){let props=__props,emits=__emit,rootContext=injectTooltipRootContext(),forwarded=useForwardPropsEmits(props,emits),{forwardRef}=useForwardExpose();return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Presence_default),{present:_ctx.forceMount||unref(rootContext).open.value},{default:withCtx(()=>[(openBlock(),createBlock(resolveDynamicComponent(unref(rootContext).disableHoverableContent.value?TooltipContentImpl_default:TooltipContentHoverable_default),mergeProps({ref:unref(forwardRef)},unref(forwarded)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),TooltipContent_default=TooltipContent_vue_vue_type_script_setup_true_lang_default,TooltipPortal_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(__props){let props=__props;return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(Teleport_default),normalizeProps(guardReactiveProps(props)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16))}}),TooltipPortal_default=TooltipPortal_vue_vue_type_script_setup_true_lang_default,TooltipTrigger_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(__props){let props=__props,rootContext=injectTooltipRootContext(),providerContext=injectTooltipProviderContext();rootContext.contentId||=useId(void 0,`reka-tooltip-content`);let{forwardRef,currentElement:triggerElement}=useForwardExpose(),isPointerDown=ref(!1),hasPointerMoveOpened=ref(!1),tooltipListeners=computed(()=>rootContext.disabled.value?{}:{click:handleClick,focus:handleFocus,pointermove:handlePointerMove,pointerleave:handlePointerLeave,pointerdown:handlePointerDown,blur:handleBlur});onMounted(()=>{rootContext.onTriggerChange(triggerElement.value)});function handlePointerUp(){setTimeout(()=>{isPointerDown.value=!1},1)}function handlePointerDown(){rootContext.open&&!rootContext.disableClosingTrigger.value&&rootContext.onClose(),isPointerDown.value=!0,document.addEventListener(`pointerup`,handlePointerUp,{once:!0})}function handlePointerMove(event){event.pointerType!==`touch`&&!hasPointerMoveOpened.value&&!providerContext.isPointerInTransitRef.value&&(rootContext.onTriggerEnter(),hasPointerMoveOpened.value=!0)}function handlePointerLeave(){rootContext.onTriggerLeave(),hasPointerMoveOpened.value=!1}function handleFocus(event){isPointerDown.value||rootContext.ignoreNonKeyboardFocus.value&&!event.target.matches?.(`:focus-visible`)||rootContext.onOpen()}function handleBlur(){rootContext.onClose()}function handleClick(){rootContext.disableClosingTrigger.value||rootContext.onClose()}return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(PopperAnchor_default),{"as-child":``,reference:_ctx.reference},{default:withCtx(()=>[createVNode(unref(Primitive),mergeProps({ref:unref(forwardRef),"aria-describedby":unref(rootContext).open.value?unref(rootContext).contentId:void 0,"data-state":unref(rootContext).stateAttribute.value,as:_ctx.as,"as-child":props.asChild,"data-grace-area-trigger":``},toHandlers(tooltipListeners.value)),{default:withCtx(()=>[renderSlot(_ctx.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),TooltipTrigger_default=TooltipTrigger_vue_vue_type_script_setup_true_lang_default,Checkbox_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Checkbox`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(__props){let modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(SwitchRoot_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,transition:`background duration-250 ease-in-out`,outline:`focus-within:none`,flex:`~`,border:`neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800`,bg:`data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800`,relative:``,"h-7":``,w:`12.5`,"rounded-full":``,shadow:`sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] `},{default:withCtx(()=>[createVNode(unref(SwitchThumb_default),{"my-auto":``,"size-6":``,flex:``,"items-center":``,"justify-center":``,"translate-x":`0.5 data-[state=checked]:full`,"rounded-full":``,"bg-white":``,"text-xs":``,"shadow-xl":``,transition:`transform duration-250 ease-in-out`,"will-change-transform":``})]),_:1},8,[`modelValue`]))}}),Checkbox_default=Checkbox_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$51={class:`line-clamp-1 overflow-hidden text-ellipsis whitespace-nowrap`};var Combobox_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Combobox`,props:mergeModels({options:{},placeholder:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);function toDisplayValue(value$1){let option$1=props.options.flatMap(group=>group.children).find(option$2=>option$2?.value===value$1);return option$1?option$1.label:props.placeholder||``}return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ComboboxRoot_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,class:`relative w-full`},{default:withCtx(()=>[createVNode(unref(ComboboxAnchor_default),{class:normalizeClass([`w-full inline-flex items-center justify-between rounded-xl border px-3 leading-none h-10 gap-[5px] outline-none`,`text-sm text-neutral-700 dark:text-neutral-200 data-[placeholder]:text-neutral-200`,`bg-white dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:disabled:bg-neutral-900 dark:hover:bg-neutral-700`,`border-neutral-200 dark:border-neutral-800 border-solid border-2 focus:border-primary-300 dark:focus:border-primary-400/50`,`shadow-sm focus:shadow-[0_0_0_2px] focus:shadow-black`,`transition-colors duration-200 ease-in-out`])},{default:withCtx(()=>[createVNode(unref(ComboboxInput_default),{class:normalizeClass([`!bg-transparent outline-none h-full selection:bg-grass5 placeholder-stone-400 w-full`,`text-neutral-700 dark:text-neutral-200`,`transition-colors duration-200 ease-in-out`]),placeholder:props.placeholder,"display-value":val=>toDisplayValue(val)},null,8,[`placeholder`,`display-value`]),createVNode(unref(ComboboxTrigger_default),null,{default:withCtx(()=>_cache$1[1]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-down-linear":``,class:normalizeClass([`h-4 w-4`,`text-neutral-700 dark:text-neutral-200`,`transition-colors duration-200 ease-in-out`])},null,-1)]),_:1,__:[1]})]),_:1}),createVNode(unref(ComboboxContent_default),{"avoid-collisions":!0,class:normalizeClass([`absolute z-10 w-full mt-1 min-w-[160px] overflow-hidden rounded-xl shadow-sm border will-change-[opacity,transform] max-h-50dvh`,`data-[side=top]:animate-slideDownAndFade data-[side=right]:animate-slideLeftAndFade data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade`,`bg-white dark:bg-neutral-900`,`border-neutral-200 dark:border-neutral-800 border-solid border-2 focus:border-neutral-300 dark:focus:border-neutral-600`])},{default:withCtx(()=>[createVNode(unref(ComboboxViewport_default),{class:`p-[2px]`},{default:withCtx(()=>[createVNode(unref(ComboboxEmpty_default),{class:normalizeClass([`font-medium py-2 px-2`,`text-xs text-neutral-700 dark:text-neutral-200`,`transition-colors duration-200 ease-in-out`])}),(openBlock(!0),createElementBlock(Fragment,null,renderList(_ctx.options,(group,index$1)=>(openBlock(),createBlock(unref(ComboboxGroup_default),{key:group.name,class:`overflow-x-hidden`},{default:withCtx(()=>[index$1===0?createCommentVNode(``,!0):(openBlock(),createBlock(unref(ComboboxSeparator_default),{key:0,class:`m-[5px] h-[1px] bg-neutral-400`})),createVNode(unref(ComboboxLabel_default),{class:normalizeClass([`px-[25px] text-xs leading-[25px]`,`text-neutral-500 dark:text-neutral-400`,`transition-colors duration-200 ease-in-out`])},{default:withCtx(()=>[createTextVNode(toDisplayString(group.groupLabel),1)]),_:2},1024),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.children,option$1=>(openBlock(),createBlock(unref(ComboboxItem_default),{key:option$1.label,"text-value":option$1.label,value:option$1.value,class:normalizeClass([`leading-none rounded-lg flex items-center h-8 pr-[0.5rem] pl-[1.5rem] relative select-none data-[disabled]:pointer-events-none data-[highlighted]:outline-none`,`data-[highlighted]:bg-neutral-100 dark:data-[highlighted]:bg-neutral-800`,`text-sm text-neutral-700 dark:text-neutral-200 data-[disabled]:text-neutral-400 dark:data-[disabled]:text-neutral-600 data-[highlighted]:text-grass1`,`transition-colors duration-200 ease-in-out`,`cursor-pointer`])},{default:withCtx(()=>[createVNode(unref(ComboboxItemIndicator_default),{class:`absolute left-0 w-[25px] inline-flex items-center justify-center opacity-30`},{default:withCtx(()=>_cache$1[2]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-right-outline":``},null,-1)]),_:1,__:[2]}),createBaseVNode(`span`,_hoisted_1$51,toDisplayString(option$1.label),1)]),_:2},1032,[`text-value`,`value`]))),128))]),_:2},1024))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`]))}}),Combobox_default=Combobox_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$50={flex:`~ col gap-4`},_hoisted_2$33={flex:`~ row`,"items-center":``,"gap-2":``},_hoisted_3$26={flex:`1`},_hoisted_4$21={class:`flex items-center gap-1 text-sm font-medium`},_hoisted_5$18={class:`text-xs text-neutral-500 dark:text-neutral-400`};var FieldCheckbox_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FieldCheckbox`,props:mergeModels({label:{},description:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`label`,_hoisted_1$50,[createBaseVNode(`div`,_hoisted_2$33,[createBaseVNode(`div`,_hoisted_3$26,[createBaseVNode(`div`,_hoisted_4$21,[renderSlot(_ctx.$slots,`label`,{},()=>[createTextVNode(toDisplayString(props.label),1)])]),createBaseVNode(`div`,_hoisted_5$18,[renderSlot(_ctx.$slots,`description`,{},()=>[createTextVNode(toDisplayString(props.description),1)])])]),createVNode(Checkbox_default,{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event},null,8,[`modelValue`])])]))}}),FieldCheckbox_default=FieldCheckbox_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$49=[`type`];var Input_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Input`,props:mergeModels({type:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>withDirectives((openBlock(),createElementBlock(`input`,{"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,type:props.type||`text`,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,_hoisted_1$49)),[[vModelDynamic,modelValue.value]])}}),Input_default=Input_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$48={"max-w-full":``},_hoisted_2$32={flex:`~ col gap-4`},_hoisted_3$25={class:`flex items-center gap-1 text-sm font-medium`},_hoisted_4$20={key:0,class:`text-red-500`},_hoisted_5$17={class:`text-xs text-neutral-500 dark:text-neutral-400`,"text-nowrap":``},_hoisted_6$16=[`type`,`placeholder`];var FieldInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FieldInput`,props:mergeModels({label:{},description:{},placeholder:{},required:{type:Boolean},type:{},inputClass:{},singleLine:{type:Boolean,default:!0}},{modelValue:{required:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$48,[createBaseVNode(`label`,_hoisted_2$32,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_3$25,[renderSlot(_ctx.$slots,`label`,{},()=>[createTextVNode(toDisplayString(props.label),1)]),props.required===!1?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,_hoisted_4$20,`*`))]),createBaseVNode(`div`,_hoisted_5$17,[renderSlot(_ctx.$slots,`description`,{},()=>[createTextVNode(toDisplayString(props.description),1)])])]),_ctx.singleLine?(openBlock(),createBlock(Input_default,{key:0,modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,type:props.type,placeholder:props.placeholder,class:normalizeClass(props.inputClass)},null,8,[`modelValue`,`type`,`placeholder`,`class`])):withDirectives((openBlock(),createElementBlock(`textarea`,{key:1,"onUpdate:modelValue":_cache$1[1]||=$event=>modelValue.value=$event,type:props.type,placeholder:props.placeholder,class:normalizeClass(props.inputClass),border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,10,_hoisted_6$16)),[[vModelText,modelValue.value]])])]))}}),FieldInput_default=FieldInput_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$47={flex:`~ gap-2`};var InputKeyValue_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`InputKeyValue`,props:mergeModels({name:{},keyPlaceholder:{},valuePlaceholder:{}},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:[`update:propertyKey`,`update:propertyValue`],setup(__props){let props=__props,key$2=useModel(__props,`propertyKey`),value$1=useModel(__props,`propertyValue`);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$47,[createVNode(Input_default,{modelValue:key$2.value,"onUpdate:modelValue":_cache$1[0]||=$event=>key$2.value=$event,placeholder:props.keyPlaceholder,class:`w-1/2`},null,8,[`modelValue`,`placeholder`]),createVNode(Input_default,{modelValue:value$1.value,"onUpdate:modelValue":_cache$1[1]||=$event=>value$1.value=$event,placeholder:props.valuePlaceholder,class:`w-1/2`},null,8,[`modelValue`,`placeholder`])]))}}),InputKeyValue_default=InputKeyValue_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$46={"max-w-full":``},_hoisted_2$31={flex:`~ col gap-2`},_hoisted_3$24={class:`flex items-center gap-1 text-sm font-medium`},_hoisted_4$19={key:0,class:`text-red-500`},_hoisted_5$16={class:`text-xs text-neutral-500 dark:text-neutral-400`,"text-nowrap":``},_hoisted_6$15={flex:`~ col gap-2`},_hoisted_7$10=[`onClick`];var FieldKeyValues_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FieldKeyValues`,props:mergeModels({label:{},description:{},name:{},keyPlaceholder:{},valuePlaceholder:{},required:{type:Boolean},inputClass:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:mergeModels([`remove`,`add`],[`update:modelValue`]),setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,keyValues=useModel(__props,`modelValue`),inputKey=ref(``),inputValue=ref(``);return watch([inputKey,inputValue],()=>{emit$1(`add`,inputKey.value,inputValue.value)}),(_ctx,_cache$1)=>{let _directive_auto_animate=resolveDirective(`auto-animate`);return openBlock(),createElementBlock(`div`,_hoisted_1$46,[createBaseVNode(`label`,_hoisted_2$31,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_3$24,[renderSlot(_ctx.$slots,`label`,{},()=>[createTextVNode(toDisplayString(props.label),1)]),props.required===!1?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,_hoisted_4$19,`*`))]),createBaseVNode(`div`,_hoisted_5$16,[renderSlot(_ctx.$slots,`description`,{},()=>[createTextVNode(toDisplayString(props.description),1)])])]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$15,[(openBlock(!0),createElementBlock(Fragment,null,renderList(keyValues.value,(keyValue,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,"w-full":``,flex:``,"items-center":``,"gap-2":``},[createVNode(InputKeyValue_default,{"property-key":keyValue.key,"onUpdate:propertyKey":$event=>keyValue.key=$event,"property-value":keyValue.value,"onUpdate:propertyValue":$event=>keyValue.value=$event,"key-placeholder":props.keyPlaceholder,"value-placeholder":props.valuePlaceholder,"w-full":``},null,8,[`property-key`,`onUpdate:propertyKey`,`property-value`,`onUpdate:propertyValue`,`key-placeholder`,`value-placeholder`]),createBaseVNode(`button`,{onClick:$event=>emit$1(`remove`,index$1)},_cache$1[0]||=[createBaseVNode(`div`,{"i-solar:minus-circle-line-duotone":``,size:`6`},null,-1)],8,_hoisted_7$10)]))),128))])),[[_directive_auto_animate]])])])}}}),FieldKeyValues_default=FieldKeyValues_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$45=[`min`,`max`,`step`];var Range_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Range`,props:mergeModels({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:`#9090906e`},trackColor:{default:`gray`},trackValueColor:{default:`red`}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`),scaledMin=computed(()=>props.min*1e4),scaledMax=computed(()=>props.max*1e4),scaledStep=computed(()=>props.step*1e4),sliderRef=ref(),sliderValue=computed({get:()=>modelValue.value*1e4,set:value$1=>{modelValue.value=value$1/1e4,updateTrackColor()}});onMounted(()=>updateTrackColor()),watch(sliderValue,()=>updateTrackColor(),{immediate:!0}),watch([scaledMin,scaledMax,scaledStep],()=>updateTrackColor(),{immediate:!0});function updateTrackColor(){sliderRef.value&&(sliderRef.value.style.setProperty(`--value`,sliderValue.value.toString()),sliderRef.value.style.setProperty(`--min`,sliderRef.value.min?sliderRef.value.min:props.min.toString()),sliderRef.value.style.setProperty(`--max`,sliderRef.value.max?sliderRef.value.max:props.max.toString()))}function handleInput(e$4){let target$1=e$4.target;target$1.style.setProperty(`--value`,target$1.value)}return(_ctx,_cache$1)=>withDirectives((openBlock(),createElementBlock(`input`,{ref_key:`sliderRef`,ref:sliderRef,"onUpdate:modelValue":_cache$1[0]||=$event=>sliderValue.value=$event,type:`range`,min:scaledMin.value,max:scaledMax.value,step:scaledStep.value,class:`slider-progress form_input-range`,onInput:handleInput},null,40,_hoisted_1$45)),[[vModelText,sliderValue.value,void 0,{number:!0}]])}}),__plugin_vue_export_helper_default=(sfc,props)=>{let target$1=sfc.__vccOpts||sfc;for(let[key$2,val]of props)target$1[key$2]=val;return target$1},Range_default=__plugin_vue_export_helper_default(Range_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-3a236ac7`]]);const _hoisted_1$44={flex:`~ row`,"items-center":``,"gap-2":``},_hoisted_2$30={flex:`1`},_hoisted_3$23={class:`flex items-center gap-1 text-sm font-medium`},_hoisted_4$18={class:`text-xs text-neutral-500 dark:text-neutral-400`},_hoisted_5$15={"font-mono":``},_hoisted_6$14={flex:`~ row`,"items-center":``,"gap-2":``};var FieldRange_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FieldRange`,props:mergeModels({min:{},max:{},step:{},label:{},description:{},formatValue:{},as:{default:`label`}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createBlock(props.as,{flex:`~ col gap-4`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$44,[createBaseVNode(`div`,_hoisted_2$30,[createBaseVNode(`div`,_hoisted_3$23,[renderSlot(_ctx.$slots,`label`,{},()=>[createTextVNode(toDisplayString(_ctx.label),1)])]),createBaseVNode(`div`,_hoisted_4$18,[renderSlot(_ctx.$slots,`description`,{},()=>[createTextVNode(toDisplayString(_ctx.description),1)])])]),createBaseVNode(`span`,_hoisted_5$15,toDisplayString(props.formatValue?.(modelValue.value)||modelValue.value),1)]),createBaseVNode(`div`,_hoisted_6$14,[createVNode(Range_default,{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,min:_ctx.min||0,max:_ctx.max||1,step:_ctx.step||.01,"w-full":``},null,8,[`modelValue`,`min`,`max`,`step`])])]),_:3}))}}),FieldRange_default=FieldRange_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$43={flex:`~ col gap-4`},_hoisted_2$29={class:`flex items-center gap-1 break-words text-sm font-medium`},_hoisted_3$22={class:`break-words text-xs text-neutral-500 dark:text-neutral-400`};var FieldSelect_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FieldSelect`,props:mergeModels({label:{},description:{},options:{},placeholder:{},disabled:{type:Boolean},layout:{default:`horizontal`},selectClass:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`label`,_hoisted_1$43,[createBaseVNode(`div`,{class:normalizeClass([`items-center justify-center`,[props.layout===`horizontal`?`grid grid-cols-3 gap-2`:`grid grid-cols-2 gap-2`]])},[createBaseVNode(`div`,{class:normalizeClass([`w-full`,[props.layout===`horizontal`?`col-span-2`:`row-span-1`]])},[createBaseVNode(`div`,_hoisted_2$29,[renderSlot(_ctx.$slots,`label`,{},()=>[createTextVNode(toDisplayString(props.label),1)])]),createBaseVNode(`div`,_hoisted_3$22,[renderSlot(_ctx.$slots,`description`,{},()=>[createTextVNode(toDisplayString(props.description),1)])])],2),renderSlot(_ctx.$slots,`default`,{},()=>[createVNode(unref(Select_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,options:props.options?.filter(option$1=>option$1.label&&option$1.value)||[],placeholder:props.placeholder,disabled:props.disabled,title:_ctx.label,class:normalizeClass([...props.selectClass?typeof props.selectClass==`string`?[props.selectClass]:props.selectClass:[],props.layout===`horizontal`?`col-span-1`:`row-span-2`])},{default:withCtx(({value:value$1})=>[createTextVNode(toDisplayString(props.options?.find(option$1=>option$1.value===value$1)?.label||props.placeholder),1)]),_:1},8,[`modelValue`,`options`,`placeholder`,`disabled`,`title`,`class`])])],2)]))}}),FieldSelect_default=FieldSelect_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$42={class:`max-w-full`},_hoisted_2$28={class:`flex flex-col gap-2`},_hoisted_3$21={class:`flex items-center gap-1 text-sm font-medium`},_hoisted_4$17={key:0,class:`text-red-500`},_hoisted_5$14={class:`text-nowrap text-xs text-neutral-500 dark:text-neutral-400`},_hoisted_6$13={class:`~ col gap-2`},_hoisted_7$9=[`onClick`];var FieldValues_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FieldValues`,props:mergeModels({label:{},description:{},name:{},valuePlaceholder:{},required:{type:Boolean},inputClass:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:mergeModels([`remove`,`add`],[`update:modelValue`]),setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,items=useModel(__props,`modelValue`);function addItem(){items.value.push(``),emit$1(`add`)}function removeItem(index$1){items.value.splice(index$1,1),emit$1(`remove`,index$1)}return(_ctx,_cache$1)=>{let _directive_auto_animate=resolveDirective(`auto-animate`);return openBlock(),createElementBlock(`div`,_hoisted_1$42,[createBaseVNode(`label`,_hoisted_2$28,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_3$21,[renderSlot(_ctx.$slots,`label`,{},()=>[createTextVNode(toDisplayString(props.label),1)]),props.required===!1?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,_hoisted_4$17,`*`))]),createBaseVNode(`div`,_hoisted_5$14,[renderSlot(_ctx.$slots,`description`,{},()=>[createTextVNode(toDisplayString(props.description),1)])])]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_6$13,[(openBlock(!0),createElementBlock(Fragment,null,renderList(items.value,(_$1,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,class:`w-full flex items-center gap-2`},[createVNode(Input_default,{modelValue:items.value[index$1],"onUpdate:modelValue":$event=>items.value[index$1]=$event,placeholder:props.valuePlaceholder,class:`w-90%`},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`]),createBaseVNode(`button`,{"i-solar:minus-circle-line-duotone":``,size:`6`,class:`min-w-20px w-10% flex text-red-500`,onClick:$event=>removeItem(index$1)},null,8,_hoisted_7$9)]))),128)),createBaseVNode(`div`,{"i-solar:add-circle-line-duotone":``,size:`6`,class:`mt-2 w-4/5 text-blue-500`,onClick:addItem})])),[[_directive_auto_animate]])])])}}}),FieldValues_default=FieldValues_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$41=[`disabled`];var ColorHueRange_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ColorHueRange`,props:mergeModels({disabled:{type:Boolean},class:{}},{colorValue:{type:String,default:``},colorValueModifiers:{}}),emits:[`update:colorValue`],setup(__props){let props=__props,colorValue=useModel(__props,`colorValue`);return(_ctx,_cache$1)=>withDirectives((openBlock(),createElementBlock(`input`,{"onUpdate:modelValue":_cache$1[0]||=$event=>colorValue.value=$event,type:`range`,min:`0`,max:`360`,step:`0.01`,class:normalizeClass([`color-hue-range`,[props.disabled?`opacity-25 cursor-not-allowed`:`cursor-pointer`,props.class||``]]),transition:`all ease-in-out duration-250`,disabled:props.disabled},null,10,_hoisted_1$41)),[[vModelText,colorValue.value]])}}),ColorHueRange_default=__plugin_vue_export_helper_default(ColorHueRange_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-3d01d2fa`]]);const _hoisted_1$40=[`min`,`max`,`step`];var RoundRange_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`RoundRange`,props:mergeModels({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`),scaledMin=computed(()=>props.min*1e4),scaledMax=computed(()=>props.max*1e4),scaledStep=computed(()=>props.step*1e4),sliderRef=ref(),sliderValue=computed({get:()=>modelValue.value*1e4,set:value$1=>{modelValue.value=value$1/1e4,updateTrackColor()}});onMounted(()=>updateTrackColor()),watch(sliderValue,()=>updateTrackColor(),{immediate:!0}),watch([scaledMin,scaledMax,scaledStep],()=>updateTrackColor(),{immediate:!0});function updateTrackColor(){sliderRef.value&&(sliderRef.value.style.setProperty(`--value`,sliderValue.value.toString()),sliderRef.value.style.setProperty(`--min`,sliderRef.value.min?sliderRef.value.min:props.min.toString()),sliderRef.value.style.setProperty(`--max`,sliderRef.value.max?sliderRef.value.max:props.max.toString()))}function handleInput(e$4){let target$1=e$4.target;target$1.style.setProperty(`--value`,target$1.value)}return(_ctx,_cache$1)=>withDirectives((openBlock(),createElementBlock(`input`,{ref_key:`sliderRef`,ref:sliderRef,"onUpdate:modelValue":_cache$1[0]||=$event=>sliderValue.value=$event,type:`range`,min:scaledMin.value,max:scaledMax.value,step:scaledStep.value,class:`slider-progress form_input-round-range`,onInput:handleInput},null,40,_hoisted_1$40)),[[vModelText,sliderValue.value,void 0,{number:!0}]])}}),RoundRange_default=__plugin_vue_export_helper_default(RoundRange_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-ac8cc218`]]),Select_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Select`,props:mergeModels({options:{},placeholder:{},disabled:{type:Boolean},title:{},layout:{}},{modelValue:{required:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,show=ref(!1),modelValue=useModel(__props,`modelValue`);function selectOption(value$1){modelValue.value=value$1}function handleHide(){show.value=!1}return provide(`selectOption`,selectOption),provide(`hide`,handleHide),(_ctx,_cache$1)=>(openBlock(),createBlock(Combobox_default,{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,"default-value":modelValue.value,options:[{groupLabel:``,children:props.options}]},null,8,[`modelValue`,`default-value`,`options`]))}}),Select_default=Select_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$39={op50:``};var Collapsable_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Collapsable`,props:mergeModels({default:{type:Boolean},label:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,visible=useModel(__props,`modelValue`);watchEffect(()=>{props.default!=null&&(visible.value=!!props.default)});function setVisible(value$1){return visible.value=value$1,value$1}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,null,[renderSlot(_ctx.$slots,`trigger`,normalizeProps(guardReactiveProps({visible:visible.value,setVisible})),()=>[createBaseVNode(`button`,{sticky:``,"top-0":``,"z-10":``,flex:``,"items-center":``,"justify-between":``,px2:``,py1:``,"text-sm":``,"backdrop-blur-xl":``,onClick:_cache$1[0]||=$event=>visible.value=!visible.value},[createBaseVNode(`span`,null,toDisplayString(props.label??`Collapsable`),1),_cache$1[1]||=createTextVNode(),createBaseVNode(`span`,_hoisted_1$39,toDisplayString(visible.value?`▲`:`▼`),1)])]),createVNode(unref(TransitionVertical_default),null,{default:withCtx(()=>[visible.value?renderSlot(_ctx.$slots,`default`,normalizeProps(mergeProps({key:0},{visible:visible.value,setVisible}))):createCommentVNode(``,!0)]),_:3})]))}}),Collapsable_default=Collapsable_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$38=[`onClick`],_hoisted_2$27={flex:``,"items-center":``,"gap-1.5":``,text:`xs 2xl:sm`};var Container_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Container`,props:{title:{},icon:{},innerClass:{},expand:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(Collapsable_default,{default:_ctx.expand},{trigger:withCtx(slotProps=>[createBaseVNode(`button`,{class:`w-full flex items-center justify-between rounded-lg px-2 py-1 outline-none transition-all duration-250 ease-in-out`,text:`neutral-600 dark:neutral-400 sm sm:base`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,onClick:$event=>slotProps.setVisible(!slotProps.visible)},[renderSlot(_ctx.$slots,`title`,{},()=>[createBaseVNode(`div`,_hoisted_2$27,[_ctx.icon?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass(_ctx.icon),"size-4":``},null,2)):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(_ctx.title),1)])]),createBaseVNode(`div`,{"i-solar:alt-arrow-down-linear":``,transition:`transform duration-250`,class:normalizeClass({"rotate-180":slotProps.visible})},null,2)],8,_hoisted_1$38)]),default:withCtx(()=>[createBaseVNode(`div`,{grid:``,"gap-2":``,"p-1":``,class:normalizeClass(_ctx.innerClass)},[renderSlot(_ctx.$slots,`default`)],2)]),_:3},8,[`default`]))}}),Container_default=Container_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$37={"text-nowrap":``,"text-xs":``},_hoisted_2$26={h:`6.25`,"grid-col-span-2":``,"w-full":``},_hoisted_3$20=[`value`,`min`,`max`,`step`,`disabled`],_hoisted_4$16={bg:`neutral-100 dark:neutral-900`,border:`~ 1 solid neutral-200 dark:neutral-800`,"h-fit":``,"min-w-16":``,"inline-flex":``,"items-center":``,"rounded-md":``,"px-2":``,"py-1":``},_hoisted_5$13={"h-fit":``,"w-full":``,"inline-flex":``,"items-center":``,"gap-2":``,"text-xs":``},_hoisted_6$12=[`value`,`min`,`max`,`step`,`disabled`];var PropertyNumber_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`PropertyNumber`,props:mergeModels({label:{default:`Range`},config:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`),isDragging=ref(!1),dragStartX=ref(0),dragStartValue=ref(0),sliderRef=ref();function postProcessValue(val,config$1){return config$1?.formatValue?config$1.formatValue(val):config$1?.precision===void 0?val.toString():val.toFixed(config$1.precision)}let normalizedValue=ref(postProcessValue(modelValue.value,props.config));watch(modelValue,()=>{normalizedValue.value=postProcessValue(modelValue.value,props.config),updateSliderProgress()},{immediate:!0});function updateSliderProgress(){if(!sliderRef.value)return;let min$1=props.config?.min??0,max$1=props.config?.max??100,value$1=modelValue.value;sliderRef.value.style.setProperty(`--value`,value$1.toString()),sliderRef.value.style.setProperty(`--min`,min$1.toString()),sliderRef.value.style.setProperty(`--max`,max$1.toString())}onMounted(()=>{updateSliderProgress()});function handleSliderChange(event){let input=event.target,value$1=Number.parseFloat(input.value);Number.isNaN(value$1)||updateValue(value$1)}function handleInputChange(event){let input=event.target,value$1=Number.parseFloat(input.value);Number.isNaN(value$1)||updateValue(value$1)}function updateValue(value$1){let config$1=props.config,min$1=config$1?.min??0,max$1=config$1?.max??100;value$1=Math.max(min$1,Math.min(max$1,value$1)),modelValue.value=value$1,normalizedValue.value=postProcessValue(value$1,config$1)}function startDrag(event){props.config?.disabled||(event.preventDefault(),isDragging.value=!0,dragStartX.value=event.clientX,dragStartValue.value=modelValue.value,document.addEventListener(`mousemove`,onDrag),document.addEventListener(`mouseup`,stopDrag),document.body.style.cursor=`ew-resize`)}function onDrag(event){if(!isDragging.value)return;let deltaX=event.clientX-dragStartX.value,config$1=props.config,sensitivity=config$1?.step||.01,newValue=dragStartValue.value+deltaX*sensitivity;updateValue(newValue)}function stopDrag(){isDragging.value=!1,document.removeEventListener(`mousemove`,onDrag),document.removeEventListener(`mouseup`,stopDrag),document.body.style.cursor=``}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode(`div`,null,[renderSlot(_ctx.$slots,`label`,{},()=>[createBaseVNode(`span`,_hoisted_1$37,toDisplayString(props.label),1)],!0)]),_cache$1[0]||=createBaseVNode(`div`,null,null,-1),createBaseVNode(`div`,_hoisted_2$26,[createBaseVNode(`input`,{ref_key:`sliderRef`,ref:sliderRef,value:modelValue.value,type:`range`,min:props.config?.min??0,max:props.config?.max??100,step:props.config?.step??1,disabled:props.config?.disabled,class:`range-slider`,"h-full":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"outline-none":``,onInput:handleSliderChange},null,40,_hoisted_3$20)]),createBaseVNode(`label`,_hoisted_4$16,[createBaseVNode(`span`,_hoisted_5$13,[createBaseVNode(`span`,{"cursor-col-resize":``,"select-none":``,class:normalizeClass({"text-blue-500":isDragging.value}),onMousedown:startDrag},`|`,34),createBaseVNode(`input`,{value:normalizedValue.value,type:`number`,min:props.config?.min,max:props.config?.max,step:props.config?.step||1e-4,disabled:props.config?.disabled,"max-w-4lh":``,"w-full":``,"flex-1":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"text-xs":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:handleInputChange},null,40,_hoisted_6$12)])])],64))}}),PropertyNumber_default=__plugin_vue_export_helper_default(PropertyNumber_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-51d388af`]]);const _hoisted_1$36={"text-nowrap":``,"text-xs":``},_hoisted_2$25={bg:`neutral-100 dark:neutral-900`,"h-fit":``,"inline-flex":``,"items-center":``,"rounded-md":``,"px-2":``,"py-1":``,border:`~ 1 solid neutral-200 dark:neutral-800`},_hoisted_3$19={"h-fit":``,"inline-flex":``,"items-center":``,"text-xs":``},_hoisted_4$15=[`value`,`min`,`max`],_hoisted_5$12={bg:`neutral-100 dark:neutral-900`,"h-fit":``,"inline-flex":``,"items-center":``,"rounded-md":``,"px-2":``,"py-1":``,border:`~ 1 solid neutral-200 dark:neutral-800`},_hoisted_6$11={"h-fit":``,"inline-flex":``,"items-center":``,"text-xs":``},_hoisted_7$8=[`value`,`min`,`max`],_hoisted_8$6={bg:`neutral-100 dark:neutral-900`,"h-fit":``,"inline-flex":``,"items-center":``,"rounded-md":``,"px-2":``,"py-1":``,border:`~ 1 solid neutral-200 dark:neutral-800`},_hoisted_9$5={"h-fit":``,"inline-flex":``,"items-center":``,"text-xs":``},_hoisted_10$5=[`value`,`min`,`max`];var PropertyPoint_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`PropertyPoint`,props:mergeModels({label:{},xConfig:{},yConfig:{},zConfig:{}},{x:{required:!1,default:0},xModifiers:{},y:{required:!1,default:0},yModifiers:{},z:{required:!1,default:0},zModifiers:{}}),emits:[`update:x`,`update:y`,`update:z`],setup(__props){let props=__props,x$1=useModel(__props,`x`),y=useModel(__props,`y`),z$1=useModel(__props,`z`),isDragging=ref(),dragStartX=ref(0),dragStartValue=ref(0);function postProcessValue(val,config$1){return config$1?.formatValue?config$1.formatValue(val):config$1?.precision?val.toFixed(config$1.precision):val.toString()}let xNormalized=ref(postProcessValue(x$1.value,props.xConfig)),yNormalized=ref(postProcessValue(y.value,props.yConfig)),zNormalized=ref(postProcessValue(z$1.value,props.zConfig));watch(x$1,()=>xNormalized.value=postProcessValue(x$1.value,props.xConfig)),watch(y,()=>yNormalized.value=postProcessValue(y.value,props.yConfig)),watch(z$1,()=>zNormalized.value=postProcessValue(z$1.value,props.zConfig));function handleChange(axis,event){let input=event.target,value$1=Number.parseFloat(input.value);Number.isNaN(value$1)||updateValue(axis,value$1)}function updateValue(axis,value$1){let config$1=axis===`x`?props.xConfig:axis===`y`?props.yConfig:props.zConfig;switch(config$1?.min!==void 0&&(value$1=Math.max(config$1.min,value$1)),config$1?.max!==void 0&&(value$1=Math.min(config$1.max,value$1)),axis){case`x`:x$1.value=value$1,xNormalized.value=postProcessValue(value$1,props.xConfig)||String(value$1);break;case`y`:y.value=value$1,yNormalized.value=postProcessValue(value$1,props.yConfig)||String(value$1);break;case`z`:z$1.value=value$1,zNormalized.value=postProcessValue(value$1,props.zConfig)||String(value$1);break}}function startDrag(axis,event){event.preventDefault(),isDragging.value=axis,dragStartX.value=event.clientX;let currentValue=axis===`x`?x$1.value:axis===`y`?y.value:z$1.value;dragStartValue.value=currentValue,document.addEventListener(`mousemove`,onDrag),document.addEventListener(`mouseup`,stopDrag)}function onDrag(event){if(!isDragging.value)return;let deltaX=event.clientX-dragStartX.value,config$1=isDragging.value===`x`?props.xConfig:isDragging.value===`y`?props.yConfig:props.zConfig,sensitivity=config$1?.step||.01,newValue=dragStartValue.value+deltaX*sensitivity;updateValue(isDragging.value,newValue)}function stopDrag(){isDragging.value=void 0,document.removeEventListener(`mousemove`,onDrag),document.removeEventListener(`mouseup`,stopDrag)}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createBaseVNode(`div`,null,[renderSlot(_ctx.$slots,`label`,{},()=>[createBaseVNode(`span`,_hoisted_1$36,toDisplayString(props.label||`Point`),1)])]),_cache$1[6]||=createBaseVNode(`div`,null,null,-1),createBaseVNode(`label`,_hoisted_2$25,[createBaseVNode(`span`,_hoisted_3$19,[createBaseVNode(`span`,{"cursor-col-resize":``,"select-none":``,class:normalizeClass({"text-blue-500":isDragging.value===`x`}),onMousedown:_cache$1[0]||=e$4=>startDrag(`x`,e$4)},`|`,34),createBaseVNode(`input`,{value:xNormalized.value,type:`number`,min:props.xConfig?.min,max:props.xConfig?.max,step:1e-4,"max-w-4lh":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:_cache$1[1]||=e$4=>handleChange(`x`,e$4)},null,40,_hoisted_4$15)])]),createBaseVNode(`label`,_hoisted_5$12,[createBaseVNode(`span`,_hoisted_6$11,[createBaseVNode(`span`,{"cursor-col-resize":``,"select-none":``,class:normalizeClass({"text-blue-500":isDragging.value===`y`}),onMousedown:_cache$1[2]||=e$4=>startDrag(`y`,e$4)},`|`,34),createBaseVNode(`input`,{value:yNormalized.value,type:`number`,min:props.yConfig?.min,max:props.yConfig?.max,step:1e-4,"max-w-4lh":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:_cache$1[3]||=e$4=>handleChange(`y`,e$4)},null,40,_hoisted_7$8)])]),createBaseVNode(`label`,_hoisted_8$6,[createBaseVNode(`span`,_hoisted_9$5,[createBaseVNode(`span`,{"cursor-col-resize":``,"select-none":``,class:normalizeClass({"text-blue-500":isDragging.value===`z`}),onMousedown:_cache$1[4]||=e$4=>startDrag(`z`,e$4)},`|`,34),createBaseVNode(`input`,{value:zNormalized.value,type:`number`,min:props.zConfig?.min,max:props.zConfig?.max,step:1e-4,"max-w-4lh":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:_cache$1[5]||=e$4=>handleChange(`z`,e$4)},null,40,_hoisted_10$5)])])],64))}}),PropertyPoint_default=PropertyPoint_vue_vue_type_script_setup_true_lang_default,AudioSpectrum_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`AudioSpectrum`,props:{stream:{},bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(__props){let props=__props,frequencies=ref(Array.from({length:props.bars}).fill(0));onMounted(()=>{handleAnalyze()}),watch(()=>props.stream,()=>{handleAnalyze()});function handleAnalyze(){if(!props.stream)return;let audioContext=new(window.AudioContext||window.webkitAudioContext),source=audioContext.createMediaStreamSource(props.stream),analyser=audioContext.createAnalyser();analyser.fftSize=2048,source.connect(analyser);let bufferLength=analyser.frequencyBinCount,dataArray=new Uint8Array(bufferLength),sampleRate=audioContext.sampleRate,frequencyResolution=sampleRate/analyser.fftSize,minBin=Math.floor(props.minFreq/frequencyResolution),maxBin=Math.floor(props.maxFreq/frequencyResolution),usableBins=maxBin-minBin,binsPerBar=Math.floor(usableBins/props.bars),analyze=()=>{try{requestAnimationFrame(analyze),analyser.getByteFrequencyData(dataArray);let bars=Array.from({length:props.bars}).fill(0);for(let i=0;irenderSlot(_ctx.$slots,`default`,{frequencies:frequencies.value})}}),AudioSpectrum_default=AudioSpectrum_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$35={"h-full":``,flex:``,"items-center":``,"gap-1":``},AMPLIFICATION=5;var AudioSpectrumVisualizer_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`AudioSpectrumVisualizer`,props:{frequencies:{},barsClass:{}},setup(__props){let props=__props;function getReductionFactor(index$1,totalBars){let minFactor=.1,maxFactor=1;return minFactor+(maxFactor-minFactor)*(index$1/totalBars)}function getBarHeight(frequency,index$1){let reductionFactor=getReductionFactor(index$1,props.frequencies.length);return Math.min(100,Math.max(10,frequency*100*AMPLIFICATION*reductionFactor))}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$35,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_ctx.frequencies,(frequency,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,"h-full":``,flex:``,"flex-1":``,"items-end":``},[createBaseVNode(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:normalizeClass(_ctx.barsClass),style:normalizeStyle({height:`${getBarHeight(frequency,index$1)}%`})},null,6)]))),128))]))}}),AudioSpectrumVisualizer_default=AudioSpectrumVisualizer_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$34={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$24={class:`text-sm font-medium`},_hoisted_3$18={class:`text-sm text-neutral-500`};var LevelMeter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`LevelMeter`,props:{level:{},min:{default:0},max:{default:100},numBars:{default:20},label:{default:`Level`},unit:{default:`%`},height:{default:24},showHeader:{type:Boolean,default:!0},animationSpeed:{default:75},colorThresholds:{default:()=>[{value:60,color:`bg-green-500`},{value:80,color:`bg-yellow-500`},{value:100,color:`bg-red-500`}]},formatValue:{}},setup(__props){let props=__props,levelBars=computed(()=>{let normalizedLevel=Math.max(0,Math.min(100,(props.level-props.min)/(props.max-props.min)*100)),activeBars=Math.floor(normalizedLevel/100*props.numBars);return Array.from({length:props.numBars},(_$1,i)=>({active:ia$1.value-b$1.value);for(let threshold of thresholds)if(barLevel<=threshold.value)return threshold.color;return thresholds[thresholds.length-1]?.color||`bg-green-500`}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$34,[createBaseVNode(`span`,_hoisted_2$24,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$18,toDisplayString(_ctx.formatValue?_ctx.formatValue(_ctx.level):`${Math.round(_ctx.level)}${_ctx.unit}`),1)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 dark:bg-neutral-700`,style:normalizeStyle({height:`${_ctx.height}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(levelBars.value,(bar,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,class:normalizeClass([`flex-1 rounded-sm transition-all`,[bar.active?getBarColor(index$1,bar.level):`bg-neutral-200 dark:bg-neutral-600`,`duration-${_ctx.animationSpeed}`]]),style:normalizeStyle({height:bar.active?`100%`:`20%`})},null,6))),128))],4)]))}}),LevelMeter_default=LevelMeter_vue_vue_type_script_setup_true_lang_default,Volumed_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Volumed`,props:{perspective:{},transform:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`volumed`,style:normalizeStyle({perspective:`${_ctx.perspective}px`,transform:_ctx.transform})},[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],4))}}),Volumed_default=__plugin_vue_export_helper_default(Volumed_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-d8ce56aa`]]),CursorMomentum_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(__props,{expose:__expose}){let props=__props,momentum=ref(1),currentValue=ref(0),lastTimestamp=0,FRICTION=toRef(()=>props.friction),BASE_SPEED=toRef(()=>props.baseSpeed),MOMENTUM_FACTOR=toRef(()=>props.momentumFactor);function updateMomentum(timestamp$2){lastTimestamp||=timestamp$2;let deltaTime=timestamp$2-lastTimestamp;lastTimestamp=timestamp$2,momentum.value=BASE_SPEED.value+(momentum.value-BASE_SPEED.value)*FRICTION.value,currentValue.value+=momentum.value*deltaTime,requestAnimationFrame(updateMomentum)}function handleMouseMove(event){let speed=Math.sqrt(event.movementX**2+event.movementY**2);momentum.value+=speed*MOMENTUM_FACTOR.value}return onMounted(()=>{window.addEventListener(`mousemove`,handleMouseMove),requestAnimationFrame(updateMomentum)}),onUnmounted(()=>{window.removeEventListener(`mousemove`,handleMouseMove)}),__expose({momentum,currentValue}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`,{momentum:momentum.value,currentValue:currentValue.value})}}),CursorMomentum_default=CursorMomentum_vue_vue_type_script_setup_true_lang_default,TestDummyMarkerFlat_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TestDummyMarkerFlat`,props:{size:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`test-dummy-flat`,style:normalizeStyle({width:`${_ctx.size}px`,height:`${_ctx.size}px`})},_cache$1[0]||=[createBaseVNode(`div`,{class:`marker`},null,-1)],4))}}),TestDummyMarkerFlat_default=__plugin_vue_export_helper_default(TestDummyMarkerFlat_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-28f8c660`]]),TestDummyMarker_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TestDummyMarker`,setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(CursorMomentum_default,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:withCtx(({currentValue})=>[createVNode(Volumed_default,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:withCtx(()=>[createVNode(TestDummyMarkerFlat_default,{size:24,style:normalizeStyle({transform:`rotate(${currentValue}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),TestDummyMarker_default=TestDummyMarker_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$33={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$23={class:`text-sm font-medium`},_hoisted_3$17={class:`text-sm text-neutral-500`},_hoisted_4$14={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},_hoisted_5$11={class:`flex items-center gap-1`},_hoisted_6$10={class:`flex items-center gap-1`},_hoisted_7$7={class:`flex items-center gap-1`};var ThresholdMeter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ThresholdMeter`,props:{value:{},threshold:{},min:{default:0},max:{default:1},numBars:{default:20},label:{default:`Value`},unit:{default:`%`},precision:{default:1},height:{default:24},showHeader:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},animationSpeed:{default:100},belowThresholdClass:{default:`bg-primary-300 dark:bg-primary-600`},aboveThresholdClass:{default:`bg-green-500`},thresholdBarClass:{default:`bg-white dark:bg-neutral-800`},inactiveBarClass:{default:`bg-neutral-300 dark:bg-neutral-600`},belowLabel:{default:`Below`},aboveLabel:{default:`Above`},thresholdLabel:{default:`Threshold`},formatValue:{}},setup(__props){let props=__props,thresholdBars=computed(()=>{let normalizedValue=Math.max(0,Math.min(1,(props.value-props.min)/(props.max-props.min))),normalizedThreshold=Math.max(0,Math.min(1,(props.threshold-props.min)/(props.max-props.min))),activeBars=Math.floor(normalizedValue*props.numBars),thresholdBar=Math.floor(normalizedThreshold*props.numBars);return Array.from({length:props.numBars},(_$1,i)=>({active:i=thresholdBar,isBelowThreshold:i(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$33,[createBaseVNode(`span`,_hoisted_2$23,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$17,toDisplayString(_ctx.formatValue?_ctx.formatValue(_ctx.value):`${(_ctx.value*100).toFixed(_ctx.precision)}${_ctx.unit}`),1)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 p-1 dark:bg-neutral-700`,style:normalizeStyle({height:`${_ctx.height}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(thresholdBars.value,(bar,index$1)=>(openBlock(),createElementBlock(`div`,{key:`threshold-${index$1}`,class:normalizeClass([`flex-1 rounded-sm transition-all`,[bar.isThreshold?_ctx.thresholdBarClass:bar.isAboveThreshold?_ctx.aboveThresholdClass:bar.isBelowThreshold?_ctx.belowThresholdClass:_ctx.inactiveBarClass,`duration-${_ctx.animationSpeed}`]]),style:normalizeStyle({height:bar.active||bar.isThreshold?`100%`:`20%`})},null,6))),128))],4),_ctx.showLegend?(openBlock(),createElementBlock(`div`,_hoisted_4$14,[createBaseVNode(`span`,_hoisted_5$11,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full ${_ctx.belowThresholdClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.belowLabel),1)]),createBaseVNode(`span`,_hoisted_6$10,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full border border-neutral-400 ${_ctx.thresholdBarClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.thresholdLabel),1)]),createBaseVNode(`span`,_hoisted_7$7,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full ${_ctx.aboveThresholdClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.aboveLabel),1)])])):createCommentVNode(``,!0)]))}}),ThresholdMeter_default=ThresholdMeter_vue_vue_type_script_setup_true_lang_default;const parseNumber$1=(color$2,len)=>{if(typeof color$2==`number`){if(len===3)return{mode:`rgb`,r:(color$2>>8&15|color$2>>4&240)/255,g:(color$2>>4&15|color$2&240)/255,b:(color$2&15|color$2<<4&240)/255};if(len===4)return{mode:`rgb`,r:(color$2>>12&15|color$2>>8&240)/255,g:(color$2>>8&15|color$2>>4&240)/255,b:(color$2>>4&15|color$2&240)/255,alpha:(color$2&15|color$2<<4&240)/255};if(len===6)return{mode:`rgb`,r:(color$2>>16&255)/255,g:(color$2>>8&255)/255,b:(color$2&255)/255};if(len===8)return{mode:`rgb`,r:(color$2>>24&255)/255,g:(color$2>>16&255)/255,b:(color$2>>8&255)/255,alpha:(color$2&255)/255}}};var parseNumber_default=parseNumber$1;const named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var named_default=named;const parseNamed=color$2=>parseNumber_default(named_default[color$2.toLowerCase()],6);var parseNamed_default=parseNamed;const hex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,parseHex=color$2=>{let match;return(match=color$2.match(hex))?parseNumber_default(parseInt(match[1],16),match[1].length):void 0};var parseHex_default=parseHex;const num$1=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`,num_none=`(?:${num$1}|none)`,per=`${num$1}%`,per_none=`(?:${num$1}%|none)`,num_per=`(?:${num$1}%|${num$1})`,num_per_none=`(?:${num$1}%|${num$1}|none)`,hue=`(?:${num$1}(deg|grad|rad|turn)|${num$1})`,hue_none=`(?:${num$1}(deg|grad|rad|turn)|${num$1}|none)`,c=`\\s*,\\s*`,rx_num_per_none=RegExp(`^`+num_per_none+`$`),rgb_num_old=RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),rgb_per_old=RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),parseRgbLegacy=color$2=>{let res={mode:`rgb`},match;if(match=color$2.match(rgb_num_old))match[1]!==void 0&&(res.r=match[1]/255),match[2]!==void 0&&(res.g=match[2]/255),match[3]!==void 0&&(res.b=match[3]/255);else if(match=color$2.match(rgb_per_old))match[1]!==void 0&&(res.r=match[1]/100),match[2]!==void 0&&(res.g=match[2]/100),match[3]!==void 0&&(res.b=match[3]/100);else return;return match[4]===void 0?match[5]!==void 0&&(res.alpha=Math.max(0,Math.min(1,+match[5]))):res.alpha=Math.max(0,Math.min(1,match[4]/100)),res};var parseRgbLegacy_default=parseRgbLegacy;const prepare=(color$2,mode)=>color$2===void 0?void 0:typeof color$2==`object`?color$2.mode===void 0?mode?{...color$2,mode}:void 0:color$2:parse_default(color$2);var _prepare_default=prepare;const converter=(target_mode=`rgb`)=>color$2=>(color$2=_prepare_default(color$2,target_mode))===void 0?void 0:color$2.mode===target_mode?color$2:converters[color$2.mode][target_mode]?converters[color$2.mode][target_mode](color$2):target_mode===`rgb`?converters[color$2.mode].rgb(color$2):converters.rgb[target_mode](converters[color$2.mode].rgb(color$2));var converter_default=converter;const converters={},modes={},parsers=[],colorProfiles={},identity=v=>v,useMode=definition$29=>(converters[definition$29.mode]={...converters[definition$29.mode],...definition$29.toMode},Object.keys(definition$29.fromMode||{}).forEach(k$3=>{converters[k$3]||(converters[k$3]={}),converters[k$3][definition$29.mode]=definition$29.fromMode[k$3]}),definition$29.ranges||={},definition$29.difference||={},definition$29.channels.forEach(channel=>{if(definition$29.ranges[channel]===void 0&&(definition$29.ranges[channel]=[0,1]),!definition$29.interpolate[channel])throw Error(`Missing interpolator for: ${channel}`);typeof definition$29.interpolate[channel]==`function`&&(definition$29.interpolate[channel]={use:definition$29.interpolate[channel]}),definition$29.interpolate[channel].fixup||(definition$29.interpolate[channel].fixup=identity)}),modes[definition$29.mode]=definition$29,(definition$29.parse||[]).forEach(parser=>{useParser(parser,definition$29.mode)}),converter_default(definition$29.mode)),getMode=mode=>modes[mode],useParser=(parser,mode)=>{if(typeof parser==`string`){if(!mode)throw Error(`'mode' required when 'parser' is a string`);colorProfiles[parser]=mode}else typeof parser==`function`&&parsers.indexOf(parser)<0&&parsers.push(parser)},IdentStartCodePoint=/[^\x00-\x7F]|[a-zA-Z_]/,IdentCodePoint=/[^\x00-\x7F]|[-\w]/,Tok={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`};let _i=0;function is_num(chars){let ch=chars[_i],ch1=chars[_i+1];return ch===`-`||ch===`+`?/\d/.test(ch1)||ch1===`.`&&/\d/.test(chars[_i+2]):ch===`.`?/\d/.test(ch1):/\d/.test(ch)}function is_ident(chars){if(_i>=chars.length)return!1;let ch=chars[_i];if(IdentStartCodePoint.test(ch))return!0;if(ch===`-`){if(chars.length-_i<2)return!1;let ch1=chars[_i+1];return!!(ch1===`-`||IdentStartCodePoint.test(ch1))}return!1}const huenits={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function num(chars){let value$1=``;if((chars[_i]===`-`||chars[_i]===`+`)&&(value$1+=chars[_i++]),value$1+=digits(chars),chars[_i]===`.`&&/\d/.test(chars[_i+1])&&(value$1+=chars[_i++]+digits(chars)),(chars[_i]===`e`||chars[_i]===`E`)&&((chars[_i+1]===`-`||chars[_i+1]===`+`)&&/\d/.test(chars[_i+2])?value$1+=chars[_i++]+chars[_i++]+digits(chars):/\d/.test(chars[_i+1])&&(value$1+=chars[_i++]+digits(chars))),is_ident(chars)){let id=ident(chars);return id===`deg`||id===`rad`||id===`turn`||id===`grad`?{type:Tok.Hue,value:value$1*huenits[id]}:void 0}return chars[_i]===`%`?(_i++,{type:Tok.Percentage,value:+value$1}):{type:Tok.Number,value:+value$1}}function digits(chars){let v=``;for(;/\d/.test(chars[_i]);)v+=chars[_i++];return v}function ident(chars){let v=``;for(;_i=2.0 are supported.`));return}let parser=new GLTFParser(json,{path:path||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});parser.fileLoader.setRequestHeader(this.requestHeader);for(let i=0;i=0&&plugins[extensionName]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+extensionName+`".`)}}parser.setExtensions(extensions),parser.setPlugins(plugins),parser.parse(onLoad,onError)}parseAsync(data$12,path){let scope$1=this;return new Promise(function(resolve$1,reject){scope$1.parse(data$12,path,resolve$1,reject)})}};function GLTFRegistry(){let objects={};return{get:function(key$2){return objects[key$2]},add:function(key$2,object$1){objects[key$2]=object$1},remove:function(key$2){delete objects[key$2]},removeAll:function(){objects={}}}}const EXTENSIONS={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`};var GLTFLightsExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let parser=this.parser,nodeDefs=this.parser.json.nodes||[];for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureWebPExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_WEBP}loadTexture(textureIndex){let name$2=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$2])return null;let extension$1=textureDef.extensions[name$2],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureAVIFExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_AVIF}loadTexture(textureIndex){let name$2=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$2])return null;let extension$1=textureDef.extensions[name$2],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFMeshoptCompression=class{constructor(parser){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=parser}loadBufferView(index$1){let json=this.parser.json,bufferView=json.bufferViews[index$1];if(bufferView.extensions&&bufferView.extensions[this.name]){let extensionDef=bufferView.extensions[this.name],buffer$1=this.parser.getDependency(`buffer`,extensionDef.buffer),decoder=this.parser.options.meshoptDecoder;if(!decoder||!decoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return buffer$1.then(function(res){let byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count$1=extensionDef.count,stride=extensionDef.byteStride,source=new Uint8Array(res,byteOffset,byteLength);return decoder.decodeGltfBufferAsync?decoder.decodeGltfBufferAsync(count$1,stride,source,extensionDef.mode,extensionDef.filter).then(function(res$1){return res$1.buffer}):decoder.ready.then(function(){let result=new ArrayBuffer(count$1*stride);return decoder.decodeGltfBuffer(new Uint8Array(result),count$1,stride,source,extensionDef.mode,extensionDef.filter),result})})}else return null}},GLTFMeshGpuInstancing=class{constructor(parser){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=parser}createNodeMesh(nodeIndex){let json=this.parser.json,nodeDef=json.nodes[nodeIndex];if(!nodeDef.extensions||!nodeDef.extensions[this.name]||nodeDef.mesh===void 0)return null;let meshDef=json.meshes[nodeDef.mesh];for(let primitive of meshDef.primitives)if(primitive.mode!==WEBGL_CONSTANTS.TRIANGLES&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&primitive.mode!==void 0)return null;let extensionDef=nodeDef.extensions[this.name],attributesDef=extensionDef.attributes,pending=[],attributes={};for(let key$2 in attributesDef)pending.push(this.parser.getDependency(`accessor`,attributesDef[key$2]).then(accessor=>(attributes[key$2]=accessor,attributes[key$2])));return pending.length<1?null:(pending.push(this.parser.createNodeMesh(nodeIndex)),Promise.all(pending).then(results=>{let nodeObject=results.pop(),meshes=nodeObject.isGroup?nodeObject.children:[nodeObject],count$1=results[0].count,instancedMeshes=[];for(let mesh of meshes){let m=new Matrix4,p$4=new Vector3,q=new Quaternion,s=new Vector3(1,1,1),instancedMesh=new InstancedMesh(mesh.geometry,mesh.material,count$1);for(let i=0;i0||uri.search(/^data\:image\/jpeg/)===0?`image/jpeg`:uri.search(/\.webp($|\?)/i)>0||uri.search(/^data\:image\/webp/)===0?`image/webp`:uri.search(/\.ktx2($|\?)/i)>0||uri.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}const _identityMatrix=new Matrix4;var GLTFParser=class{constructor(json={},options$1={}){this.json=json,this.extensions={},this.plugins={},this.options=options$1,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let isSafari=!1,safariVersion=-1,isFirefox=!1,firefoxVersion=-1;if(typeof navigator<`u`){let userAgent=navigator.userAgent;isSafari=/^((?!chrome|android).)*safari/i.test(userAgent)===!0;let safariMatch=userAgent.match(/Version\/(\d+)/);safariVersion=isSafari&&safariMatch?parseInt(safariMatch[1],10):-1,isFirefox=userAgent.indexOf(`Firefox`)>-1,firefoxVersion=isFirefox?userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||isSafari&&safariVersion<17||isFirefox&&firefoxVersion<98?this.textureLoader=new TextureLoader(this.options.manager):this.textureLoader=new ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(extensions){this.extensions=extensions}setPlugins(plugins){this.plugins=plugins}parse(onLoad,onError){let parser=this,json=this.json,extensions=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(ext){return ext._markDefs&&ext._markDefs()}),Promise.all(this._invokeAll(function(ext){return ext.beforeRoot&&ext.beforeRoot()})).then(function(){return Promise.all([parser.getDependencies(`scene`),parser.getDependencies(`animation`),parser.getDependencies(`camera`)])}).then(function(dependencies){let result={scene:dependencies[0][json.scene||0],scenes:dependencies[0],animations:dependencies[1],cameras:dependencies[2],asset:json.asset,parser,userData:{}};return addUnknownExtensionsToUserData(extensions,result,json),assignExtrasToUserData(result,json),Promise.all(parser._invokeAll(function(ext){return ext.afterRoot&&ext.afterRoot(result)})).then(function(){for(let scene of result.scenes)scene.updateMatrixWorld();onLoad(result)})}).catch(onError)}_markDefs(){let nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex{let mappings=this.associations.get(original);mappings!=null&&this.associations.set(clone$3,mappings);for(let[i,child]of original.children.entries())updateMappings(child,clone$3.children[i])};return updateMappings(object$1,ref$1),ref$1.name+=`_instance_`+ cache$1.uses[index$1]++,ref$1}_invokeOne(func){let extensions=Object.values(this.plugins);extensions.push(this);for(let i=0;i=2&&bufferAttribute.setY(index$1,sparseValues[i*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index$1,sparseValues[i*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index$1,sparseValues[i*itemSize+3]),itemSize>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}bufferAttribute.normalized=normalized}return bufferAttribute})}loadTexture(textureIndex){let json=this.json,options$1=this.options,textureDef=json.textures[textureIndex],sourceIndex=textureDef.source,sourceDef=json.images[sourceIndex],loader$1=this.textureLoader;if(sourceDef.uri){let handler=options$1.manager.getHandler(sourceDef.uri);handler!==null&&(loader$1=handler)}return this.loadTextureImage(textureIndex,sourceIndex,loader$1)}loadTextureImage(textureIndex,sourceIndex,loader$1){let parser=this,json=this.json,textureDef=json.textures[textureIndex],sourceDef=json.images[sourceIndex],cacheKey=(sourceDef.uri||sourceDef.bufferView)+`:`+textureDef.sampler;if(this.textureCache[cacheKey])return this.textureCache[cacheKey];let promise=this.loadImageSource(sourceIndex,loader$1).then(function(texture){texture.flipY=!1,texture.name=textureDef.name||sourceDef.name||``,texture.name===``&&typeof sourceDef.uri==`string`&&sourceDef.uri.startsWith(`data:image/`)===!1&&(texture.name=sourceDef.uri);let samplers=json.samplers||{},sampler=samplers[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||RepeatWrapping,texture.generateMipmaps=!texture.isCompressedTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter,parser.associations.set(texture,{textures:textureIndex}),texture}).catch(function(){return null});return this.textureCache[cacheKey]=promise,promise}loadImageSource(sourceIndex,loader$1){let parser=this,json=this.json,options$1=this.options;if(this.sourceCache[sourceIndex]!==void 0)return this.sourceCache[sourceIndex].then(texture=>texture.clone());let sourceDef=json.images[sourceIndex],URL$1=self.URL||self.webkitURL,sourceURI=sourceDef.uri||``,isObjectURL=!1;if(sourceDef.bufferView!==void 0)sourceURI=parser.getDependency(`bufferView`,sourceDef.bufferView).then(function(bufferView){isObjectURL=!0;let blob=new Blob([bufferView],{type:sourceDef.mimeType});return sourceURI=URL$1.createObjectURL(blob),sourceURI});else if(sourceDef.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+sourceIndex+` is missing URI and bufferView`);let promise=Promise.resolve(sourceURI).then(function(sourceURI$1){return new Promise(function(resolve$1,reject){let onLoad=resolve$1;loader$1.isImageBitmapLoader===!0&&(onLoad=function(imageBitmap){let texture=new Texture(imageBitmap);texture.needsUpdate=!0,resolve$1(texture)}),loader$1.load(LoaderUtils.resolveURL(sourceURI$1,options$1.path),onLoad,void 0,reject)})}).then(function(texture){return isObjectURL===!0&&URL$1.revokeObjectURL(sourceURI),assignExtrasToUserData(texture,sourceDef),texture.userData.mimeType=sourceDef.mimeType||getImageURIMimeType(sourceDef.uri),texture}).catch(function(error){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,sourceURI),error});return this.sourceCache[sourceIndex]=promise,promise}assignTexture(materialParams,mapName,mapDef,colorSpace){let parser=this;return this.getDependency(`texture`,mapDef.index).then(function(texture){if(!texture)return null;if(mapDef.texCoord!==void 0&&mapDef.texCoord>0&&(texture=texture.clone(),texture.channel=mapDef.texCoord),parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){let transform$2=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM];if(transform$2){let gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform$2),parser.associations.set(texture,gltfReference)}}return colorSpace!==void 0&&(texture.colorSpace=colorSpace),materialParams[mapName]=texture,texture})}assignFinalMaterial(mesh){let geometry=mesh.geometry,material=mesh.material,useDerivativeTangents=geometry.attributes.tangent===void 0,useVertexColors=geometry.attributes.color!==void 0,useFlatShading=geometry.attributes.normal===void 0;if(mesh.isPoints){let cacheKey=`PointsMaterial:`+material.uuid,pointsMaterial=this.cache.get(cacheKey);pointsMaterial||(pointsMaterial=new PointsMaterial,Material.prototype.copy.call(pointsMaterial,material),pointsMaterial.color.copy(material.color),pointsMaterial.map=material.map,pointsMaterial.sizeAttenuation=!1,this.cache.add(cacheKey,pointsMaterial)),material=pointsMaterial}else if(mesh.isLine){let cacheKey=`LineBasicMaterial:`+material.uuid,lineMaterial=this.cache.get(cacheKey);lineMaterial||(lineMaterial=new LineBasicMaterial,Material.prototype.copy.call(lineMaterial,material),lineMaterial.color.copy(material.color),lineMaterial.map=material.map,this.cache.add(cacheKey,lineMaterial)),material=lineMaterial}if(useDerivativeTangents||useVertexColors||useFlatShading){let cacheKey=`ClonedMaterial:`+material.uuid+`:`;useDerivativeTangents&&(cacheKey+=`derivative-tangents:`),useVertexColors&&(cacheKey+=`vertex-colors:`),useFlatShading&&(cacheKey+=`flat-shading:`);let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&(cachedMaterial.flatShading=!0),useDerivativeTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.add(cacheKey,cachedMaterial),this.associations.set(cachedMaterial,this.associations.get(material))),material=cachedMaterial}mesh.material=material}getMaterialType(){return MeshStandardMaterial}loadMaterial(materialIndex){let parser=this,json=this.json,extensions=this.extensions,materialDef=json.materials[materialIndex],materialType,materialParams={},materialExtensions=materialDef.extensions||{},pending=[];if(materialExtensions[EXTENSIONS.KHR_MATERIALS_UNLIT]){let kmuExtension=extensions[EXTENSIONS.KHR_MATERIALS_UNLIT];materialType=kmuExtension.getMaterialType(),pending.push(kmuExtension.extendParams(materialParams,materialDef,parser))}else{let metallicRoughness=materialDef.pbrMetallicRoughness||{};if(materialParams.color=new Color(1,1,1),materialParams.opacity=1,Array.isArray(metallicRoughness.baseColorFactor)){let array$1=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array$1[0],array$1[1],array$1[2],LinearSRGBColorSpace),materialParams.opacity=array$1[3]}metallicRoughness.baseColorTexture!==void 0&&pending.push(parser.assignTexture(materialParams,`map`,metallicRoughness.baseColorTexture,SRGBColorSpace)),materialParams.metalness=metallicRoughness.metallicFactor===void 0?1:metallicRoughness.metallicFactor,materialParams.roughness=metallicRoughness.roughnessFactor===void 0?1:metallicRoughness.roughnessFactor,metallicRoughness.metallicRoughnessTexture!==void 0&&(pending.push(parser.assignTexture(materialParams,`metalnessMap`,metallicRoughness.metallicRoughnessTexture)),pending.push(parser.assignTexture(materialParams,`roughnessMap`,metallicRoughness.metallicRoughnessTexture))),materialType=this._invokeOne(function(ext){return ext.getMaterialType&&ext.getMaterialType(materialIndex)}),pending.push(Promise.all(this._invokeAll(function(ext){return ext.extendMaterialParams&&ext.extendMaterialParams(materialIndex,materialParams)})))}materialDef.doubleSided===!0&&(materialParams.side=DoubleSide);let alphaMode=materialDef.alphaMode||ALPHA_MODES.OPAQUE;if(alphaMode===ALPHA_MODES.BLEND?(materialParams.transparent=!0,materialParams.depthWrite=!1):(materialParams.transparent=!1,alphaMode===ALPHA_MODES.MASK&&(materialParams.alphaTest=materialDef.alphaCutoff===void 0?.5:materialDef.alphaCutoff)),materialDef.normalTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`normalMap`,materialDef.normalTexture)),materialParams.normalScale=new Vector2(1,1),materialDef.normalTexture.scale!==void 0)){let scale$1=materialDef.normalTexture.scale;materialParams.normalScale.set(scale$1,scale$1)}if(materialDef.occlusionTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`aoMap`,materialDef.occlusionTexture)),materialDef.occlusionTexture.strength!==void 0&&(materialParams.aoMapIntensity=materialDef.occlusionTexture.strength)),materialDef.emissiveFactor!==void 0&&materialType!==MeshBasicMaterial){let emissiveFactor=materialDef.emissiveFactor;materialParams.emissive=new Color().setRGB(emissiveFactor[0],emissiveFactor[1],emissiveFactor[2],LinearSRGBColorSpace)}return materialDef.emissiveTexture!==void 0&&materialType!==MeshBasicMaterial&&pending.push(parser.assignTexture(materialParams,`emissiveMap`,materialDef.emissiveTexture,SRGBColorSpace)),Promise.all(pending).then(function(){let material=new materialType(materialParams);return materialDef.name&&(material.name=materialDef.name),assignExtrasToUserData(material,materialDef),parser.associations.set(material,{materials:materialIndex}),materialDef.extensions&&addUnknownExtensionsToUserData(extensions,material,materialDef),material})}createUniqueName(originalName){let sanitizedName=PropertyBinding.sanitizeNodeName(originalName||``);return sanitizedName in this.nodeNamesUsed?sanitizedName+`_`+ ++this.nodeNamesUsed[sanitizedName]:(this.nodeNamesUsed[sanitizedName]=0,sanitizedName)}loadGeometries(primitives){let parser=this,extensions=this.extensions,cache$1=this.primitiveCache;function createDracoPrimitive(primitive){return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive,parser).then(function(geometry){return addPrimitiveAttributes(geometry,primitive,parser)})}let pending=[];for(let i=0,il=primitives.length;i0&&updateMorphTargets(mesh,meshDef),mesh.name=parser.createUniqueName(meshDef.name||`mesh_`+meshIndex),assignExtrasToUserData(mesh,meshDef),primitive.extensions&&addUnknownExtensionsToUserData(extensions,mesh,primitive),parser.assignFinalMaterial(mesh),meshes.push(mesh)}for(let i=0,il=meshes.length;i1?new Group:objects.length===1?objects[0]:new Object3D,node$1!==objects[0])for(let i=0,il=objects.length;i1){let mapping=parser.associations.get(node$1);parser.associations.set(node$1,{...mapping})}return parser.associations.get(node$1).nodes=nodeIndex,node$1}),this.nodeCache[nodeIndex]}loadScene(sceneIndex){let extensions=this.extensions,sceneDef=this.json.scenes[sceneIndex],parser=this,scene=new Group;sceneDef.name&&(scene.name=parser.createUniqueName(sceneDef.name)),assignExtrasToUserData(scene,sceneDef),sceneDef.extensions&&addUnknownExtensionsToUserData(extensions,scene,sceneDef);let nodeIds=sceneDef.nodes||[],pending=[];for(let i=0,il=nodeIds.length;i{let reducedAssociations=new Map;for(let[key$2,value$1]of parser.associations)(key$2 instanceof Material||key$2 instanceof Texture)&&reducedAssociations.set(key$2,value$1);return node$1.traverse(node$2=>{let mappings=parser.associations.get(node$2);mappings!=null&&reducedAssociations.set(node$2,mappings)}),reducedAssociations};return parser.associations=reduceAssociations(scene),scene})}_createAnimationTracks(node$1,inputAccessor,outputAccessor,sampler,target$1){let tracks=[],targetName=node$1.name?node$1.name:node$1.uuid,targetNames=[];PATH_PROPERTIES[target$1.path]===PATH_PROPERTIES.weights?node$1.traverse(function(object$1){object$1.morphTargetInfluences&&targetNames.push(object$1.name?object$1.name:object$1.uuid)}):targetNames.push(targetName);let TypedKeyframeTrack;switch(PATH_PROPERTIES[target$1.path]){case PATH_PROPERTIES.weights:TypedKeyframeTrack=NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:TypedKeyframeTrack=QuaternionKeyframeTrack;break;case PATH_PROPERTIES.translation:case PATH_PROPERTIES.scale:TypedKeyframeTrack=VectorKeyframeTrack;break;default:switch(outputAccessor.itemSize){case 1:TypedKeyframeTrack=NumberKeyframeTrack;break;case 2:case 3:default:TypedKeyframeTrack=VectorKeyframeTrack;break}break}let interpolation=sampler.interpolation===void 0?InterpolateLinear:INTERPOLATION[sampler.interpolation],outputArray=this._getArrayFromAccessor(outputAccessor);for(let j$1=0,jl=targetNames.length;j$1new VRMLoaderPlugin(parser)),loader.register(parser=>new VRMAnimationLoaderPlugin(parser)),loader)}async function loadVRMAnimation(url){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(url),userData=gltf.userData;if(!userData.vrmAnimations){console.warn(`No VRM animations found in the .vrma file`);return}if(userData.vrmAnimations.length===0){console.warn(`No VRM animations found in the .vrma file`);return}return userData.vrmAnimations[0]}async function clipFromVRMAnimation(vrm,animation){if(!vrm){console.warn(`No VRM found`);return}if(animation)return createVRMAnimationClip(animation,vrm)}function useBlink(){let isBlinking=ref(!1),blinkProgress=ref(0),timeSinceLastBlink=ref(0),BLINK_DURATION=.2,MIN_BLINK_INTERVAL=1,MAX_BLINK_INTERVAL=6,nextBlinkTime=ref(Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL);function update(vrm,delta){if(vrm?.expressionManager&&(timeSinceLastBlink.value+=delta,!isBlinking.value&&timeSinceLastBlink.value>=nextBlinkTime.value&&(isBlinking.value=!0,blinkProgress.value=0),isBlinking.value)){blinkProgress.value+=delta/BLINK_DURATION;let blinkValue=Math.sin(Math.PI*blinkProgress.value);vrm.expressionManager.setValue(`blink`,blinkValue),blinkProgress.value>=1&&(isBlinking.value=!1,timeSinceLastBlink.value=0,vrm.expressionManager.setValue(`blink`,0),nextBlinkTime.value=Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL)}}return{update}}function useIdleEyeSaccades(){let nextSaccadeAfter=-1,fixationTarget=new Vector3,timeSinceLastSaccade=0;function updateFixationTarget(lookAtTarget){fixationTarget.set(lookAtTarget.value.x+randFloat(-.25,.25),lookAtTarget.value.y+randFloat(-.25,.25),lookAtTarget.value.z)}function update(vrm,lookAtTarget,delta){!vrm?.expressionManager||!vrm.lookAt||(timeSinceLastSaccade>=nextSaccadeAfter?(updateFixationTarget(lookAtTarget),timeSinceLastSaccade=0,nextSaccadeAfter=randomSaccadeInterval()/1e3):fixationTarget||updateFixationTarget(lookAtTarget),vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,1),vrm.lookAt?.update(delta),timeSinceLastSaccade+=delta)}function instantUpdate(vrm,lookAtTarget){fixationTarget.set(lookAtTarget.x,lookAtTarget.y,lookAtTarget.z),!(!vrm?.expressionManager||!vrm.lookAt)&&(vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,1),vrm.lookAt?.update(.016))}return{update,instantUpdate}}async function loadVrm(model,options$1){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(model,progress$1=>options$1?.onProgress?.(progress$1)),userData=gltf.userData;if(!userData.vrm)return;let _vrm=userData.vrm;if(VRMUtils.removeUnnecessaryVertices(_vrm.scene),VRMUtils.combineSkeletons(_vrm.scene),_vrm.scene.traverse(object$1=>{object$1.frustumCulled=!1}),options$1?.lookAt&&_vrm.lookAt){let lookAtQuatProxy=new VRMLookAtQuaternionProxy(_vrm.lookAt);lookAtQuatProxy.name=`lookAtQuaternionProxy`,_vrm.scene.add(lookAtQuatProxy)}let _vrmGroup=new Group;_vrmGroup.add(_vrm.scene),options$1?.scene&&options$1.scene.add(_vrmGroup);let box=new Box3().setFromObject(_vrm.scene),modelSize=new Vector3,modelCenter=new Vector3;box.getSize(modelSize),box.getCenter(modelCenter),modelCenter.y+=modelSize.y/5;let fov$1=40,radians=fov$1/2*Math.PI/180,initialCameraOffset=new Vector3(modelSize.x/16,modelSize.y/6,-(modelSize.y/3)/Math.tan(radians));return{_vrm,_vrmGroup,modelCenter,modelSize,initialCameraOffset}}function useVRMEmote(vrm){let currentEmotion=ref(null),isTransitioning=ref(!1),transitionProgress=ref(0),currentExpressionValues=ref(new Map),targetExpressionValues=ref(new Map),resetTimeout=ref(),lerp$4=(start,end,t$1)=>start+(end-start)*t$1,easeInOutCubic=t$1=>t$1<.5?4*t$1*t$1*t$1:1-(-2*t$1+2)**3/2,emotionStates=new Map([[`happy`,{expression:[{name:`happy`,value:1,duration:.3},{name:`aa`,value:.3}],blendDuration:.3}],[`sad`,{expression:[{name:`sad`,value:1},{name:`oh`,value:.2}],blendDuration:.3}],[`angry`,{expression:[{name:`angry`,value:1},{name:`ee`,value:.4}],blendDuration:.2}],[`surprised`,{expression:[{name:`Surprised`,value:1},{name:`oh`,value:.6}],blendDuration:.1}],[`neutral`,{expression:[{name:`neutral`,value:1}],blendDuration:.5}]]),clearResetTimeout=()=>{resetTimeout.value&&(clearTimeout(resetTimeout.value),resetTimeout.value=void 0)},setEmotion=emotionName=>{if(clearResetTimeout(),!emotionStates.has(emotionName)){console.warn(`Emotion ${emotionName} not found`);return}let emotionState=emotionStates.get(emotionName);if(currentEmotion.value=emotionName,isTransitioning.value=!0,transitionProgress.value=0,vrm.expressionManager){let expressionNames=Object.keys(vrm.expressionManager.expressionMap);for(let name$2 of expressionNames)vrm.expressionManager.setValue(name$2,0)}currentExpressionValues.value.clear(),targetExpressionValues.value.clear();for(let expr of emotionState.expression||[]){let currentValue=vrm.expressionManager?.getValue(expr.name)||0;currentExpressionValues.value.set(expr.name,currentValue),targetExpressionValues.value.set(expr.name,expr.value)}},setEmotionWithResetAfter=(emotionName,ms)=>{clearResetTimeout(),setEmotion(emotionName),resetTimeout.value=setTimeout(()=>{setEmotion(`neutral`),resetTimeout.value=void 0},ms)},update=deltaTime=>{if(!isTransitioning.value||!currentEmotion.value)return;let emotionState=emotionStates.get(currentEmotion.value),blendDuration=emotionState.blendDuration||.3;transitionProgress.value+=deltaTime/blendDuration,transitionProgress.value>=1&&(transitionProgress.value=1,isTransitioning.value=!1);for(let[exprName,targetValue]of targetExpressionValues.value){let startValue=currentExpressionValues.value.get(exprName)||0,currentValue=lerp$4(startValue,targetValue,easeInOutCubic(transitionProgress.value));vrm.expressionManager?.setValue(exprName,currentValue)}},addEmotionState=(emotionName,state)=>{emotionStates.set(emotionName,state)},removeEmotionState=emotionName=>{emotionStates.delete(emotionName)},dispose$1=()=>{clearResetTimeout()};return{currentEmotion,isTransitioning,setEmotion,setEmotionWithResetAfter,update,addEmotionState,removeEmotionState,dispose:dispose$1}}function useWhisper(url,options$1){let opts=merge$3({onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}},options$1),{post:whisperPost,data:whisperData,terminate}=useWebWorker(url,{type:`module`}),status=ref(null),loadingMessage=ref(``),loadingProgress=ref([]),transcribing=ref(!1),tps=ref(0),result=ref(``);return watch(whisperData,e$4=>{switch(e$4.status){case`loading`:status.value=`loading`,loadingMessage.value=e$4.data,opts.onLoading?.(e$4.data);break;case`initiate`:loadingProgress.value.push(e$4),opts.onInitiate?.(e$4);break;case`progress`:loadingProgress.value=loadingProgress.value.map(item=>item.file===e$4.file?{...item,...e$4}:item),opts.onProgress?.(e$4);break;case`done`:loadingProgress.value=loadingProgress.value.filter(item=>item.file!==e$4.file),opts.onDone?.(e$4);break;case`ready`:status.value=`ready`,opts.onReady?.();break;case`start`:transcribing.value=!0,opts.onStart?.();break;case`update`:tps.value=e$4.tps,opts.onUpdate?.(e$4.tps);break;case`complete`:transcribing.value=!1,result.value=e$4.output[0]||``,console.debug(`Whisper result:`,result.value),opts.onComplete?.(e$4.output[0]);break}}),onUnmounted(()=>{terminate()}),{transcribe:message$1=>whisperPost(message$1),status,loadingMessage,loadingProgress,transcribing,tps,result,load:()=>whisperPost({type:`load`}),terminate}}var XSAIError$1=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const strCamelToSnake$2=str=>str.replace(/[A-Z]/g,s=>`_${s.toLowerCase()}`),objCamelToSnake$1=obj=>Object.fromEntries(Object.entries(obj).map(([k$3,v])=>[strCamelToSnake$2(k$3),v])),clean$2=obj=>Object.fromEntries(Object.entries(obj).filter(([,v])=>v!==void 0)),requestBody=body$2=>JSON.stringify(objCamelToSnake$1(clean$2({...body$2,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),requestHeaders=(headers,apiKey)=>clean$2({Authorization:apiKey===void 0?void 0:`Bearer ${apiKey}`,...headers}),requestURL=(path,baseURL)=>{let base=baseURL.toString();return new URL(path,base.endsWith(`/`)?base:`${base}/`)},responseCatch=async res=>{if(!res.ok)throw new XSAIError$1(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError$1(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError$1(`Expected Response body to be a ReadableStream, but got ${String(res.body)}; Content Type is ${res.headers.get(`Content-Type`)}`,res);return res},responseJSON=async res=>responseCatch(res).then(async res2=>{let text$5=await res2.text();try{return JSON.parse(text$5)}catch{throw Error(`Failed to parse response, response body: ${text$5}`)}}),listModels=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`models`,options$1.baseURL),{headers:requestHeaders(options$1.headers,options$1.apiKey),signal:options$1.abortSignal}).then(responseJSON).then(({data:data$12})=>data$12),chat=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`chat/completions`,options$1.baseURL),{body:requestBody({...options$1,tools:options$1.tools?.map(tool$1=>({function:clean$2({...tool$1.function,returns:void 0}),type:`function`}))}),headers:requestHeaders({"Content-Type":`application/json`,...options$1.headers},options$1.apiKey),method:`POST`,signal:options$1.abortSignal}).then(responseCatch),determineStepType=({finishReason,maxSteps,stepsLength,toolCallsLength})=>{if(stepsLength===0)return`initial`;if(stepsLength0&&finishReason===`tool_calls`)return`tool-result`;if(![`error`,`length`].includes(finishReason))return`continue`}return`done`},wrapToolResult=result=>typeof result==`string`||Array.isArray(result)&&result.every(item=>!!(typeof item==`object`&&`type`in item&&[`audio`,`image`,`text`].includes(item.type)))?result:JSON.stringify(result),executeTool=async({abortSignal,messages,toolCall,tools:tools$2})=>{let tool$1=tools$2?.find(tool2=>tool2.function.name===toolCall.function.name);if(!tool$1){let availableTools=tools$2?.map(tool2=>tool2.function.name),availableToolsErrorMsg=availableTools==null||availableTools.length===0?`No tools are available`:`Available tools: ${availableTools.join(`, `)}`;throw Error(`Model tried to call unavailable tool "${toolCall.function.name}", ${availableToolsErrorMsg}.`)}let toolCallId=toolCall.id,toolName=toolCall.function.name,parsedArgs=JSON.parse(toolCall.function.arguments),result=wrapToolResult(await tool$1.execute(parsedArgs,{abortSignal,messages,toolCallId})),completionToolCall={args:toolCall.function.arguments,toolCallId,toolCallType:toolCall.type,toolName},completionToolResult={args:parsedArgs,result,toolCallId,toolName},message$1={content:result,role:`tool`,tool_call_id:toolCallId};return{completionToolCall,completionToolResult,message:message$1}},strCamelToSnake$1=str=>str.replace(/[A-Z]/g,s=>`_${s.toLowerCase()}`),objCamelToSnake$2=obj=>Object.fromEntries(Object.entries(obj).map(([k$3,v])=>[strCamelToSnake$1(k$3),v])),trampoline=async fn$5=>{let result=await fn$5();for(;result instanceof Function;)result=await result();return result};var DelayedPromise=class{get promise(){return this._promise??=new Promise((resolve$1,reject)=>{this.status.type===`resolved`?resolve$1(this.status.value):this.status.type===`rejected`&&reject(this.status.error),this._resolve=resolve$1,this._reject=reject}),this._promise}_promise;_reject;_resolve;status={type:`pending`};reject(error){this.status={error,type:`rejected`},this._promise&&this._reject?.(error)}resolve(value$1){this.status={type:`resolved`,value:value$1},this._promise&&this._resolve?.(value$1)}};const parseChunk=text$5=>{if(!text$5||!text$5.startsWith(`data:`))return[void 0,!1];let content$2=text$5.slice(5),data$12=content$2.startsWith(` `)?content$2.slice(1):content$2;if(data$12===`[DONE]`)return[void 0,!0];if(data$12.startsWith(`{`)&&data$12.includes(`"error":`))throw Error(`Error from server: ${data$12}`);let chunk=JSON.parse(data$12);return[chunk,!1]},transformChunk=()=>{let decoder=new TextDecoder,buffer$1=``;return new TransformStream({transform:async(chunk,controller)=>{let text$5=decoder.decode(chunk,{stream:!0});buffer$1+=text$5;let lines=buffer$1.split(` -`);buffer$1=lines.pop()??``;for(let line of lines)try{let[chunk2,isEnd]=parseChunk(line);if(isEnd)break;chunk2&&controller.enqueue(chunk2)}catch(error){controller.error(error)}}})},streamText=async options$1=>{let steps$2=[],messages=structuredClone(options$1.messages),maxSteps=options$1.maxSteps??1,usage,resultSteps=new DelayedPromise,resultMessages=new DelayedPromise,resultUsage=new DelayedPromise,eventCtrl,textCtrl,eventStream=new ReadableStream({start:controller=>eventCtrl=controller}),textStream=new ReadableStream({start:controller=>textCtrl=controller}),pushEvent=stepEvent=>{eventCtrl?.enqueue(stepEvent),options$1.onEvent?.(stepEvent)},pushStep=step=>{steps$2.push(step),options$1.onStepFinish?.(step)},startStream=async()=>{let pushUsage=u=>{usage=u},text$5=``,pushText=content$2=>{textCtrl?.enqueue(content$2),text$5+=content$2},tool_calls=[],toolCalls=[],toolResults=[],finishReason=`other`;if(await chat({...options$1,maxSteps:void 0,messages,stream:!0,streamOptions:options$1.streamOptions==null?void 0:objCamelToSnake$2(options$1.streamOptions)}).then(async res=>res.body.pipeThrough(transformChunk()).pipeTo(new WritableStream({abort:reason=>{eventCtrl?.error(reason),textCtrl?.error(reason)},close:()=>{},write:chunk=>{if(chunk.usage&&pushUsage(chunk.usage),chunk.choices==null||chunk.choices.length===0)return;let choice=chunk.choices[0];if(choice.finish_reason!=null&&(finishReason=choice.finish_reason),choice.delta.tool_calls?.length===0||choice.delta.tool_calls==null)choice.delta.content==null?choice.delta.refusal==null?choice.finish_reason!=null&&pushEvent({finishReason:choice.finish_reason,type:`finish`,usage}):pushEvent({error:choice.delta.refusal,type:`error`}):(pushEvent({text:choice.delta.content,type:`text-delta`}),pushText(choice.delta.content));else for(let toolCall of choice.delta.tool_calls){let{index:index$1}=toolCall;tool_calls.at(index$1)?(tool_calls[index$1].function.arguments+=toolCall.function.arguments,pushEvent({argsTextDelta:toolCall.function.arguments,toolCallId:toolCall.id,toolName:toolCall.function.name,type:`tool-call-delta`})):(tool_calls[index$1]=toolCall,pushEvent({toolCallId:toolCall.id,toolName:toolCall.function.name,type:`tool-call-streaming-start`}))}}}))),messages.push({content:text$5,role:`assistant`,tool_calls}),tool_calls.length!==0)for(let toolCall of tool_calls){let{completionToolCall,completionToolResult,message:message$1}=await executeTool({abortSignal:options$1.abortSignal,messages,toolCall,tools:options$1.tools});toolCalls.push(completionToolCall),toolResults.push(completionToolResult),messages.push(message$1),pushEvent({...completionToolCall,type:`tool-call`}),pushEvent({...completionToolResult,type:`tool-result`})}else pushEvent({finishReason,type:`finish`,usage});if(pushStep({finishReason,stepType:determineStepType({finishReason,maxSteps,stepsLength:steps$2.length,toolCallsLength:toolCalls.length}),text:text$5,toolCalls,toolResults,usage}),toolCalls.length!==0&&steps$2.lengthstartStream()};try{await trampoline(async()=>startStream()),eventCtrl?.close(),textCtrl?.close()}catch(err){eventCtrl?.error(err),textCtrl?.error(err),resultSteps.reject(err),resultMessages.reject(err),resultUsage.reject(err)}finally{resultSteps.resolve(steps$2),resultMessages.resolve(messages),resultUsage.resolve(usage),options$1.onFinish?.(steps$2.at(-1))}return{fullStream:eventStream,messages:resultMessages.promise,steps:resultSteps.promise,textStream,usage:resultUsage.promise}},strictJsonSchema=schema=>({...schema,additionalProperties:!1,properties:schema.properties==null?schema.properties:Object.fromEntries(Object.entries(schema.properties).map(([k$3,v])=>[k$3,typeof v==`object`&&v&&`type`in v&&v.type===`object`?strictJsonSchema(v):v]))}),missingDependenciesUrl=`https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies`,tryImport=async(result,name$2)=>{try{return await result}catch{throw Error(`xsschema: Missing dependencies "${name$2}". see ${missingDependenciesUrl}`)}},getToJsonSchemaFn=async vendor=>{switch(vendor){case`arktype`:return __vitePreload(()=>import(`./arktype-C-GObzDh-CYoI0Osm.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`effect`:return __vitePreload(()=>import(`./effect--zg3C1LQ-BC7uVPyf.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`sury`:return __vitePreload(()=>import(`./sury-s6Akl-oc-9Lj4-L3G.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`valibot`:return __vitePreload(()=>import(`./valibot-DBCeetIe-CvO_piDA.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`zod`:return __vitePreload(()=>import(`./zod-Bw_60DVU-Bcmc6iZH.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());default:throw Error(`xsschema: Unsupported schema vendor "${vendor}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},toJsonSchema=async schema=>getToJsonSchemaFn(schema[`~standard`].vendor).then(async toJsonSchema2=>toJsonSchema2(schema)),tool=async({description,execute,name:name$2,parameters})=>{let schema=await toJsonSchema(parameters);return{execute,function:{description,name:name$2,parameters:strictJsonSchema(schema),strict:!0},type:`function`}},NEVER=Object.freeze({status:`aborted`});function $constructor(name$2,initializer$2,params){function init(inst,def$1){var _a$2;for(let k$3 in Object.defineProperty(inst,`_zod`,{value:inst._zod??{},enumerable:!1}),(_a$2=inst._zod).traits??(_a$2.traits=new Set),inst._zod.traits.add(name$2),initializer$2(inst,def$1),_$1.prototype)k$3 in inst||Object.defineProperty(inst,k$3,{value:_$1.prototype[k$3].bind(inst)});inst._zod.constr=_$1,inst._zod.def=def$1}let Parent=params?.Parent??Object;class Definition extends Parent{}Object.defineProperty(Definition,`name`,{value:name$2});function _$1(def$1){var _a$2;let inst=params?.Parent?new Definition:this;init(inst,def$1),(_a$2=inst._zod).deferred??(_a$2.deferred=[]);for(let fn$5 of inst._zod.deferred)fn$5();return inst}return Object.defineProperty(_$1,`init`,{value:init}),Object.defineProperty(_$1,Symbol.hasInstance,{value:inst=>params?.Parent&&inst instanceof params.Parent?!0:inst?._zod?.traits?.has(name$2)}),Object.defineProperty(_$1,`name`,{value:name$2}),_$1}const $brand=Symbol(`zod_brand`);var $ZodAsyncError=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const globalConfig={};function config(newConfig){return newConfig&&Object.assign(globalConfig,newConfig),globalConfig}function getEnumValues(entries){let numericValues=Object.values(entries).filter(v=>typeof v==`number`),values=Object.entries(entries).filter(([k$3,_$1])=>numericValues.indexOf(+k$3)===-1).map(([_$1,v])=>v);return values}function jsonStringifyReplacer(_$1,value$1){return typeof value$1==`bigint`?value$1.toString():value$1}function cached(getter){let set=!1;return{get value(){{let value$1=getter();return Object.defineProperty(this,`value`,{value:value$1}),value$1}throw Error(`cached value already set`)}}}function nullish(input){return input==null}function cleanRegex(source){let start=source.startsWith(`^`)?1:0,end=source.endsWith(`$`)?source.length-1:source.length;return source.slice(start,end)}function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(`.`)[1]||``).length,stepString=step.toString(),stepDecCount=(stepString.split(`.`)[1]||``).length;if(stepDecCount===0&&/\d?e-\d?/.test(stepString)){let match=stepString.match(/\d?e-(\d?)/);match?.[1]&&(stepDecCount=Number.parseInt(match[1]))}let decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(`.`,``)),stepInt=Number.parseInt(step.toFixed(decCount).replace(`.`,``));return valInt%stepInt/10**decCount}const EVALUATING=Symbol(`evaluating`);function defineLazy(object$1,key$2,getter){let value$1;Object.defineProperty(object$1,key$2,{get(){if(value$1!==EVALUATING)return value$1===void 0&&(value$1=EVALUATING,value$1=getter()),value$1},set(v){Object.defineProperty(object$1,key$2,{value:v})},configurable:!0})}function assignProp(target$1,prop,value$1){Object.defineProperty(target$1,prop,{value:value$1,writable:!0,enumerable:!0,configurable:!0})}function mergeDefs(...defs){let mergedDescriptors={};for(let def$1 of defs){let descriptors=Object.getOwnPropertyDescriptors(def$1);Object.assign(mergedDescriptors,descriptors)}return Object.defineProperties({},mergedDescriptors)}function esc(str){return JSON.stringify(str)}const captureStackTrace=`captureStackTrace`in Error?Error.captureStackTrace:(..._args)=>{};function isObject$1(data$12){return typeof data$12==`object`&&!!data$12&&!Array.isArray(data$12)}const allowsEval=cached(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{let F$1=Function;return new F$1(``),!0}catch{return!1}});function isPlainObject$1(o){if(isObject$1(o)===!1)return!1;let ctor=o.constructor;if(ctor===void 0)return!0;let prot=ctor.prototype;return!(isObject$1(prot)===!1||Object.prototype.hasOwnProperty.call(prot,`isPrototypeOf`)===!1)}const propertyKeyTypes=new Set([`string`,`number`,`symbol`]);function escapeRegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function clone(inst,def$1,params){let cl=new inst._zod.constr(def$1??inst._zod.def);return(!def$1||params?.parent)&&(cl._zod.parent=inst),cl}function normalizeParams(_params){let params=_params;if(!params)return{};if(typeof params==`string`)return{error:()=>params};if(params?.message!==void 0){if(params?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");params.error=params.message}return delete params.message,typeof params.error==`string`?{...params,error:()=>params.error}:params}function optionalKeys(shape){return Object.keys(shape).filter(k$3=>shape[k$3]._zod.optin===`optional`&&shape[k$3]._zod.optout===`optional`)}const NUMBER_FORMAT_RANGES={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pick(schema,mask){let currDef=schema._zod.def,def$1=mergeDefs(schema._zod.def,{get shape(){let newShape={};for(let key$2 in mask){if(!(key$2 in currDef.shape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;newShape[key$2]=currDef.shape[key$2]}return assignProp(this,`shape`,newShape),newShape},checks:[]});return clone(schema,def$1)}function omit(schema,mask){let currDef=schema._zod.def,def$1=mergeDefs(schema._zod.def,{get shape(){let newShape={...schema._zod.def.shape};for(let key$2 in mask){if(!(key$2 in currDef.shape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;delete newShape[key$2]}return assignProp(this,`shape`,newShape),newShape},checks:[]});return clone(schema,def$1)}function extend(schema,shape){if(!isPlainObject$1(shape))throw Error(`Invalid input to extend: expected a plain object`);let def$1=mergeDefs(schema._zod.def,{get shape(){let _shape={...schema._zod.def.shape,...shape};return assignProp(this,`shape`,_shape),_shape},checks:[]});return clone(schema,def$1)}function merge$2(a$1,b$1){let def$1=mergeDefs(a$1._zod.def,{get shape(){let _shape={...a$1._zod.def.shape,...b$1._zod.def.shape};return assignProp(this,`shape`,_shape),_shape},get catchall(){return b$1._zod.def.catchall},checks:[]});return clone(a$1,def$1)}function partial(Class,schema,mask){let def$1=mergeDefs(schema._zod.def,{get shape(){let oldShape=schema._zod.def.shape,shape={...oldShape};if(mask)for(let key$2 in mask){if(!(key$2 in oldShape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;shape[key$2]=Class?new Class({type:`optional`,innerType:oldShape[key$2]}):oldShape[key$2]}else for(let key$2 in oldShape)shape[key$2]=Class?new Class({type:`optional`,innerType:oldShape[key$2]}):oldShape[key$2];return assignProp(this,`shape`,shape),shape},checks:[]});return clone(schema,def$1)}function required(Class,schema,mask){let def$1=mergeDefs(schema._zod.def,{get shape(){let oldShape=schema._zod.def.shape,shape={...oldShape};if(mask)for(let key$2 in mask){if(!(key$2 in shape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;shape[key$2]=new Class({type:`nonoptional`,innerType:oldShape[key$2]})}else for(let key$2 in oldShape)shape[key$2]=new Class({type:`nonoptional`,innerType:oldShape[key$2]});return assignProp(this,`shape`,shape),shape},checks:[]});return clone(schema,def$1)}function aborted(x$1,startIndex=0){for(let i=startIndex;i{var _a$2;return(_a$2=iss).path??(_a$2.path=[]),iss.path.unshift(path),iss})}function unwrapMessage(message$1){return typeof message$1==`string`?message$1:message$1?.message}function finalizeIssue(iss,ctx,config$1){let full={...iss,path:iss.path??[]};if(!iss.message){let message$1=unwrapMessage(iss.inst?._zod.def?.error?.(iss))??unwrapMessage(ctx?.error?.(iss))??unwrapMessage(config$1.customError?.(iss))??unwrapMessage(config$1.localeError?.(iss))??`Invalid input`;full.message=message$1}return delete full.inst,delete full.continue,ctx?.reportInput||delete full.input,full}function getLengthableOrigin(input){return Array.isArray(input)?`array`:typeof input==`string`?`string`:`unknown`}function issue(...args){let[iss,input,inst]=args;return typeof iss==`string`?{message:iss,code:`custom`,input,inst}:{...iss}}const initializer$1=(inst,def$1)=>{inst.name=`$ZodError`,Object.defineProperty(inst,`_zod`,{value:inst._zod,enumerable:!1}),Object.defineProperty(inst,`issues`,{value:def$1,enumerable:!1}),inst.message=JSON.stringify(def$1,jsonStringifyReplacer,2),Object.defineProperty(inst,`toString`,{value:()=>inst.message,enumerable:!1})},$ZodError=$constructor(`$ZodError`,initializer$1),$ZodRealError=$constructor(`$ZodError`,initializer$1,{Parent:Error});function flattenError(error,mapper=issue$1=>issue$1.message){let fieldErrors={},formErrors=[];for(let sub of error.issues)sub.path.length>0?(fieldErrors[sub.path[0]]=fieldErrors[sub.path[0]]||[],fieldErrors[sub.path[0]].push(mapper(sub))):formErrors.push(mapper(sub));return{formErrors,fieldErrors}}function formatError(error,_mapper){let mapper=_mapper||function(issue$1){return issue$1.message},fieldErrors={_errors:[]},processError=error$1=>{for(let issue$1 of error$1.issues)if(issue$1.code===`invalid_union`&&issue$1.errors.length)issue$1.errors.map(issues=>processError({issues}));else if(issue$1.code===`invalid_key`)processError({issues:issue$1.issues});else if(issue$1.code===`invalid_element`)processError({issues:issue$1.issues});else if(issue$1.path.length===0)fieldErrors._errors.push(mapper(issue$1));else{let curr=fieldErrors,i=0;for(;i(schema,value$1,_ctx,_params)=>{let ctx=_ctx?Object.assign(_ctx,{async:!1}):{async:!1},result=schema._zod.run({value:value$1,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;if(result.issues.length){let e$4=new(_params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e$4,_params?.callee),e$4}return result.value},parse$2=_parse($ZodRealError),_parseAsync=_Err=>async(schema,value$1,_ctx,params)=>{let ctx=_ctx?Object.assign(_ctx,{async:!0}):{async:!0},result=schema._zod.run({value:value$1,issues:[]},ctx);if(result instanceof Promise&&(result=await result),result.issues.length){let e$4=new(params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e$4,params?.callee),e$4}return result.value},parseAsync$1=_parseAsync($ZodRealError),_safeParse=_Err=>(schema,value$1,_ctx)=>{let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value:value$1,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;return result.issues.length?{success:!1,error:new(_Err??$ZodError)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParse$1=_safeParse($ZodRealError),_safeParseAsync=_Err=>async(schema,value$1,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{async:!0}):{async:!0},result=schema._zod.run({value:value$1,issues:[]},ctx);return result instanceof Promise&&(result=await result),result.issues.length?{success:!1,error:new _Err(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParseAsync$1=_safeParseAsync($ZodRealError),cuid=/^[cC][^\s-]{8,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/,duration$1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,uuid=version$2=>version$2?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_emoji$1=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function emoji(){return new RegExp(_emoji$1,`u`)}const ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^[A-Za-z0-9_-]*$/,hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,e164=/^\+(?:[0-9]){6,14}[0-9]$/,dateSource=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,date$1=RegExp(`^${dateSource}$`);function timeSource(args){let hhmm=`(?:[01]\\d|2[0-3]):[0-5]\\d`,regex=typeof args.precision==`number`?args.precision===-1?`${hhmm}`:args.precision===0?`${hhmm}:[0-5]\\d`:`${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`:`${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;return regex}function time$1(args){return RegExp(`^${timeSource(args)}$`)}function datetime$2(args){let time$2=timeSource({precision:args.precision}),opts=[`Z`];args.local&&opts.push(``),args.offset&&opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let timeRegex=`${time$2}(?:${opts.join(`|`)})`;return RegExp(`^${dateSource}T(?:${timeRegex})$`)}const string$1=params=>{let regex=params?`[\\s\\S]{${params?.minimum??0},${params?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${regex}$`)},integer=/^\d+$/,number$2=/^-?\d+(?:\.\d+)?/i,boolean$1=/true|false/i,lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/,$ZodCheck=$constructor(`$ZodCheck`,(inst,def$1)=>{var _a$2;inst._zod??={},inst._zod.def=def$1,(_a$2=inst._zod).onattach??(_a$2.onattach=[])}),numericOriginMap={number:`number`,bigint:`bigint`,object:`date`},$ZodCheckLessThan=$constructor(`$ZodCheckLessThan`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let origin=numericOriginMap[typeof def$1.value];inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag,curr=(def$1.inclusive?bag.maximum:bag.exclusiveMaximum)??1/0;def$1.value{(def$1.inclusive?payload.value<=def$1.value:payload.value{$ZodCheck.init(inst,def$1);let origin=numericOriginMap[typeof def$1.value];inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag,curr=(def$1.inclusive?bag.minimum:bag.exclusiveMinimum)??-1/0;def$1.value>curr&&(def$1.inclusive?bag.minimum=def$1.value:bag.exclusiveMinimum=def$1.value)}),inst._zod.check=payload=>{(def$1.inclusive?payload.value>=def$1.value:payload.value>def$1.value)||payload.issues.push({origin,code:`too_small`,minimum:def$1.value,input:payload.value,inclusive:def$1.inclusive,inst,continue:!def$1.abort})}}),$ZodCheckMultipleOf=$constructor(`$ZodCheckMultipleOf`,(inst,def$1)=>{$ZodCheck.init(inst,def$1),inst._zod.onattach.push(inst$1=>{var _a$2;(_a$2=inst$1._zod.bag).multipleOf??(_a$2.multipleOf=def$1.value)}),inst._zod.check=payload=>{if(typeof payload.value!=typeof def$1.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);let isMultiple=typeof payload.value==`bigint`?payload.value%def$1.value===BigInt(0):floatSafeRemainder(payload.value,def$1.value)===0;isMultiple||payload.issues.push({origin:typeof payload.value,code:`not_multiple_of`,divisor:def$1.value,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckNumberFormat=$constructor(`$ZodCheckNumberFormat`,(inst,def$1)=>{$ZodCheck.init(inst,def$1),def$1.format=def$1.format||`float64`;let isInt=def$1.format?.includes(`int`),origin=isInt?`int`:`number`,[minimum,maximum]=NUMBER_FORMAT_RANGES[def$1.format];inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.format=def$1.format,bag.minimum=minimum,bag.maximum=maximum,isInt&&(bag.pattern=integer)}),inst._zod.check=payload=>{let input=payload.value;if(isInt){if(!Number.isInteger(input)){payload.issues.push({expected:origin,format:def$1.format,code:`invalid_type`,continue:!1,input,inst});return}if(!Number.isSafeInteger(input)){input>0?payload.issues.push({input,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst,origin,continue:!def$1.abort}):payload.issues.push({input,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst,origin,continue:!def$1.abort});return}}inputmaximum&&payload.issues.push({origin:`number`,input,code:`too_big`,maximum,inst})}}),$ZodCheckMaxLength=$constructor(`$ZodCheckMaxLength`,(inst,def$1)=>{var _a$2;$ZodCheck.init(inst,def$1),(_a$2=inst._zod.def).when??(_a$2.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst$1=>{let curr=inst$1._zod.bag.maximum??1/0;def$1.maximum{let input=payload.value,length=input.length;if(length<=def$1.maximum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:`too_big`,maximum:def$1.maximum,inclusive:!0,input,inst,continue:!def$1.abort})}}),$ZodCheckMinLength=$constructor(`$ZodCheckMinLength`,(inst,def$1)=>{var _a$2;$ZodCheck.init(inst,def$1),(_a$2=inst._zod.def).when??(_a$2.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst$1=>{let curr=inst$1._zod.bag.minimum??-1/0;def$1.minimum>curr&&(inst$1._zod.bag.minimum=def$1.minimum)}),inst._zod.check=payload=>{let input=payload.value,length=input.length;if(length>=def$1.minimum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:`too_small`,minimum:def$1.minimum,inclusive:!0,input,inst,continue:!def$1.abort})}}),$ZodCheckLengthEquals=$constructor(`$ZodCheckLengthEquals`,(inst,def$1)=>{var _a$2;$ZodCheck.init(inst,def$1),(_a$2=inst._zod.def).when??(_a$2.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.minimum=def$1.length,bag.maximum=def$1.length,bag.length=def$1.length}),inst._zod.check=payload=>{let input=payload.value,length=input.length;if(length===def$1.length)return;let origin=getLengthableOrigin(input),tooBig=length>def$1.length;payload.issues.push({origin,...tooBig?{code:`too_big`,maximum:def$1.length}:{code:`too_small`,minimum:def$1.length},inclusive:!0,exact:!0,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckStringFormat=$constructor(`$ZodCheckStringFormat`,(inst,def$1)=>{var _a$2,_b;$ZodCheck.init(inst,def$1),inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.format=def$1.format,def$1.pattern&&(bag.patterns??=new Set,bag.patterns.add(def$1.pattern))}),def$1.pattern?(_a$2=inst._zod).check??(_a$2.check=payload=>{def$1.pattern.lastIndex=0,!def$1.pattern.test(payload.value)&&payload.issues.push({origin:`string`,code:`invalid_format`,format:def$1.format,input:payload.value,...def$1.pattern?{pattern:def$1.pattern.toString()}:{},inst,continue:!def$1.abort})}):(_b=inst._zod).check??(_b.check=()=>{})}),$ZodCheckRegex=$constructor(`$ZodCheckRegex`,(inst,def$1)=>{$ZodCheckStringFormat.init(inst,def$1),inst._zod.check=payload=>{def$1.pattern.lastIndex=0,!def$1.pattern.test(payload.value)&&payload.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:payload.value,pattern:def$1.pattern.toString(),inst,continue:!def$1.abort})}}),$ZodCheckLowerCase=$constructor(`$ZodCheckLowerCase`,(inst,def$1)=>{def$1.pattern??=lowercase,$ZodCheckStringFormat.init(inst,def$1)}),$ZodCheckUpperCase=$constructor(`$ZodCheckUpperCase`,(inst,def$1)=>{def$1.pattern??=uppercase,$ZodCheckStringFormat.init(inst,def$1)}),$ZodCheckIncludes=$constructor(`$ZodCheckIncludes`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let escapedRegex=escapeRegex(def$1.includes),pattern=new RegExp(typeof def$1.position==`number`?`^.{${def$1.position}}${escapedRegex}`:escapedRegex);def$1.pattern=pattern,inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.patterns??=new Set,bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.includes(def$1.includes,def$1.position)||payload.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:def$1.includes,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckStartsWith=$constructor(`$ZodCheckStartsWith`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let pattern=RegExp(`^${escapeRegex(def$1.prefix)}.*`);def$1.pattern??=pattern,inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.patterns??=new Set,bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.startsWith(def$1.prefix)||payload.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:def$1.prefix,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckEndsWith=$constructor(`$ZodCheckEndsWith`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let pattern=RegExp(`.*${escapeRegex(def$1.suffix)}$`);def$1.pattern??=pattern,inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.patterns??=new Set,bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.endsWith(def$1.suffix)||payload.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:def$1.suffix,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckOverwrite=$constructor(`$ZodCheckOverwrite`,(inst,def$1)=>{$ZodCheck.init(inst,def$1),inst._zod.check=payload=>{payload.value=def$1.tx(payload.value)}});var Doc=class{constructor(args=[]){this.content=[],this.indent=0,this&&(this.args=args)}indented(fn$5){this.indent+=1,fn$5(this),--this.indent}write(arg){if(typeof arg==`function`){arg(this,{execution:`sync`}),arg(this,{execution:`async`});return}let content$2=arg,lines=content$2.split(` +`);buffer$1=lines.pop()??``;for(let line of lines)try{let[chunk2,isEnd]=parseChunk(line);if(isEnd)break;chunk2&&controller.enqueue(chunk2)}catch(error){controller.error(error)}}})},streamText=async options$1=>{let steps$2=[],messages=structuredClone(options$1.messages),maxSteps=options$1.maxSteps??1,usage,resultSteps=new DelayedPromise,resultMessages=new DelayedPromise,resultUsage=new DelayedPromise,eventCtrl,textCtrl,eventStream=new ReadableStream({start:controller=>eventCtrl=controller}),textStream=new ReadableStream({start:controller=>textCtrl=controller}),pushEvent=stepEvent=>{eventCtrl?.enqueue(stepEvent),options$1.onEvent?.(stepEvent)},pushStep=step=>{steps$2.push(step),options$1.onStepFinish?.(step)},startStream=async()=>{let pushUsage=u=>{usage=u},text$5=``,pushText=content$2=>{textCtrl?.enqueue(content$2),text$5+=content$2},tool_calls=[],toolCalls=[],toolResults=[],finishReason=`other`;if(await chat({...options$1,maxSteps:void 0,messages,stream:!0,streamOptions:options$1.streamOptions==null?void 0:objCamelToSnake$2(options$1.streamOptions)}).then(async res=>res.body.pipeThrough(transformChunk()).pipeTo(new WritableStream({abort:reason=>{eventCtrl?.error(reason),textCtrl?.error(reason)},close:()=>{},write:chunk=>{if(chunk.usage&&pushUsage(chunk.usage),chunk.choices==null||chunk.choices.length===0)return;let choice=chunk.choices[0];if(choice.finish_reason!=null&&(finishReason=choice.finish_reason),choice.delta.tool_calls?.length===0||choice.delta.tool_calls==null)choice.delta.content==null?choice.delta.refusal==null?choice.finish_reason!=null&&pushEvent({finishReason:choice.finish_reason,type:`finish`,usage}):pushEvent({error:choice.delta.refusal,type:`error`}):(pushEvent({text:choice.delta.content,type:`text-delta`}),pushText(choice.delta.content));else for(let toolCall of choice.delta.tool_calls){let{index:index$1}=toolCall;tool_calls.at(index$1)?(tool_calls[index$1].function.arguments+=toolCall.function.arguments,pushEvent({argsTextDelta:toolCall.function.arguments,toolCallId:toolCall.id,toolName:toolCall.function.name,type:`tool-call-delta`})):(tool_calls[index$1]=toolCall,pushEvent({toolCallId:toolCall.id,toolName:toolCall.function.name,type:`tool-call-streaming-start`}))}}}))),messages.push({content:text$5,role:`assistant`,tool_calls}),tool_calls.length!==0)for(let toolCall of tool_calls){let{completionToolCall,completionToolResult,message:message$1}=await executeTool({abortSignal:options$1.abortSignal,messages,toolCall,tools:options$1.tools});toolCalls.push(completionToolCall),toolResults.push(completionToolResult),messages.push(message$1),pushEvent({...completionToolCall,type:`tool-call`}),pushEvent({...completionToolResult,type:`tool-result`})}else pushEvent({finishReason,type:`finish`,usage});if(pushStep({finishReason,stepType:determineStepType({finishReason,maxSteps,stepsLength:steps$2.length,toolCallsLength:toolCalls.length}),text:text$5,toolCalls,toolResults,usage}),toolCalls.length!==0&&steps$2.lengthstartStream()};try{await trampoline(async()=>startStream()),eventCtrl?.close(),textCtrl?.close()}catch(err){eventCtrl?.error(err),textCtrl?.error(err),resultSteps.reject(err),resultMessages.reject(err),resultUsage.reject(err)}finally{resultSteps.resolve(steps$2),resultMessages.resolve(messages),resultUsage.resolve(usage),options$1.onFinish?.(steps$2.at(-1))}return{fullStream:eventStream,messages:resultMessages.promise,steps:resultSteps.promise,textStream,usage:resultUsage.promise}},strictJsonSchema=schema=>({...schema,additionalProperties:!1,properties:schema.properties==null?schema.properties:Object.fromEntries(Object.entries(schema.properties).map(([k$3,v])=>[k$3,typeof v==`object`&&v&&`type`in v&&v.type===`object`?strictJsonSchema(v):v]))}),missingDependenciesUrl=`https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies`,tryImport=async(result,name$2)=>{try{return await result}catch{throw Error(`xsschema: Missing dependencies "${name$2}". see ${missingDependenciesUrl}`)}},getToJsonSchemaFn=async vendor=>{switch(vendor){case`arktype`:return __vitePreload(()=>import(`./arktype-C-GObzDh-CYoI0Osm.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`effect`:return __vitePreload(()=>import(`./effect--zg3C1LQ-ld3Bkn4f.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`sury`:return __vitePreload(()=>import(`./sury-s6Akl-oc-BC_NKWkZ.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`valibot`:return __vitePreload(()=>import(`./valibot-DBCeetIe-CZqQHx2v.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`zod`:return __vitePreload(()=>import(`./zod-Bw_60DVU-DrbGHdRQ.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());default:throw Error(`xsschema: Unsupported schema vendor "${vendor}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},toJsonSchema=async schema=>getToJsonSchemaFn(schema[`~standard`].vendor).then(async toJsonSchema2=>toJsonSchema2(schema)),tool=async({description,execute,name:name$2,parameters})=>{let schema=await toJsonSchema(parameters);return{execute,function:{description,name:name$2,parameters:strictJsonSchema(schema),strict:!0},type:`function`}},NEVER=Object.freeze({status:`aborted`});function $constructor(name$2,initializer$2,params){function init(inst,def$1){var _a$2;for(let k$3 in Object.defineProperty(inst,`_zod`,{value:inst._zod??{},enumerable:!1}),(_a$2=inst._zod).traits??(_a$2.traits=new Set),inst._zod.traits.add(name$2),initializer$2(inst,def$1),_$1.prototype)k$3 in inst||Object.defineProperty(inst,k$3,{value:_$1.prototype[k$3].bind(inst)});inst._zod.constr=_$1,inst._zod.def=def$1}let Parent=params?.Parent??Object;class Definition extends Parent{}Object.defineProperty(Definition,`name`,{value:name$2});function _$1(def$1){var _a$2;let inst=params?.Parent?new Definition:this;init(inst,def$1),(_a$2=inst._zod).deferred??(_a$2.deferred=[]);for(let fn$5 of inst._zod.deferred)fn$5();return inst}return Object.defineProperty(_$1,`init`,{value:init}),Object.defineProperty(_$1,Symbol.hasInstance,{value:inst=>params?.Parent&&inst instanceof params.Parent?!0:inst?._zod?.traits?.has(name$2)}),Object.defineProperty(_$1,`name`,{value:name$2}),_$1}const $brand=Symbol(`zod_brand`);var $ZodAsyncError=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const globalConfig={};function config(newConfig){return newConfig&&Object.assign(globalConfig,newConfig),globalConfig}function getEnumValues(entries){let numericValues=Object.values(entries).filter(v=>typeof v==`number`),values=Object.entries(entries).filter(([k$3,_$1])=>numericValues.indexOf(+k$3)===-1).map(([_$1,v])=>v);return values}function jsonStringifyReplacer(_$1,value$1){return typeof value$1==`bigint`?value$1.toString():value$1}function cached(getter){let set=!1;return{get value(){{let value$1=getter();return Object.defineProperty(this,`value`,{value:value$1}),value$1}throw Error(`cached value already set`)}}}function nullish(input){return input==null}function cleanRegex(source){let start=source.startsWith(`^`)?1:0,end=source.endsWith(`$`)?source.length-1:source.length;return source.slice(start,end)}function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(`.`)[1]||``).length,stepString=step.toString(),stepDecCount=(stepString.split(`.`)[1]||``).length;if(stepDecCount===0&&/\d?e-\d?/.test(stepString)){let match=stepString.match(/\d?e-(\d?)/);match?.[1]&&(stepDecCount=Number.parseInt(match[1]))}let decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(`.`,``)),stepInt=Number.parseInt(step.toFixed(decCount).replace(`.`,``));return valInt%stepInt/10**decCount}const EVALUATING=Symbol(`evaluating`);function defineLazy(object$1,key$2,getter){let value$1;Object.defineProperty(object$1,key$2,{get(){if(value$1!==EVALUATING)return value$1===void 0&&(value$1=EVALUATING,value$1=getter()),value$1},set(v){Object.defineProperty(object$1,key$2,{value:v})},configurable:!0})}function assignProp(target$1,prop,value$1){Object.defineProperty(target$1,prop,{value:value$1,writable:!0,enumerable:!0,configurable:!0})}function mergeDefs(...defs){let mergedDescriptors={};for(let def$1 of defs){let descriptors=Object.getOwnPropertyDescriptors(def$1);Object.assign(mergedDescriptors,descriptors)}return Object.defineProperties({},mergedDescriptors)}function esc(str){return JSON.stringify(str)}const captureStackTrace=`captureStackTrace`in Error?Error.captureStackTrace:(..._args)=>{};function isObject$1(data$12){return typeof data$12==`object`&&!!data$12&&!Array.isArray(data$12)}const allowsEval=cached(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{let F$1=Function;return new F$1(``),!0}catch{return!1}});function isPlainObject$1(o){if(isObject$1(o)===!1)return!1;let ctor=o.constructor;if(ctor===void 0)return!0;let prot=ctor.prototype;return!(isObject$1(prot)===!1||Object.prototype.hasOwnProperty.call(prot,`isPrototypeOf`)===!1)}const propertyKeyTypes=new Set([`string`,`number`,`symbol`]);function escapeRegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function clone(inst,def$1,params){let cl=new inst._zod.constr(def$1??inst._zod.def);return(!def$1||params?.parent)&&(cl._zod.parent=inst),cl}function normalizeParams(_params){let params=_params;if(!params)return{};if(typeof params==`string`)return{error:()=>params};if(params?.message!==void 0){if(params?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");params.error=params.message}return delete params.message,typeof params.error==`string`?{...params,error:()=>params.error}:params}function optionalKeys(shape){return Object.keys(shape).filter(k$3=>shape[k$3]._zod.optin===`optional`&&shape[k$3]._zod.optout===`optional`)}const NUMBER_FORMAT_RANGES={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pick(schema,mask){let currDef=schema._zod.def,def$1=mergeDefs(schema._zod.def,{get shape(){let newShape={};for(let key$2 in mask){if(!(key$2 in currDef.shape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;newShape[key$2]=currDef.shape[key$2]}return assignProp(this,`shape`,newShape),newShape},checks:[]});return clone(schema,def$1)}function omit(schema,mask){let currDef=schema._zod.def,def$1=mergeDefs(schema._zod.def,{get shape(){let newShape={...schema._zod.def.shape};for(let key$2 in mask){if(!(key$2 in currDef.shape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;delete newShape[key$2]}return assignProp(this,`shape`,newShape),newShape},checks:[]});return clone(schema,def$1)}function extend(schema,shape){if(!isPlainObject$1(shape))throw Error(`Invalid input to extend: expected a plain object`);let def$1=mergeDefs(schema._zod.def,{get shape(){let _shape={...schema._zod.def.shape,...shape};return assignProp(this,`shape`,_shape),_shape},checks:[]});return clone(schema,def$1)}function merge$2(a$1,b$1){let def$1=mergeDefs(a$1._zod.def,{get shape(){let _shape={...a$1._zod.def.shape,...b$1._zod.def.shape};return assignProp(this,`shape`,_shape),_shape},get catchall(){return b$1._zod.def.catchall},checks:[]});return clone(a$1,def$1)}function partial(Class,schema,mask){let def$1=mergeDefs(schema._zod.def,{get shape(){let oldShape=schema._zod.def.shape,shape={...oldShape};if(mask)for(let key$2 in mask){if(!(key$2 in oldShape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;shape[key$2]=Class?new Class({type:`optional`,innerType:oldShape[key$2]}):oldShape[key$2]}else for(let key$2 in oldShape)shape[key$2]=Class?new Class({type:`optional`,innerType:oldShape[key$2]}):oldShape[key$2];return assignProp(this,`shape`,shape),shape},checks:[]});return clone(schema,def$1)}function required(Class,schema,mask){let def$1=mergeDefs(schema._zod.def,{get shape(){let oldShape=schema._zod.def.shape,shape={...oldShape};if(mask)for(let key$2 in mask){if(!(key$2 in shape))throw Error(`Unrecognized key: "${key$2}"`);if(!mask[key$2])continue;shape[key$2]=new Class({type:`nonoptional`,innerType:oldShape[key$2]})}else for(let key$2 in oldShape)shape[key$2]=new Class({type:`nonoptional`,innerType:oldShape[key$2]});return assignProp(this,`shape`,shape),shape},checks:[]});return clone(schema,def$1)}function aborted(x$1,startIndex=0){for(let i=startIndex;i{var _a$2;return(_a$2=iss).path??(_a$2.path=[]),iss.path.unshift(path),iss})}function unwrapMessage(message$1){return typeof message$1==`string`?message$1:message$1?.message}function finalizeIssue(iss,ctx,config$1){let full={...iss,path:iss.path??[]};if(!iss.message){let message$1=unwrapMessage(iss.inst?._zod.def?.error?.(iss))??unwrapMessage(ctx?.error?.(iss))??unwrapMessage(config$1.customError?.(iss))??unwrapMessage(config$1.localeError?.(iss))??`Invalid input`;full.message=message$1}return delete full.inst,delete full.continue,ctx?.reportInput||delete full.input,full}function getLengthableOrigin(input){return Array.isArray(input)?`array`:typeof input==`string`?`string`:`unknown`}function issue(...args){let[iss,input,inst]=args;return typeof iss==`string`?{message:iss,code:`custom`,input,inst}:{...iss}}const initializer$1=(inst,def$1)=>{inst.name=`$ZodError`,Object.defineProperty(inst,`_zod`,{value:inst._zod,enumerable:!1}),Object.defineProperty(inst,`issues`,{value:def$1,enumerable:!1}),inst.message=JSON.stringify(def$1,jsonStringifyReplacer,2),Object.defineProperty(inst,`toString`,{value:()=>inst.message,enumerable:!1})},$ZodError=$constructor(`$ZodError`,initializer$1),$ZodRealError=$constructor(`$ZodError`,initializer$1,{Parent:Error});function flattenError(error,mapper=issue$1=>issue$1.message){let fieldErrors={},formErrors=[];for(let sub of error.issues)sub.path.length>0?(fieldErrors[sub.path[0]]=fieldErrors[sub.path[0]]||[],fieldErrors[sub.path[0]].push(mapper(sub))):formErrors.push(mapper(sub));return{formErrors,fieldErrors}}function formatError(error,_mapper){let mapper=_mapper||function(issue$1){return issue$1.message},fieldErrors={_errors:[]},processError=error$1=>{for(let issue$1 of error$1.issues)if(issue$1.code===`invalid_union`&&issue$1.errors.length)issue$1.errors.map(issues=>processError({issues}));else if(issue$1.code===`invalid_key`)processError({issues:issue$1.issues});else if(issue$1.code===`invalid_element`)processError({issues:issue$1.issues});else if(issue$1.path.length===0)fieldErrors._errors.push(mapper(issue$1));else{let curr=fieldErrors,i=0;for(;i(schema,value$1,_ctx,_params)=>{let ctx=_ctx?Object.assign(_ctx,{async:!1}):{async:!1},result=schema._zod.run({value:value$1,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;if(result.issues.length){let e$4=new(_params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e$4,_params?.callee),e$4}return result.value},parse$2=_parse($ZodRealError),_parseAsync=_Err=>async(schema,value$1,_ctx,params)=>{let ctx=_ctx?Object.assign(_ctx,{async:!0}):{async:!0},result=schema._zod.run({value:value$1,issues:[]},ctx);if(result instanceof Promise&&(result=await result),result.issues.length){let e$4=new(params?.Err??_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e$4,params?.callee),e$4}return result.value},parseAsync$1=_parseAsync($ZodRealError),_safeParse=_Err=>(schema,value$1,_ctx)=>{let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value:value$1,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;return result.issues.length?{success:!1,error:new(_Err??$ZodError)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParse$1=_safeParse($ZodRealError),_safeParseAsync=_Err=>async(schema,value$1,_ctx)=>{let ctx=_ctx?Object.assign(_ctx,{async:!0}):{async:!0},result=schema._zod.run({value:value$1,issues:[]},ctx);return result instanceof Promise&&(result=await result),result.issues.length?{success:!1,error:new _Err(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParseAsync$1=_safeParseAsync($ZodRealError),cuid=/^[cC][^\s-]{8,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/,duration$1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,uuid=version$2=>version$2?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_emoji$1=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function emoji(){return new RegExp(_emoji$1,`u`)}const ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,base64url=/^[A-Za-z0-9_-]*$/,hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,e164=/^\+(?:[0-9]){6,14}[0-9]$/,dateSource=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,date$1=RegExp(`^${dateSource}$`);function timeSource(args){let hhmm=`(?:[01]\\d|2[0-3]):[0-5]\\d`,regex=typeof args.precision==`number`?args.precision===-1?`${hhmm}`:args.precision===0?`${hhmm}:[0-5]\\d`:`${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`:`${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;return regex}function time$1(args){return RegExp(`^${timeSource(args)}$`)}function datetime$2(args){let time$2=timeSource({precision:args.precision}),opts=[`Z`];args.local&&opts.push(``),args.offset&&opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let timeRegex=`${time$2}(?:${opts.join(`|`)})`;return RegExp(`^${dateSource}T(?:${timeRegex})$`)}const string$1=params=>{let regex=params?`[\\s\\S]{${params?.minimum??0},${params?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${regex}$`)},integer=/^\d+$/,number$2=/^-?\d+(?:\.\d+)?/i,boolean$1=/true|false/i,lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/,$ZodCheck=$constructor(`$ZodCheck`,(inst,def$1)=>{var _a$2;inst._zod??={},inst._zod.def=def$1,(_a$2=inst._zod).onattach??(_a$2.onattach=[])}),numericOriginMap={number:`number`,bigint:`bigint`,object:`date`},$ZodCheckLessThan=$constructor(`$ZodCheckLessThan`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let origin=numericOriginMap[typeof def$1.value];inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag,curr=(def$1.inclusive?bag.maximum:bag.exclusiveMaximum)??1/0;def$1.value{(def$1.inclusive?payload.value<=def$1.value:payload.value{$ZodCheck.init(inst,def$1);let origin=numericOriginMap[typeof def$1.value];inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag,curr=(def$1.inclusive?bag.minimum:bag.exclusiveMinimum)??-1/0;def$1.value>curr&&(def$1.inclusive?bag.minimum=def$1.value:bag.exclusiveMinimum=def$1.value)}),inst._zod.check=payload=>{(def$1.inclusive?payload.value>=def$1.value:payload.value>def$1.value)||payload.issues.push({origin,code:`too_small`,minimum:def$1.value,input:payload.value,inclusive:def$1.inclusive,inst,continue:!def$1.abort})}}),$ZodCheckMultipleOf=$constructor(`$ZodCheckMultipleOf`,(inst,def$1)=>{$ZodCheck.init(inst,def$1),inst._zod.onattach.push(inst$1=>{var _a$2;(_a$2=inst$1._zod.bag).multipleOf??(_a$2.multipleOf=def$1.value)}),inst._zod.check=payload=>{if(typeof payload.value!=typeof def$1.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);let isMultiple=typeof payload.value==`bigint`?payload.value%def$1.value===BigInt(0):floatSafeRemainder(payload.value,def$1.value)===0;isMultiple||payload.issues.push({origin:typeof payload.value,code:`not_multiple_of`,divisor:def$1.value,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckNumberFormat=$constructor(`$ZodCheckNumberFormat`,(inst,def$1)=>{$ZodCheck.init(inst,def$1),def$1.format=def$1.format||`float64`;let isInt=def$1.format?.includes(`int`),origin=isInt?`int`:`number`,[minimum,maximum]=NUMBER_FORMAT_RANGES[def$1.format];inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.format=def$1.format,bag.minimum=minimum,bag.maximum=maximum,isInt&&(bag.pattern=integer)}),inst._zod.check=payload=>{let input=payload.value;if(isInt){if(!Number.isInteger(input)){payload.issues.push({expected:origin,format:def$1.format,code:`invalid_type`,continue:!1,input,inst});return}if(!Number.isSafeInteger(input)){input>0?payload.issues.push({input,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst,origin,continue:!def$1.abort}):payload.issues.push({input,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst,origin,continue:!def$1.abort});return}}inputmaximum&&payload.issues.push({origin:`number`,input,code:`too_big`,maximum,inst})}}),$ZodCheckMaxLength=$constructor(`$ZodCheckMaxLength`,(inst,def$1)=>{var _a$2;$ZodCheck.init(inst,def$1),(_a$2=inst._zod.def).when??(_a$2.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst$1=>{let curr=inst$1._zod.bag.maximum??1/0;def$1.maximum{let input=payload.value,length=input.length;if(length<=def$1.maximum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:`too_big`,maximum:def$1.maximum,inclusive:!0,input,inst,continue:!def$1.abort})}}),$ZodCheckMinLength=$constructor(`$ZodCheckMinLength`,(inst,def$1)=>{var _a$2;$ZodCheck.init(inst,def$1),(_a$2=inst._zod.def).when??(_a$2.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst$1=>{let curr=inst$1._zod.bag.minimum??-1/0;def$1.minimum>curr&&(inst$1._zod.bag.minimum=def$1.minimum)}),inst._zod.check=payload=>{let input=payload.value,length=input.length;if(length>=def$1.minimum)return;let origin=getLengthableOrigin(input);payload.issues.push({origin,code:`too_small`,minimum:def$1.minimum,inclusive:!0,input,inst,continue:!def$1.abort})}}),$ZodCheckLengthEquals=$constructor(`$ZodCheckLengthEquals`,(inst,def$1)=>{var _a$2;$ZodCheck.init(inst,def$1),(_a$2=inst._zod.def).when??(_a$2.when=payload=>{let val=payload.value;return!nullish(val)&&val.length!==void 0}),inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.minimum=def$1.length,bag.maximum=def$1.length,bag.length=def$1.length}),inst._zod.check=payload=>{let input=payload.value,length=input.length;if(length===def$1.length)return;let origin=getLengthableOrigin(input),tooBig=length>def$1.length;payload.issues.push({origin,...tooBig?{code:`too_big`,maximum:def$1.length}:{code:`too_small`,minimum:def$1.length},inclusive:!0,exact:!0,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckStringFormat=$constructor(`$ZodCheckStringFormat`,(inst,def$1)=>{var _a$2,_b;$ZodCheck.init(inst,def$1),inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.format=def$1.format,def$1.pattern&&(bag.patterns??=new Set,bag.patterns.add(def$1.pattern))}),def$1.pattern?(_a$2=inst._zod).check??(_a$2.check=payload=>{def$1.pattern.lastIndex=0,!def$1.pattern.test(payload.value)&&payload.issues.push({origin:`string`,code:`invalid_format`,format:def$1.format,input:payload.value,...def$1.pattern?{pattern:def$1.pattern.toString()}:{},inst,continue:!def$1.abort})}):(_b=inst._zod).check??(_b.check=()=>{})}),$ZodCheckRegex=$constructor(`$ZodCheckRegex`,(inst,def$1)=>{$ZodCheckStringFormat.init(inst,def$1),inst._zod.check=payload=>{def$1.pattern.lastIndex=0,!def$1.pattern.test(payload.value)&&payload.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:payload.value,pattern:def$1.pattern.toString(),inst,continue:!def$1.abort})}}),$ZodCheckLowerCase=$constructor(`$ZodCheckLowerCase`,(inst,def$1)=>{def$1.pattern??=lowercase,$ZodCheckStringFormat.init(inst,def$1)}),$ZodCheckUpperCase=$constructor(`$ZodCheckUpperCase`,(inst,def$1)=>{def$1.pattern??=uppercase,$ZodCheckStringFormat.init(inst,def$1)}),$ZodCheckIncludes=$constructor(`$ZodCheckIncludes`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let escapedRegex=escapeRegex(def$1.includes),pattern=new RegExp(typeof def$1.position==`number`?`^.{${def$1.position}}${escapedRegex}`:escapedRegex);def$1.pattern=pattern,inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.patterns??=new Set,bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.includes(def$1.includes,def$1.position)||payload.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:def$1.includes,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckStartsWith=$constructor(`$ZodCheckStartsWith`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let pattern=RegExp(`^${escapeRegex(def$1.prefix)}.*`);def$1.pattern??=pattern,inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.patterns??=new Set,bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.startsWith(def$1.prefix)||payload.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:def$1.prefix,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckEndsWith=$constructor(`$ZodCheckEndsWith`,(inst,def$1)=>{$ZodCheck.init(inst,def$1);let pattern=RegExp(`.*${escapeRegex(def$1.suffix)}$`);def$1.pattern??=pattern,inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.patterns??=new Set,bag.patterns.add(pattern)}),inst._zod.check=payload=>{payload.value.endsWith(def$1.suffix)||payload.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:def$1.suffix,input:payload.value,inst,continue:!def$1.abort})}}),$ZodCheckOverwrite=$constructor(`$ZodCheckOverwrite`,(inst,def$1)=>{$ZodCheck.init(inst,def$1),inst._zod.check=payload=>{payload.value=def$1.tx(payload.value)}});var Doc=class{constructor(args=[]){this.content=[],this.indent=0,this&&(this.args=args)}indented(fn$5){this.indent+=1,fn$5(this),--this.indent}write(arg){if(typeof arg==`function`){arg(this,{execution:`sync`}),arg(this,{execution:`async`});return}let content$2=arg,lines=content$2.split(` `).filter(x$1=>x$1),minIndent=Math.min(...lines.map(x$1=>x$1.length-x$1.trimStart().length)),dedented=lines.map(x$1=>x$1.slice(minIndent)).map(x$1=>` `.repeat(this.indent*2)+x$1);for(let line of dedented)this.content.push(line)}compile(){let F$1=Function,args=this?.args,content$2=this?.content??[``],lines=[...content$2.map(x$1=>` ${x$1}`)];return new F$1(...args,lines.join(` `))}};const version={major:4,minor:0,patch:14},$ZodType=$constructor(`$ZodType`,(inst,def$1)=>{var _a$2;inst??={},inst._zod.def=def$1,inst._zod.bag=inst._zod.bag||{},inst._zod.version=version;let checks$1=[...inst._zod.def.checks??[]];inst._zod.traits.has(`$ZodCheck`)&&checks$1.unshift(inst);for(let ch of checks$1)for(let fn$5 of ch._zod.onattach)fn$5(inst);if(checks$1.length===0)(_a$2=inst._zod).deferred??(_a$2.deferred=[]),inst._zod.deferred?.push(()=>{inst._zod.run=inst._zod.parse});else{let runChecks=(payload,checks$2,ctx)=>{let isAborted=aborted(payload),asyncResult;for(let ch of checks$2){if(ch._zod.def.when){let shouldRun=ch._zod.def.when(payload);if(!shouldRun)continue}else if(isAborted)continue;let currLen=payload.issues.length,_$1=ch._zod.check(payload);if(_$1 instanceof Promise&&ctx?.async===!1)throw new $ZodAsyncError;if(asyncResult||_$1 instanceof Promise)asyncResult=(asyncResult??Promise.resolve()).then(async()=>{await _$1;let nextLen=payload.issues.length;nextLen!==currLen&&(isAborted||=aborted(payload,currLen))});else{let nextLen=payload.issues.length;if(nextLen===currLen)continue;isAborted||=aborted(payload,currLen)}}return asyncResult?asyncResult.then(()=>payload):payload};inst._zod.run=(payload,ctx)=>{let result=inst._zod.parse(payload,ctx);if(result instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return result.then(result$1=>runChecks(result$1,checks$1,ctx))}return runChecks(result,checks$1,ctx)}}inst[`~standard`]={validate:value$1=>{try{let r$1=safeParse$1(inst,value$1);return r$1.success?{value:r$1.data}:{issues:r$1.error?.issues}}catch{return safeParseAsync$1(inst,value$1).then(r$1=>r$1.success?{value:r$1.data}:{issues:r$1.error?.issues})}},vendor:`zod`,version:1}}),$ZodString=$constructor(`$ZodString`,(inst,def$1)=>{$ZodType.init(inst,def$1),inst._zod.pattern=[...inst?._zod.bag?.patterns??[]].pop()??string$1(inst._zod.bag),inst._zod.parse=(payload,_$1)=>{if(def$1.coerce)try{payload.value=String(payload.value)}catch{}return typeof payload.value==`string`||payload.issues.push({expected:`string`,code:`invalid_type`,input:payload.value,inst}),payload}}),$ZodStringFormat=$constructor(`$ZodStringFormat`,(inst,def$1)=>{$ZodCheckStringFormat.init(inst,def$1),$ZodString.init(inst,def$1)}),$ZodGUID=$constructor(`$ZodGUID`,(inst,def$1)=>{def$1.pattern??=guid,$ZodStringFormat.init(inst,def$1)}),$ZodUUID=$constructor(`$ZodUUID`,(inst,def$1)=>{if(def$1.version){let versionMap={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8},v=versionMap[def$1.version];if(v===void 0)throw Error(`Invalid UUID version: "${def$1.version}"`);def$1.pattern??=uuid(v)}else def$1.pattern??=uuid();$ZodStringFormat.init(inst,def$1)}),$ZodEmail=$constructor(`$ZodEmail`,(inst,def$1)=>{def$1.pattern??=email,$ZodStringFormat.init(inst,def$1)}),$ZodURL=$constructor(`$ZodURL`,(inst,def$1)=>{$ZodStringFormat.init(inst,def$1),inst._zod.check=payload=>{try{let trimmed=payload.value.trim(),url=new URL(trimmed);def$1.hostname&&(def$1.hostname.lastIndex=0,def$1.hostname.test(url.hostname)||payload.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:hostname.source,input:payload.value,inst,continue:!def$1.abort})),def$1.protocol&&(def$1.protocol.lastIndex=0,def$1.protocol.test(url.protocol.endsWith(`:`)?url.protocol.slice(0,-1):url.protocol)||payload.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:def$1.protocol.source,input:payload.value,inst,continue:!def$1.abort})),def$1.normalize?payload.value=url.href:payload.value=trimmed;return}catch{payload.issues.push({code:`invalid_format`,format:`url`,input:payload.value,inst,continue:!def$1.abort})}}}),$ZodEmoji=$constructor(`$ZodEmoji`,(inst,def$1)=>{def$1.pattern??=emoji(),$ZodStringFormat.init(inst,def$1)}),$ZodNanoID=$constructor(`$ZodNanoID`,(inst,def$1)=>{def$1.pattern??=nanoid,$ZodStringFormat.init(inst,def$1)}),$ZodCUID=$constructor(`$ZodCUID`,(inst,def$1)=>{def$1.pattern??=cuid,$ZodStringFormat.init(inst,def$1)}),$ZodCUID2=$constructor(`$ZodCUID2`,(inst,def$1)=>{def$1.pattern??=cuid2,$ZodStringFormat.init(inst,def$1)}),$ZodULID=$constructor(`$ZodULID`,(inst,def$1)=>{def$1.pattern??=ulid,$ZodStringFormat.init(inst,def$1)}),$ZodXID=$constructor(`$ZodXID`,(inst,def$1)=>{def$1.pattern??=xid,$ZodStringFormat.init(inst,def$1)}),$ZodKSUID=$constructor(`$ZodKSUID`,(inst,def$1)=>{def$1.pattern??=ksuid,$ZodStringFormat.init(inst,def$1)}),$ZodISODateTime=$constructor(`$ZodISODateTime`,(inst,def$1)=>{def$1.pattern??=datetime$2(def$1),$ZodStringFormat.init(inst,def$1)}),$ZodISODate=$constructor(`$ZodISODate`,(inst,def$1)=>{def$1.pattern??=date$1,$ZodStringFormat.init(inst,def$1)}),$ZodISOTime=$constructor(`$ZodISOTime`,(inst,def$1)=>{def$1.pattern??=time$1(def$1),$ZodStringFormat.init(inst,def$1)}),$ZodISODuration=$constructor(`$ZodISODuration`,(inst,def$1)=>{def$1.pattern??=duration$1,$ZodStringFormat.init(inst,def$1)}),$ZodIPv4=$constructor(`$ZodIPv4`,(inst,def$1)=>{def$1.pattern??=ipv4,$ZodStringFormat.init(inst,def$1),inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.format=`ipv4`})}),$ZodIPv6=$constructor(`$ZodIPv6`,(inst,def$1)=>{def$1.pattern??=ipv6,$ZodStringFormat.init(inst,def$1),inst._zod.onattach.push(inst$1=>{let bag=inst$1._zod.bag;bag.format=`ipv6`}),inst._zod.check=payload=>{try{new URL(`http://[${payload.value}]`)}catch{payload.issues.push({code:`invalid_format`,format:`ipv6`,input:payload.value,inst,continue:!def$1.abort})}}}),$ZodCIDRv4=$constructor(`$ZodCIDRv4`,(inst,def$1)=>{def$1.pattern??=cidrv4,$ZodStringFormat.init(inst,def$1)}),$ZodCIDRv6=$constructor(`$ZodCIDRv6`,(inst,def$1)=>{def$1.pattern??=cidrv6,$ZodStringFormat.init(inst,def$1),inst._zod.check=payload=>{let[address,prefix]=payload.value.split(`/`);try{if(!prefix)throw Error();let prefixNum=Number(prefix);if(`${prefixNum}`!==prefix||prefixNum<0||prefixNum>128)throw Error();new URL(`http://[${address}]`)}catch{payload.issues.push({code:`invalid_format`,format:`cidrv6`,input:payload.value,inst,continue:!def$1.abort})}}});function isValidBase64(data$12){if(data$12===``)return!0;if(data$12.length%4!=0)return!1;try{return atob(data$12),!0}catch{return!1}}const $ZodBase64=$constructor(`$ZodBase64`,(inst,def$1)=>{def$1.pattern??=base64,$ZodStringFormat.init(inst,def$1),inst._zod.onattach.push(inst$1=>{inst$1._zod.bag.contentEncoding=`base64`}),inst._zod.check=payload=>{isValidBase64(payload.value)||payload.issues.push({code:`invalid_format`,format:`base64`,input:payload.value,inst,continue:!def$1.abort})}});function isValidBase64URL(data$12){if(!base64url.test(data$12))return!1;let base64$1=data$12.replace(/[-_]/g,c$3=>c$3===`-`?`+`:`/`),padded=base64$1.padEnd(Math.ceil(base64$1.length/4)*4,`=`);return isValidBase64(padded)}const $ZodBase64URL=$constructor(`$ZodBase64URL`,(inst,def$1)=>{def$1.pattern??=base64url,$ZodStringFormat.init(inst,def$1),inst._zod.onattach.push(inst$1=>{inst$1._zod.bag.contentEncoding=`base64url`}),inst._zod.check=payload=>{isValidBase64URL(payload.value)||payload.issues.push({code:`invalid_format`,format:`base64url`,input:payload.value,inst,continue:!def$1.abort})}}),$ZodE164=$constructor(`$ZodE164`,(inst,def$1)=>{def$1.pattern??=e164,$ZodStringFormat.init(inst,def$1)});function isValidJWT(token,algorithm=null){try{let tokensParts=token.split(`.`);if(tokensParts.length!==3)return!1;let[header]=tokensParts;if(!header)return!1;let parsedHeader=JSON.parse(atob(header));return!(`typ`in parsedHeader&&parsedHeader?.typ!==`JWT`||!parsedHeader.alg||algorithm&&(!(`alg`in parsedHeader)||parsedHeader.alg!==algorithm))}catch{return!1}}const $ZodJWT=$constructor(`$ZodJWT`,(inst,def$1)=>{$ZodStringFormat.init(inst,def$1),inst._zod.check=payload=>{isValidJWT(payload.value,def$1.alg)||payload.issues.push({code:`invalid_format`,format:`jwt`,input:payload.value,inst,continue:!def$1.abort})}}),$ZodNumber=$constructor(`$ZodNumber`,(inst,def$1)=>{$ZodType.init(inst,def$1),inst._zod.pattern=inst._zod.bag.pattern??number$2,inst._zod.parse=(payload,_ctx)=>{if(def$1.coerce)try{payload.value=Number(payload.value)}catch{}let input=payload.value;if(typeof input==`number`&&!Number.isNaN(input)&&Number.isFinite(input))return payload;let received=typeof input==`number`?Number.isNaN(input)?`NaN`:Number.isFinite(input)?void 0:`Infinity`:void 0;return payload.issues.push({expected:`number`,code:`invalid_type`,input,inst,...received?{received}:{}}),payload}}),$ZodNumberFormat=$constructor(`$ZodNumber`,(inst,def$1)=>{$ZodCheckNumberFormat.init(inst,def$1),$ZodNumber.init(inst,def$1)}),$ZodBoolean=$constructor(`$ZodBoolean`,(inst,def$1)=>{$ZodType.init(inst,def$1),inst._zod.pattern=boolean$1,inst._zod.parse=(payload,_ctx)=>{if(def$1.coerce)try{payload.value=!!payload.value}catch{}let input=payload.value;return typeof input==`boolean`||payload.issues.push({expected:`boolean`,code:`invalid_type`,input,inst}),payload}}),$ZodUnknown=$constructor(`$ZodUnknown`,(inst,def$1)=>{$ZodType.init(inst,def$1),inst._zod.parse=payload=>payload}),$ZodNever=$constructor(`$ZodNever`,(inst,def$1)=>{$ZodType.init(inst,def$1),inst._zod.parse=(payload,_ctx)=>(payload.issues.push({expected:`never`,code:`invalid_type`,input:payload.value,inst}),payload)});function handleArrayResult(result,final,index$1){result.issues.length&&final.issues.push(...prefixIssues(index$1,result.issues)),final.value[index$1]=result.value}const $ZodArray=$constructor(`$ZodArray`,(inst,def$1)=>{$ZodType.init(inst,def$1),inst._zod.parse=(payload,ctx)=>{let input=payload.value;if(!Array.isArray(input))return payload.issues.push({expected:`array`,code:`invalid_type`,input,inst}),payload;payload.value=Array(input.length);let proms=[];for(let i=0;ihandleArrayResult(result$1,payload,i))):handleArrayResult(result,payload,i)}return proms.length?Promise.all(proms).then(()=>payload):payload}});function handlePropertyResult(result,final,key$2,input){result.issues.length&&final.issues.push(...prefixIssues(key$2,result.issues)),result.value===void 0?key$2 in input&&(final.value[key$2]=void 0):final.value[key$2]=result.value}const $ZodObject=$constructor(`$ZodObject`,(inst,def$1)=>{$ZodType.init(inst,def$1);let _normalized=cached(()=>{let keys$3=Object.keys(def$1.shape);for(let k$3 of keys$3)if(!(def$1.shape[k$3]instanceof $ZodType))throw Error(`Invalid element at key "${k$3}": expected a Zod schema`);let okeys=optionalKeys(def$1.shape);return{shape:def$1.shape,keys:keys$3,keySet:new Set(keys$3),numKeys:keys$3.length,optionalKeys:new Set(okeys)}});defineLazy(inst._zod,`propValues`,()=>{let shape=def$1.shape,propValues={};for(let key$2 in shape){let field=shape[key$2]._zod;if(field.values){propValues[key$2]??(propValues[key$2]=new Set);for(let v of field.values)propValues[key$2].add(v)}}return propValues});let generateFastpass=shape=>{let doc$2=new Doc([`shape`,`payload`,`ctx`]),normalized=_normalized.value,parseStr=key$2=>{let k$3=esc(key$2);return`shape[${k$3}]._zod.run({ value: input[${k$3}], issues: [] }, ctx)`};doc$2.write(`const input = payload.value;`);let ids=Object.create(null),counter=0;for(let key$2 of normalized.keys)ids[key$2]=`key_${counter++}`;doc$2.write(`const newResult = {}`);for(let key$2 of normalized.keys){let id=ids[key$2],k$3=esc(key$2);doc$2.write(`const ${id} = ${parseStr(key$2)};`),doc$2.write(` if (${id}.issues.length) { @@ -5073,7 +5073,7 @@ Coordinate axes are visualised. `},common:{fields:{field:{"api-key":{label:`API 密钥`}}},section:{advanced:{fields:{field:{headers:{description:`添加自定义 HTTP 标头`,key:{placeholder:`请求头名字`},label:`HTTP 请求头`,value:{placeholder:`请求头数值`}}}},title:`高级配置`},basic:{description:`基本设置`,title:`基础配置`},voice:{title:`声音配置`}}},description:`LLM,语音合成,语音识别服务来源等`,provider:{"app-local-audio-transcription":{title:`应用内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"app-local-audio-speech":{title:`应用内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"browser-local-audio-transcription":{title:`浏览器内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"browser-local-audio-speech":{title:`浏览器内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"alibaba-cloud-model-studio":{description:`bailian.console.aliyun.com`,title:`阿里百炼`},anthropic:{description:`anthropic.com`,title:`Anthropic | Claude`,helpinfo:{title:`开始之前`,description:{part1:`虽然 Anthropic 最近宣布他们正在提供对 OpenAI SDK 兼容性的 Beta 版支持`,part2:`(您可以在此处阅读更多信息)`,part3:`但由于实现细节附带`,part4:`与 OpenAI SDK 不一致,目前无法在浏览器中使用此提供程序。`,part5:`如果您确实需要使用此提供程序,则需要一个专用的代理后端,例如在`,part6:`上运行的Serverless Function,或者一些绕过 CORS 的服务,以绕过 CORS 限制。`}}},"cloudflare-workers-ai":{description:`Cloudflare.com`,fields:{field:{"account-id":{description:`Cloudflare 帐户 ID`,label:`Cloudflare Account ID`,placeholder:`请输入 Cloudflare Account ID`},"api-key":{placeholder:`请输入 Cloudflare Workers AI 的 API Key`}}},title:`Workers AI`},common:{fields:{field:{pitch:{description:`调节合成语音的音高(比如更尖锐或者更粗旷)`,label:`音高`},speed:{description:`调节说话的语速`,label:`语速`},volume:{description:`调节语音的响度`,label:`响度`}}}},deepseek:{description:`DeepSeek.com`,title:`深度求索 DeepSeek`},elevenlabs:{description:`Elevenlabs.io`,fields:{field:{"simularity-boost":{description:`声音相似性与依从性`,label:`相似度修正`},"speaker-boost":{description:`增强说话者的相似性`,label:`扬声器增强`},speed:{description:`语音生成速度`,label:`语速`},stability:{description:`语音稳定性和随机性`,label:`稳定性`},style:{description:`夸张的语音风格`,label:`风格`}}},playground:{buttons:{button:{"test-voice":{generating:`生成中...`,label:`测试声音`}}},fields:{field:{input:{placeholder:`输入用于测试发音的文本`},language:{description:`选择语音语言`,label:`语言`},voice:{description:`选择首选语音`,label:`声线`}}},title:`实验平台`,validation:{"error-missing-api-key":`需要填写 API Key 才能用哦!`}},title:`ElevenLabs (11labs)`},fireworks:{description:`Fireworks.ai`,title:`Fireworks.ai`},"microsoft-speech":{description:`speech.microsoft.com`,fields:{field:{region:{description:`服务 Endpoint 地区(比如亚太 eastasia 区域)`,label:`Endpoint 地区`}}},title:`Microsoft / Azure 语音服务`},mistral:{description:`mistral.ai`,title:`Mistral`},moonshot:{description:`Moonshot.ai`,title:`月之暗面`},novita:{description:`novita.ai`,title:`Novita`},ollama:{description:`ollama.ai`,title:`Ollama`},openai:{description:`OpenAi.com`,title:`OpenAI`},openrouter:{description:`OpenRouter.ai`,title:`OpenRouter`},perplexity:{description:`perplexity.ai`,title:`Perplexity`},player2:{description:`player2.game`,title:`Player2`},together:{description:`together.ai`,title:`Together.ai`},"google-generative-ai":{description:`gemini.google.com`,title:`Google Gemini`},featherless:{description:`featherless.ai`,title:`Featherless AI`},vllm:{description:`vllm.ai`,title:`vLLM`},volcengine:{description:`volcengine.com`,fields:{field:{appId:{description:`可在控制台获取的 App ID`,label:`App ID`}}},title:`火山引擎`},xai:{description:`X.AI`,title:`xAI`},transcriptions:{playground:{title:`实验平台`}}},title:`服务来源`},scene:{description:`配置角色所在环境`,title:`场景`},themes:{"color-scheme":{description:`更改舞台的配色方案`,title:`配色方案`},developer:{description:`为开发者提供的选项`,title:`开发者`},general:{description:`深色主题、语言等选项`,title:`通用`},description:`自定义你的舞台外观!`,sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:`强调色`,"rgb-on":{title:`RGB ON!`}}}},title:`配色`},developer:{title:`开发者`},"theme-presets":{presets:[{colors:[`AIRI 绿`],description:`默认的绿色主题,由 AIRI 为您带来!`,title:`默认颜色`},{colors:[`灰褐色`,`米色`,`灰白色`,`浅灰褐色`,`象牙色`,`橄榄灰`,`沙色`,`暖灰色`],description:`受乔治·莫兰迪绘画启发的柔和、低调的色调`,title:`Morandi 颜色`},{colors:[`天蓝色`,`薄雾色`,`沙色`,`苔藓绿`,`睡莲色`,`小麦色`,`板岩蓝`,`鼠尾草色`],description:`受克劳德·莫奈作品启发的印象派调色板`,title:`莫奈颜色`},{colors:[`棕褐色`,`暖灰褐色`,`赭色`,`咖啡色`,`青铜色`,`金色`,`芥末色`,`琥珀色`],description:`传统日本色彩调色板`,title:`日本颜色`},{colors:[`北欧蓝`,`冰色`,`峡湾色`,`钢铁色`,`冰川色`,`板岩色`,`云色`,`石头色`],description:`北欧极简主义配色方案`,title:`北欧颜色`},{colors:[`霞光红`,`枣红`,`黄栌`,`竹青`,`乌梅紫`,`缃色`,`青冥`,`赭石`],description:`中国传统色彩,源自古代纺织品、瓷器和绘画`,title:`中国传统颜色`}],title:`预设`}}},title:`外观`}},sections:{section:{general:{title:`通用`}}},theme:{title:`主题`,description:`切换 AIRI 的基础主题,亮色模式或暗色模式。 `},title:`设置`,voices:`声线`,vrm:{"change-model":{"from-file":`从文件加载`,"from-file-select":`选择`,"from-url":`从 URL 加载`,"from-url-confirm":`加载`,"from-url-placeholder":`输入 VRM 模型 URL`,title:`更换模型`},title:`VRM 设置`,"scale-and-position":{"model-info-title":`模型尺寸信息`,"model-info-x":`宽度(X轴)`,"model-info-y":`高度(Y轴)`,"model-info-z":`深度(Z轴)`,tips:`设定模型放置的空间坐标。 坐标轴已被可视化。 -`,scale:`缩放`,x:`X轴偏移`,y:`Y 轴偏移`,z:`Z轴偏移`,fov:`视角调整(度)`,"rotation-y":`模型朝向(Y轴旋转)`,"camera-distance":`相机距离(画面缩放)`,"eye-tracking-mode":{title:`模型注视方向`,options:{option:{camera:`相机`,mouse:`鼠标`,disabled:`禁用`}}}},"switch-to-vrm":{title:`想切换至Live2D虚拟形象?`,"change-to-vrm":`切换至Live2D虚拟形象设定页面`},"theme-color-from-model":{"button-extract":{title:`提取`}}}},settings_default=data$3,data$2={chat:{message:{"character-name":{airi:`AIRI`,"core-system":`核心系统`,you:`你`}}},message:`说点什么...`,"select-a-audio-input":`选择一个音频输入设备`,"select-a-model":`选择一个模型`,"select-a-voice":`选择一个声线`,viewers:{"debug-menu":{emotions:`表情`,"emotions-btn":{angry:`😠 生气`,awkward:`😳 尴尬`,happy:`😄 开心`,neutral:`🙂 日常`,question:`🤔 疑问`,sad:`😫 难过`,surprised:`🤯 惊喜`,think:`🤨 思考`},vrm:{camera:`摄像机`,model:{title:`模型`}}}},waiting:`等待中`,operations:{"load-models":`加载模型`,"load-models-status":{loading:`模型加载中`,ready:`已就绪`}}},stage_default=data$2,data$1={"allow-visible-on-all-workspaces":{title:`跨桌面可见性`,description:`允许窗口在所有虚拟桌面中可见,仅限 macOS。`},pages:{modules:{"mcp-server":{description:`连接与管理 MCP 服务器和工具`,title:`MCP 服务器`}},themes:{sections:{section:{"window-shortcuts":{title:`键盘快捷键`}}},"window-shortcuts":{description:`修改窗口快捷方式`,title:`窗口快捷方式`,"toggle-move":{label:`切换移动状态`},"toggle-resize":{label:`调整大小`},"toggle-ignore-mouse-event":{label:`忽略鼠标事件`},"press-keys":`请按下按键...`}}}},settings_default$1=data$1,data={operations:{"load-models":`加载推理模型`,"load-models-status":{loading:`加载中`,ready:`已就绪`}}},stage_default$1=data,tamagotchi_default={stage:stage_default$1,settings:settings_default$1},zh_Hans_default={base:base_default,docs:docs_default,settings:settings_default,stage:stage_default,tamagotchi:tamagotchi_default},locales_default={en:en_default,"zh-Hans":zh_Hans_default};const languageRemap$1={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hans`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`},DEFAULT_THEME_COLORS_HUE=220.44,convert=converter_default(`oklch`),getHueFrom=color$2=>color$2?convert(color$2)?.h:DEFAULT_THEME_COLORS_HUE,useSettings=defineStore(`settings`,()=>{let selectedAudioDevice=ref(),language=useLocalStorage(`settings/language`,``),stageView=useLocalStorage(`settings/stage/view/model-renderer`,`2d`),stageViewControlsEnabled=ref(!1),live2dDisableFocus=useLocalStorage(`settings/live2d/disable-focus`,!1),disableTransitions=useLocalStorage(`settings/disable-transitions`,!0),usePageSpecificTransitions=useLocalStorage(`settings/use-page-specific-transitions`,!0),themeColorsHue=useLocalStorage(`settings/theme/colors/hue`,DEFAULT_THEME_COLORS_HUE),themeColorsHueDynamic=useLocalStorage(`settings/theme/colors/hue-dynamic`,!1),allowVisibleOnAllWorkspaces=useLocalStorage(`settings/allow-visible-on-all-workspaces`,!0);function getLanguage(){let language$1=localStorage.getItem(`settings/language`);language$1||=navigator.language||`en`;let languages=Object.keys(locales_default);return languageRemap$1[language$1||`en`]!=null&&(language$1=languageRemap$1[language$1||`en`]),language$1&&languages.includes(language$1)?language$1:`en`}function setThemeColorsHue(hue$2=DEFAULT_THEME_COLORS_HUE){themeColorsHue.value=hue$2,themeColorsHueDynamic.value=!1}function applyPrimaryColorFrom(color$2){setThemeColorsHue(getHueFrom(color$2))}function isColorSelectedForPrimary(hexColor){if(themeColorsHueDynamic.value)return!1;let h$1=getHueFrom(hexColor);if(!h$1)return!1;let hueDifference=Math.abs(h$1-themeColorsHue.value);return hueDifference<.01||hueDifference>359.99}return onMounted(()=>{language.value=getLanguage()}),{disableTransitions,usePageSpecificTransitions,language,stageView,live2dDisableFocus,stageViewControlsEnabled,themeColorsHue,themeColorsHueDynamic,selectedAudioDevice,allowVisibleOnAllWorkspaces,setThemeColorsHue,applyPrimaryColorFrom,isColorSelectedForPrimary}}),useSettingsAudioDevice=defineStore(`settings-audio-devices`,()=>{let{audioInputs,deviceConstraints,selectedAudioInput:selectedAudioInputNonPersist,startStream,stopStream,stream,askPermission}=useAudioDevice$1(),selectedAudioInputPersist=useLocalStorage(`settings/audio/input`,selectedAudioInputNonPersist.value),selectedAudioInputEnabledPersist=useLocalStorage(`settings/audio/input-enabled`,!1);return watch(selectedAudioInputPersist,newValue=>{selectedAudioInputNonPersist.value=newValue}),watch(selectedAudioInputEnabledPersist,val=>{val?startStream():stopStream()}),onMounted(()=>{selectedAudioInputEnabledPersist.value&&selectedAudioInputPersist.value&&startStream(),selectedAudioInputNonPersist.value&&!selectedAudioInputEnabledPersist.value&&(selectedAudioInputPersist.value=selectedAudioInputNonPersist.value)}),{audioInputs,deviceConstraints,selectedAudioInput:selectedAudioInputPersist,enabled:selectedAudioInputEnabledPersist,stream,askPermission,startStream,stopStream}});var import_localforage=__toESM(require_localforage());const useVRM=defineStore(`vrm`,()=>{let indexedDbModelFile=ref(null);onMounted(async()=>{let file=await import_localforage.default.getItem(`assets-models-vrm`);file&&(indexedDbModelFile.value=file)});let modelFile=computed({get:()=>indexedDbModelFile.value,set:file=>{file?import_localforage.default.setItem(`assets-models-vrm`,file):import_localforage.default.removeItem(`assets-models-vrm`),indexedDbModelFile.value=file}}),defaultModelUrl=`/assets/vrm/models/AvatarSample-B/AvatarSample_B.vrm`,modelUrl=useLocalStorage(`settings/vrm/modelURL`,defaultModelUrl),scale$1=useLocalStorage(`settings/vrm/cameraScale`,1),modelSize=useLocalStorage(`settings/vrm/modelSize`,{x:0,y:0,z:0}),modelOrigin=useLocalStorage(`settings/vrm/modelOrigin`,{x:0,y:0,z:0}),modelOffset=useLocalStorage(`settings/vrm/modelOffset`,{x:0,y:0,z:0}),cameraFOV=useLocalStorage(`settings/vrm/cameraFOV`,40),cameraPosition=useLocalStorage(`settings/vrm/camera-position`,{x:0,y:0,z:-1}),modelRotationY=useLocalStorage(`settings/vrm/modelRotationY`,0),cameraDistance=useLocalStorage(`settings/vrm/cameraDistance`,0),isTracking=useLocalStorage(`settings/vrm/isTracking`,!1),trackingMode=useLocalStorage(`settings/vrm/trackingMode`,`none`),lookAtTarget=useLocalStorage(`settings/vrm/lookAtTarget`,{x:0,y:0,z:0}),eyeHeight=useLocalStorage(`settings/vrm/eyeHeight`,0);return{modelFile,modelUrl,modelSize,scale:scale$1,modelOrigin,modelOffset,cameraFOV,cameraPosition,modelRotationY,cameraDistance,isTracking,trackingMode,lookAtTarget,eyeHeight}});var onboarding_default=`/assets/onboarding-S2C4LIWw.avif`,ProviderAccountIdInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderAccountIdInput`,props:mergeModels({placeholder:{},required:{type:Boolean},label:{},description:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FieldInput_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,label:props.label||`Account ID`,description:props.description||`Account ID`,placeholder:props.placeholder,required:props.required,type:`text`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ProviderAccountIdInput_default=ProviderAccountIdInput_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$19=[`onClick`],_hoisted_2$10={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},_hoisted_3$7={"mt-4":``};var ProviderAdvancedSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderAdvancedSettings`,props:{title:{},initialVisible:{type:Boolean}},setup(__props){let props=__props,visible=ref(props.initialVisible||!1);function toggleVisible(){visible.value=!visible.value}return(_ctx,_cache$1)=>(openBlock(),createBlock(Collapsable_default,{"w-full":``},{trigger:withCtx(slotProps=>[createBaseVNode(`button`,{transition:`all ease-in-out duration-250`,"w-full":``,flex:``,"items-center":``,"gap-1.5":``,"outline-none":``,class:`[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0`,onClick:()=>slotProps.setVisible(!slotProps.visible)&&toggleVisible()},[createBaseVNode(`h2`,_hoisted_2$10,[createBaseVNode(`span`,null,toDisplayString(_ctx.title||`Advanced`),1)]),createBaseVNode(`div`,{transform:``,transition:`transform duration-250`,class:normalizeClass({"rotate-180":slotProps.visible})},_cache$1[0]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-down-linear":``},null,-1)],2)],8,_hoisted_1$19)]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$7,[renderSlot(_ctx.$slots,`default`)])]),_:3}))}}),ProviderAdvancedSettings_default=ProviderAdvancedSettings_vue_vue_type_script_setup_true_lang_default,ProviderApiKeyInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderApiKeyInput`,props:mergeModels({providerName:{},placeholder:{},required:{type:Boolean},label:{},description:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,{t:t$1}=useI18n(),modelValue=useModel(__props,`modelValue`),computedDescription=computed(()=>props.description||`API Key for ${props.providerName}`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FieldInput_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,label:_ctx.label||unref(t$1)(`settings.pages.providers.common.fields.field.api-key.label`),description:computedDescription.value,placeholder:_ctx.placeholder,required:_ctx.required,type:`password`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ProviderApiKeyInput_default=ProviderApiKeyInput_vue_vue_type_script_setup_true_lang_default,ProviderBaseUrlInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderBaseUrlInput`,props:mergeModels({placeholder:{},required:{type:Boolean},label:{},description:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FieldInput_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,label:props.label||`Base URL`,description:props.description||(props.required?`Base URL`:`Custom base URL (optional)`),placeholder:props.placeholder,required:props.required,type:`text`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ProviderBaseUrlInput_default=ProviderBaseUrlInput_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$18={flex:`~ col gap-6`},_hoisted_2$9={flex:`~ row`,"items-center":``,"justify-between":``},_hoisted_3$6={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},_hoisted_4$5={text:`neutral-400 dark:neutral-500`};var ProviderBasicSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderBasicSettings`,props:{title:{},description:{},onReset:{type:Function}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$18,[createBaseVNode(`div`,_hoisted_2$9,[createBaseVNode(`div`,null,[createBaseVNode(`h2`,_hoisted_3$6,toDisplayString(_ctx.title||`Basic`),1),createBaseVNode(`div`,_hoisted_4$5,[createBaseVNode(`span`,null,toDisplayString(_ctx.description||`Essential settings`),1)])]),_ctx.onReset?(openBlock(),createElementBlock(`button`,{key:0,title:`Reset settings`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-2":``,transition:`all duration-250 ease-in-out`,text:`neutral-500 dark:neutral-400`,bg:`transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700`,onClick:_cache$1[0]||=(...args)=>_ctx.onReset&&_ctx.onReset(...args)},_cache$1[1]||=[createBaseVNode(`div`,{"i-solar:refresh-bold-duotone":``,"text-xl":``},null,-1)])):createCommentVNode(``,!0)]),renderSlot(_ctx.$slots,`default`)]))}}),ProviderBasicSettings_default=ProviderBasicSettings_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$17={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-6`};var ProviderSettingsContainer_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderSettingsContainer`,setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$17,[renderSlot(_ctx.$slots,`default`)]))}}),ProviderSettingsContainer_default=ProviderSettingsContainer_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$16={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``};var ProviderSettingsLayout2_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderSettingsLayout2`,props:{providerName:{},providerIcon:{},providerIconColor:{},onBack:{type:Function}},setup(__props){return(_ctx,_cache$1)=>{let _directive_motion=resolveDirective(`motion`);return openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$16,[createBaseVNode(`div`,{text:`60`,class:normalizeClass(_ctx.providerIcon||_ctx.providerIconColor)},null,2)])),[[_directive_motion]])],64)}}}),ProviderSettingsLayout2_default=ProviderSettingsLayout2_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$15={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``};var ProviderSettingsLayout_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderSettingsLayout`,props:{providerName:{},providerIcon:{},providerIconColor:{},onBack:{type:Function}},setup(__props){return(_ctx,_cache$1)=>{let _directive_motion=resolveDirective(`motion`);return openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$15,[createBaseVNode(`div`,{text:`60`,class:normalizeClass(_ctx.providerIcon||_ctx.providerIconColor)},null,2)])),[[_directive_motion]])],64)}}}),ProviderSettingsLayout_default=ProviderSettingsLayout_vue_vue_type_script_setup_true_lang_default; +`,scale:`缩放`,x:`X轴偏移`,y:`Y 轴偏移`,z:`Z轴偏移`,fov:`视角调整(度)`,"rotation-y":`模型朝向(Y轴旋转)`,"camera-distance":`相机距离(画面缩放)`,"eye-tracking-mode":{title:`模型注视方向`,options:{option:{camera:`相机`,mouse:`鼠标`,disabled:`禁用`}}}},"switch-to-vrm":{title:`想切换至Live2D虚拟形象?`,"change-to-vrm":`切换至Live2D虚拟形象设定页面`},"theme-color-from-model":{"button-extract":{title:`提取`}}}},settings_default=data$3,data$2={chat:{message:{"character-name":{airi:`AIRI`,"core-system":`核心系统`,you:`你`}}},message:`说点什么...`,"select-a-audio-input":`选择一个音频输入设备`,"select-a-model":`选择一个模型`,"select-a-voice":`选择一个声线`,viewers:{"debug-menu":{emotions:`表情`,"emotions-btn":{angry:`😠 生气`,awkward:`😳 尴尬`,happy:`😄 开心`,neutral:`🙂 日常`,question:`🤔 疑问`,sad:`😫 难过`,surprised:`🤯 惊喜`,think:`🤨 思考`},vrm:{camera:`摄像机`,model:{title:`模型`}}}},waiting:`等待中`,operations:{"load-models":`加载模型`,"load-models-status":{loading:`模型加载中`,ready:`已就绪`}}},stage_default=data$2,data$1={"allow-visible-on-all-workspaces":{title:`跨桌面可见性`,description:`允许窗口在所有虚拟桌面中可见,仅限 macOS。`},pages:{modules:{"mcp-server":{description:`连接与管理 MCP 服务器和工具`,title:`MCP 服务器`}},themes:{sections:{section:{"window-shortcuts":{title:`键盘快捷键`}}},"window-shortcuts":{description:`修改窗口快捷方式`,title:`窗口快捷方式`,"toggle-move":{label:`切换移动状态`},"toggle-resize":{label:`调整大小`},"toggle-ignore-mouse-event":{label:`忽略鼠标事件`},"press-keys":`请按下按键...`}}}},settings_default$1=data$1,data={operations:{"load-models":`加载推理模型`,"load-models-status":{loading:`加载中`,ready:`已就绪`}}},stage_default$1=data,tamagotchi_default={stage:stage_default$1,settings:settings_default$1},zh_Hans_default={base:base_default,docs:docs_default,settings:settings_default,stage:stage_default,tamagotchi:tamagotchi_default},locales_default={en:en_default,"zh-Hans":zh_Hans_default};const languageRemap$1={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hans`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`},DEFAULT_THEME_COLORS_HUE=220.44,convert=converter_default(`oklch`),getHueFrom=color$2=>color$2?convert(color$2)?.h:DEFAULT_THEME_COLORS_HUE,useSettings=defineStore(`settings`,()=>{let selectedAudioDevice=ref(),language=useLocalStorage(`settings/language`,``),stageView=useLocalStorage(`settings/stage/view/model-renderer`,`2d`),stageViewControlsEnabled=ref(!1),live2dDisableFocus=useLocalStorage(`settings/live2d/disable-focus`,!1),disableTransitions=useLocalStorage(`settings/disable-transitions`,!0),usePageSpecificTransitions=useLocalStorage(`settings/use-page-specific-transitions`,!0),themeColorsHue=useLocalStorage(`settings/theme/colors/hue`,DEFAULT_THEME_COLORS_HUE),themeColorsHueDynamic=useLocalStorage(`settings/theme/colors/hue-dynamic`,!1),allowVisibleOnAllWorkspaces=useLocalStorage(`settings/allow-visible-on-all-workspaces`,!0);function getLanguage(){let language$1=localStorage.getItem(`settings/language`);language$1||=navigator.language||`en`;let languages=Object.keys(locales_default);return languageRemap$1[language$1||`en`]!=null&&(language$1=languageRemap$1[language$1||`en`]),language$1&&languages.includes(language$1)?language$1:`en`}function setThemeColorsHue(hue$2=DEFAULT_THEME_COLORS_HUE){themeColorsHue.value=hue$2,themeColorsHueDynamic.value=!1}function applyPrimaryColorFrom(color$2){setThemeColorsHue(getHueFrom(color$2))}function isColorSelectedForPrimary(hexColor){if(themeColorsHueDynamic.value)return!1;let h$1=getHueFrom(hexColor);if(!h$1)return!1;let hueDifference=Math.abs(h$1-themeColorsHue.value);return hueDifference<.01||hueDifference>359.99}return onMounted(()=>{language.value=getLanguage()}),{disableTransitions,usePageSpecificTransitions,language,stageView,live2dDisableFocus,stageViewControlsEnabled,themeColorsHue,themeColorsHueDynamic,selectedAudioDevice,allowVisibleOnAllWorkspaces,setThemeColorsHue,applyPrimaryColorFrom,isColorSelectedForPrimary}}),useSettingsAudioDevice=defineStore(`settings-audio-devices`,()=>{let{audioInputs,deviceConstraints,selectedAudioInput:selectedAudioInputNonPersist,startStream,stopStream,stream,askPermission}=useAudioDevice$1(),selectedAudioInputPersist=useLocalStorage(`settings/audio/input`,selectedAudioInputNonPersist.value),selectedAudioInputEnabledPersist=useLocalStorage(`settings/audio/input-enabled`,!1);return watch(selectedAudioInputPersist,newValue=>{selectedAudioInputNonPersist.value=newValue}),watch(selectedAudioInputEnabledPersist,val=>{val?startStream():stopStream()}),onMounted(()=>{selectedAudioInputEnabledPersist.value&&selectedAudioInputPersist.value&&startStream(),selectedAudioInputNonPersist.value&&!selectedAudioInputEnabledPersist.value&&(selectedAudioInputPersist.value=selectedAudioInputNonPersist.value)}),{audioInputs,deviceConstraints,selectedAudioInput:selectedAudioInputPersist,enabled:selectedAudioInputEnabledPersist,stream,askPermission,startStream,stopStream}});var import_localforage=__toESM(require_localforage());const useVRM=defineStore(`vrm`,()=>{let indexedDbModelFile=ref(null);onMounted(async()=>{let file=await import_localforage.default.getItem(`assets-models-vrm`);file&&(indexedDbModelFile.value=file)});let modelFile=computed({get:()=>indexedDbModelFile.value,set:file=>{file?import_localforage.default.setItem(`assets-models-vrm`,file):import_localforage.default.removeItem(`assets-models-vrm`),indexedDbModelFile.value=file}}),defaultModelUrl=`/assets/vrm/models/AvatarSample-B/AvatarSample_B.vrm`,modelUrl=useLocalStorage(`settings/vrm/modelURL`,defaultModelUrl),scale$1=useLocalStorage(`settings/vrm/cameraScale`,1),modelSize=useLocalStorage(`settings/vrm/modelSize`,{x:0,y:0,z:0}),modelOrigin=useLocalStorage(`settings/vrm/modelOrigin`,{x:0,y:0,z:0}),modelOffset=useLocalStorage(`settings/vrm/modelOffset`,{x:0,y:0,z:0}),modelRotationY=useLocalStorage(`settings/vrm/modelRotationY`,0),cameraFOV=useLocalStorage(`settings/vrm/cameraFOV`,40),cameraPosition=useLocalStorage(`settings/vrm/camera-position`,{x:0,y:0,z:-1}),cameraDistance=useLocalStorage(`settings/vrm/cameraDistance`,0),directionalLightPosition=useLocalStorage(`settings/vrm/scenes/scene/directional-light/position`,{x:1,y:1,z:-10}),directionalLightTarget=useLocalStorage(`settings/vrm/scenes/scene/directional-light/target`,{x:0,y:0,z:0}),directionalLightRotation=useLocalStorage(`settings/vrm/scenes/scene/directional-light/rotation`,{x:0,y:0,z:0}),directionalLightIntensity=useLocalStorage(`settings/vrm/scenes/scene/directional-light/intensity`,1.8),directionalLightColor=useLocalStorage(`settings/vrm/scenes/scene/directional-light/color`,16777215),hemisphereLightPosition=useLocalStorage(`settings/vrm/scenes/scene/hemisphere-light/position`,{x:0,y:1,z:0}),hemisphereSkyColor=useLocalStorage(`settings/vrm/scenes/scene/hemisphere-light/sky-color`,16777215),hemisphereGroundColor=useLocalStorage(`settings/vrm/scenes/scene/hemisphere-light/ground-color`,0),hemisphereLightIntensity=useLocalStorage(`settings/vrm/scenes/scene/hemisphere-light/intensity`,1),ambientLightIntensity=useLocalStorage(`settings/vrm/scenes/scene/ambient-light/intensity`,2.3),ambientLightColor=useLocalStorage(`settings/vrm/scenes/scene/ambient-light/color`,16777215),lookAtTarget=useLocalStorage(`settings/vrm/lookAtTarget`,{x:0,y:0,z:0}),isTracking=useLocalStorage(`settings/vrm/isTracking`,!1),trackingMode=useLocalStorage(`settings/vrm/trackingMode`,`none`),eyeHeight=useLocalStorage(`settings/vrm/eyeHeight`,0);return{modelFile,modelUrl,modelSize,scale:scale$1,modelOrigin,modelOffset,modelRotationY,cameraFOV,cameraPosition,cameraDistance,directionalLightPosition,directionalLightTarget,directionalLightRotation,directionalLightIntensity,directionalLightColor,ambientLightIntensity,ambientLightColor,hemisphereLightPosition,hemisphereSkyColor,hemisphereGroundColor,hemisphereLightIntensity,lookAtTarget,isTracking,trackingMode,eyeHeight}});var onboarding_default=`/assets/onboarding-S2C4LIWw.avif`,ProviderAccountIdInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderAccountIdInput`,props:mergeModels({placeholder:{},required:{type:Boolean},label:{},description:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FieldInput_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,label:props.label||`Account ID`,description:props.description||`Account ID`,placeholder:props.placeholder,required:props.required,type:`text`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ProviderAccountIdInput_default=ProviderAccountIdInput_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$19=[`onClick`],_hoisted_2$10={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},_hoisted_3$7={"mt-4":``};var ProviderAdvancedSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderAdvancedSettings`,props:{title:{},initialVisible:{type:Boolean}},setup(__props){let props=__props,visible=ref(props.initialVisible||!1);function toggleVisible(){visible.value=!visible.value}return(_ctx,_cache$1)=>(openBlock(),createBlock(Collapsable_default,{"w-full":``},{trigger:withCtx(slotProps=>[createBaseVNode(`button`,{transition:`all ease-in-out duration-250`,"w-full":``,flex:``,"items-center":``,"gap-1.5":``,"outline-none":``,class:`[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0`,onClick:()=>slotProps.setVisible(!slotProps.visible)&&toggleVisible()},[createBaseVNode(`h2`,_hoisted_2$10,[createBaseVNode(`span`,null,toDisplayString(_ctx.title||`Advanced`),1)]),createBaseVNode(`div`,{transform:``,transition:`transform duration-250`,class:normalizeClass({"rotate-180":slotProps.visible})},_cache$1[0]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-down-linear":``},null,-1)],2)],8,_hoisted_1$19)]),default:withCtx(()=>[createBaseVNode(`div`,_hoisted_3$7,[renderSlot(_ctx.$slots,`default`)])]),_:3}))}}),ProviderAdvancedSettings_default=ProviderAdvancedSettings_vue_vue_type_script_setup_true_lang_default,ProviderApiKeyInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderApiKeyInput`,props:mergeModels({providerName:{},placeholder:{},required:{type:Boolean},label:{},description:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,{t:t$1}=useI18n(),modelValue=useModel(__props,`modelValue`),computedDescription=computed(()=>props.description||`API Key for ${props.providerName}`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FieldInput_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,label:_ctx.label||unref(t$1)(`settings.pages.providers.common.fields.field.api-key.label`),description:computedDescription.value,placeholder:_ctx.placeholder,required:_ctx.required,type:`password`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ProviderApiKeyInput_default=ProviderApiKeyInput_vue_vue_type_script_setup_true_lang_default,ProviderBaseUrlInput_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderBaseUrlInput`,props:mergeModels({placeholder:{},required:{type:Boolean},label:{},description:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props){let props=__props,modelValue=useModel(__props,`modelValue`);return(_ctx,_cache$1)=>(openBlock(),createBlock(unref(FieldInput_default),{modelValue:modelValue.value,"onUpdate:modelValue":_cache$1[0]||=$event=>modelValue.value=$event,label:props.label||`Base URL`,description:props.description||(props.required?`Base URL`:`Custom base URL (optional)`),placeholder:props.placeholder,required:props.required,type:`text`},null,8,[`modelValue`,`label`,`description`,`placeholder`,`required`]))}}),ProviderBaseUrlInput_default=ProviderBaseUrlInput_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$18={flex:`~ col gap-6`},_hoisted_2$9={flex:`~ row`,"items-center":``,"justify-between":``},_hoisted_3$6={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},_hoisted_4$5={text:`neutral-400 dark:neutral-500`};var ProviderBasicSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderBasicSettings`,props:{title:{},description:{},onReset:{type:Function}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$18,[createBaseVNode(`div`,_hoisted_2$9,[createBaseVNode(`div`,null,[createBaseVNode(`h2`,_hoisted_3$6,toDisplayString(_ctx.title||`Basic`),1),createBaseVNode(`div`,_hoisted_4$5,[createBaseVNode(`span`,null,toDisplayString(_ctx.description||`Essential settings`),1)])]),_ctx.onReset?(openBlock(),createElementBlock(`button`,{key:0,title:`Reset settings`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-2":``,transition:`all duration-250 ease-in-out`,text:`neutral-500 dark:neutral-400`,bg:`transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700`,onClick:_cache$1[0]||=(...args)=>_ctx.onReset&&_ctx.onReset(...args)},_cache$1[1]||=[createBaseVNode(`div`,{"i-solar:refresh-bold-duotone":``,"text-xl":``},null,-1)])):createCommentVNode(``,!0)]),renderSlot(_ctx.$slots,`default`)]))}}),ProviderBasicSettings_default=ProviderBasicSettings_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$17={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-6`};var ProviderSettingsContainer_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderSettingsContainer`,setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$17,[renderSlot(_ctx.$slots,`default`)]))}}),ProviderSettingsContainer_default=ProviderSettingsContainer_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$16={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``};var ProviderSettingsLayout2_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderSettingsLayout2`,props:{providerName:{},providerIcon:{},providerIconColor:{},onBack:{type:Function}},setup(__props){return(_ctx,_cache$1)=>{let _directive_motion=resolveDirective(`motion`);return openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$16,[createBaseVNode(`div`,{text:`60`,class:normalizeClass(_ctx.providerIcon||_ctx.providerIconColor)},null,2)])),[[_directive_motion]])],64)}}}),ProviderSettingsLayout2_default=ProviderSettingsLayout2_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$15={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``};var ProviderSettingsLayout_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ProviderSettingsLayout`,props:{providerName:{},providerIcon:{},providerIconColor:{},onBack:{type:Function}},setup(__props){return(_ctx,_cache$1)=>{let _directive_motion=resolveDirective(`motion`);return openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$15,[createBaseVNode(`div`,{text:`60`,class:normalizeClass(_ctx.providerIcon||_ctx.providerIconColor)},null,2)])),[[_directive_motion]])],64)}}}),ProviderSettingsLayout_default=ProviderSettingsLayout_vue_vue_type_script_setup_true_lang_default; /** * anime.js - ESM * @version v4.1.2 @@ -5082,4 +5082,4 @@ Coordinate axes are visualised. * @copyright (c) 2025 Julian Garnier * @see https://animejs.com */ -const isBrowser=typeof window<`u`,win=isBrowser?window:null,doc=isBrowser?document:null,tweenTypes={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},valueTypes={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},tickModes={NONE:0,AUTO:1,FORCE:2},compositionTypes={replace:0,none:1,blend:2},isRegisteredTargetSymbol=Symbol(),isDomSymbol=Symbol(),isSvgSymbol=Symbol(),transformsSymbol=Symbol(),morphPointsSymbol=Symbol(),proxyTargetSymbol=Symbol(),minValue=1e-11,maxValue=1e12,K=1e3,maxFps=120,emptyString=``,shortTransforms=(()=>{let map=new Map;return map.set(`x`,`translateX`),map.set(`y`,`translateY`),map.set(`z`,`translateZ`),map})(),validTransforms=[`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`,`perspective`,`matrix`,`matrix3d`],transformsFragmentStrings=validTransforms.reduce((a$1,v)=>({...a$1,[v]:v+`(`}),{}),noop=()=>{},hexTestRgx=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,rgbExecRgx=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,rgbaExecRgx=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,hslExecRgx=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,hslaExecRgx=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,digitWithExponentRgx=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,unitsExecRgx=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,lowerCaseRgx=/([a-z])([A-Z])/g,transformsExecRgx=/(\w+)(\([^)]+\)+)/g,defaults={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:maxFps,loop:0,reversed:!1,alternate:!1,autoplay:!0,duration:K,delay:0,loopDelay:0,ease:`out(2)`,composition:compositionTypes.replace,modifier:v=>v,onBegin:noop,onBeforeUpdate:noop,onUpdate:noop,onLoop:noop,onPause:noop,onComplete:noop,onRender:noop},scope={current:null,root:doc},globals={defaults,precision:4,timeScale:1,tickThreshold:200},globalVersions={version:`4.1.2`,engine:null};isBrowser&&(win.AnimeJS||=[],win.AnimeJS.push(globalVersions));const toLowerCase=str=>str.replace(lowerCaseRgx,`$1-$2`).toLowerCase(),stringStartsWith=(str,sub)=>str.indexOf(sub)===0,now=Date.now,isArr=Array.isArray,isObj=a$1=>a$1&&a$1.constructor===Object,isNum=a$1=>typeof a$1==`number`&&!isNaN(a$1),isStr=a$1=>typeof a$1==`string`,isFnc=a$1=>typeof a$1==`function`,isUnd=a$1=>a$1===void 0,isNil=a$1=>isUnd(a$1)||a$1===null,isSvg=a$1=>isBrowser&&a$1 instanceof SVGElement,isHex=a$1=>hexTestRgx.test(a$1),isRgb=a$1=>stringStartsWith(a$1,`rgb`),isHsl=a$1=>stringStartsWith(a$1,`hsl`),isCol=a$1=>isHex(a$1)||isRgb(a$1)||isHsl(a$1),isKey=a$1=>!globals.defaults.hasOwnProperty(a$1),parseNumber=str=>isStr(str)?parseFloat(str):str,pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,abs=Math.abs,ceil=Math.ceil,floor=Math.floor,asin=Math.asin,PI=Math.PI,_round=Math.round,clamp=(v,min$1,max$1)=>vmax$1?max$1:v,powCache={},round=(v,decimalLength)=>{if(decimalLength<0)return v;if(!decimalLength)return _round(v);let p$4=powCache[decimalLength];return p$4||=powCache[decimalLength]=10**decimalLength,_round(v*p$4)/p$4},snap=(v,increment$1)=>isArr(increment$1)?increment$1.reduce((closest,cv)=>abs(cv-v)start+(end-start)*progress$1,random=(min$1,max$1,decimalLength)=>{let m=10**(decimalLength||0);return floor((Math.random()*(max$1-min$1+1/m)+min$1)*m)/m},shuffle=items=>{let m=items.length,t$1,i;for(;m;)i=random(0,--m),t$1=items[m],items[m]=items[i],items[i]=t$1;return items},clampInfinity=v=>v===1/0?maxValue:v===-1/0?-1e12:v,normalizeTime=v=>v<=minValue?minValue:clampInfinity(round(v,11)),cloneArray=a$1=>isArr(a$1)?[...a$1]:a$1,mergeObjects=(o1,o2)=>{let merged={...o1};for(let p$4 in o2){let o1p=o1[p$4];merged[p$4]=isUnd(o1p)?o2[p$4]:o1p}return merged},forEachChildren=(parent,callback,reverse,prevProp=`_prev`,nextProp=`_next`)=>{let next=parent._head,adjustedNextProp=nextProp;for(reverse&&(next=parent._tail,adjustedNextProp=prevProp);next;){let currentNext=next[adjustedNextProp];callback(next),next=currentNext}},removeChild=(parent,child,prevProp=`_prev`,nextProp=`_next`)=>{let prev=child[prevProp],next=child[nextProp];prev?prev[nextProp]=next:parent._head=next,next?next[prevProp]=prev:parent._tail=prev,child[prevProp]=null,child[nextProp]=null},addChild=(parent,child,sortMethod,prevProp=`_prev`,nextProp=`_next`)=>{let prev=parent._tail;for(;prev&&sortMethod&&sortMethod(prev,child);)prev=prev[prevProp];let next=prev?prev[nextProp]:parent._head;prev?prev[nextProp]=child:parent._head=child,next?next[prevProp]=child:parent._tail=child,child[prevProp]=prev,child[nextProp]=next},createRefreshable=constructor=>{let tracked;return(...args)=>{let currentIteration,currentIterationProgress,reversed,alternate;tracked&&(currentIteration=tracked.currentIteration,currentIterationProgress=tracked.iterationProgress,reversed=tracked.reversed,alternate=tracked._alternate,tracked.revert());let cleanup=constructor(...args);return cleanup&&!isFnc(cleanup)&&cleanup.revert&&(tracked=cleanup),isUnd(currentIterationProgress)||(tracked.currentIteration=currentIteration,tracked.iterationProgress=(alternate&¤tIteration%2?!reversed:reversed)?1-currentIterationProgress:currentIterationProgress),cleanup||noop}};var Clock=class{constructor(initTime=0){this.deltaTime=0,this._currentTime=initTime,this._elapsedTime=initTime,this._startTime=initTime,this._lastTime=initTime,this._scheduledTime=0,this._frameDuration=round(K/maxFps,0),this._fps=maxFps,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(frameRate){let previousFrameDuration=this._frameDuration,fr=+frameRate,fps=fr{let parent=tickable.parent,duration$2=tickable.duration,completed=tickable.completed,iterationDuration=tickable.iterationDuration,iterationCount=tickable.iterationCount,_currentIteration=tickable._currentIteration,_loopDelay=tickable._loopDelay,_reversed=tickable._reversed,_alternate=tickable._alternate,_hasChildren=tickable._hasChildren,tickableDelay=tickable._delay,tickablePrevAbsoluteTime=tickable._currentTime,tickableEndTime=tickableDelay+iterationDuration,tickableAbsoluteTime=time$2-tickableDelay,tickablePrevTime=clamp(tickablePrevAbsoluteTime,-tickableDelay,duration$2),tickableCurrentTime=clamp(tickableAbsoluteTime,-tickableDelay,duration$2),deltaTime=tickableAbsoluteTime-tickablePrevAbsoluteTime,isCurrentTimeAboveZero=tickableCurrentTime>0,isCurrentTimeEqualOrAboveDuration=tickableCurrentTime>=duration$2,isSetter=duration$2<=minValue,forcedTick=tickMode===tickModes.FORCE,isOdd=0,iterationElapsedTime=tickableAbsoluteTime,hasRendered=0;if(iterationCount>1){let currentIteration=~~(tickableCurrentTime/(iterationDuration+(isCurrentTimeEqualOrAboveDuration?0:_loopDelay)));tickable._currentIteration=clamp(currentIteration,0,iterationCount),isCurrentTimeEqualOrAboveDuration&&tickable._currentIteration--,isOdd=tickable._currentIteration%2,iterationElapsedTime=tickableCurrentTime%(iterationDuration+_loopDelay)||0}let isReversed=_reversed^(_alternate&&isOdd),_ease=tickable._ease,iterationTime=isCurrentTimeEqualOrAboveDuration?isReversed?0:duration$2:isReversed?iterationDuration-iterationElapsedTime:iterationElapsedTime;_ease&&(iterationTime=iterationDuration*_ease(iterationTime/iterationDuration)||0);let isRunningBackwards=(parent?parent.backwards:tickableAbsoluteTime=tickableDelay&&time$2<=tickableEndTime||time$2<=tickableDelay&&tickablePrevTime>tickableDelay||time$2>=tickableEndTime&&tickablePrevTime!==duration$2)||iterationTime>=tickableEndTime&&tickablePrevTime!==duration$2||iterationTime<=tickableDelay&&tickablePrevTime>0||time$2<=tickablePrevTime&&tickablePrevTime===duration$2&&completed||isCurrentTimeEqualOrAboveDuration&&!completed&&isSetter){if(isCurrentTimeAboveZero&&(tickable.computeDeltaTime(tickablePrevTime),muteCallbacks||tickable.onBeforeUpdate(tickable)),!_hasChildren){let forcedRender=forcedTick||(isRunningBackwards?deltaTime*-1:deltaTime)>=globals.tickThreshold,absoluteTime=tickable._offset+(parent?parent._offset:0)+tickableDelay+iterationTime,tween=tickable._head,tweenTarget,tweenStyle,tweenTargetTransforms,tweenTargetTransformsProperties,tweenTransformsNeedUpdate=0;for(;tween;){let tweenComposition=tween._composition,tweenCurrentTime=tween._currentTime,tweenChangeDuration=tween._changeDuration,tweenAbsEndTime=tween._absoluteStartTime+tween._changeDuration,tweenNextRep=tween._nextRep,tweenPrevRep=tween._prevRep,tweenHasComposition=tweenComposition!==compositionTypes.none;if((forcedRender||(tweenCurrentTime!==tweenChangeDuration||absoluteTime<=tweenAbsEndTime+(tweenNextRep?tweenNextRep._delay:0))&&(tweenCurrentTime!==0||absoluteTime>=tween._absoluteStartTime))&&(!tweenHasComposition||!tween._isOverridden&&(!tween._isOverlapped||absoluteTime<=tweenAbsEndTime)&&(!tweenNextRep||tweenNextRep._isOverridden||absoluteTime<=tweenNextRep._absoluteStartTime)&&(!tweenPrevRep||tweenPrevRep._isOverridden||absoluteTime>=tweenPrevRep._absoluteStartTime+tweenPrevRep._changeDuration+tween._delay))){let tweenNewTime=tween._currentTime=clamp(iterationTime-tween._startTime,0,tweenChangeDuration),tweenProgress=tween._ease(tweenNewTime/tween._updateDuration),tweenModifier=tween._modifier,tweenValueType=tween._valueType,tweenType=tween._tweenType,tweenIsObject=tweenType===tweenTypes.OBJECT,tweenIsNumber=tweenValueType===valueTypes.NUMBER,tweenPrecision=tweenIsNumber&&tweenIsObject||tweenProgress===0||tweenProgress===1?-1:globals.precision,value$1,number$5;if(tweenIsNumber)value$1=number$5=tweenModifier(round(interpolate(tween._fromNumber,tween._toNumber,tweenProgress),tweenPrecision));else if(tweenValueType===valueTypes.UNIT)number$5=tweenModifier(round(interpolate(tween._fromNumber,tween._toNumber,tweenProgress),tweenPrecision)),value$1=`${number$5}${tween._unit}`;else if(tweenValueType===valueTypes.COLOR){let fn$5=tween._fromNumbers,tn$1=tween._toNumbers,r$1=round(clamp(tweenModifier(interpolate(fn$5[0],tn$1[0],tweenProgress)),0,255),0),g=round(clamp(tweenModifier(interpolate(fn$5[1],tn$1[1],tweenProgress)),0,255),0),b$1=round(clamp(tweenModifier(interpolate(fn$5[2],tn$1[2],tweenProgress)),0,255),0),a$1=clamp(tweenModifier(round(interpolate(fn$5[3],tn$1[3],tweenProgress),tweenPrecision)),0,1);if(value$1=`rgba(${r$1},${g},${b$1},${a$1})`,tweenHasComposition){let ns=tween._numbers;ns[0]=r$1,ns[1]=g,ns[2]=b$1,ns[3]=a$1}}else if(tweenValueType===valueTypes.COMPLEX){value$1=tween._strings[0];for(let j$1=0,l=tween._toNumbers.length;j$1=duration$2&&!completed||isRunningBackwards&&tickableAbsoluteTime<=minValue&&completed)&&(tickable.onComplete(tickable),tickable.completed=!isRunningBackwards):isCurrentTimeAboveZero&&isCurrentTimeEqualOrAboveDuration?iterationCount===1/0?tickable._startTime+=tickable.duration:tickable._currentIteration>=iterationCount-1&&(tickable.paused=!0,!completed&&!_hasChildren&&(tickable.completed=!0,!muteCallbacks&&!(parent&&(isRunningBackwards||!parent.began))&&(tickable.onComplete(tickable),tickable._resolve(tickable)))):tickable.completed=!1,hasRendered},tick=(tickable,time$2,muteCallbacks,internalRender,tickMode)=>{let _currentIteration=tickable._currentIteration;if(render(tickable,time$2,muteCallbacks,internalRender,tickMode),tickable._hasChildren){let tl=tickable,tlIsRunningBackwards=tl.backwards,tlChildrenTime=internalRender?time$2:tl._iterationTime,tlCildrenTickTime=now(),tlChildrenHasRendered=0,tlChildrenHaveCompleted=!0;if(!internalRender&&tl._currentIteration!==_currentIteration){let tlIterationDuration=tl.iterationDuration;forEachChildren(tl,child=>{if(!tlIsRunningBackwards)!child.completed&&!child.backwards&&child._currentTime{let childTime=round((tlChildrenTime-child._offset)*child._speed,12),childTickMode=child._fps=tl.duration&&(tl.paused=!0,tl.completed||(tl.completed=!0,muteCallbacks||(tl.onComplete(tl),tl._resolve(tl))))}},additive={animation:null,update:noop},addAdditiveAnimation=lookups$1=>{let animation=additive.animation;return animation||(animation={duration:minValue,computeDeltaTime:noop,_offset:0,_delay:0,_head:null,_tail:null},additive.animation=animation,additive.update=()=>{lookups$1.forEach(propertyAnimation=>{for(let propertyName in propertyAnimation){let tweens=propertyAnimation[propertyName],lookupTween=tweens._head;if(lookupTween){let valueType=lookupTween._valueType,additiveValues=valueType===valueTypes.COMPLEX||valueType===valueTypes.COLOR?cloneArray(lookupTween._fromNumbers):null,additiveValue=lookupTween._fromNumber,tween=tweens._tail;for(;tween&&tween!==lookupTween;){if(additiveValues)for(let i=0,l=tween._numbers.length;iisBrowser?requestAnimationFrame:setImmediate)(),engineCancelMethod=(()=>isBrowser?cancelAnimationFrame:clearImmediate)();var Engine=class extends Clock{constructor(initTime){super(initTime),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=defaults,this.paused=!!(isBrowser&&doc.hidden),this.reqId=null}update(){let time$2=this._currentTime=now();if(this.requestTick(time$2)){this.computeDeltaTime(time$2);let engineSpeed=this._speed,engineFps=this._fps,activeTickable=this._head;for(;activeTickable;){let nextTickable=activeTickable._next;activeTickable.paused?(removeChild(this,activeTickable),this._hasChildren=!!this._tail,activeTickable._running=!1,activeTickable.completed&&!activeTickable._cancelled&&activeTickable.cancel()):tick(activeTickable,(time$2-activeTickable._startTime)*activeTickable._speed*engineSpeed,0,0,activeTickable._fpschild.resetTime()),this.wake()}get speed(){return this._speed*(globals.timeScale===1?1:K)}set speed(playbackRate){this._speed=playbackRate*globals.timeScale,forEachChildren(this,child=>child.speed=child._speed)}get timeUnit(){return globals.timeScale===1?`ms`:`s`}set timeUnit(unit){let secondsScale=.001,isSecond=unit===`s`,newScale=isSecond?secondsScale:1;if(globals.timeScale!==newScale){globals.timeScale=newScale,globals.tickThreshold=200*newScale;let scaleFactor=isSecond?secondsScale:K;this.defaults.duration*=scaleFactor,this._speed*=scaleFactor}}get precision(){return globals.precision}set precision(precision){globals.precision=precision}};const engine=(()=>{let engine$1=new Engine(now());return isBrowser&&(globalVersions.engine=engine$1,doc.addEventListener(`visibilitychange`,()=>{engine$1.pauseOnDocumentHidden&&(doc.hidden?engine$1.pause():engine$1.resume())})),engine$1})(),tickEngine=()=>{engine._head?(engine.reqId=engineTickMethod(tickEngine),engine.update()):engine.reqId=0},killEngine=()=>(engineCancelMethod(engine.reqId),engine.reqId=0,engine),parseInlineTransforms=(target$1,propName,animationInlineStyles)=>{let inlineTransforms=target$1.style.transform,inlinedStylesPropertyValue;if(inlineTransforms){let cachedTransforms=target$1[transformsSymbol],t$1;for(;t$1=transformsExecRgx.exec(inlineTransforms);){let inlinePropertyName=t$1[1],inlinePropertyValue=t$1[2].slice(1,-1);cachedTransforms[inlinePropertyName]=inlinePropertyValue,inlinePropertyName===propName&&(inlinedStylesPropertyValue=inlinePropertyValue,animationInlineStyles&&(animationInlineStyles[propName]=inlinePropertyValue))}}return inlineTransforms&&!isUnd(inlinedStylesPropertyValue)?inlinedStylesPropertyValue:stringStartsWith(propName,`scale`)?`1`:stringStartsWith(propName,`rotate`)||stringStartsWith(propName,`skew`)?`0deg`:`0px`};function getNodeList(v){let n=isStr(v)?scope.root.querySelectorAll(v):v;if(n instanceof NodeList||n instanceof HTMLCollection)return n}function parseTargets(targets){if(isNil(targets))return[];if(isArr(targets)){let flattened=targets.flat(1/0),parsed=[];for(let i=0,l=flattened.length;i{if(cssReservedProperties.includes(propertyName))return!1;if(el.getAttribute(propertyName)||propertyName in el){if(propertyName===`scale`){let elParentNode=el.parentNode;return elParentNode&&elParentNode.tagName===`filter`}return!0}},rgbToRgba=rgbValue=>{let rgba$1=rgbExecRgx.exec(rgbValue)||rgbaExecRgx.exec(rgbValue),a$1=isUnd(rgba$1[4])?1:+rgba$1[4];return[+rgba$1[1],+rgba$1[2],+rgba$1[3],a$1]},hexToRgba=hexValue=>{let hexLength=hexValue.length,isShort=hexLength===4||hexLength===5;return[+(`0x`+hexValue[1]+hexValue[isShort?1:2]),+(`0x`+hexValue[isShort?2:3]+hexValue[isShort?2:4]),+(`0x`+hexValue[isShort?3:5]+hexValue[isShort?3:6]),hexLength===5||hexLength===9?+((`0x`+hexValue[isShort?4:7]+hexValue[isShort?4:8])/255).toFixed(3):1]},hue2rgb=(p$4,q,t$1)=>(t$1<0&&(t$1+=1),t$1>1&&--t$1,t$1<1/6?p$4+(q-p$4)*6*t$1:t$1<1/2?q:t$1<2/3?p$4+(q-p$4)*(2/3-t$1)*6:p$4),hslToRgba=hslValue=>{let hsla$1=hslExecRgx.exec(hslValue)||hslaExecRgx.exec(hslValue),h$1=hsla$1[1]/360,s=hsla$1[2]/100,l=hsla$1[3]/100,a$1=isUnd(hsla$1[4])?1:+hsla$1[4],r$1,g,b$1;if(s===0)r$1=g=b$1=l;else{let q=l<.5?l*(1+s):l+s-l*s,p$4=2*l-q;r$1=round(hue2rgb(p$4,q,h$1+1/3)*255,0),g=round(hue2rgb(p$4,q,h$1)*255,0),b$1=round(hue2rgb(p$4,q,h$1-1/3)*255,0)}return[r$1,g,b$1,a$1]},convertColorStringValuesToRgbaArray=colorString=>isRgb(colorString)?rgbToRgba(colorString):isHex(colorString)?hexToRgba(colorString):isHsl(colorString)?hslToRgba(colorString):[0,0,0,1],setValue=(targetValue,defaultValue)=>isUnd(targetValue)?defaultValue:targetValue,getFunctionValue=(value$1,target$1,index$1,total,store)=>{if(isFnc(value$1)){let func=()=>{let computed$2=value$1(target$1,index$1,total);return isNaN(+computed$2)?computed$2||0:+computed$2};return store&&(store.func=func),func()}else return value$1},getTweenType=(target$1,prop)=>target$1[isDomSymbol]?target$1[isSvgSymbol]&&isValidSVGAttribute(target$1,prop)?tweenTypes.ATTRIBUTE:validTransforms.includes(prop)||shortTransforms.get(prop)?tweenTypes.TRANSFORM:stringStartsWith(prop,`--`)?tweenTypes.CSS_VAR:prop in target$1.style?tweenTypes.CSS:prop in target$1?tweenTypes.OBJECT:tweenTypes.ATTRIBUTE:tweenTypes.OBJECT,getCSSValue=(target$1,propName,animationInlineStyles)=>{let inlineStyles=target$1.style[propName];inlineStyles&&animationInlineStyles&&(animationInlineStyles[propName]=inlineStyles);let value$1=inlineStyles||getComputedStyle(target$1[proxyTargetSymbol]||target$1).getPropertyValue(propName);return value$1===`auto`?`0`:value$1},getOriginalAnimatableValue=(target$1,propName,tweenType,animationInlineStyles)=>{let type=isUnd(tweenType)?getTweenType(target$1,propName):tweenType;return type===tweenTypes.OBJECT?target$1[propName]||0:type===tweenTypes.ATTRIBUTE?target$1.getAttribute(propName):type===tweenTypes.TRANSFORM?parseInlineTransforms(target$1,propName,animationInlineStyles):type===tweenTypes.CSS_VAR?getCSSValue(target$1,propName,animationInlineStyles).trimStart():getCSSValue(target$1,propName,animationInlineStyles)},getRelativeValue=(x$1,y,operator)=>operator===`-`?x$1-y:operator===`+`?x$1+y:x$1*y,createDecomposedValueTargetObject=()=>({t:valueTypes.NUMBER,n:0,u:null,o:null,d:null,s:null}),decomposeRawValue=(rawValue,targetObject)=>{if(targetObject.t=valueTypes.NUMBER,targetObject.n=0,targetObject.u=null,targetObject.o=null,targetObject.d=null,targetObject.s=null,!rawValue)return targetObject;let num$2=+rawValue;if(isNaN(num$2)){let str=rawValue;str[1]===`=`&&(targetObject.o=str[0],str=str.slice(2));let unitMatch=str.includes(` `)?!1:unitsExecRgx.exec(str);if(unitMatch)return targetObject.t=valueTypes.UNIT,targetObject.n=+unitMatch[1],targetObject.u=unitMatch[2],targetObject;if(targetObject.o)return targetObject.n=+str,targetObject;if(isCol(str))return targetObject.t=valueTypes.COLOR,targetObject.d=convertColorStringValuesToRgbaArray(str),targetObject;{let matchedNumbers=str.match(digitWithExponentRgx);return targetObject.t=valueTypes.COMPLEX,targetObject.d=matchedNumbers?matchedNumbers.map(Number):[],targetObject.s=str.split(digitWithExponentRgx)||[],targetObject}}else return targetObject.n=num$2,targetObject},decomposeTweenValue=(tween,targetObject)=>(targetObject.t=tween._valueType,targetObject.n=tween._toNumber,targetObject.u=tween._unit,targetObject.o=null,targetObject.d=cloneArray(tween._toNumbers),targetObject.s=cloneArray(tween._strings),targetObject),decomposedOriginalValue=createDecomposedValueTargetObject(),lookups={_rep:new WeakMap,_add:new Map},getTweenSiblings=(target$1,property,lookup=`_rep`)=>{let lookupMap=lookups[lookup],targetLookup=lookupMap.get(target$1);return targetLookup||(targetLookup={},lookupMap.set(target$1,targetLookup)),targetLookup[property]?targetLookup[property]:targetLookup[property]={_head:null,_tail:null}},addTweenSortMethod=(p$4,c$3)=>p$4._isOverridden||p$4._absoluteStartTime>c$3._absoluteStartTime,overrideTween=tween=>{tween._isOverlapped=1,tween._isOverridden=1,tween._changeDuration=minValue,tween._currentTime=minValue},composeTween=(tween,siblings$2)=>{let tweenCompositionType=tween._composition;if(tweenCompositionType===compositionTypes.replace){let tweenAbsStartTime=tween._absoluteStartTime;addChild(siblings$2,tween,addTweenSortMethod,`_prevRep`,`_nextRep`);let prevSibling=tween._prevRep;if(prevSibling){let prevParent=prevSibling.parent,prevAbsEndTime=prevSibling._absoluteStartTime+prevSibling._changeDuration;if(tween.parent.id!==prevParent.id&&prevParent.iterationCount>1&&prevAbsEndTime+(prevParent.duration-prevParent.iterationDuration)>tweenAbsStartTime){overrideTween(prevSibling);let prevPrevSibling=prevSibling._prevRep;for(;prevPrevSibling&&prevPrevSibling.parent.id===prevParent.id;)overrideTween(prevPrevSibling),prevPrevSibling=prevPrevSibling._prevRep}let absoluteUpdateStartTime=tweenAbsStartTime-tween._delay;if(prevAbsEndTime>absoluteUpdateStartTime){let prevChangeStartTime=prevSibling._startTime,prevTLOffset=prevAbsEndTime-(prevChangeStartTime+prevSibling._updateDuration);prevSibling._changeDuration=absoluteUpdateStartTime-prevTLOffset-prevChangeStartTime,prevSibling._currentTime=prevSibling._changeDuration,prevSibling._isOverlapped=1,prevSibling._changeDuration{t$1._isOverlapped||(pausePrevParentAnimation=!1)}),pausePrevParentAnimation){let prevParentTL=prevParent.parent;if(prevParentTL){let pausePrevParentTL=!0;forEachChildren(prevParentTL,a$1=>{a$1!==prevParent&&forEachChildren(a$1,t$1=>{t$1._isOverlapped||(pausePrevParentTL=!1)})}),pausePrevParentTL&&prevParentTL.cancel()}else prevParent.cancel()}}}else if(tweenCompositionType===compositionTypes.blend){let additiveTweenSiblings=getTweenSiblings(tween.target,tween.property,`_add`),additiveAnimation=addAdditiveAnimation(lookups._add),lookupTween=additiveTweenSiblings._head;lookupTween||(lookupTween={...tween},lookupTween._composition=compositionTypes.replace,lookupTween._updateDuration=minValue,lookupTween._startTime=0,lookupTween._numbers=cloneArray(tween._fromNumbers),lookupTween._number=0,lookupTween._next=null,lookupTween._prev=null,addChild(additiveTweenSiblings,lookupTween),addChild(additiveAnimation,lookupTween));let toNumber$1=tween._toNumber;if(tween._fromNumber=lookupTween._fromNumber-toNumber$1,tween._toNumber=0,tween._numbers=cloneArray(tween._fromNumbers),tween._number=0,lookupTween._fromNumber=toNumber$1,tween._toNumbers){let toNumbers=cloneArray(tween._toNumbers);toNumbers&&toNumbers.forEach((value$1,i)=>{tween._fromNumbers[i]=lookupTween._fromNumbers[i]-value$1,tween._toNumbers[i]=0}),lookupTween._fromNumbers=toNumbers}addChild(additiveTweenSiblings,tween,null,`_prevAdd`,`_nextAdd`)}return tween},removeTweenSliblings=tween=>{let tweenComposition=tween._composition;if(tweenComposition!==compositionTypes.none){let tweenTarget=tween.target,tweenProperty=tween.property,replaceTweensLookup=lookups._rep,replaceTargetProps=replaceTweensLookup.get(tweenTarget),tweenReplaceSiblings=replaceTargetProps[tweenProperty];if(removeChild(tweenReplaceSiblings,tween,`_prevRep`,`_nextRep`),tweenComposition===compositionTypes.blend){let addTweensLookup=lookups._add,addTargetProps=addTweensLookup.get(tweenTarget);if(!addTargetProps)return;let additiveTweenSiblings=addTargetProps[tweenProperty],additiveAnimation=additive.animation;removeChild(additiveTweenSiblings,tween,`_prevAdd`,`_nextAdd`);let lookupTween=additiveTweenSiblings._head;if(lookupTween&&lookupTween===additiveTweenSiblings._tail){removeChild(additiveTweenSiblings,lookupTween,`_prevAdd`,`_nextAdd`),removeChild(additiveAnimation,lookupTween);let shouldClean=!0;for(let prop in addTargetProps)if(addTargetProps[prop]._head){shouldClean=!1;break}shouldClean&&addTweensLookup.delete(tweenTarget)}}}return tween},resetTimerProperties=timer=>(timer.paused=!0,timer.began=!1,timer.completed=!1,timer),reviveTimer=timer=>timer._cancelled?(timer._hasChildren?forEachChildren(timer,reviveTimer):forEachChildren(timer,tween=>{tween._composition!==compositionTypes.none&&composeTween(tween,getTweenSiblings(tween.target,tween.property))}),timer._cancelled=0,timer):timer;let timerId=0;var Timer=class extends Clock{constructor(parameters={},parent=null,parentPosition=0){super(0);let{id,delay,duration:duration$2,reversed,alternate,loop,loopDelay,autoplay,frameRate,playbackRate,onComplete,onLoop,onPause,onBegin,onBeforeUpdate:onBeforeUpdate$1,onUpdate}=parameters;scope.current&&scope.current.register(this);let timerInitTime=parent?0:engine._elapsedTime,timerDefaults=parent?parent.defaults:globals.defaults,timerDelay=isFnc(delay)||isUnd(delay)?timerDefaults.delay:+delay,timerDuration=isFnc(duration$2)||isUnd(duration$2)?1/0:+duration$2,timerLoop=setValue(loop,timerDefaults.loop),timerLoopDelay=setValue(loopDelay,timerDefaults.loopDelay),timerIterationCount=timerLoop===!0||timerLoop===1/0||timerLoop<0?1/0:timerLoop+1,offsetPosition=0;if(parent)offsetPosition=parentPosition;else{let startTime=now();engine.paused&&(engine.requestTick(startTime),startTime=engine._elapsedTime),offsetPosition=startTime-engine._startTime}this.id=isUnd(id)?++timerId:id,this.parent=parent,this.duration=clampInfinity((timerDuration+timerLoopDelay)*timerIterationCount-timerLoopDelay)||minValue,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=onBegin||timerDefaults.onBegin,this.onBeforeUpdate=onBeforeUpdate$1||timerDefaults.onBeforeUpdate,this.onUpdate=onUpdate||timerDefaults.onUpdate,this.onLoop=onLoop||timerDefaults.onLoop,this.onPause=onPause||timerDefaults.onPause,this.onComplete=onComplete||timerDefaults.onComplete,this.iterationDuration=timerDuration,this.iterationCount=timerIterationCount,this._autoplay=parent?!1:setValue(autoplay,timerDefaults.autoplay),this._offset=offsetPosition,this._delay=timerDelay,this._loopDelay=timerLoopDelay,this._iterationTime=0,this._currentIteration=0,this._resolve=noop,this._running=!1,this._reversed=+setValue(reversed,timerDefaults.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=setValue(alternate,timerDefaults.alternate),this._prev=null,this._next=null,this._elapsedTime=timerInitTime,this._startTime=timerInitTime,this._lastTime=timerInitTime,this._fps=setValue(frameRate,timerDefaults.frameRate),this._speed=setValue(playbackRate,timerDefaults.playbackRate)}get cancelled(){return!!this._cancelled}set cancelled(cancelled){cancelled?this.cancel():this.reset(1).play()}get currentTime(){return clamp(round(this._currentTime,globals.precision),-this._delay,this.duration)}set currentTime(time$2){let paused=this.paused;this.pause().seek(+time$2),paused||this.resume()}get iterationCurrentTime(){return round(this._iterationTime,globals.precision)}set iterationCurrentTime(time$2){this.currentTime=this.iterationDuration*this._currentIteration+time$2}get progress(){return clamp(round(this._currentTime/this.duration,10),0,1)}set progress(progress$1){this.currentTime=this.duration*progress$1}get iterationProgress(){return clamp(round(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(progress$1){let iterationDuration=this.iterationDuration;this.currentTime=iterationDuration*this._currentIteration+iterationDuration*progress$1}get currentIteration(){return this._currentIteration}set currentIteration(iterationCount){this.currentTime=this.iterationDuration*clamp(+iterationCount,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(reverse){reverse?this.reverse():this.play()}get speed(){return super.speed}set speed(playbackRate){super.speed=playbackRate,this.resetTime()}reset(internalRender=0){return reviveTimer(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,tick(this,0,1,internalRender,tickModes.FORCE),resetTimerProperties(this),this._hasChildren&&forEachChildren(this,resetTimerProperties),this}init(internalRender=0){this.fps=this._fps,this.speed=this._speed,!internalRender&&this._hasChildren&&tick(this,this.duration,1,internalRender,tickModes.FORCE),this.reset(internalRender);let autoplay=this._autoplay;return autoplay===!0?this.resume():autoplay&&!isUnd(autoplay.linked)&&autoplay.link(this),this}resetTime(){let timeScale=1/(this._speed*engine._speed);return this._startTime=now()-(this._currentTime+this._delay)*timeScale,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=minValue&&!this._hasChildren?tick(this,minValue,0,0,tickModes.FORCE):(this._running||(addChild(engine,this),engine._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,engine.wake()),this):this}restart(){return this.reset(0).resume()}seek(time$2,muteCallbacks=0,internalRender=0){reviveTimer(this),this.completed=!1;let isPaused=this.paused;return this.paused=!0,tick(this,time$2+this._delay,~~muteCallbacks,~~internalRender,tickModes.AUTO),isPaused?this:this.resume()}alternate(){let reversed=this._reversed,count$1=this.iterationCount,duration$2=this.iterationDuration,iterations=count$1===1/0?floor(maxValue/duration$2):count$1;return this._reversed=+(this._alternate&&!(iterations%2)?reversed:!reversed),count$1===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(duration$2*iterations-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?forEachChildren(this,child=>child.cancel(),!0):forEachChildren(this,removeTweenSliblings),this._cancelled=1,this.pause()}stretch(newDuration){let currentDuration=this.duration,normlizedDuration=normalizeTime(newDuration);if(currentDuration===normlizedDuration)return this;let timeScale=newDuration/currentDuration,isSetter=newDuration<=minValue;return this.duration=isSetter?minValue:normlizedDuration,this.iterationDuration=isSetter?minValue:normalizeTime(this.iterationDuration*timeScale),this._offset*=timeScale,this._delay*=timeScale,this._loopDelay*=timeScale,this}revert(){tick(this,0,1,0,tickModes.AUTO);let ap=this._autoplay;return ap&&ap.linked&&ap.linked===this&&ap.revert(),this.cancel()}complete(){return this.seek(this.duration).cancel()}then(callback=noop){let then=this.then,onResolve=()=>{this.then=null,callback(this),this.then=then,this._resolve=noop};return new Promise(r$1=>(this._resolve=()=>r$1(onResolve()),this.completed&&this._resolve(),this))}};const none=t$1=>t$1,calcBezier=(aT,aA1,aA2)=>(((1-3*aA2+3*aA1)*aT+(3*aA2-6*aA1))*aT+3*aA1)*aT,binarySubdivide=(aX,mX1,mX2)=>{let aA=0,aB=1,currentX,currentT,i=0;do currentT=aA+(aB-aA)/2,currentX=calcBezier(currentT,mX1,mX2)-aX,currentX>0?aB=currentT:aA=currentT;while(abs(currentX)>1e-7&&++i<100);return currentT},cubicBezier=(mX1=.5,mY1=0,mX2=.5,mY2=1)=>mX1===mY1&&mX2===mY2?none:t$1=>t$1===0||t$1===1?t$1:calcBezier(binarySubdivide(t$1,mX1,mX2),mY1,mY2),steps=(steps$2=10,fromStart)=>{let roundMethod=fromStart?ceil:floor;return t$1=>roundMethod(clamp(t$1,0,1)*steps$2)*(1/steps$2)},linear=(...args)=>{let argsLength=args.length;if(!argsLength)return none;let totalPoints=argsLength-1,firstArg=args[0],lastArg=args[totalPoints],xPoints=[0],yPoints=[parseNumber(firstArg)];for(let i=1;i{let values=[0],total=length-1;for(let i=1;it$1=>pow(t$1,+p$4),easeInFunctions={[emptyString]:easeInPower,Quad:easeInPower(2),Cubic:easeInPower(3),Quart:easeInPower(4),Quint:easeInPower(5),Sine:t$1=>1-cos(t$1*halfPI),Circ:t$1=>1-sqrt(1-t$1*t$1),Expo:t$1=>t$1?pow(2,10*t$1-10):0,Bounce:t$1=>{let pow2,b$1=4;for(;t$1<((pow2=pow(2,--b$1))-1)/11;);return 1/pow(4,3-b$1)-7.5625*pow((pow2*3-2)/22-t$1,2)},Back:(overshoot=1.70158)=>t$1=>(+overshoot+1)*t$1*t$1*t$1-+overshoot*t$1*t$1,Elastic:(amplitude=1,period=.3)=>{let a$1=clamp(+amplitude,1,10),p$4=clamp(+period,minValue,2),s=p$4/doublePI*asin(1/a$1),e$4=doublePI/p$4;return t$1=>t$1===0||t$1===1?t$1:-a$1*pow(2,-10*(1-t$1))*sin((1-t$1-s)*e$4)}},easeTypes={in:easeIn$1=>t$1=>easeIn$1(t$1),out:easeIn$1=>t$1=>1-easeIn$1(1-t$1),inOut:easeIn$1=>t$1=>t$1<.5?easeIn$1(t$1*2)/2:1-easeIn$1(t$1*-2+2)/2,outIn:easeIn$1=>t$1=>t$1<.5?(1-easeIn$1(1-t$1*2))/2:(easeIn$1(t$1*2-1)+1)/2},parseEaseString=(string$4,easesFunctions,easesLookups)=>{if(easesLookups[string$4])return easesLookups[string$4];if(string$4.indexOf(`(`)<=-1){let hasParams=easeTypes[string$4]||string$4.includes(`Back`)||string$4.includes(`Elastic`),parsedFn=hasParams?easesFunctions[string$4]():easesFunctions[string$4];return parsedFn?easesLookups[string$4]=parsedFn:none}else{let split=string$4.slice(0,-1).split(`(`),parsedFn=easesFunctions[split[0]];return parsedFn?easesLookups[string$4]=parsedFn(...split[1].split(`,`)):none}},eases=(()=>{let list$2={linear,irregular,steps,cubicBezier};for(let type in easeTypes)for(let name$2 in easeInFunctions){let easeIn$1=easeInFunctions[name$2],easeType=easeTypes[type];list$2[type+name$2]=name$2===emptyString||name$2===`Back`||name$2===`Elastic`?(a$1,b$1)=>easeType(easeIn$1(a$1,b$1)):easeType(easeIn$1)}return list$2})(),JSEasesLookups={linear:none},parseEasings=ease=>isFnc(ease)?ease:isStr(ease)?parseEaseString(ease,eases,JSEasesLookups):none,propertyNamesCache={},sanitizePropertyName=(propertyName,target$1,tweenType)=>{if(tweenType===tweenTypes.TRANSFORM){let t$1=shortTransforms.get(propertyName);return t$1||propertyName}else if(tweenType===tweenTypes.CSS||tweenType===tweenTypes.ATTRIBUTE&&isSvg(target$1)&&propertyName in target$1.style){let cachedPropertyName=propertyNamesCache[propertyName];if(cachedPropertyName)return cachedPropertyName;{let lowerCaseName=propertyName&&toLowerCase(propertyName);return propertyNamesCache[propertyName]=lowerCaseName,lowerCaseName}}else return propertyName},angleUnitsMap={deg:1,rad:180/PI,turn:360},convertedValuesCache={},convertValueUnit=(el,decomposedValue,unit,force=!1)=>{let currentUnit=decomposedValue.u,currentNumber=decomposedValue.n;if(decomposedValue.t===valueTypes.UNIT&¤tUnit===unit)return decomposedValue;let cachedKey=currentNumber+currentUnit+unit,cached$1=convertedValuesCache[cachedKey];if(!isUnd(cached$1)&&!force)decomposedValue.n=cached$1;else{let convertedValue;if(currentUnit in angleUnitsMap)convertedValue=currentNumber*angleUnitsMap[currentUnit]/angleUnitsMap[unit];else{let baseline=100,tempEl=el.cloneNode(),parentNode=el.parentNode,parentEl=parentNode&&parentNode!==doc?parentNode:doc.body;parentEl.appendChild(tempEl);let elStyle=tempEl.style;elStyle.width=baseline+currentUnit;let currentUnitWidth=tempEl.offsetWidth||baseline;elStyle.width=baseline+unit;let newUnitWidth=tempEl.offsetWidth||baseline,factor$1=currentUnitWidth/newUnitWidth;parentEl.removeChild(tempEl),convertedValue=factor$1*currentNumber}decomposedValue.n=convertedValue,convertedValuesCache[cachedKey]=convertedValue}return decomposedValue.t,valueTypes.UNIT,decomposedValue.u=unit,decomposedValue},cleanInlineStyles=renderable=>{if(renderable._hasChildren)forEachChildren(renderable,cleanInlineStyles,!0);else{let animation=renderable;animation.pause(),forEachChildren(animation,tween=>{let tweenProperty=tween.property,tweenTarget=tween.target;if(tweenTarget[isDomSymbol]){let targetStyle=tweenTarget.style,originalInlinedValue=animation._inlineStyles[tweenProperty];if(tween._tweenType===tweenTypes.TRANSFORM){let cachedTransforms=tweenTarget[transformsSymbol];if(isUnd(originalInlinedValue)||originalInlinedValue===emptyString?delete cachedTransforms[tweenProperty]:cachedTransforms[tweenProperty]=originalInlinedValue,tween._renderTransforms)if(!Object.keys(cachedTransforms).length)targetStyle.removeProperty(`transform`);else{let str=emptyString;for(let key$2 in cachedTransforms)str+=transformsFragmentStrings[key$2]+cachedTransforms[key$2]+`) `;targetStyle.transform=str}}else isUnd(originalInlinedValue)||originalInlinedValue===emptyString?targetStyle.removeProperty(tweenProperty):targetStyle[tweenProperty]=originalInlinedValue;animation._tail===tween&&animation.targets.forEach(t$1=>{t$1.getAttribute&&t$1.getAttribute(`style`)===emptyString&&t$1.removeAttribute(`style`)})}})}return renderable},fromTargetObject=createDecomposedValueTargetObject(),toTargetObject=createDecomposedValueTargetObject(),toFunctionStore={func:null},keyframesTargetArray=[null],fastSetValuesArray=[null,null],keyObjectTarget={to:null};let tweenId=0,keyframes,key;const generateKeyframes=(keyframes$4,parameters)=>{let properties={};if(isArr(keyframes$4)){let propertyNames=[].concat(...keyframes$4.map(key$2=>Object.keys(key$2))).filter(isKey);for(let i=0,l=propertyNames.length;i{let newKey={};for(let p$4 in key$2){let keyValue=key$2[p$4];isKey(p$4)?p$4===propName&&(newKey.to=keyValue):newKey[p$4]=keyValue}return newKey});properties[propName]=propArray}}else{let totalDuration=setValue(parameters.duration,globals.defaults.duration),keys$3=Object.keys(keyframes$4).map(key$2=>({o:parseFloat(key$2)/100,p:keyframes$4[key$2]})).sort((a$1,b$1)=>a$1.o-b$1.o);for(let name$2 in keys$3.forEach(key$2=>{let offset$2=key$2.o,prop=key$2.p;for(let name$2 in prop)if(isKey(name$2)){let propArray=properties[name$2];propArray||=properties[name$2]=[];let duration$2=offset$2*totalDuration,length=propArray.length,prevKey=propArray[length-1],keyObj={to:prop[name$2]},durProgress=0;for(let i=0;i=K?compositionTypes.none:isUnd(composition)?animDefaults.composition:composition,animInlineStyles={},absoluteOffsetTime=this._offset+(parent?parent._offset:0),iterationDuration=NaN,iterationDelay=NaN,animationAnimationLength=0,shouldTriggerRender=0;for(let targetIndex=0;targetIndex2&&isNotObjectValue?(keyframes=[],propValue.forEach((v,i)=>{i?i===1?(fastSetValuesArray[1]=v,keyframes.push(fastSetValuesArray)):keyframes.push(v):fastSetValuesArray[0]=v})):keyframes=propValue}else keyframesTargetArray[0]=propValue,keyframes=keyframesTargetArray;let siblings$2=null,prevTween=null,firstTweenChangeStartTime=NaN,lastTweenChangeEndTime=0,tweenIndex=0;for(let l=keyframes.length;tweenIndex1?getFunctionValue(tDuration,target$1,ti,tl)/l:tDuration),target$1,ti,tl),tweenDelay=getFunctionValue(setValue(key.delay,tweenIndex?0:tDelay),target$1,ti,tl),computedComposition=getFunctionValue(setValue(key.composition,tComposition),target$1,ti,tl),tweenComposition=isNum(computedComposition)?computedComposition:compositionTypes[computedComposition],tweenModifier=key.modifier||tModifier,hasFromvalue=!isUnd(tweenFromValue),hasToValue=!isUnd(tweenToValue),isFromToArray=isArr(tweenToValue),isFromToValue=isFromToArray||hasFromvalue&&hasToValue,tweenStartTime=prevTween?lastTweenChangeEndTime+tweenDelay:tweenDelay,absoluteStartTime=absoluteOffsetTime+tweenStartTime;!shouldTriggerRender&&(hasFromvalue||isFromToArray)&&(shouldTriggerRender=1);let prevSibling=prevTween;if(tweenComposition!==compositionTypes.none){siblings$2||=getTweenSiblings(target$1,propName);let nextSibling=siblings$2._head;for(;nextSibling&&!nextSibling._isOverridden&&nextSibling._absoluteStartTime<=absoluteStartTime;)if(prevSibling=nextSibling,nextSibling=nextSibling._nextRep,nextSibling&&nextSibling._absoluteStartTime>=absoluteStartTime)for(;nextSibling;)overrideTween(nextSibling),nextSibling=nextSibling._nextRep}if(isFromToValue?(decomposeRawValue(isFromToArray?getFunctionValue(tweenToValue[0],target$1,ti,tl):tweenFromValue,fromTargetObject),decomposeRawValue(isFromToArray?getFunctionValue(tweenToValue[1],target$1,ti,tl,toFunctionStore):tweenToValue,toTargetObject),fromTargetObject.t===valueTypes.NUMBER&&(prevSibling?prevSibling._valueType===valueTypes.UNIT&&(fromTargetObject.t=valueTypes.UNIT,fromTargetObject.u=prevSibling._unit):(decomposeRawValue(getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),decomposedOriginalValue),decomposedOriginalValue.t===valueTypes.UNIT&&(fromTargetObject.t=valueTypes.UNIT,fromTargetObject.u=decomposedOriginalValue.u)))):(hasToValue?decomposeRawValue(tweenToValue,toTargetObject):prevTween?decomposeTweenValue(prevTween,toTargetObject):decomposeRawValue(parent&&prevSibling&&prevSibling.parent.parent===parent?prevSibling._value:getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),toTargetObject),hasFromvalue?decomposeRawValue(tweenFromValue,fromTargetObject):prevTween?decomposeTweenValue(prevTween,fromTargetObject):decomposeRawValue(parent&&prevSibling&&prevSibling.parent.parent===parent?prevSibling._value:getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),fromTargetObject)),fromTargetObject.o&&(fromTargetObject.n=getRelativeValue(prevSibling?prevSibling._toNumber:decomposeRawValue(getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),decomposedOriginalValue).n,fromTargetObject.n,fromTargetObject.o)),toTargetObject.o&&(toTargetObject.n=getRelativeValue(fromTargetObject.n,toTargetObject.n,toTargetObject.o)),fromTargetObject.t!==toTargetObject.t){if(fromTargetObject.t===valueTypes.COMPLEX||toTargetObject.t===valueTypes.COMPLEX){let complexValue=fromTargetObject.t===valueTypes.COMPLEX?fromTargetObject:toTargetObject,notComplexValue=fromTargetObject.t===valueTypes.COMPLEX?toTargetObject:fromTargetObject;notComplexValue.t=valueTypes.COMPLEX,notComplexValue.s=cloneArray(complexValue.s),notComplexValue.d=complexValue.d.map(()=>notComplexValue.n)}else if(fromTargetObject.t===valueTypes.UNIT||toTargetObject.t===valueTypes.UNIT){let unitValue=fromTargetObject.t===valueTypes.UNIT?fromTargetObject:toTargetObject,notUnitValue=fromTargetObject.t===valueTypes.UNIT?toTargetObject:fromTargetObject;notUnitValue.t=valueTypes.UNIT,notUnitValue.u=unitValue.u}else if(fromTargetObject.t===valueTypes.COLOR||toTargetObject.t===valueTypes.COLOR){let colorValue=fromTargetObject.t===valueTypes.COLOR?fromTargetObject:toTargetObject,notColorValue=fromTargetObject.t===valueTypes.COLOR?toTargetObject:fromTargetObject;notColorValue.t=valueTypes.COLOR,notColorValue.s=colorValue.s,notColorValue.d=[0,0,0,1]}}if(fromTargetObject.u!==toTargetObject.u){let valueToConvert=toTargetObject.u?fromTargetObject:toTargetObject;valueToConvert=convertValueUnit(target$1,valueToConvert,toTargetObject.u?toTargetObject.u:fromTargetObject.u,!1)}if(toTargetObject.d&&fromTargetObject.d&&toTargetObject.d.length!==fromTargetObject.d.length){let longestValue=fromTargetObject.d.length>toTargetObject.d.length?fromTargetObject:toTargetObject,shortestValue=longestValue===fromTargetObject?toTargetObject:fromTargetObject;shortestValue.d=longestValue.d.map((_$1,i)=>isUnd(shortestValue.d[i])?0:shortestValue.d[i]),shortestValue.s=cloneArray(longestValue.s)}let tweenUpdateDuration=round(+tweenDuration||minValue,12),tween={parent:this,id:tweenId++,property:propName,target:target$1,_value:null,_func:toFunctionStore.func,_ease:parseEasings(tweenEasing),_fromNumbers:cloneArray(fromTargetObject.d),_toNumbers:cloneArray(toTargetObject.d),_strings:cloneArray(toTargetObject.s),_fromNumber:fromTargetObject.n,_toNumber:toTargetObject.n,_numbers:cloneArray(fromTargetObject.d),_number:fromTargetObject.n,_unit:toTargetObject.u,_modifier:tweenModifier,_currentTime:0,_startTime:tweenStartTime,_delay:+tweenDelay,_updateDuration:tweenUpdateDuration,_changeDuration:tweenUpdateDuration,_absoluteStartTime:absoluteStartTime,_tweenType:tweenType,_valueType:toTargetObject.t,_composition:tweenComposition,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};tweenComposition!==compositionTypes.none&&composeTween(tween,siblings$2),isNaN(firstTweenChangeStartTime)&&(firstTweenChangeStartTime=tween._startTime),lastTweenChangeEndTime=round(tweenStartTime+tweenUpdateDuration,12),prevTween=tween,animationAnimationLength++,addChild(this,tween)}(isNaN(iterationDelay)||firstTweenChangeStartTimeiterationDuration)&&(iterationDuration=lastTweenChangeEndTime),tweenType===tweenTypes.TRANSFORM&&(lastTransformGroupIndex=animationAnimationLength-tweenIndex,lastTransformGroupLength=animationAnimationLength)}if(!isNaN(lastTransformGroupIndex)){let i=0;forEachChildren(this,tween=>{i>=lastTransformGroupIndex&&i{additiveTween.id===tween.id&&(additiveTween._renderTransforms=1)})),i++})}}targetsLength||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),iterationDelay?(forEachChildren(this,tween=>{tween._startTime-tween._delay||(tween._delay-=iterationDelay),tween._startTime-=iterationDelay}),iterationDuration-=iterationDelay):iterationDelay=0,iterationDuration||(iterationDuration=minValue,this.iterationCount=0),this.targets=parsedTargets,this.duration=iterationDuration===minValue?minValue:clampInfinity((iterationDuration+this._loopDelay)*this.iterationCount-this._loopDelay)||minValue,this.onRender=onRender||animDefaults.onRender,this._ease=animEase,this._delay=iterationDelay,this.iterationDuration=iterationDuration,this._inlineStyles=animInlineStyles,!this._autoplay&&shouldTriggerRender&&this.onRender(this)}stretch(newDuration){let currentDuration=this.duration;if(currentDuration===normalizeTime(newDuration))return this;let timeScale=newDuration/currentDuration;return forEachChildren(this,tween=>{tween._updateDuration=normalizeTime(tween._updateDuration*timeScale),tween._changeDuration=normalizeTime(tween._changeDuration*timeScale),tween._currentTime*=timeScale,tween._startTime*=timeScale,tween._absoluteStartTime*=timeScale}),super.stretch(newDuration)}refresh(){return forEachChildren(this,tween=>{let tweenFunc=tween._func;if(tweenFunc){let ogValue=getOriginalAnimatableValue(tween.target,tween.property,tween._tweenType);decomposeRawValue(ogValue,decomposedOriginalValue),decomposeRawValue(tweenFunc(),toTargetObject),tween._fromNumbers=cloneArray(decomposedOriginalValue.d),tween._fromNumber=decomposedOriginalValue.n,tween._toNumbers=cloneArray(toTargetObject.d),tween._strings=cloneArray(toTargetObject.s),tween._toNumber=toTargetObject.o?getRelativeValue(decomposedOriginalValue.n,toTargetObject.n,toTargetObject.o):toTargetObject.n}}),this}revert(){return super.revert(),cleanInlineStyles(this)}then(callback){return super.then(callback)}};const animate=(targets,parameters)=>new JSAnimation(targets,parameters,null,0,!1).init(),transformsShorthands=[`x`,`y`,`z`],commonDefaultPXProperties=[`perspective`,`width`,`height`,`margin`,`padding`,`top`,`right`,`bottom`,`left`,`borderWidth`,`fontSize`,`borderRadius`,...transformsShorthands],WAAPIAnimationsLookups={_head:null,_tail:null},removeWAAPIAnimation=($el,property,parent)=>{let nextLookup=WAAPIAnimationsLookups._head;for(;nextLookup;){let next=nextLookup._next,matchTarget=nextLookup.$el===$el,matchProperty=!property||nextLookup.property===property,matchParent=!parent||nextLookup.parent===parent;if(matchTarget&&matchProperty&&matchParent){let anim=nextLookup.animation;try{anim.commitStyles()}catch{}anim.cancel(),removeChild(WAAPIAnimationsLookups,nextLookup);let lookupParent=nextLookup.parent;lookupParent&&(lookupParent._completed++,lookupParent.animations.length===lookupParent._completed&&(lookupParent.completed=!0,lookupParent.muteCallbacks||(lookupParent.paused=!0,lookupParent.onComplete(lookupParent),lookupParent._resolve(lookupParent))))}nextLookup=next}},sync=(callback=noop)=>new Timer({duration:1*globals.timeScale,onComplete:callback},null,0).resume();function getTargetValue(targetSelector,propName,unit){let targets=registerTargets(targetSelector);if(!targets.length)return;let[target$1]=targets,tweenType=getTweenType(target$1,propName),normalizePropName=sanitizePropertyName(propName,target$1,tweenType),originalValue=getOriginalAnimatableValue(target$1,normalizePropName);if(isUnd(unit))return originalValue;if(decomposeRawValue(originalValue,decomposedOriginalValue),decomposedOriginalValue.t===valueTypes.NUMBER||decomposedOriginalValue.t===valueTypes.UNIT){if(unit===!1)return decomposedOriginalValue.n;{let convertedValue=convertValueUnit(target$1,decomposedOriginalValue,unit,!1);return`${round(convertedValue.n,globals.precision)}${convertedValue.u}`}}}const setTargetValues=(targets,parameters)=>{if(!isUnd(parameters))return parameters.duration=minValue,parameters.composition=setValue(parameters.composition,compositionTypes.none),new JSAnimation(targets,parameters,null,0,!0).resume()},removeTargetsFromAnimation=(targetsArray,animation,propertyName)=>{let tweensMatchesTargets=!1;return forEachChildren(animation,tween=>{let tweenTarget=tween.target;if(targetsArray.includes(tweenTarget)){let tweenName=tween.property,tweenType=tween._tweenType,normalizePropName=sanitizePropertyName(propertyName,tweenTarget,tweenType);(!normalizePropName||normalizePropName&&normalizePropName===tweenName)&&(tween.parent._tail===tween&&tween._tweenType===tweenTypes.TRANSFORM&&tween._prev&&tween._prev._tweenType===tweenTypes.TRANSFORM&&(tween._prev._renderTransforms=1),removeChild(animation,tween),removeTweenSliblings(tween),tweensMatchesTargets=!0)}},!0),tweensMatchesTargets},remove=(targets,renderable,propertyName)=>{let targetsArray=parseTargets(targets),parent=renderable||engine,waapiAnimation=renderable&&renderable.controlAnimation&&renderable;for(let i=0,l=targetsArray.length;i{if(!child._hasChildren)if(removeMatches=removeTargetsFromAnimation(targetsArray,child,propertyName),removeMatches&&!child._head)child.cancel(),removeChild(parent,child);else{let childTLOffset=child._offset+child._delay,childDur=childTLOffset+child.duration;childDur>iterationDuration&&(iterationDuration=childDur)}child._head?remove(targets,child,propertyName):child._hasChildren=!1},!0),isUnd(parent.iterationDuration)||(parent.iterationDuration=iterationDuration)}else removeMatches=removeTargetsFromAnimation(targetsArray,parent,propertyName);return removeMatches&&!parent._head&&(parent._hasChildren=!1,parent.cancel&&parent.cancel()),targetsArray},keepTime=createRefreshable,randomPick=items=>items[random(0,items.length-1)],roundPad=(v,decimalLength)=>(+v).toFixed(decimalLength),padStart=(v,totalLength,padString)=>`${v}`.padStart(totalLength,padString),padEnd=(v,totalLength,padString)=>`${v}`.padEnd(totalLength,padString),wrap=(v,min$1,max$1)=>((v-min$1)%(max$1-min$1)+(max$1-min$1))%(max$1-min$1)+min$1,mapRange=(value$1,inLow,inHigh,outLow,outHigh)=>outLow+(value$1-inLow)/(inHigh-inLow)*(outHigh-outLow),degToRad=degrees$1=>degrees$1*PI/180,radToDeg=radians=>radians*180/PI,lerp=(start,end,amount,renderable)=>{let dt$3=K/globals.defaults.frameRate;if(renderable!==!1){let ticker=renderable||engine._hasChildren&&engine;ticker&&ticker.deltaTime&&(dt$3=ticker.deltaTime)}let t$1=1-Math.exp(-amount*dt$3*.1);return amount?amount===1?end:(1-t$1)*start+t$1*end:start},curry=(fn$5,last=0)=>(...args)=>last?v=>fn$5(...args,v):v=>fn$5(v,...args),chain=fn$5=>(...args)=>{let result=fn$5(...args);return new Proxy(noop,{apply:(_$1,__,[v])=>result(v),get:(_$1,prop)=>chain((...nextArgs)=>{let nextResult=utils[prop](...nextArgs);return v=>nextResult(result(v))})})},makeChainable=(fn$5,right=0)=>(...args)=>(args.lengthnew Promise(resolve$1=>{let source=audioContext.createBufferSource();source.buffer=ctx.data.audioBuffer,source.connect(audioContext.destination),nowSpeaking.value=!0,source.start(0),source.onended=()=>{nowSpeaking.value=!1,resolve$1()}})]});async function handleSpeechGeneration(ctx){speechGenerationIndex.value++;try{let input=ctx.data,res=await props.generateSpeech(input,props.voice,!1),audioBuffer=await audioContext.decodeAudioData(res);await audioQueue.add({audioBuffer,text:ctx.data})}catch(error){console.error(`Speech generation failed:`,error)}}let ttsQueue=useQueue({handlers:[handleSpeechGeneration]}),messageContentQueue=useMessageContentQueue(ttsQueue);async function testStreaming(){await messageContentQueue.add(props.text)}async function testChunking(){let chunks=[],stream=new ReadableStream({start(controller){controller.enqueue(new TextEncoder().encode(props.text)),controller.close()}});for await(let chunk of chunkTTSInput(stream.getReader(),{boost:1,minimumWords:4,maximumWords:12}))chunks.push(chunk);ttsInputChunks.value=chunks}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[_cache$1[4]||=createBaseVNode(`div`,{class:`flex items-center gap-1 text-sm font-medium`},` Streaming Playground `,-1),createBaseVNode(`div`,_hoisted_1$14,[createBaseVNode(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,bg:`neutral-700 dark:neutral-300`,onClick:testChunking},_cache$1[1]||=[createBaseVNode(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[createBaseVNode(`div`,{"i-solar:round-double-alt-arrow-right-bold-duotone":``}),createBaseVNode(`span`,null,`Test chunking`)],-1)]),ttsInputChunks.value.length>0?(openBlock(),createElementBlock(`button`,{key:0,border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,bg:`neutral-700 dark:neutral-300`,onClick:testStreaming},_cache$1[2]||=[createBaseVNode(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[createBaseVNode(`div`,{"i-solar:round-double-alt-arrow-right-bold-duotone":``}),createBaseVNode(`span`,null,`Test streaming`)],-1)])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_2$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(ttsInputChunks.value,(chunk,i)=>(openBlock(),createElementBlock(`div`,{key:i,flex:`~ row gap-2 items-center`},[createBaseVNode(`div`,{flex:`~ row gap-2 items-center`,"rounded-xl":``,"px-2":``,"py-1.5":``,class:normalizeClass({"bg-neutral-100 dark:bg-neutral-800":speechGenerationIndex.value=i})},[createBaseVNode(`span`,_hoisted_3$5,toDisplayString(chunk.text),1),createBaseVNode(`span`,{"rounded-full":``,"px-2":``,"py-.5":``,"text-nowrap":``,"text-xs":``,b:`~ dashed`,class:normalizeClass({"b-green text-green":chunk.reason===`boost`,"b-orange text-orange":chunk.reason===`limit`,"b-red text-red":chunk.reason===`hard`,"b-purple text-purple":chunk.reason===`flush`})},toDisplayString(chunk.words)+` words, `+toDisplayString(chunk.reason),3)],2),createVNode(Transition,{css:!1,onEnter:_cache$1[0]||=el=>unref(animate)(el,{opacity:[0,1],translateX:[10,0],duration:200,ease:`inOut`})},{default:withCtx(()=>[speechGenerationIndex.value>=i?(openBlock(),createElementBlock(`div`,_hoisted_4$4,_cache$1[3]||=[createBaseVNode(`div`,{"i-solar-check-circle-line-duotone":``},null,-1),createBaseVNode(`div`,null,`Queued`,-1)])):createCommentVNode(``,!0)]),_:2},1024)]))),128))])],64))}}),SpeechStreamingPlayground_default=SpeechStreamingPlayground_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$13={"w-full":``,"rounded-xl":``},_hoisted_2$7={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},_hoisted_3$4={class:`inline-flex items-center gap-4`},_hoisted_4$3={flex:`~ col gap-4`},_hoisted_5$3=[`placeholder`],_hoisted_6$3=[`placeholder`],_hoisted_7$2={flex:`~ row`,"gap-4":``},_hoisted_8$2=[`disabled`],_hoisted_9$2={flex:`~ row`,"items-center":``,"gap-2":``},_hoisted_10$2={flex:`~ row`,"items-center":``,"gap-2":``},_hoisted_11$1={key:2,class:`mt-2 text-sm text-red-500`},_hoisted_12$1={key:3,class:`mt-2 text-sm text-red-500`},_hoisted_13$1={key:4,class:`mt-2 text-sm text-red-500`},_hoisted_14$1=[`src`];var SpeechPlayground_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SpeechPlayground`,props:{defaultText:{},availableVoices:{},generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(__props,{expose:__expose}){let props=__props,{t:t$1}=useI18n(),testText=ref(props.defaultText||`Hello! This is a test of the voice synthesis.`),isGenerating=ref(!1),audioUrl=ref(``),errorMessage=ref(``),audioPlayer=ref(null),useSSML=ref(!1),ssmlText=ref(``),selectedVoice=ref(``);watch(()=>props.availableVoices,newVoices=>{newVoices.length>0&&!selectedVoice.value&&(selectedVoice.value=newVoices[0]?.id||``)},{immediate:!0});let voiceOptions=computed(()=>props.availableVoices.map(voice=>({value:voice.id,label:voice.name})));async function handleGenerateTestSpeech(){if(!(!testText.value.trim()&&!useSSML.value||useSSML.value&&!ssmlText.value.trim()||!selectedVoice.value)){isGenerating.value=!0,errorMessage.value=``;try{audioUrl.value&&stopTestAudio();let input=useSSML.value?ssmlText.value:testText.value,response=await props.generateSpeech(input,selectedVoice.value,useSSML.value);audioUrl.value=URL.createObjectURL(new Blob([response])),setTimeout(()=>{audioPlayer.value&&audioPlayer.value.play()},100)}catch(error){console.error(`Error generating speech:`,error),errorMessage.value=error instanceof Error?error.message:`An unknown error occurred`}finally{isGenerating.value=!1}}}function stopTestAudio(){audioPlayer.value&&(audioPlayer.value.pause(),audioPlayer.value.currentTime=0),audioUrl.value&&(URL.revokeObjectURL(audioUrl.value),audioUrl.value=``)}return onUnmounted(()=>{audioUrl.value&&URL.revokeObjectURL(audioUrl.value)}),__expose({testText,ssmlText,useSSML,selectedVoice,isGenerating,audioUrl,errorMessage,audioPlayer,generateTestSpeech:handleGenerateTestSpeech,stopTestAudio}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$13,[createBaseVNode(`h2`,_hoisted_2$7,[createBaseVNode(`div`,_hoisted_3$4,[createVNode(unref(TestDummyMarker_default)),createBaseVNode(`div`,null,toDisplayString(unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),createBaseVNode(`div`,_hoisted_4$3,[createVNode(unref(FieldCheckbox_default),{modelValue:useSSML.value,"onUpdate:modelValue":_cache$1[0]||=$event=>useSSML.value=$event,label:unref(t$1)(`settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label`),description:unref(t$1)(`settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description`)},null,8,[`modelValue`,`label`,`description`]),useSSML.value?withDirectives((openBlock(),createElementBlock(`textarea`,{key:1,"onUpdate:modelValue":_cache$1[2]||=$event=>ssmlText.value=$event,placeholder:unref(t$1)(`settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder`),border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,8,_hoisted_6$3)),[[vModelText,ssmlText.value]]):withDirectives((openBlock(),createElementBlock(`textarea`,{key:0,"onUpdate:modelValue":_cache$1[1]||=$event=>testText.value=$event,placeholder:unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`),border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-24":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"outline-none":``},null,8,_hoisted_5$3)),[[vModelText,testText.value]]),createVNode(unref(FieldSelect_default),{modelValue:selectedVoice.value,"onUpdate:modelValue":_cache$1[3]||=$event=>selectedVoice.value=$event,class:`[&>div]:grid [&>div]:grid-cols-[4fr_2fr]`,options:voiceOptions.value,label:unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label`),description:unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description`),layout:`horizontal`},null,8,[`modelValue`,`options`,`label`,`description`]),createBaseVNode(`div`,_hoisted_7$2,[createBaseVNode(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:isGenerating.value||!testText.value.trim()&&!useSSML.value||useSSML.value&&!ssmlText.value.trim()||!selectedVoice.value||!_ctx.apiKeyConfigured,class:normalizeClass({"opacity-50 cursor-not-allowed":isGenerating.value||!testText.value.trim()&&!useSSML.value||useSSML.value&&!ssmlText.value.trim()||!selectedVoice.value||!_ctx.apiKeyConfigured}),bg:`neutral-700 dark:neutral-300`,onClick:handleGenerateTestSpeech},[createBaseVNode(`div`,_hoisted_9$2,[_cache$1[4]||=createBaseVNode(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),createBaseVNode(`span`,null,toDisplayString(isGenerating.value?unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,_hoisted_8$2),audioUrl.value?(openBlock(),createElementBlock(`button`,{key:0,border:`primary-300 dark:primary-800 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,"py-2":``,"text-sm":``,onClick:stopTestAudio},[createBaseVNode(`div`,_hoisted_10$2,[_cache$1[5]||=createBaseVNode(`div`,{"i-solar:stop-circle-bold-duotone":``},null,-1),createBaseVNode(`span`,null,toDisplayString(unref(t$1)(`settings.pages.modules.speech.sections.section.playground.buttons.stop.label`)),1)])])):createCommentVNode(``,!0)]),_ctx.apiKeyConfigured?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_11$1,toDisplayString(unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key`)),1)),selectedVoice.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_12$1,toDisplayString(unref(t$1)(`settings.pages.modules.speech.sections.section.playground.select-voice.required`)),1)),errorMessage.value?(openBlock(),createElementBlock(`div`,_hoisted_13$1,toDisplayString(errorMessage.value),1)):createCommentVNode(``,!0),audioUrl.value?(openBlock(),createElementBlock(`audio`,{key:5,ref_key:`audioPlayer`,ref:audioPlayer,src:audioUrl.value,controls:``,class:`mt-2 w-full`},null,8,_hoisted_14$1)):createCommentVNode(``,!0),createVNode(SpeechStreamingPlayground_default,{text:testText.value,voice:selectedVoice.value,"generate-speech":_ctx.generateSpeech},null,8,[`text`,`voice`,`generate-speech`])]),renderSlot(_ctx.$slots,`default`)]))}}),SpeechPlayground_default=SpeechPlayground_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$12={flex:`~ col md:row gap-6`},_hoisted_2$6={flex:`~ col gap-6`},_hoisted_3$3={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},_hoisted_4$2={flex:`~ col gap-4`},_hoisted_5$2={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},_hoisted_6$2={"w-full":``,"rounded-xl":``};var SpeechProviderSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SpeechProviderSettings`,props:{providerId:{},defaultModel:{},additionalSettings:{},placeholder:{}},setup(__props){let props=__props,{t:t$1}=useI18n(),router$1=useRouter(),providersStore=useProvidersStore(),speechStore=useSpeechStore(),{providers}=storeToRefs(providersStore),providerMetadata=computed(()=>providersStore.getProviderMetadata(props.providerId)),apiKey=computed({get:()=>providers.value[props.providerId]?.apiKey||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].apiKey=value$1}}),baseUrl=computed({get:()=>providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].baseUrl=value$1}}),voiceSettings=ref({});function initializeVoiceSettings(){providers.value[props.providerId]?.voiceSettings?voiceSettings.value={...providers.value[props.providerId].voiceSettings}:voiceSettings.value={pitch:0,speed:1,volume:0,...props.additionalSettings}}onMounted(()=>{providersStore.initializeProvider(props.providerId),apiKey.value=providers.value[props.providerId]?.apiKey||``,baseUrl.value=providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``,initializeVoiceSettings(),providersStore.configuredProviders[props.providerId]&&speechStore.loadVoicesForProvider(props.providerId)});let debouncedUpdate=useDebounceFn(()=>{providers.value[props.providerId]={...providers.value[props.providerId],apiKey:apiKey.value,baseUrl:baseUrl.value||providerMetadata.value?.defaultOptions?.().baseUrl||``,voiceSettings:{...voiceSettings.value}}},1e3);watch([apiKey,baseUrl],debouncedUpdate),watch(voiceSettings,debouncedUpdate,{deep:!0});function handleResetVoiceSettings(){voiceSettings.value={...providerMetadata.value?.defaultOptions?.().voiceSettings||{}},debouncedUpdate()}return(_ctx,_cache$1)=>(openBlock(),createBlock(ProviderSettingsLayout2_default,{"provider-name":providerMetadata.value?.localizedName,"provider-icon":providerMetadata.value?.icon,"on-back":()=>unref(router$1).back()},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$12,[createVNode(unref(ProviderSettingsContainer_default),{class:`w-full md:w-[40%]`},{default:withCtx(()=>[createVNode(unref(ProviderBasicSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.basic.title`),description:unref(t$1)(`settings.pages.providers.common.section.basic.description`),"on-reset":handleResetVoiceSettings},{default:withCtx(()=>[createVNode(unref(ProviderApiKeyInput_default),{modelValue:apiKey.value,"onUpdate:modelValue":_cache$1[0]||=$event=>apiKey.value=$event,"provider-name":providerMetadata.value?.localizedName,placeholder:props.placeholder||`API Key`},null,8,[`modelValue`,`provider-name`,`placeholder`]),renderSlot(_ctx.$slots,`basic-settings`)]),_:3},8,[`title`,`description`]),createBaseVNode(`div`,_hoisted_2$6,[createBaseVNode(`h2`,_hoisted_3$3,toDisplayString(unref(t$1)(`settings.pages.providers.common.section.voice.title`)),1),createBaseVNode(`div`,_hoisted_4$2,[renderSlot(_ctx.$slots,`voice-settings`)])]),createVNode(unref(ProviderAdvancedSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.advanced.title`)},{default:withCtx(()=>[createVNode(unref(ProviderBaseUrlInput_default),{modelValue:baseUrl.value,"onUpdate:modelValue":_cache$1[1]||=$event=>baseUrl.value=$event,placeholder:providerMetadata.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`]),renderSlot(_ctx.$slots,`advanced-settings`)]),_:3},8,[`title`])]),_:3}),createBaseVNode(`div`,_hoisted_5$2,[createBaseVNode(`div`,_hoisted_6$2,[renderSlot(_ctx.$slots,`playground`)])])])]),_:3},8,[`provider-name`,`provider-icon`,`on-back`]))}}),SpeechProviderSettings_default=SpeechProviderSettings_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$11={"w-full":``,"pt-1":``},_hoisted_2$5={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},_hoisted_3$2={class:`inline-flex items-center gap-4`},_hoisted_4$1={"mb-2":``},_hoisted_5$1=[`src`],_hoisted_6$1={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},_hoisted_7$1={class:`space-y-3`},_hoisted_8$1={class:`space-y-3`},_hoisted_9$1={class:`flex items-center gap-3`},_hoisted_10$1={class:`text-sm font-medium`};var TranscriptionPlayground_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TranscriptionPlayground`,props:{generateTranscription:{type:Function},apiKeyConfigured:{type:Boolean}},setup(__props){let props=__props,{t:t$1}=useI18n(),{audioInputs,selectedAudioInput,stream,stopStream,startStream}=useAudioDevice(),speakingThreshold=ref(25),isMonitoring=ref(!1),isSpeaking=ref(!1),errorMessage=ref(``),audioContext=ref(),analyser=ref(),dataArray=ref(),animationFrame=ref(),volumeLevel=ref(0),audios=ref([]),audioCleanups=ref([]),audioURLs=computed(()=>audios.value.map(blob=>{let url=URL.createObjectURL(blob);return audioCleanups.value.push(()=>URL.revokeObjectURL(url)),url})),transcriptions=ref([]),{startRecord,stopRecord,onStopRecord}=useAudioRecorder(stream);async function setupAudioMonitoring(){try{await stopAudioMonitoring(),await startStream(),await until(stream).toBeTruthy(),audioContext.value=new AudioContext;let source=audioContext.value.createMediaStreamSource(stream.value);analyser.value=audioContext.value.createAnalyser(),analyser.value.fftSize=256,analyser.value.smoothingTimeConstant=.3,source.connect(analyser.value);let bufferLength=analyser.value.frequencyBinCount;dataArray.value=new Uint8Array(bufferLength),startAudioAnalysis()}catch(error){console.error(`Error setting up audio monitoring:`,error),errorMessage.value=error instanceof Error?error.message:String(error)}}async function stopAudioMonitoring(){animationFrame.value&&(cancelAnimationFrame(animationFrame.value),animationFrame.value=void 0),stream.value&&(stream.value.getTracks().forEach(track$1=>track$1.stop()),stream.value=void 0),audioContext.value&&(await audioContext.value.close(),audioContext.value=void 0),await stopRecord(),await stopStream(),analyser.value=void 0,dataArray.value=void 0,volumeLevel.value=0,isSpeaking.value=!1}function startAudioAnalysis(){let analyze=()=>{if(!analyser.value||!dataArray.value)return;analyser.value.getByteFrequencyData(dataArray.value);let sum=0;for(let i=0;ispeakingThreshold.value,animationFrame.value=requestAnimationFrame(analyze)};analyze()}watch(selectedAudioInput,async()=>{isMonitoring.value&&await setupAudioMonitoring()}),watch(audioInputs,()=>{!selectedAudioInput.value&&audioInputs.value.length>0&&(selectedAudioInput.value=audioInputs.value.find(input=>input.deviceId===`default`)?.deviceId||audioInputs.value[0].deviceId)});async function toggleMonitoring(){isMonitoring.value?(await stopAudioMonitoring(),await stopRecord(),isMonitoring.value=!1):(onStopRecord(async recording=>{try{if(recording&&recording.size>0){audios.value.push(recording);let res=await props.generateTranscription(new File([recording],`recording.wav`));transcriptions.value.push(res.text)}}catch(err){errorMessage.value=err instanceof Error?err.message:String(err),console.error(`Error generating transcription:`,errorMessage.value)}}),await setupAudioMonitoring(),await startRecord(),isMonitoring.value=!0)}let speakingIndicatorClass=computed(()=>isSpeaking.value?`bg-green-500 shadow-lg shadow-green-500/50`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`);return onUnmounted(()=>{stopAudioMonitoring()}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$11,[createBaseVNode(`h2`,_hoisted_2$5,[createBaseVNode(`div`,_hoisted_3$2,[createVNode(unref(TestDummyMarker_default)),createBaseVNode(`div`,null,toDisplayString(unref(t$1)(`settings.pages.providers.provider.transcriptions.playground.title`)),1)])]),createBaseVNode(`div`,_hoisted_4$1,[createVNode(unref(FieldSelect_default),{modelValue:unref(selectedAudioInput),"onUpdate:modelValue":_cache$1[0]||=$event=>isRef(selectedAudioInput)?selectedAudioInput.value=$event:null,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:unref(audioInputs).map(input=>({label:input.label||input.deviceId,value:input.deviceId})),placeholder:`Select an audio input device`,layout:`vertical`,"h-fit":``,"w-full":``},null,8,[`modelValue`,`options`])]),createVNode(unref(Button_default),{class:`my-4`,"w-full":``,onClick:toggleMonitoring},{default:withCtx(()=>[createTextVNode(toDisplayString(isMonitoring.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(audioURLs.value,(audio,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,class:`mb-2`},[createBaseVNode(`audio`,{src:audio,controls:``,class:`w-full`},null,8,_hoisted_5$1),transcriptions.value[index$1]?(openBlock(),createElementBlock(`div`,_hoisted_6$1,toDisplayString(transcriptions.value[index$1]),1)):createCommentVNode(``,!0)]))),128))]),createBaseVNode(`div`,_hoisted_7$1,[createVNode(unref(LevelMeter_default),{level:volumeLevel.value,label:`Input Level`},null,8,[`level`]),createVNode(unref(ThresholdMeter_default),{value:volumeLevel.value/100,threshold:speakingThreshold.value/100,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`]),createBaseVNode(`div`,_hoisted_8$1,[createVNode(unref(FieldRange_default),{modelValue:speakingThreshold.value,"onUpdate:modelValue":_cache$1[1]||=$event=>speakingThreshold.value=$event,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:1,max:80,step:1,"format-value":value$1=>`${value$1}%`},null,8,[`modelValue`,`format-value`])]),createBaseVNode(`div`,_hoisted_9$1,[createBaseVNode(`div`,{class:normalizeClass([`h-4 w-4 rounded-full transition-all duration-200`,speakingIndicatorClass.value])},null,2),createBaseVNode(`span`,_hoisted_10$1,toDisplayString(isSpeaking.value?`Speaking Detected`:`Silence`),1)])])]))}}),TranscriptionPlayground_default=TranscriptionPlayground_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$10={flex:`~ col md:row gap-6`},_hoisted_2$4={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},_hoisted_3$1={"w-full":``,"rounded-xl":``};var TranscriptionProviderSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TranscriptionProviderSettings`,props:{providerId:{},defaultModel:{},additionalSettings:{},placeholder:{}},setup(__props){let props=__props,{t:t$1}=useI18n(),router$1=useRouter(),providersStore=useProvidersStore(),{providers}=storeToRefs(providersStore),providerMetadata=computed(()=>providersStore.getProviderMetadata(props.providerId)),apiKey=computed({get:()=>providers.value[props.providerId]?.apiKey||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].apiKey=value$1}}),baseUrl=computed({get:()=>providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].baseUrl=value$1}});return onMounted(()=>{providersStore.initializeProvider(props.providerId),apiKey.value=providers.value[props.providerId]?.apiKey||``,baseUrl.value=providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ProviderSettingsLayout2_default),{"provider-name":providerMetadata.value?.localizedName,"provider-icon":providerMetadata.value?.icon,"on-back":()=>unref(router$1).back()},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$10,[createVNode(unref(ProviderSettingsContainer_default),{class:`w-full md:w-[40%]`},{default:withCtx(()=>[createVNode(unref(ProviderBasicSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.basic.title`),description:unref(t$1)(`settings.pages.providers.common.section.basic.description`)},{default:withCtx(()=>[createVNode(unref(ProviderApiKeyInput_default),{modelValue:apiKey.value,"onUpdate:modelValue":_cache$1[0]||=$event=>apiKey.value=$event,"provider-name":providerMetadata.value?.localizedName,placeholder:props.placeholder||`API Key`},null,8,[`modelValue`,`provider-name`,`placeholder`]),renderSlot(_ctx.$slots,`basic-settings`)]),_:3},8,[`title`,`description`]),createVNode(unref(ProviderAdvancedSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.advanced.title`)},{default:withCtx(()=>[createVNode(unref(ProviderBaseUrlInput_default),{modelValue:baseUrl.value,"onUpdate:modelValue":_cache$1[1]||=$event=>baseUrl.value=$event,placeholder:providerMetadata.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`]),renderSlot(_ctx.$slots,`advanced-settings`)]),_:3},8,[`title`])]),_:3}),createBaseVNode(`div`,_hoisted_2$4,[createBaseVNode(`div`,_hoisted_3$1,[renderSlot(_ctx.$slots,`playground`)])])])]),_:3},8,[`provider-name`,`provider-icon`,`on-back`]))}}),TranscriptionProviderSettings_default=TranscriptionProviderSettings_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$9={"h-full":``,"w-full":``},_hoisted_2$3={key:0,"h-full":``,flex:``,"flex-col":``},_hoisted_3={class:`mb-2 text-center md:mb-8`,flex:``,"flex-1":``,"flex-col":``,"justify-center":``},_hoisted_4={initial:{opacity:0,scale:.5},visible:{opacity:1,scale:1},duration:500,class:`mb-1 flex justify-center md:mb-4 lg:pt-16 md:pt-8`},_hoisted_5=[`src`],_hoisted_6={initial:{opacity:0,y:10},visible:{opacity:1,y:0},duration:500,class:`mb-0 text-3xl text-neutral-800 font-bold md:mb-2 dark:text-neutral-100`},_hoisted_7={initial:{opacity:0,y:10},visible:{opacity:1,y:0},duration:500,delay:100,class:`text-sm text-neutral-600 md:text-lg dark:text-neutral-400`},_hoisted_8={key:1,"h-full":``,flex:``,"flex-col":``,"gap-4":``},_hoisted_9={sticky:``,"top-0":``,"z-100":``,flex:``,"flex-shrink-0":``,"items-center":``,"gap-2":``},_hoisted_10={class:`flex-1 text-center text-xl text-neutral-800 font-semibold md:text-left md:text-2xl dark:text-neutral-100`},_hoisted_11={class:`flex-1 overflow-y-auto`},_hoisted_12={class:`grid grid-cols-1 gap-3 sm:grid-cols-2`},_hoisted_13={key:2,"h-full":``,flex:``,"flex-col":``,"gap-4":``},_hoisted_14={sticky:``,"top-0":``,"z-100":``,flex:``,"flex-shrink-0":``,"items-center":``,"gap-2":``},_hoisted_15={class:`flex-1 text-center text-xl text-neutral-800 font-semibold md:text-left md:text-2xl dark:text-neutral-100`},_hoisted_16={key:0,"flex-1":``,"overflow-y-auto":``},_hoisted_17={class:`space-y-4`},_hoisted_18={key:0},_hoisted_19={key:1},_hoisted_20={key:2},_hoisted_21={key:0,class:`mt-4`},_hoisted_22={key:3,"h-full":``,flex:``,"flex-col":``,"gap-4":``},_hoisted_23={sticky:``,"top-0":``,"z-100":``,flex:``,"flex-shrink-0":``,"items-center":``,"gap-2":``},_hoisted_24={class:`flex-1 text-center text-xl text-neutral-800 font-semibold md:text-left md:text-2xl dark:text-neutral-100`},_hoisted_25={"flex-1":``};var Onboarding_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Onboarding`,emits:[`configured`,`skipped`],setup(__props,{emit:__emit}){let emit$1=__emit,step=ref(1),direction=ref(`next`),{t:t$1}=useI18n(),providersStore=useProvidersStore(),{providers,allChatProvidersMetadata}=storeToRefs(providersStore),consciousnessStore=useConsciousnessStore(),{activeModel,activeProvider,modelSearchQuery,providerModels,isLoadingActiveProviderModels}=storeToRefs(consciousnessStore),popularProviders=computed(()=>{let popular=[`openai`,`anthropic`,`google-generative-ai`,`openrouter-ai`,`ollama`,`deepseek`,`player2`];return allChatProvidersMetadata.value.filter(provider=>popular.includes(provider.id)).sort((a$1,b$1)=>popular.indexOf(a$1.id)-popular.indexOf(b$1.id))}),selectedProviderId=ref(``),apiKey=ref(``),baseUrl=ref(``),accountId=ref(``),selectedProvider=computed(()=>allChatProvidersMetadata.value.find(p$4=>p$4.id===selectedProviderId.value)||null),isValidating=ref(!1),isValid=ref(!1),validationMessage=ref(``),needsApiKey=computed(()=>selectedProvider.value?selectedProvider.value.id!==`ollama`&&selectedProvider.value.id!==`player2`:!1),needsBaseUrl=computed(()=>selectedProvider.value?selectedProvider.value.id!==`cloudflare-workers-ai`:!1),canSave=computed(()=>!selectedProvider.value||needsApiKey.value&&!apiKey.value.trim()||needsBaseUrl.value&&!baseUrl.value.trim()||selectedProvider.value.id===`cloudflare-workers-ai`&&!accountId.value.trim()||!activeModel.value?!1:isValid.value);function selectProvider(provider){selectedProviderId.value=provider.id;let defaultOptions=provider.defaultOptions?.()||{};baseUrl.value=defaultOptions?.baseUrl||``,apiKey.value=``,accountId.value=``,isValid.value=!1,validationMessage.value=``}function getApiKeyPlaceholder(_providerId){let placeholders={openai:`sk-...`,anthropic:`sk-ant-...`,"google-generative-ai":`GEMINI_API_KEY`,"openrouter-ai":`sk-or-...`,deepseek:`sk-...`,xai:`xai-...`,"together-ai":`togetherapi-...`,"mistral-ai":`mis-...`,"moonshot-ai":`ms-...`,"fireworks-ai":`fw-...`,"featherless-ai":`fw-...`,"novita-ai":`nvt-...`};return placeholders[_providerId]||`API Key`}function getBaseUrlPlaceholder(_providerId){let defaultOptions=selectedProvider.value?.defaultOptions?.()||{};return defaultOptions?.baseUrl||`https://api.example.com/v1/`}async function validateConfiguration(){if(selectedProvider.value){isValidating.value=!0,validationMessage.value=t$1(`settings.dialogs.onboarding.validating`);try{let config$1={};needsApiKey.value&&(config$1.apiKey=apiKey.value.trim()),needsBaseUrl.value&&(config$1.baseUrl=baseUrl.value.trim()),selectedProvider.value.id===`cloudflare-workers-ai`&&(config$1.accountId=accountId.value.trim());let metadata=providersStore.getProviderMetadata(selectedProvider.value.id);isValid.value=await metadata.validators.validateProviderConfig(config$1),isValid.value?validationMessage.value=t$1(`settings.dialogs.onboarding.validationSuccess`):validationMessage.value=t$1(`settings.dialogs.onboarding.validationFailed`)}catch(error){isValid.value=!1,validationMessage.value=t$1(`settings.dialogs.onboarding.validationError`,{error:error instanceof Error?error.message:String(error)})}finally{isValidating.value=!1}}}let debouncedValidateConfiguration=useDebounceFn(()=>{selectedProvider.value&&(needsApiKey.value&&!apiKey.value.trim()||needsBaseUrl.value&&!baseUrl.value.trim()||selectedProvider.value.id===`cloudflare-workers-ai`&&!accountId.value.trim()||validateConfiguration())},500);watch([apiKey,baseUrl,accountId],()=>{selectedProvider.value&&(apiKey.value||baseUrl.value||accountId.value)&&debouncedValidateConfiguration()},{deep:!0});function handlePreviousStep(){step.value>1&&(direction.value=`previous`,step.value--)}function handleNextStep(){step.value<4?(direction.value=`next`,step.value++):handleSave()}async function handleFinishProviderConfiguration(){if(!selectedProvider.value)return;let config$1={};needsApiKey.value&&(config$1.apiKey=apiKey.value.trim()),needsBaseUrl.value&&(config$1.baseUrl=baseUrl.value.trim()),selectedProvider.value.id===`cloudflare-workers-ai`&&(config$1.accountId=accountId.value.trim()),providers.value[selectedProvider.value.id]={...providers.value[selectedProvider.value.id],...config$1},activeProvider.value=selectedProvider.value.id,await nextTick(),await consciousnessStore.loadModelsForProvider(selectedProvider.value.id),handleNextStep()}async function handleSave(){emit$1(`configured`)}return onMounted(()=>{popularProviders.value.length>0&&(selectedProviderId.value=popularProviders.value[0].id,selectProvider(popularProviders.value[0]))}),(_ctx,_cache$1)=>{let _directive_motion=resolveDirective(`motion`);return openBlock(),createElementBlock(`div`,_hoisted_1$9,[createVNode(Transition,{name:direction.value===`next`?`slide-next`:`slide-prev`,mode:`out-in`},{default:withCtx(()=>[step.value===1?(openBlock(),createElementBlock(`div`,_hoisted_2$3,[createBaseVNode(`div`,_hoisted_3,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4,[createBaseVNode(`img`,{src:unref(onboarding_default),"max-h":`50`,"aspect-square":``,"h-auto":``,"w-auto":``,"object-cover":``},null,8,_hoisted_5)])),[[_directive_motion]]),withDirectives((openBlock(),createElementBlock(`h2`,_hoisted_6,[createTextVNode(toDisplayString(unref(t$1)(`settings.dialogs.onboarding.title`)),1)])),[[_directive_motion]]),withDirectives((openBlock(),createElementBlock(`p`,_hoisted_7,[createTextVNode(toDisplayString(unref(t$1)(`settings.dialogs.onboarding.description`)),1)])),[[_directive_motion]])]),withDirectives(createVNode(unref(Button_default),{initial:{opacity:0},visible:{opacity:1},duration:500,delay:200,label:unref(t$1)(`settings.dialogs.onboarding.start`),onClick:handleNextStep},null,8,[`label`]),[[_directive_motion]])])):step.value===2?(openBlock(),createElementBlock(`div`,_hoisted_8,[createBaseVNode(`div`,_hoisted_9,[createBaseVNode(`button`,{"outline-none":``,onClick:handlePreviousStep},_cache$1[6]||=[createBaseVNode(`div`,{class:`i-solar:alt-arrow-left-line-duotone h-5 w-5`},null,-1)]),createBaseVNode(`h2`,_hoisted_10,toDisplayString(unref(t$1)(`settings.dialogs.onboarding.selectProvider`)),1),_cache$1[7]||=createBaseVNode(`div`,{class:`h-5 w-5`},null,-1)]),createBaseVNode(`div`,_hoisted_11,[createBaseVNode(`div`,_hoisted_12,[(openBlock(!0),createElementBlock(Fragment,null,renderList(popularProviders.value,provider=>(openBlock(),createBlock(unref(RadioCardDetail_default),{id:provider.id,key:provider.id,modelValue:selectedProviderId.value,"onUpdate:modelValue":_cache$1[0]||=$event=>selectedProviderId.value=$event,name:`provider-selection`,value:provider.id,title:provider.localizedName||provider.id,description:provider.localizedDescription||``,onClick:$event=>selectProvider(provider)},null,8,[`id`,`modelValue`,`value`,`title`,`description`,`onClick`]))),128))])]),createVNode(unref(Button_default),{label:unref(t$1)(`settings.dialogs.onboarding.next`),disabled:!selectedProviderId.value,onClick:handleNextStep},null,8,[`label`,`disabled`])])):step.value===3&&selectedProvider.value?(openBlock(),createElementBlock(`div`,_hoisted_13,[createBaseVNode(`div`,_hoisted_14,[createBaseVNode(`button`,{"outline-none":``,onClick:handlePreviousStep},_cache$1[8]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-left-line-duotone":``,"h-5":``,"w-5":``},null,-1)]),createBaseVNode(`h2`,_hoisted_15,toDisplayString(unref(t$1)(`settings.dialogs.onboarding.configureProvider`,{provider:selectedProvider.value.localizedName})),1),_cache$1[9]||=createBaseVNode(`div`,{"h-5":``,"w-5":``},null,-1)]),selectedProvider.value?(openBlock(),createElementBlock(`div`,_hoisted_16,[createVNode(unref(Callout_default),{label:`Keep your API keys and credentials safe!`,theme:`violet`},{default:withCtx(()=>_cache$1[10]||=[createBaseVNode(`div`,null,[createBaseVNode(`div`,null,` AIRI is running pure locally in your browser, and we will never steal your credentials for AI / LLM providers. But keep in mind that your API keys are sensitive information. Make sure to keep them safe and do not share them with anyone. `),createBaseVNode(`div`,null,[createTextVNode(` AIRI is open sourced at `),createBaseVNode(`div`,{"inline-flex":``,"translate-y-1":``,"items-center":``,"gap-1":``},[createBaseVNode(`div`,{"i-simple-icons:github":``,"inline-block":``}),createBaseVNode(`a`,{"decoration-underline":``,"decoration-dashed":``,href:`https://github.com/moeru-ai/airi`,target:`_blank`,rel:`noopener noreferrer`},`GitHub`)]),createTextVNode(`, if you want to check how we handle your credentials, feel free to inspect our code. `)])],-1)]),_:1,__:[10]}),createBaseVNode(`div`,_hoisted_17,[needsApiKey.value?(openBlock(),createElementBlock(`div`,_hoisted_18,[createVNode(unref(FieldInput_default),{modelValue:apiKey.value,"onUpdate:modelValue":_cache$1[1]||=$event=>apiKey.value=$event,placeholder:getApiKeyPlaceholder(selectedProvider.value.id),type:`password`,label:`API Key`,description:`Enter your API key for the selected provider.`,required:``},null,8,[`modelValue`,`placeholder`])])):createCommentVNode(``,!0),needsBaseUrl.value?(openBlock(),createElementBlock(`div`,_hoisted_19,[createVNode(unref(FieldInput_default),{modelValue:baseUrl.value,"onUpdate:modelValue":_cache$1[2]||=$event=>baseUrl.value=$event,placeholder:getBaseUrlPlaceholder(selectedProvider.value.id),type:`text`,label:`Base URL`,description:`Enter the base URL for the provider's API.`},null,8,[`modelValue`,`placeholder`])])):createCommentVNode(``,!0),selectedProvider.value.id===`cloudflare-workers-ai`?(openBlock(),createElementBlock(`div`,_hoisted_20,[createVNode(unref(ProviderAccountIdInput_default),{modelValue:accountId.value,"onUpdate:modelValue":_cache$1[3]||=$event=>accountId.value=$event},null,8,[`modelValue`])])):createCommentVNode(``,!0)]),validationMessage.value?(openBlock(),createElementBlock(`div`,_hoisted_21,[createBaseVNode(`div`,{class:normalizeClass([`flex items-center rounded-lg p-3`,[isValidating.value?`bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300`:isValid.value?`bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300`:`bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300`]])},[createBaseVNode(`div`,{class:normalizeClass([`mr-2 text-lg`,[isValidating.value?`i-svg-spinners:3-dots-fade`:isValid.value?`i-solar:check-circle-bold-duotone`:`i-solar:danger-circle-bold-duotone`]])},null,2),createTextVNode(` `+toDisplayString(validationMessage.value),1)],2)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createVNode(unref(Button_default),{label:unref(t$1)(`settings.dialogs.onboarding.next`),disabled:!selectedProviderId.value,loading:unref(isLoadingActiveProviderModels),onClick:handleFinishProviderConfiguration},null,8,[`label`,`disabled`,`loading`])])):step.value===4&&selectedProvider.value?(openBlock(),createElementBlock(`div`,_hoisted_22,[createBaseVNode(`div`,_hoisted_23,[createBaseVNode(`button`,{"outline-none":``,onClick:handlePreviousStep},_cache$1[11]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-left-line-duotone":``,"h-5":``,"w-5":``},null,-1)]),createBaseVNode(`h2`,_hoisted_24,toDisplayString(unref(t$1)(`settings.dialogs.onboarding.select-model`)),1),_cache$1[12]||=createBaseVNode(`div`,{"h-5":``,"w-5":``},null,-1)]),createBaseVNode(`div`,_hoisted_25,[createVNode(unref(RadioCardManySelect_default),{modelValue:unref(activeModel),"onUpdate:modelValue":_cache$1[4]||=$event=>isRef(activeModel)?activeModel.value=$event:null,"search-query":unref(modelSearchQuery),"onUpdate:searchQuery":_cache$1[5]||=$event=>isRef(modelSearchQuery)?modelSearchQuery.value=$event:null,items:unref(providerModels).sort((a$1,b$1)=>a$1.id===unref(activeModel)?-1:b$1.id===unref(activeModel)?1:0),searchable:!0,"search-placeholder":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:unref(modelSearchQuery)}),"search-results-text":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"list-class":`max-h-[calc(100dvh-17rem)] sm:max-h-120`},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])]),createVNode(unref(Button_default),{variant:`primary`,disabled:!canSave.value,label:unref(t$1)(`settings.dialogs.onboarding.saveAndContinue`),onClick:handleSave},null,8,[`disabled`,`label`])])):createCommentVNode(``,!0)]),_:1},8,[`name`])])}}}),Onboarding_default=__plugin_vue_export_helper_default(Onboarding_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-181bca39`]]),OnboardingDialog_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`OnboardingDialog`,props:{modelValue:{type:Boolean,default:!1,required:!1},modelModifiers:{}},emits:mergeModels([`configured`,`skipped`],[`update:modelValue`]),setup(__props,{emit:__emit}){let emit$1=__emit,showDialog=useModel(__props,`modelValue`),isDesktop=useMediaQuery(`(min-width: 768px)`),screenSafeArea=useScreenSafeArea();return useResizeObserver(document.documentElement,()=>screenSafeArea.update()),onMounted(()=>screenSafeArea.update()),(_ctx,_cache$1)=>unref(isDesktop)?(openBlock(),createBlock(unref(DialogRoot_default),{key:0,open:showDialog.value,"onUpdate:open":_cache$1[2]||=value$1=>showDialog.value=value$1},{default:withCtx(()=>[createVNode(unref(DialogPortal_default),null,{default:withCtx(()=>[createVNode(unref(DialogOverlay_default),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm`}),createVNode(unref(DialogContent_default),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-[9999] max-h-full max-w-2xl w-[92dvw] transform overflow-y-scroll rounded-2xl bg-white p-6 shadow-xl outline-none backdrop-blur-md scrollbar-none -translate-x-1/2 -translate-y-1/2 dark:bg-neutral-900`},{default:withCtx(()=>[createVNode(Onboarding_default,{onConfigured:_cache$1[0]||=$event=>emit$1(`configured`),onSkipped:_cache$1[1]||=$event=>emit$1(`skipped`)})]),_:1})]),_:1})]),_:1},8,[`open`])):(openBlock(),createBlock(unref(St),{key:1,open:showDialog.value,"should-scale-background":``,"onUpdate:open":_cache$1[5]||=value$1=>showDialog.value=value$1},{default:withCtx(()=>[createVNode(unref(DialogPortal_default),null,{default:withCtx(()=>[createVNode(unref(Bt),{class:`fixed inset-0`}),createVNode(unref(Ct),{class:`fixed bottom-0 left-0 right-0 z-1000 mt-20 h-full max-h-[96%] flex flex-col rounded-t-2xl bg-neutral-50 px-4 pt-4 outline-none backdrop-blur-md dark:bg-neutral-900/95`,style:normalizeStyle({paddingBottom:`${Math.max(Number.parseFloat(unref(screenSafeArea).bottom.value.replace(`px`,``)),24)}px`})},{default:withCtx(()=>[createVNode(unref(Nt)),createVNode(Onboarding_default,{onConfigured:_cache$1[3]||=$event=>emit$1(`configured`),onSkipped:_cache$1[4]||=$event=>emit$1(`skipped`)})]),_:1},8,[`style`])]),_:1})]),_:1},8,[`open`]))}}),OnboardingDialog_default=OnboardingDialog_vue_vue_type_script_setup_true_lang_default;const ToasterRootInjectionKey=Symbol(`ToasterRoot`);var ToasterRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ToasterRoot`,emits:[`close`],setup(__props,{emit:__emit}){let emits=__emit;return provide(ToasterRootInjectionKey,{close:id=>emits(`close`,id)}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`)}}),ToasterRoot_default=ToasterRoot_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$8={key:0,flex:``,"gap-2":``};var ColorPalette_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ColorPalette`,props:{colors:{}},setup(__props){let settings=useSettings();return(_ctx,_cache$1)=>_ctx.colors.length?(openBlock(),createElementBlock(`div`,_hoisted_1$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_ctx.colors,({hex:hex$2,name:name$2})=>(openBlock(),createBlock(unref(TooltipProvider_default),{key:hex$2||`default`},{default:withCtx(()=>[createVNode(unref(TooltipRoot_default),null,{default:withCtx(()=>[createVNode(unref(TooltipTrigger_default),{transition:`all ease-in-out duration-250`,"size-8":``,"cursor-pointer":``,"rounded-full":``,"bg-primary-500":``,style:normalizeStyle(hex$2?{background:hex$2}:{"--chromatic-hue":unref(DEFAULT_THEME_COLORS_HUE)}),class:normalizeClass(unref(settings).isColorSelectedForPrimary(hex$2)?`scale-120 md:scale-150 mx-1`:`hover:scale-110`),onClick:$event=>unref(settings).applyPrimaryColorFrom(hex$2)},null,8,[`style`,`class`,`onClick`]),createVNode(unref(TooltipPortal_default),null,{default:withCtx(()=>[createVNode(unref(TooltipContent_default),{bg:`white dark:neutral-800`,"rounded-lg":``,"px-3":``,"py-1.5":``,"text-sm":``,"shadow-md":``},{default:withCtx(()=>[createTextVNode(toDisplayString(name$2)+` `,1),createVNode(unref(TooltipArrow_default),{"fill-white":``,"dark:fill-neutral-800":``})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):createCommentVNode(``,!0)}}),ColorPalette_default=ColorPalette_vue_vue_type_script_setup_true_lang_default,ArrowTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ArrowTransition`,props:{stageTransition:{default:()=>({primaryColor:`#666`,secondaryColor:`#ccc`})}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value.primaryColor||`#666`),overlayColor2=computed(()=>stageTransition.value.secondaryColor||`#ccc`);return onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-3`,style:normalizeStyle({zIndex:stageTransition.value.zIndex||100})},null,4))}}),ArrowTransition_default=__plugin_vue_export_helper_default(ArrowTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-17464329`]]),BubbleWaveOutTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`BubbleWaveOutTransition`,props:{stageTransition:{}},setup(__props){let props=__props,colors=computed(()=>props.stageTransition?.colors||[`#eee`,`#ebcb8b`,`#c56370`,`#3f3b52`]);return onMounted(()=>{document.documentElement.style.setProperty(`--circle-expansion-delay`,`${props.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--circle-expansion-duration`,`${props.stageTransition?.duration||.4}s`),colors.value.forEach((color$2,index$1)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${index$1+1}`,color$2)})}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`circle-expansion-transition`,style:normalizeStyle({zIndex:_ctx.stageTransition?.zIndex||100})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(colors.value,(_$1,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1}))),128))],4))}}),BubbleWaveOutTransition_default=__plugin_vue_export_helper_default(BubbleWaveOutTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-4624be9e`]]),FantasyFallTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FantasyFallTransition`,props:{stageTransition:{}},setup(__props){let props=__props,direction=computed(()=>props.stageTransition?.direction||`up`),directionClass=computed(()=>`fantasy-fall-${direction.value}`);return onMounted(()=>{document.documentElement.style.setProperty(`--fantasy-fall-color`,props.stageTransition?.primaryColor||`#eee`),document.documentElement.style.setProperty(`--fantasy-fall-duration`,`${props.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--fantasy-fall-delay`,`${props.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--fantasy-fall-radius-sm`,`${props.stageTransition?.borderRadius?.sm||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-md`,`${props.stageTransition?.borderRadius?.md||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-lg`,`${props.stageTransition?.borderRadius?.lg||`50%`}`)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`fantasy-fall-transition`,directionClass.value]),style:normalizeStyle({zIndex:_ctx.stageTransition?.zIndex??100})},null,6))}}),FantasyFallTransition_default=__plugin_vue_export_helper_default(FantasyFallTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-826171f5`]]),MultipleBlocksRevealTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`MultipleBlocksRevealTransition`,props:{stageTransition:{}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value?.primaryColor||`#666`),overlayColor2=computed(()=>stageTransition.value?.secondaryColor||`#ccc`);return onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-4`,style:normalizeStyle({zIndex:stageTransition.value?.zIndex??100})},_cache$1[0]||=[createStaticVNode(`
`,5)],4))}}),MultipleBlocksRevealTransition_default=__plugin_vue_export_helper_default(MultipleBlocksRevealTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-4221f976`]]),SlideTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SlideTransition`,props:{stageTransition:{}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value?.primaryColor||`#666`),overlayColor2=computed(()=>stageTransition.value?.secondaryColor||`#ccc`);return watch([stageTransition,overlayColor1,overlayColor2],()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,overlayColor2.value)}),onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-1`,style:normalizeStyle({zIndex:stageTransition.value?.zIndex??100})},null,4))}}),SlideTransition_default=__plugin_vue_export_helper_default(SlideTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-81c0af14`]]),SlopeSlideTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SlopeSlideTransition`,props:{stageTransition:{}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value?.primaryColor??`#666`),overlayColor2=computed(()=>stageTransition.value?.secondaryColor??`#ccc`);return onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-2`,style:normalizeStyle({zIndex:stageTransition.value?.zIndex??100})},null,4))}}),SlopeSlideTransition_default=__plugin_vue_export_helper_default(SlopeSlideTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-9e8b66c8`]]),RectanglesRotateTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`RectanglesRotateTransition`,props:{stageTransition:{}},setup(__props){let props=__props;return onMounted(()=>{document.documentElement.style.setProperty(`--rectangle-rotate-1-color`,props.stageTransition?.primaryColor||`#ebcb8b`),document.documentElement.style.setProperty(`--rectangle-rotate-2-color`,props.stageTransition?.secondaryColor||`#c56370`),document.documentElement.style.setProperty(`--rectangle-rotate-3-color`,props.stageTransition?.tertiaryColor||`#43445b`),document.documentElement.style.setProperty(`--rectangle-rotate-duration`,`${props.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--rectangle-rotate-delay`,`${props.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--rectangle-rotate-stagger`,`${props.stageTransition?.staggerDelay||.1}s`),document.documentElement.style.setProperty(`--rectangle-rotate-rotation`,`${props.stageTransition?.rotation||270}deg`)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`rectangle-rotate-transition`,style:normalizeStyle({zIndex:_ctx.stageTransition?.zIndex??100})},_cache$1[0]||=[createBaseVNode(`div`,{class:`rectangle rectangle-rotate-1`},[createBaseVNode(`div`)],-1),createBaseVNode(`div`,{class:`rectangle rectangle-rotate-2`},[createBaseVNode(`div`)],-1),createBaseVNode(`div`,{class:`rectangle rectangle-rotate-3`},[createBaseVNode(`div`)],-1)],4))}}),RectanglesRotateTransition_default=__plugin_vue_export_helper_default(RectanglesRotateTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-45ea2f7f`]]),StageTransitionGroup_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`StageTransitionGroup`,props:{primaryColor:{},secondaryColor:{},tertiaryColor:{},colors:{},zIndex:{},disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(__props){let props=__props,router$1=useRouter(),showTransition=ref(!1),transitionStage=ref(),activeTransitionName=ref(``),activeStageTransitionParams=ref(),transitions=shallowRef({slide:{component:SlideTransition_default,duration:2700},"slope-slide":{component:SlopeSlideTransition_default,duration:2700},arrow:{component:ArrowTransition_default,duration:2700},"multiple-blocks-reveal":{component:MultipleBlocksRevealTransition_default,duration:2800},"fantasy-fall":{component:FantasyFallTransition_default,duration:2700},"rectangles-rotate":{component:RectanglesRotateTransition_default,duration:2700},"bubble-wave-out":{component:BubbleWaveOutTransition_default,duration:1e3}}),lifecycleHooks=ref([]);function addTransitionHook(hook){return lifecycleHooks.value.push(hook),()=>{let index$1=lifecycleHooks.value.indexOf(hook);index$1>=0&&lifecycleHooks.value.splice(index$1,1)}}async function triggerHooks(stage,data$12={}){transitionStage.value=stage;for(let hook of lifecycleHooks.value)try{await Promise.resolve(hook(stage,data$12))}catch(error){console.error(`Error in transition hook at stage "${stage}":`,error)}}async function triggerTransitionAsyncFn(params,next,resolve$1){if(params.name===`none`||!params.name){next(),resolve$1();return}let transition=transitions.value[params.name];if(!transition){console.error(`Transition ${params.name} not found`),next(),resolve$1();return}let navTiming=transition.nextDelay===void 0?transition.duration/3:transition.nextDelay,hasNavigated=!1,navigationHook=stage=>{stage===`navigation`&&!hasNavigated&&(hasNavigated=!0,next())},removeNavHook=addTransitionHook(navigationHook);try{await triggerHooks(`before-enter`,{transitionName:params.name}),showTransition.value&&(await triggerHooks(`before-leave`,{transitionName:activeTransitionName.value}),activeTransitionName.value=``,activeStageTransitionParams.value=void 0,showTransition.value=!1,await triggerHooks(`after-leave`,{transitionName:activeTransitionName.value}),await new Promise(r$1=>setTimeout(r$1,50))),activeTransitionName.value=params.name,activeStageTransitionParams.value=params,showTransition.value=!0,await triggerHooks(`enter-active`,{transitionName:name}),setTimeout(async()=>{await triggerHooks(`navigation`,{transitionName:params.name,config:transition}),hasNavigated||(hasNavigated=!0,next())},navTiming),setTimeout(async()=>{await triggerHooks(`after-enter`,{transitionName:params.name})},transition.duration),setTimeout(async()=>{await triggerHooks(`before-leave`,{transitionName:params.name})},transition.duration+10),setTimeout(async()=>{await triggerHooks(`leave-active`,{transitionName:params.name})},transition.duration+20);let totalDuration=transition.exitDuration??0;setTimeout(async()=>{showTransition.value=!1,activeTransitionName.value=``,activeStageTransitionParams.value=void 0,await triggerHooks(`after-leave`,{transitionName:params.name}),resolve$1()},transition.duration+totalDuration)}catch(error){console.error(error)}finally{removeNavHook(),setTimeout(()=>{hasNavigated||(hasNavigated=!0,next())},transition.duration*2)}}function triggerTransition(params,next){return new Promise(resolve$1=>{triggerTransitionAsyncFn(params,next,resolve$1)})}return router$1.beforeEach((to$1,_from,next)=>{if(props.disableTransitions){next();return}if(typeof to$1.meta.stageTransition!=`object`){next();return}let stageTransition=to$1.meta.stageTransition;if(props.usePageSpecificTransitions&&stageTransition.pageSpecificAvailable){next();return}props.primaryColor!==void 0&&(stageTransition.primaryColor=props.primaryColor),props.secondaryColor!==void 0&&(stageTransition.secondaryColor=props.secondaryColor),props.tertiaryColor!==void 0&&(stageTransition.tertiaryColor=props.tertiaryColor),props.colors!==void 0&&(stageTransition.colors=props.colors),props.zIndex!==void 0&&(stageTransition.zIndex=props.zIndex),triggerTransition(stageTransition,next)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`),showTransition.value?(openBlock(),createElementBlock(Fragment,{key:0},[transitions.value[activeTransitionName.value]?(openBlock(),createBlock(resolveDynamicComponent(transitions.value[activeTransitionName.value].component),{key:0,"stage-transition":activeStageTransitionParams.value},null,8,[`stage-transition`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0)],64))}}),StageTransitionGroup_default=StageTransitionGroup_vue_vue_type_script_setup_true_lang_default;let toastsCounter=1;var Observer=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=subscriber=>(this.subscribers.push(subscriber),()=>{let index$1=this.subscribers.indexOf(subscriber);this.subscribers.splice(index$1,1)});publish=data$12=>{this.subscribers.forEach(subscriber=>subscriber(data$12))};addToast=data$12=>{this.publish(data$12),this.toasts=[...this.toasts,data$12]};create=data$12=>{let{message:message$1,...rest}=data$12,id=typeof data$12.id==`number`||data$12.id&&data$12.id?.length>0?data$12.id:toastsCounter++,alreadyExists=this.toasts.find(toast$1=>toast$1.id===id),dismissible=data$12.dismissible===void 0?!0:data$12.dismissible;return this.dismissedToasts.has(id)&&this.dismissedToasts.delete(id),alreadyExists?this.toasts=this.toasts.map(toast$1=>toast$1.id===id?(this.publish({...toast$1,...data$12,id,title:message$1}),{...toast$1,...data$12,id,dismissible,title:message$1}):toast$1):this.addToast({title:message$1,...rest,dismissible,id}),id};dismiss=id=>(id?(this.dismissedToasts.add(id),requestAnimationFrame(()=>this.subscribers.forEach(subscriber=>subscriber({id,dismiss:!0})))):this.toasts.forEach(toast$1=>{this.subscribers.forEach(subscriber=>subscriber({id:toast$1.id,dismiss:!0}))}),id);message=(message$1,data$12)=>this.create({...data$12,message:message$1,type:`default`});error=(message$1,data$12)=>this.create({...data$12,type:`error`,message:message$1});success=(message$1,data$12)=>this.create({...data$12,type:`success`,message:message$1});info=(message$1,data$12)=>this.create({...data$12,type:`info`,message:message$1});warning=(message$1,data$12)=>this.create({...data$12,type:`warning`,message:message$1});loading=(message$1,data$12)=>this.create({...data$12,type:`loading`,message:message$1});promise=(promise,data$12)=>{if(!data$12)return;let id;data$12.loading!==void 0&&(id=this.create({...data$12,promise,type:`loading`,message:data$12.loading,description:typeof data$12.description==`function`?void 0:data$12.description}));let p$4=Promise.resolve(promise instanceof Function?promise():promise),shouldDismiss=id!==void 0,result,originalPromise=p$4.then(async response=>{result=[`resolve`,response];let isVueComponent=isVNode(response);if(isVueComponent)shouldDismiss=!1,this.create({id,type:`default`,message:response});else if(isHttpResponse(response)&&!response.ok){shouldDismiss=!1;let promiseData=typeof data$12.error==`function`?await data$12.error(`HTTP error! status: ${response.status}`):data$12.error,description=typeof data$12.description==`function`?await data$12.description(`HTTP error! status: ${response.status}`):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`error`,description,...toastSettings})}else if(response instanceof Error){shouldDismiss=!1;let promiseData=typeof data$12.error==`function`?await data$12.error(response):data$12.error,description=typeof data$12.description==`function`?await data$12.description(response):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`error`,description,...toastSettings})}else if(data$12.success!==void 0){shouldDismiss=!1;let promiseData=typeof data$12.success==`function`?await data$12.success(response):data$12.success,description=typeof data$12.description==`function`?await data$12.description(response):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`success`,description,...toastSettings})}}).catch(async error=>{if(result=[`reject`,error],data$12.error!==void 0){shouldDismiss=!1;let promiseData=typeof data$12.error==`function`?await data$12.error(error):data$12.error,description=typeof data$12.description==`function`?await data$12.description(error):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`error`,description,...toastSettings})}}).finally(()=>{shouldDismiss&&(this.dismiss(id),id=void 0),data$12.finally?.()}),unwrap=()=>new Promise((resolve$1,reject)=>originalPromise.then(()=>result[0]===`reject`?reject(result[1]):resolve$1(result[1])).catch(reject));return typeof id!=`string`&&typeof id!=`number`?{unwrap}:Object.assign(id,{unwrap})};custom=(component,data$12)=>{let id=data$12?.id||toastsCounter++;return this.publish({component,id,...data$12}),id};getActiveToasts=()=>this.toasts.filter(toast$1=>!this.dismissedToasts.has(toast$1.id))};const ToastState=new Observer;function toastFunction(message$1,data$12){let id=data$12?.id||toastsCounter++;return ToastState.create({message:message$1,id,type:`default`,...data$12}),id}const isHttpResponse=data$12=>data$12&&typeof data$12==`object`&&`ok`in data$12&&typeof data$12.ok==`boolean`&&`status`in data$12&&typeof data$12.status==`number`,basicToast=toastFunction,getHistory=()=>ToastState.toasts,getToasts=()=>ToastState.getActiveToasts(),toast=Object.assign(basicToast,{success:ToastState.success,info:ToastState.info,warning:ToastState.warning,error:ToastState.error,custom:ToastState.custom,message:ToastState.message,promise:ToastState.promise,dismiss:ToastState.dismiss,loading:ToastState.loading},{getHistory,getToasts});function isAction(action){return action.label!==void 0}const VISIBLE_TOASTS_AMOUNT=3,VIEWPORT_OFFSET=`24px`,MOBILE_VIEWPORT_OFFSET=`16px`,TOAST_LIFETIME=4e3,TOAST_WIDTH=356,GAP=14,SWIPE_THRESHOLD=45,TIME_BEFORE_UNMOUNT=200;function useIsDocumentHidden(){let isDocumentHidden=ref(!1);return watchEffect(()=>{let callback=()=>{isDocumentHidden.value=document.hidden};return document.addEventListener(`visibilitychange`,callback),()=>window.removeEventListener(`visibilitychange`,callback)}),{isDocumentHidden}}function cn(...classes){return classes.filter(Boolean).join(` `)}function getDefaultSwipeDirections(position$2){let[y,x$1]=position$2.split(`-`),directions=[];return y&&directions.push(y),x$1&&directions.push(x$1),directions}function assignOffset(defaultOffset$1,mobileOffset){let styles={};return[defaultOffset$1,mobileOffset].forEach((offset$2,index$1)=>{let isMobile=index$1===1,prefix=isMobile?`--mobile-offset`:`--offset`,defaultValue=isMobile?MOBILE_VIEWPORT_OFFSET:VIEWPORT_OFFSET;function assignAll(offset$1$1){[`top`,`right`,`bottom`,`left`].forEach(key$2=>{styles[`${prefix}-${key$2}`]=typeof offset$1$1==`number`?`${offset$1$1}px`:offset$1$1})}typeof offset$2==`number`||typeof offset$2==`string`?assignAll(offset$2):typeof offset$2==`object`?[`top`,`right`,`bottom`,`left`].forEach(key$2=>{offset$2[key$2]===void 0?styles[`${prefix}-${key$2}`]=defaultValue:styles[`${prefix}-${key$2}`]=typeof offset$2[key$2]==`number`?`${offset$2[key$2]}px`:offset$2[key$2]}):assignAll(defaultValue)}),styles}const _hoisted_1$7=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`],_hoisted_2$2=[`aria-label`,`data-disabled`];var Toast_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,swipeDirection=ref(null),swipeOutDirection=ref(null),mounted=ref(!1),removed=ref(!1),swiping=ref(!1),swipeOut=ref(!1),swiped=ref(!1),offsetBeforeRemove=ref(0),initialHeight=ref(0),remainingTime=ref(props.toast.duration||props.duration||TOAST_LIFETIME),dragStartTime=ref(null),toastRef=ref(null),isFront=computed(()=>props.index===0),isVisible=computed(()=>props.index+1<=props.visibleToasts),toastType=computed(()=>props.toast.type),dismissible=computed(()=>props.toast.dismissible!==!1),toastClass=computed(()=>props.toast.class||``),toastDescriptionClass=computed(()=>props.descriptionClass||``),heightIndex=computed(()=>{let currentPosition=props.toast.position||props.position,samePositionHeights=props.heights.filter(h$1=>h$1.position===currentPosition),index$1=samePositionHeights.findIndex(height=>height.toastId===props.toast.id);return index$1>=0?index$1:0}),toastsHeightBefore=computed(()=>{let currentPosition=props.toast.position||props.position,samePositionHeights=props.heights.filter(h$1=>h$1.position===currentPosition);return samePositionHeights.reduce((prev,curr,reducerIndex)=>reducerIndex>=heightIndex.value?prev:prev+curr.height,0)}),offset$2=computed(()=>heightIndex.value*props.gap+toastsHeightBefore.value||0),closeButton=computed(()=>props.toast.closeButton??props.closeButton),duration$2=computed(()=>props.toast.duration||props.duration||TOAST_LIFETIME),closeTimerStartTimeRef=ref(0),lastCloseTimerStartTimeRef=ref(0),pointerStartRef=ref(null),coords$1=computed(()=>props.position.split(`-`)),y=computed(()=>coords$1.value[0]),x$1=computed(()=>coords$1.value[1]),isStringOfTitle=computed(()=>typeof props.toast.title!=`string`),isStringOfDescription=computed(()=>typeof props.toast.description!=`string`),{isDocumentHidden}=useIsDocumentHidden(),disabled=computed(()=>toastType.value&&toastType.value===`loading`);onMounted(()=>{mounted.value=!0,remainingTime.value=duration$2.value}),watchEffect(async()=>{if(!mounted.value||!toastRef.value)return;await nextTick();let toastNode=toastRef.value,originalHeight=toastNode.style.height;toastNode.style.height=`auto`;let newHeight=toastNode.getBoundingClientRect().height;toastNode.style.height=originalHeight,initialHeight.value=newHeight,emit$1(`update:height`,{toastId:props.toast.id,height:newHeight,position:props.toast.position||props.position})});function deleteToast(){removed.value=!0,offsetBeforeRemove.value=offset$2.value,setTimeout(()=>{emit$1(`removeToast`,props.toast)},TIME_BEFORE_UNMOUNT)}function handleCloseToast(){if(disabled.value||!dismissible.value)return{};deleteToast(),props.toast.onDismiss?.(props.toast)}function onPointerDown(event){disabled.value||!dismissible.value||(dragStartTime.value=new Date,offsetBeforeRemove.value=offset$2.value,event.target.setPointerCapture(event.pointerId),event.target.tagName!==`BUTTON`&&(swiping.value=!0,pointerStartRef.value={x:event.clientX,y:event.clientY}))}function onPointerUp(){if(swipeOut.value||!dismissible.value)return;pointerStartRef.value=null;let swipeAmountX=Number(toastRef.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),swipeAmountY=Number(toastRef.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),timeTaken=new Date().getTime()-(dragStartTime.value?.getTime()||0),swipeAmount=swipeDirection.value===`x`?swipeAmountX:swipeAmountY,velocity=Math.abs(swipeAmount)/timeTaken;if(Math.abs(swipeAmount)>=SWIPE_THRESHOLD||velocity>.11){offsetBeforeRemove.value=offset$2.value,props.toast.onDismiss?.(props.toast),swipeDirection.value===`x`?swipeOutDirection.value=swipeAmountX>0?`right`:`left`:swipeOutDirection.value=swipeAmountY>0?`down`:`up`,deleteToast(),swipeOut.value=!0;return}else toastRef.value?.style.setProperty(`--swipe-amount-x`,`0px`),toastRef.value?.style.setProperty(`--swipe-amount-y`,`0px`);swiped.value=!1,swiping.value=!1,swipeDirection.value=null}function onPointerMove(event){if(!pointerStartRef.value||!dismissible.value)return;let isHighlighted=window?.getSelection()?.toString()?.length??!1;if(isHighlighted)return;let yDelta=event.clientY-pointerStartRef.value.y,xDelta=event.clientX-pointerStartRef.value.x,swipeDirections=props.swipeDirections??getDefaultSwipeDirections(props.position);!swipeDirection.value&&(Math.abs(xDelta)>1||Math.abs(yDelta)>1)&&(swipeDirection.value=Math.abs(xDelta)>Math.abs(yDelta)?`x`:`y`);let swipeAmount={x:0,y:0},getDampening=delta=>{let factor$1=Math.abs(delta)/20;return 1/(1.5+factor$1)};if(swipeDirection.value===`y`){if(swipeDirections.includes(`top`)||swipeDirections.includes(`bottom`))if(swipeDirections.includes(`top`)&&yDelta<0||swipeDirections.includes(`bottom`)&&yDelta>0)swipeAmount.y=yDelta;else{let dampenedDelta=yDelta*getDampening(yDelta);swipeAmount.y=Math.abs(dampenedDelta)0)swipeAmount.x=xDelta;else{let dampenedDelta=xDelta*getDampening(xDelta);swipeAmount.x=Math.abs(dampenedDelta)0||Math.abs(swipeAmount.y)>0)&&(swiped.value=!0),toastRef.value?.style.setProperty(`--swipe-amount-x`,`${swipeAmount.x}px`),toastRef.value?.style.setProperty(`--swipe-amount-y`,`${swipeAmount.y}px`)}onMounted(()=>{if(mounted.value=!0,!toastRef.value)return;let height=toastRef.value.getBoundingClientRect().height;initialHeight.value=height;let newHeights=[{toastId:props.toast.id,height,position:props.toast.position},...props.heights];emit$1(`update:heights`,newHeights)}),onBeforeUnmount(()=>{toastRef.value&&emit$1(`removeToast`,props.toast)}),watchEffect(onInvalidate=>{if(props.toast.promise&&toastType.value===`loading`||props.toast.duration===1/0||props.toast.type===`loading`)return;let timeoutId,pauseTimer=()=>{if(lastCloseTimerStartTimeRef.value{remainingTime.value!==1/0&&(closeTimerStartTimeRef.value=new Date().getTime(),timeoutId=setTimeout(()=>{props.toast.onAutoClose?.(props.toast),deleteToast()},remainingTime.value))};props.expanded||props.interacting||isDocumentHidden.value?pauseTimer():startTimer(),onInvalidate(()=>{clearTimeout(timeoutId)})}),watch(()=>props.toast.delete,value$1=>{value$1!==void 0&&value$1&&deleteToast()},{deep:!0});function handleDragEnd(){swiping.value=!1,swipeDirection.value=null,pointerStartRef.value=null}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:toastRef,class:normalizeClass(unref(cn)(props.class,toastClass.value,_ctx.classes?.toast,_ctx.toast.classes?.toast,_ctx.classes?.[toastType.value],_ctx.toast?.classes?.[toastType.value])),"data-sonner-toast":``,"data-rich-colors":_ctx.toast.richColors??_ctx.defaultRichColors,"data-styled":!(_ctx.toast.component||_ctx.toast?.unstyled||_ctx.unstyled),"data-mounted":mounted.value,"data-promise":!!_ctx.toast.promise,"data-swiped":swiped.value,"data-removed":removed.value,"data-visible":isVisible.value,"data-y-position":y.value,"data-x-position":x$1.value,"data-index":_ctx.index,"data-front":isFront.value,"data-swiping":swiping.value,"data-dismissible":dismissible.value,"data-type":toastType.value,"data-invert":_ctx.toast.invert||_ctx.invert,"data-swipe-out":swipeOut.value,"data-swipe-direction":swipeOutDirection.value,"data-expanded":!!(_ctx.expanded||_ctx.expandByDefault&&mounted.value),style:normalizeStyle({"--index":_ctx.index,"--toasts-before":_ctx.index,"--z-index":_ctx.toasts.length-_ctx.index,"--offset":`${removed.value?offsetBeforeRemove.value:offset$2.value}px`,"--initial-height":_ctx.expandByDefault?`auto`:`${initialHeight.value}px`,..._ctx.style,...props.toast.style}),onDragend:handleDragEnd,onPointerdown:onPointerDown,onPointerup:onPointerUp,onPointermove:onPointerMove},[closeButton.value&&!_ctx.toast.component&&toastType.value!==`loading`?(openBlock(),createElementBlock(`button`,{key:0,"aria-label":_ctx.closeButtonAriaLabel||`Close toast`,"data-disabled":disabled.value,"data-close-button":`true`,class:normalizeClass(unref(cn)(_ctx.classes?.closeButton,_ctx.toast?.classes?.closeButton)),onClick:handleCloseToast},[_ctx.icons?.close?(openBlock(),createBlock(resolveDynamicComponent(_ctx.icons?.close),{key:0})):renderSlot(_ctx.$slots,`close-icon`,{key:1})],10,_hoisted_2$2)):createCommentVNode(`v-if`,!0),_ctx.toast.component?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.component),mergeProps({key:1},_ctx.toast.componentProps,{onCloseToast:handleCloseToast}),null,16)):(openBlock(),createElementBlock(Fragment,{key:2},[toastType.value!==`default`||_ctx.toast.icon||_ctx.toast.promise?(openBlock(),createElementBlock(`div`,{key:0,"data-icon":``,class:normalizeClass(unref(cn)(_ctx.classes?.icon,_ctx.toast?.classes?.icon))},[_ctx.toast.icon?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.icon),{key:0})):(openBlock(),createElementBlock(Fragment,{key:1},[toastType.value===`loading`?renderSlot(_ctx.$slots,`loading-icon`,{key:0}):toastType.value===`success`?renderSlot(_ctx.$slots,`success-icon`,{key:1}):toastType.value===`error`?renderSlot(_ctx.$slots,`error-icon`,{key:2}):toastType.value===`warning`?renderSlot(_ctx.$slots,`warning-icon`,{key:3}):toastType.value===`info`?renderSlot(_ctx.$slots,`info-icon`,{key:4}):createCommentVNode(`v-if`,!0)],64))],2)):createCommentVNode(`v-if`,!0),createBaseVNode(`div`,{"data-content":``,class:normalizeClass(unref(cn)(_ctx.classes?.content,_ctx.toast?.classes?.content))},[createBaseVNode(`div`,{"data-title":``,class:normalizeClass(unref(cn)(_ctx.classes?.title,_ctx.toast.classes?.title))},[isStringOfTitle.value?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.title),normalizeProps(mergeProps({key:0},_ctx.toast.componentProps)),null,16)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.toast.title),1)],64))],2),_ctx.toast.description?(openBlock(),createElementBlock(`div`,{key:0,"data-description":``,class:normalizeClass(unref(cn)(_ctx.descriptionClass,toastDescriptionClass.value,_ctx.classes?.description,_ctx.toast.classes?.description))},[isStringOfDescription.value?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.description),normalizeProps(mergeProps({key:0},_ctx.toast.componentProps)),null,16)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.toast.description),1)],64))],2)):createCommentVNode(`v-if`,!0)],2),_ctx.toast.cancel?(openBlock(),createElementBlock(`button`,{key:1,style:normalizeStyle(_ctx.toast.cancelButtonStyle||_ctx.cancelButtonStyle),class:normalizeClass(unref(cn)(_ctx.classes?.cancelButton,_ctx.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:_cache$1[0]||=event=>{unref(isAction)(_ctx.toast.cancel)&&dismissible.value&&(_ctx.toast.cancel.onClick?.(event),deleteToast())}},toDisplayString(unref(isAction)(_ctx.toast.cancel)?_ctx.toast.cancel?.label:_ctx.toast.cancel),7)):createCommentVNode(`v-if`,!0),_ctx.toast.action?(openBlock(),createElementBlock(`button`,{key:2,style:normalizeStyle(_ctx.toast.actionButtonStyle||_ctx.actionButtonStyle),class:normalizeClass(unref(cn)(_ctx.classes?.actionButton,_ctx.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:_cache$1[1]||=event=>{unref(isAction)(_ctx.toast.action)&&(_ctx.toast.action.onClick?.(event),!event.defaultPrevented&&deleteToast())}},toDisplayString(unref(isAction)(_ctx.toast.action)?_ctx.toast.action?.label:_ctx.toast.action),7)):createCommentVNode(`v-if`,!0)],64))],46,_hoisted_1$7))}}),Toast_default=Toast_vue_vue_type_script_setup_true_lang_default,export_helper_default=(sfc,props)=>{let target$1=sfc.__vccOpts||sfc;for(let[key$2,val]of props)target$1[key$2]=val;return target$1};const _sfc_main$4={},_hoisted_1$6={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function _sfc_render$4(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$6,_cache$1[0]||=[createBaseVNode(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),createBaseVNode(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var CloseIcon_default=export_helper_default(_sfc_main$4,[[`render`,_sfc_render$4]]);const _hoisted_1$5=[`data-visible`],_hoisted_2$1={class:`sonner-spinner`};var Loader_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Loader`,props:{visible:{type:Boolean}},setup(__props){let bars=Array(12).fill(0);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`sonner-loading-wrapper`,"data-visible":_ctx.visible},[createBaseVNode(`div`,_hoisted_2$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(bars),bar=>(openBlock(),createElementBlock(`div`,{key:`spinner-bar-${bar}`,class:`sonner-loading-bar`}))),128))])],8,_hoisted_1$5))}}),Loader_default=Loader_vue_vue_type_script_setup_true_lang_default;const _sfc_main$3={},_hoisted_1$4={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render$3(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$4,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var SuccessIcon_default=export_helper_default(_sfc_main$3,[[`render`,_sfc_render$3]]);const _sfc_main$2={},_hoisted_1$3={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render$2(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$3,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var InfoIcon_default=export_helper_default(_sfc_main$2,[[`render`,_sfc_render$2]]);const _sfc_main$1={},_hoisted_1$2={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render$1(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$2,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var WarningIcon_default=export_helper_default(_sfc_main$1,[[`render`,_sfc_render$1]]);const _sfc_main={},_hoisted_1$1={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$1,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var ErrorIcon_default=export_helper_default(_sfc_main,[[`render`,_sfc_render]]);const _hoisted_1=[`aria-label`],_hoisted_2=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`,`data-lifted`],isClient=typeof window<`u`&&typeof document<`u`;function getDocumentDirection(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let dirAttribute=document.documentElement.getAttribute(`dir`);return dirAttribute===`auto`||!dirAttribute?window.getComputedStyle(document.documentElement).direction:dirAttribute}var Toaster_vue_vue_type_script_setup_true_lang_default=defineComponent({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:GAP},visibleToasts:{default:VISIBLE_TOASTS_AMOUNT},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:VIEWPORT_OFFSET},mobileOffset:{default:MOBILE_VIEWPORT_OFFSET},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(__props){let props=__props,attrs=useAttrs(),toasts=ref([]);function filteredToasts(pos,index$1){return toasts.value.filter(toast$1=>!toast$1.position&&index$1===0||toast$1.position===pos)}let possiblePositions=computed(()=>{let posList=toasts.value.filter(toast$1=>toast$1.position).map(toast$1=>toast$1.position);return posList.length>0?Array.from(new Set([props.position].concat(posList))):[props.position]}),toastsByPosition=computed(()=>{let result={};return possiblePositions.value.forEach(pos=>{result[pos]=toasts.value.filter(t$1=>t$1.position===pos)}),result}),heights=ref([]),expanded=ref(!1),interacting=ref(!1),actualTheme=ref(props.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:props.theme),listRef=ref(null),lastFocusedElementRef=ref(null),isFocusWithinRef=ref(!1),hotkeyLabel=props.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function removeToast(toastToRemove){toasts.value.find(toast$1=>toast$1.id===toastToRemove.id)?.delete||ToastState.dismiss(toastToRemove.id),toasts.value=toasts.value.filter(({id})=>id!==toastToRemove.id),setTimeout(()=>{toasts.value.find(t$1=>t$1.id===toastToRemove.id)||(heights.value=heights.value.filter(h$1=>h$1.toastId!==toastToRemove.id))},TIME_BEFORE_UNMOUNT+50)}function onBlur(event){isFocusWithinRef.value&&!event.currentTarget?.contains?.(event.relatedTarget)&&(isFocusWithinRef.value=!1,lastFocusedElementRef.value&&(lastFocusedElementRef.value.focus({preventScroll:!0}),lastFocusedElementRef.value=null))}function onFocus(event){let isNotDismissible=event.target instanceof HTMLElement&&event.target.dataset.dismissible===`false`;isNotDismissible||isFocusWithinRef.value||(isFocusWithinRef.value=!0,lastFocusedElementRef.value=event.relatedTarget)}function onPointerDown(event){if(event.target){let isNotDismissible=event.target instanceof HTMLElement&&event.target.dataset.dismissible===`false`;if(isNotDismissible)return}interacting.value=!0}watchEffect(onInvalidate=>{let unsubscribe=ToastState.subscribe(toast$1=>{if(toast$1.dismiss){requestAnimationFrame(()=>{toasts.value=toasts.value.map(t$1=>t$1.id===toast$1.id?{...t$1,delete:!0}:t$1)});return}nextTick(()=>{let indexOfExistingToast=toasts.value.findIndex(t$1=>t$1.id===toast$1.id);indexOfExistingToast===-1?toasts.value=[toast$1,...toasts.value]:toasts.value=[...toasts.value.slice(0,indexOfExistingToast),{...toasts.value[indexOfExistingToast],...toast$1},...toasts.value.slice(indexOfExistingToast+1)]})});onInvalidate(unsubscribe)}),watchEffect(onInvalidate=>{if(typeof window>`u`)return;if(props.theme!==`system`){actualTheme.value=props.theme;return}let darkMediaQuery=window.matchMedia(`(prefers-color-scheme: dark)`),updateTheme=matches$1=>{actualTheme.value=matches$1?`dark`:`light`};updateTheme(darkMediaQuery.matches);let handler=event=>{updateTheme(event.matches)};try{darkMediaQuery.addEventListener(`change`,handler)}catch{darkMediaQuery.addListener(handler)}onInvalidate(()=>{try{darkMediaQuery.removeEventListener(`change`,handler)}catch{darkMediaQuery.removeListener(handler)}})}),watchEffect(()=>{listRef.value&&lastFocusedElementRef.value&&(lastFocusedElementRef.value.focus({preventScroll:!0}),lastFocusedElementRef.value=null,isFocusWithinRef.value=!1)}),watchEffect(()=>{toasts.value.length<=1&&(expanded.value=!1)}),watchEffect(onInvalidate=>{function handleKeyDown(event){let isHotkeyPressed=props.hotkey.every(key$2=>event[key$2]||event.code===key$2),listRefItem=Array.isArray(listRef.value)?listRef.value[0]:listRef.value;isHotkeyPressed&&(expanded.value=!0,listRefItem?.focus());let isItemActive=document.activeElement===listRef.value||listRefItem?.contains(document.activeElement);event.code===`Escape`&&isItemActive&&(expanded.value=!1)}isClient&&(document.addEventListener(`keydown`,handleKeyDown),onInvalidate(()=>{document.removeEventListener(`keydown`,handleKeyDown)}))});function handleMouseEnter(){expanded.value=!0}function handleMouseLeave(){interacting.value||(expanded.value=!1)}function handleDragEnd(){expanded.value=!1}function handlePointerUp(){interacting.value=!1}function updateHeights(h$1){heights.value=h$1}function updateHeight(h$1){let index$1=heights.value.findIndex(item=>item.toastId===h$1.toastId);if(index$1!==-1)heights.value[index$1]=h$1;else{let samePositionIndex=heights.value.findIndex(item=>item.position===h$1.position);samePositionIndex===-1?heights.value.unshift(h$1):heights.value.splice(samePositionIndex,0,h$1)}}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createCommentVNode(` Remove item from normal navigation flow, only available via hotkey `),createBaseVNode(`section`,{"aria-label":`${_ctx.containerAriaLabel} ${unref(hotkeyLabel)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(openBlock(!0),createElementBlock(Fragment,null,renderList(possiblePositions.value,(pos,index$1)=>(openBlock(),createElementBlock(`ol`,mergeProps({key:pos,ref_for:!0,ref_key:`listRef`,ref:listRef,"data-sonner-toaster":``,"data-sonner-theme":actualTheme.value,class:props.class,dir:_ctx.dir===`auto`?getDocumentDirection():_ctx.dir,tabIndex:-1,"data-theme":_ctx.theme,"data-rich-colors":_ctx.richColors,"data-y-position":pos.split(`-`)[0],"data-x-position":pos.split(`-`)[1],"data-lifted":expanded.value&&toasts.value.length>1&&!_ctx.expand,style:{"--front-toast-height":`${heights.value[0]?.height||0}px`,"--width":`${unref(TOAST_WIDTH)}px`,"--gap":`${_ctx.gap}px`,..._ctx.style,...unref(attrs).style,...unref(assignOffset)(_ctx.offset,_ctx.mobileOffset)}},_ctx.$attrs,{onBlur,onFocus,onMouseenter:handleMouseEnter,onMousemove:handleMouseEnter,onMouseleave:handleMouseLeave,onDragend:handleDragEnd,onPointerdown:onPointerDown,onPointerup:handlePointerUp}),[(openBlock(!0),createElementBlock(Fragment,null,renderList(filteredToasts(pos,index$1),(toast$1,idx)=>(openBlock(),createBlock(Toast_default,{key:toast$1.id,heights:heights.value,icons:_ctx.icons,index:idx,toast:toast$1,defaultRichColors:_ctx.richColors,duration:_ctx.toastOptions?.duration??_ctx.duration,class:normalizeClass(_ctx.toastOptions?.class??``),descriptionClass:_ctx.toastOptions?.descriptionClass,invert:_ctx.invert,visibleToasts:_ctx.visibleToasts,closeButton:_ctx.toastOptions?.closeButton??_ctx.closeButton,interacting:interacting.value,position:pos,style:normalizeStyle(_ctx.toastOptions?.style),unstyled:_ctx.toastOptions?.unstyled,classes:_ctx.toastOptions?.classes,cancelButtonStyle:_ctx.toastOptions?.cancelButtonStyle,actionButtonStyle:_ctx.toastOptions?.actionButtonStyle,"close-button-aria-label":_ctx.toastOptions?.closeButtonAriaLabel,toasts:toastsByPosition.value[pos],expandByDefault:_ctx.expand,gap:_ctx.gap,expanded:expanded.value,swipeDirections:props.swipeDirections,"onUpdate:heights":updateHeights,"onUpdate:height":updateHeight,onRemoveToast:removeToast},{"close-icon":withCtx(()=>[renderSlot(_ctx.$slots,`close-icon`,{},()=>[createVNode(CloseIcon_default)])]),"loading-icon":withCtx(()=>[renderSlot(_ctx.$slots,`loading-icon`,{},()=>[createVNode(Loader_default,{visible:toast$1.type===`loading`},null,8,[`visible`])])]),"success-icon":withCtx(()=>[renderSlot(_ctx.$slots,`success-icon`,{},()=>[createVNode(SuccessIcon_default)])]),"error-icon":withCtx(()=>[renderSlot(_ctx.$slots,`error-icon`,{},()=>[createVNode(ErrorIcon_default)])]),"warning-icon":withCtx(()=>[renderSlot(_ctx.$slots,`warning-icon`,{},()=>[createVNode(WarningIcon_default)])]),"info-icon":withCtx(()=>[renderSlot(_ctx.$slots,`info-icon`,{},()=>[createVNode(InfoIcon_default)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,_hoisted_2))),128))],8,_hoisted_1)],2112))}}),Toaster_default=Toaster_vue_vue_type_script_setup_true_lang_default;const usePWAStore=defineStore(`pwa`,()=>{ref([]);let breakpoints=useBreakpoints(breakpointsTailwind);breakpoints.smaller(`md`),onMounted(async()=>{})});var App_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`App`,setup(__props){usePWAStore();let i18n$1=useI18n(),settings=storeToRefs(useSettings()),onboardingStore=useOnboardingStore(),{shouldShowSetup}=storeToRefs(onboardingStore),isDark=useDark(),primaryColor=computed(()=>isDark.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 90%, oklch(90% 0 360))`),secondaryColor=computed(()=>isDark.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 90%, oklch(90% 0 360))`),tertiaryColor=computed(()=>isDark.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 90%, oklch(90% 0 360))`),colors=computed(()=>[primaryColor.value,secondaryColor.value,tertiaryColor.value,isDark.value?`#121212`:`#FFFFFF`]);watch(settings.language,()=>{i18n$1.locale.value=settings.language.value}),watch(settings.themeColorsHue,()=>{document.documentElement.style.setProperty(`--chromatic-hue`,settings.themeColorsHue.value.toString())},{immediate:!0}),watch(settings.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle(`dynamic-hue`,settings.themeColorsHueDynamic.value)},{immediate:!0}),onMounted(()=>{onboardingStore.initializeSetupCheck()});function handleSetupConfigured(){onboardingStore.markSetupCompleted()}function handleSetupSkipped(){onboardingStore.markSetupSkipped()}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(StageTransitionGroup_default),{"primary-color":primaryColor.value,"secondary-color":secondaryColor.value,"tertiary-color":tertiaryColor.value,colors:colors.value,"z-index":100,"disable-transitions":unref(settings).disableTransitions.value,"use-page-specific-transitions":unref(settings).usePageSpecificTransitions.value},{default:withCtx(()=>[createVNode(unref(RouterView),null,{default:withCtx(({Component})=>[(openBlock(),createBlock(KeepAlive,{include:/IndexScenePage|StageScenePage/},[(openBlock(),createBlock(resolveDynamicComponent(Component)))],1024))]),_:1})]),_:1},8,[`primary-color`,`secondary-color`,`tertiary-color`,`colors`,`disable-transitions`,`use-page-specific-transitions`]),createVNode(unref(ToasterRoot_default),{onClose:_cache$1[0]||=id=>unref(toast).dismiss(id)},{default:withCtx(()=>[createVNode(unref(Toaster_default))]),_:1}),createVNode(unref(OnboardingDialog_default),{modelValue:unref(shouldShowSetup),"onUpdate:modelValue":_cache$1[1]||=$event=>isRef(shouldShowSetup)?shouldShowSetup.value=$event:null,onConfigured:handleSetupConfigured,onSkipped:handleSetupSkipped},null,8,[`modelValue`])],64))}}),App_default=App_vue_vue_type_script_setup_true_lang_default;const languageRemap={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hans`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`};function getLocale(){let language=localStorage.getItem(`settings/language`);language||=navigator.language||`en`;let languages=Object.keys(locales_default);return languageRemap[language||`en`]!=null&&(language=languageRemap[language||`en`]),language&&languages.includes(language)?language:`en`}const i18n=createI18n({legacy:!1,locale:getLocale(),fallbackLocale:`en`,messages:locales_default});var import_nprogress=__toESM(require_nprogress());const pinia=createPinia(),routeRecords=setupLayouts(routes);let router;router=createRouter({routes:routeRecords,history:createWebHashHistory()}),router.beforeEach((to$1,from)=>{to$1.path!==from.path&&import_nprogress.default.start()}),router.afterEach(()=>{import_nprogress.default.done()}),router.isReady().then(async()=>{}).catch(()=>{}),createApp(App_default).use(MotionPlugin).use(autoAnimatePlugin).use(router).use(pinia).use(i18n).use(mo).mount(`#app`);export{_jwt as $,useI18n as A,JSONSchemaGenerator as B,toJSONSchema as C,_array as D,_base64 as E,_base64url as F,_boolean as G,_check as H,_cidrv4 as I,_cidrv6 as J,_cuid as K,_cuid2 as L,_e164 as M,_email as N,_emoji as O,_endsWith as P,_gt as Q,_gte as R,_guid as S,_includes as T,_int as U,_ipv4 as V,_ipv6 as W,_isoDate as X,_isoDateTime as Y,_isoDuration as Z,_isoTime as _,$ZodNumber as a$,_ksuid as a1,_length as a2,_lowercase as a3,_lt as a4,_lte as a5,_maxLength as a6,_minLength as a7,_multipleOf as a8,_nanoid as a9,$ZodBase64URL as aA,$ZodBoolean as aB,$ZodCIDRv4 as aC,$ZodCIDRv6 as aD,$ZodCUID as aE,$ZodCUID2 as aF,$ZodCatch as aG,$ZodCustom as aH,$ZodDefault as aI,$ZodE164 as aJ,$ZodEmail as aK,$ZodEmoji as aL,$ZodEnum as aM,$ZodGUID as aN,$ZodIPv4 as aO,$ZodIPv6 as aP,$ZodISODate as aQ,$ZodISODateTime as aR,$ZodISODuration as aS,$ZodISOTime as aT,$ZodIntersection as aU,$ZodJWT as aV,$ZodKSUID as aW,$ZodNanoID as aX,$ZodNever as aY,$ZodNonOptional as aZ,$ZodNullable as a_,_never as aa,_normalize as ab,_number as ac,_overwrite as ad,_refine as ae,_regex as af,_startsWith as ag,_string as ah,_superRefine as ai,_toLowerCase as aj,_toUpperCase as ak,_trim as al,_ulid as am,_unknown as an,_uppercase as ao,_url as ap,_uuid as aq,_uuidv4 as ar,_uuidv6 as as,_uuidv7 as at,_xid as au,$ZodRegistry as av,globalRegistry as aw,registry as ax,$ZodArray as ay,$ZodBase64 as az,ColorPalette_default as b,randomSaccadeInterval as b$,$ZodNumberFormat as b0,$ZodObject as b1,$ZodOptional as b2,$ZodPipe as b3,$ZodPrefault as b4,$ZodReadonly as b5,$ZodString as b6,$ZodStringFormat as b7,$ZodTransform as b8,$ZodType as b9,$ZodCheckUpperCase as bA,_parse as bB,_parseAsync as bC,_safeParse as bD,_safeParseAsync as bE,safeParse$1 as bF,safeParseAsync$1 as bG,$ZodError as bH,$ZodRealError as bI,flattenError as bJ,formatError as bK,clone as bL,$ZodAsyncError as bM,$constructor as bN,config as bO,globalConfig as bP,missingDependenciesUrl as bQ,tryImport as bR,streamText as bS,useWhisper as bT,useVRMEmote as bU,loadVrm as bV,clipFromVRMAnimation as bW,loadVRMAnimation as bX,useBlink as bY,useIdleEyeSaccades as bZ,VRMUtils as b_,$ZodULID as ba,$ZodURL as bb,$ZodUUID as bc,$ZodUnion as bd,$ZodUnknown as be,$ZodXID as bf,isValidBase64 as bg,isValidBase64URL as bh,isValidJWT as bi,version as bj,Doc as bk,$ZodCheck as bl,$ZodCheckEndsWith as bm,$ZodCheckGreaterThan as bn,$ZodCheckIncludes as bo,$ZodCheckLengthEquals as bp,$ZodCheckLessThan as bq,$ZodCheckLowerCase as br,$ZodCheckMaxLength as bs,$ZodCheckMinLength as bt,$ZodCheckMultipleOf as bu,$ZodCheckNumberFormat as bv,$ZodCheckOverwrite as bw,$ZodCheckRegex as bx,$ZodCheckStartsWith as by,$ZodCheckStringFormat as bz,TranscriptionProviderSettings_default as c,useForwardPropsEmits as c$,lerp$1 as c0,randFloat as c1,useDelayMessageQueue as c2,useEmotionsMessageQueue as c3,useMessageContentQueue as c4,useQueue as c5,useMicVAD as c6,useMarkdown as c7,useAudioRecorder as c8,toWAVBase64 as c9,formatHex as cA,average as cB,ThresholdMeter_default as cC,TestDummyMarker_default as cD,LevelMeter_default as cE,PropertyPoint_default as cF,PropertyNumber_default as cG,Container_default as cH,Select_default as cI,RoundRange_default as cJ,ColorHueRange_default as cK,FieldValues_default as cL,FieldSelect_default as cM,FieldRange_default as cN,__plugin_vue_export_helper_default as cO,FieldKeyValues_default as cP,FieldInput_default as cQ,Input_default as cR,FieldCheckbox_default as cS,Checkbox_default as cT,DialogPortal_default as cU,Teleport_default as cV,DialogOverlay_default as cW,DialogContent_default as cX,DialogRoot_default as cY,injectDialogRootContext as cZ,Primitive as c_,sleep$1 as ca,merge$3 as cb,useAudioContext as cc,useSpeakingStore as cd,Dialog_default as ce,CursorFloating_default as cf,Skeleton_default as cg,Screen_default as ch,ErrorContainer_default as ci,Button_default as cj,VoiceCardManySelect_default as ck,RadioCardSimple_default as cl,RadioCardManySelect_default as cm,Alert_default as cn,IconStatusItem_default as co,IconItem_default as cp,Section_default as cq,PageHeader_default as cr,Callout_default as cs,TimeSeriesChart_default as ct,llmInferenceEndToken as cu,EMOTION_EmotionMotionName_value as cv,EMOTION_VRMExpressionName_value as cw,Emotion as cx,EmotionNeutralMotionName as cy,EmotionThinkMotionName as cz,TranscriptionPlayground_default as d,guardReactiveProps as d$,useForwardExpose as d0,useEmitAsProps as d1,createContext as d2,RouterLink as d3,RouterView as d4,useRoute as d5,useRouter as d6,__vitePreload as d7,storeToRefs as d8,breakpointsTailwind as d9,MathUtils as dA,PerspectiveCamera as dB,Plane as dC,Quaternion as dD,Ray as dE,Raycaster as dF,Spherical as dG,TOUCH as dH,Vector2 as dI,Vector3 as dJ,VectorKeyframeTrack as dK,Transition as dL,vModelCheckbox as dM,vModelSelect as dN,vModelText as dO,vShow as dP,withModifiers as dQ,Fragment as dR,KeepAlive as dS,computed as dT,createBaseVNode as dU,createBlock as dV,createCommentVNode as dW,createElementBlock as dX,createTextVNode as dY,createVNode as dZ,defineComponent as d_,useBreakpoints as da,useClipboard as db,useDark as dc,useDevicesList as dd,useElementBounding as de,useFileDialog as df,useLocalStorage as dg,useMouse as dh,useObjectUrl as di,usePointer as dj,useResizeObserver as dk,useScreenSafeArea as dl,useUserMedia as dm,refDebounced as dn,refThrottled as do,until as dp,useDebounceFn as dq,watchDebounced as dr,defu as ds,Ee$1 as dt,Vn as du,io as dv,pe as dw,AnimationMixer as dx,Controls as dy,MOUSE as dz,SpeechProviderSettings_default as e,inject as e0,mergeModels as e1,mergeProps as e2,nextTick as e3,onMounted as e4,onUnmounted as e5,openBlock as e6,renderList as e7,renderSlot as e8,resolveComponent as e9,resolveDirective as ea,useModel as eb,useTemplateRef as ec,watch as ed,withCtx as ee,withDirectives as ef,isRef as eg,ref as eh,shallowRef as ei,toRaw as ej,toRef as ek,unref as el,normalizeClass as em,normalizeProps as en,normalizeStyle as eo,toDisplayString as ep,__commonJSMin as eq,__export as er,__require as es,__toDynamicImportESM as et,__toESM as eu,SpeechPlayground_default as f,ProviderSettingsLayout_default as g,ProviderSettingsContainer_default as h,ProviderBasicSettings_default as i,ProviderBaseUrlInput_default as j,ProviderApiKeyInput_default as k,ProviderAdvancedSettings_default as l,ProviderAccountIdInput_default as m,useVRM as n,useSettings as o,useSettingsAudioDevice as p,useLive2d as q,require_localforage as r,useChatStore as s,useHearingStore as t,useAiriCardStore as u,useSpeechStore as v,generateSpeech as w,useConsciousnessStore as x,useProvidersStore as y,check as z}; \ No newline at end of file +const isBrowser=typeof window<`u`,win=isBrowser?window:null,doc=isBrowser?document:null,tweenTypes={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},valueTypes={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},tickModes={NONE:0,AUTO:1,FORCE:2},compositionTypes={replace:0,none:1,blend:2},isRegisteredTargetSymbol=Symbol(),isDomSymbol=Symbol(),isSvgSymbol=Symbol(),transformsSymbol=Symbol(),morphPointsSymbol=Symbol(),proxyTargetSymbol=Symbol(),minValue=1e-11,maxValue=1e12,K=1e3,maxFps=120,emptyString=``,shortTransforms=(()=>{let map=new Map;return map.set(`x`,`translateX`),map.set(`y`,`translateY`),map.set(`z`,`translateZ`),map})(),validTransforms=[`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`,`perspective`,`matrix`,`matrix3d`],transformsFragmentStrings=validTransforms.reduce((a$1,v)=>({...a$1,[v]:v+`(`}),{}),noop=()=>{},hexTestRgx=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,rgbExecRgx=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,rgbaExecRgx=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,hslExecRgx=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,hslaExecRgx=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,digitWithExponentRgx=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,unitsExecRgx=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,lowerCaseRgx=/([a-z])([A-Z])/g,transformsExecRgx=/(\w+)(\([^)]+\)+)/g,defaults={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:maxFps,loop:0,reversed:!1,alternate:!1,autoplay:!0,duration:K,delay:0,loopDelay:0,ease:`out(2)`,composition:compositionTypes.replace,modifier:v=>v,onBegin:noop,onBeforeUpdate:noop,onUpdate:noop,onLoop:noop,onPause:noop,onComplete:noop,onRender:noop},scope={current:null,root:doc},globals={defaults,precision:4,timeScale:1,tickThreshold:200},globalVersions={version:`4.1.2`,engine:null};isBrowser&&(win.AnimeJS||=[],win.AnimeJS.push(globalVersions));const toLowerCase=str=>str.replace(lowerCaseRgx,`$1-$2`).toLowerCase(),stringStartsWith=(str,sub)=>str.indexOf(sub)===0,now=Date.now,isArr=Array.isArray,isObj=a$1=>a$1&&a$1.constructor===Object,isNum=a$1=>typeof a$1==`number`&&!isNaN(a$1),isStr=a$1=>typeof a$1==`string`,isFnc=a$1=>typeof a$1==`function`,isUnd=a$1=>a$1===void 0,isNil=a$1=>isUnd(a$1)||a$1===null,isSvg=a$1=>isBrowser&&a$1 instanceof SVGElement,isHex=a$1=>hexTestRgx.test(a$1),isRgb=a$1=>stringStartsWith(a$1,`rgb`),isHsl=a$1=>stringStartsWith(a$1,`hsl`),isCol=a$1=>isHex(a$1)||isRgb(a$1)||isHsl(a$1),isKey=a$1=>!globals.defaults.hasOwnProperty(a$1),parseNumber=str=>isStr(str)?parseFloat(str):str,pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,abs=Math.abs,ceil=Math.ceil,floor=Math.floor,asin=Math.asin,PI=Math.PI,_round=Math.round,clamp=(v,min$1,max$1)=>vmax$1?max$1:v,powCache={},round=(v,decimalLength)=>{if(decimalLength<0)return v;if(!decimalLength)return _round(v);let p$4=powCache[decimalLength];return p$4||=powCache[decimalLength]=10**decimalLength,_round(v*p$4)/p$4},snap=(v,increment$1)=>isArr(increment$1)?increment$1.reduce((closest,cv)=>abs(cv-v)start+(end-start)*progress$1,random=(min$1,max$1,decimalLength)=>{let m=10**(decimalLength||0);return floor((Math.random()*(max$1-min$1+1/m)+min$1)*m)/m},shuffle=items=>{let m=items.length,t$1,i;for(;m;)i=random(0,--m),t$1=items[m],items[m]=items[i],items[i]=t$1;return items},clampInfinity=v=>v===1/0?maxValue:v===-1/0?-1e12:v,normalizeTime=v=>v<=minValue?minValue:clampInfinity(round(v,11)),cloneArray=a$1=>isArr(a$1)?[...a$1]:a$1,mergeObjects=(o1,o2)=>{let merged={...o1};for(let p$4 in o2){let o1p=o1[p$4];merged[p$4]=isUnd(o1p)?o2[p$4]:o1p}return merged},forEachChildren=(parent,callback,reverse,prevProp=`_prev`,nextProp=`_next`)=>{let next=parent._head,adjustedNextProp=nextProp;for(reverse&&(next=parent._tail,adjustedNextProp=prevProp);next;){let currentNext=next[adjustedNextProp];callback(next),next=currentNext}},removeChild=(parent,child,prevProp=`_prev`,nextProp=`_next`)=>{let prev=child[prevProp],next=child[nextProp];prev?prev[nextProp]=next:parent._head=next,next?next[prevProp]=prev:parent._tail=prev,child[prevProp]=null,child[nextProp]=null},addChild=(parent,child,sortMethod,prevProp=`_prev`,nextProp=`_next`)=>{let prev=parent._tail;for(;prev&&sortMethod&&sortMethod(prev,child);)prev=prev[prevProp];let next=prev?prev[nextProp]:parent._head;prev?prev[nextProp]=child:parent._head=child,next?next[prevProp]=child:parent._tail=child,child[prevProp]=prev,child[nextProp]=next},createRefreshable=constructor=>{let tracked;return(...args)=>{let currentIteration,currentIterationProgress,reversed,alternate;tracked&&(currentIteration=tracked.currentIteration,currentIterationProgress=tracked.iterationProgress,reversed=tracked.reversed,alternate=tracked._alternate,tracked.revert());let cleanup=constructor(...args);return cleanup&&!isFnc(cleanup)&&cleanup.revert&&(tracked=cleanup),isUnd(currentIterationProgress)||(tracked.currentIteration=currentIteration,tracked.iterationProgress=(alternate&¤tIteration%2?!reversed:reversed)?1-currentIterationProgress:currentIterationProgress),cleanup||noop}};var Clock=class{constructor(initTime=0){this.deltaTime=0,this._currentTime=initTime,this._elapsedTime=initTime,this._startTime=initTime,this._lastTime=initTime,this._scheduledTime=0,this._frameDuration=round(K/maxFps,0),this._fps=maxFps,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(frameRate){let previousFrameDuration=this._frameDuration,fr=+frameRate,fps=fr{let parent=tickable.parent,duration$2=tickable.duration,completed=tickable.completed,iterationDuration=tickable.iterationDuration,iterationCount=tickable.iterationCount,_currentIteration=tickable._currentIteration,_loopDelay=tickable._loopDelay,_reversed=tickable._reversed,_alternate=tickable._alternate,_hasChildren=tickable._hasChildren,tickableDelay=tickable._delay,tickablePrevAbsoluteTime=tickable._currentTime,tickableEndTime=tickableDelay+iterationDuration,tickableAbsoluteTime=time$2-tickableDelay,tickablePrevTime=clamp(tickablePrevAbsoluteTime,-tickableDelay,duration$2),tickableCurrentTime=clamp(tickableAbsoluteTime,-tickableDelay,duration$2),deltaTime=tickableAbsoluteTime-tickablePrevAbsoluteTime,isCurrentTimeAboveZero=tickableCurrentTime>0,isCurrentTimeEqualOrAboveDuration=tickableCurrentTime>=duration$2,isSetter=duration$2<=minValue,forcedTick=tickMode===tickModes.FORCE,isOdd=0,iterationElapsedTime=tickableAbsoluteTime,hasRendered=0;if(iterationCount>1){let currentIteration=~~(tickableCurrentTime/(iterationDuration+(isCurrentTimeEqualOrAboveDuration?0:_loopDelay)));tickable._currentIteration=clamp(currentIteration,0,iterationCount),isCurrentTimeEqualOrAboveDuration&&tickable._currentIteration--,isOdd=tickable._currentIteration%2,iterationElapsedTime=tickableCurrentTime%(iterationDuration+_loopDelay)||0}let isReversed=_reversed^(_alternate&&isOdd),_ease=tickable._ease,iterationTime=isCurrentTimeEqualOrAboveDuration?isReversed?0:duration$2:isReversed?iterationDuration-iterationElapsedTime:iterationElapsedTime;_ease&&(iterationTime=iterationDuration*_ease(iterationTime/iterationDuration)||0);let isRunningBackwards=(parent?parent.backwards:tickableAbsoluteTime=tickableDelay&&time$2<=tickableEndTime||time$2<=tickableDelay&&tickablePrevTime>tickableDelay||time$2>=tickableEndTime&&tickablePrevTime!==duration$2)||iterationTime>=tickableEndTime&&tickablePrevTime!==duration$2||iterationTime<=tickableDelay&&tickablePrevTime>0||time$2<=tickablePrevTime&&tickablePrevTime===duration$2&&completed||isCurrentTimeEqualOrAboveDuration&&!completed&&isSetter){if(isCurrentTimeAboveZero&&(tickable.computeDeltaTime(tickablePrevTime),muteCallbacks||tickable.onBeforeUpdate(tickable)),!_hasChildren){let forcedRender=forcedTick||(isRunningBackwards?deltaTime*-1:deltaTime)>=globals.tickThreshold,absoluteTime=tickable._offset+(parent?parent._offset:0)+tickableDelay+iterationTime,tween=tickable._head,tweenTarget,tweenStyle,tweenTargetTransforms,tweenTargetTransformsProperties,tweenTransformsNeedUpdate=0;for(;tween;){let tweenComposition=tween._composition,tweenCurrentTime=tween._currentTime,tweenChangeDuration=tween._changeDuration,tweenAbsEndTime=tween._absoluteStartTime+tween._changeDuration,tweenNextRep=tween._nextRep,tweenPrevRep=tween._prevRep,tweenHasComposition=tweenComposition!==compositionTypes.none;if((forcedRender||(tweenCurrentTime!==tweenChangeDuration||absoluteTime<=tweenAbsEndTime+(tweenNextRep?tweenNextRep._delay:0))&&(tweenCurrentTime!==0||absoluteTime>=tween._absoluteStartTime))&&(!tweenHasComposition||!tween._isOverridden&&(!tween._isOverlapped||absoluteTime<=tweenAbsEndTime)&&(!tweenNextRep||tweenNextRep._isOverridden||absoluteTime<=tweenNextRep._absoluteStartTime)&&(!tweenPrevRep||tweenPrevRep._isOverridden||absoluteTime>=tweenPrevRep._absoluteStartTime+tweenPrevRep._changeDuration+tween._delay))){let tweenNewTime=tween._currentTime=clamp(iterationTime-tween._startTime,0,tweenChangeDuration),tweenProgress=tween._ease(tweenNewTime/tween._updateDuration),tweenModifier=tween._modifier,tweenValueType=tween._valueType,tweenType=tween._tweenType,tweenIsObject=tweenType===tweenTypes.OBJECT,tweenIsNumber=tweenValueType===valueTypes.NUMBER,tweenPrecision=tweenIsNumber&&tweenIsObject||tweenProgress===0||tweenProgress===1?-1:globals.precision,value$1,number$5;if(tweenIsNumber)value$1=number$5=tweenModifier(round(interpolate(tween._fromNumber,tween._toNumber,tweenProgress),tweenPrecision));else if(tweenValueType===valueTypes.UNIT)number$5=tweenModifier(round(interpolate(tween._fromNumber,tween._toNumber,tweenProgress),tweenPrecision)),value$1=`${number$5}${tween._unit}`;else if(tweenValueType===valueTypes.COLOR){let fn$5=tween._fromNumbers,tn$1=tween._toNumbers,r$1=round(clamp(tweenModifier(interpolate(fn$5[0],tn$1[0],tweenProgress)),0,255),0),g=round(clamp(tweenModifier(interpolate(fn$5[1],tn$1[1],tweenProgress)),0,255),0),b$1=round(clamp(tweenModifier(interpolate(fn$5[2],tn$1[2],tweenProgress)),0,255),0),a$1=clamp(tweenModifier(round(interpolate(fn$5[3],tn$1[3],tweenProgress),tweenPrecision)),0,1);if(value$1=`rgba(${r$1},${g},${b$1},${a$1})`,tweenHasComposition){let ns=tween._numbers;ns[0]=r$1,ns[1]=g,ns[2]=b$1,ns[3]=a$1}}else if(tweenValueType===valueTypes.COMPLEX){value$1=tween._strings[0];for(let j$1=0,l=tween._toNumbers.length;j$1=duration$2&&!completed||isRunningBackwards&&tickableAbsoluteTime<=minValue&&completed)&&(tickable.onComplete(tickable),tickable.completed=!isRunningBackwards):isCurrentTimeAboveZero&&isCurrentTimeEqualOrAboveDuration?iterationCount===1/0?tickable._startTime+=tickable.duration:tickable._currentIteration>=iterationCount-1&&(tickable.paused=!0,!completed&&!_hasChildren&&(tickable.completed=!0,!muteCallbacks&&!(parent&&(isRunningBackwards||!parent.began))&&(tickable.onComplete(tickable),tickable._resolve(tickable)))):tickable.completed=!1,hasRendered},tick=(tickable,time$2,muteCallbacks,internalRender,tickMode)=>{let _currentIteration=tickable._currentIteration;if(render(tickable,time$2,muteCallbacks,internalRender,tickMode),tickable._hasChildren){let tl=tickable,tlIsRunningBackwards=tl.backwards,tlChildrenTime=internalRender?time$2:tl._iterationTime,tlCildrenTickTime=now(),tlChildrenHasRendered=0,tlChildrenHaveCompleted=!0;if(!internalRender&&tl._currentIteration!==_currentIteration){let tlIterationDuration=tl.iterationDuration;forEachChildren(tl,child=>{if(!tlIsRunningBackwards)!child.completed&&!child.backwards&&child._currentTime{let childTime=round((tlChildrenTime-child._offset)*child._speed,12),childTickMode=child._fps=tl.duration&&(tl.paused=!0,tl.completed||(tl.completed=!0,muteCallbacks||(tl.onComplete(tl),tl._resolve(tl))))}},additive={animation:null,update:noop},addAdditiveAnimation=lookups$1=>{let animation=additive.animation;return animation||(animation={duration:minValue,computeDeltaTime:noop,_offset:0,_delay:0,_head:null,_tail:null},additive.animation=animation,additive.update=()=>{lookups$1.forEach(propertyAnimation=>{for(let propertyName in propertyAnimation){let tweens=propertyAnimation[propertyName],lookupTween=tweens._head;if(lookupTween){let valueType=lookupTween._valueType,additiveValues=valueType===valueTypes.COMPLEX||valueType===valueTypes.COLOR?cloneArray(lookupTween._fromNumbers):null,additiveValue=lookupTween._fromNumber,tween=tweens._tail;for(;tween&&tween!==lookupTween;){if(additiveValues)for(let i=0,l=tween._numbers.length;iisBrowser?requestAnimationFrame:setImmediate)(),engineCancelMethod=(()=>isBrowser?cancelAnimationFrame:clearImmediate)();var Engine=class extends Clock{constructor(initTime){super(initTime),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=defaults,this.paused=!!(isBrowser&&doc.hidden),this.reqId=null}update(){let time$2=this._currentTime=now();if(this.requestTick(time$2)){this.computeDeltaTime(time$2);let engineSpeed=this._speed,engineFps=this._fps,activeTickable=this._head;for(;activeTickable;){let nextTickable=activeTickable._next;activeTickable.paused?(removeChild(this,activeTickable),this._hasChildren=!!this._tail,activeTickable._running=!1,activeTickable.completed&&!activeTickable._cancelled&&activeTickable.cancel()):tick(activeTickable,(time$2-activeTickable._startTime)*activeTickable._speed*engineSpeed,0,0,activeTickable._fpschild.resetTime()),this.wake()}get speed(){return this._speed*(globals.timeScale===1?1:K)}set speed(playbackRate){this._speed=playbackRate*globals.timeScale,forEachChildren(this,child=>child.speed=child._speed)}get timeUnit(){return globals.timeScale===1?`ms`:`s`}set timeUnit(unit){let secondsScale=.001,isSecond=unit===`s`,newScale=isSecond?secondsScale:1;if(globals.timeScale!==newScale){globals.timeScale=newScale,globals.tickThreshold=200*newScale;let scaleFactor=isSecond?secondsScale:K;this.defaults.duration*=scaleFactor,this._speed*=scaleFactor}}get precision(){return globals.precision}set precision(precision){globals.precision=precision}};const engine=(()=>{let engine$1=new Engine(now());return isBrowser&&(globalVersions.engine=engine$1,doc.addEventListener(`visibilitychange`,()=>{engine$1.pauseOnDocumentHidden&&(doc.hidden?engine$1.pause():engine$1.resume())})),engine$1})(),tickEngine=()=>{engine._head?(engine.reqId=engineTickMethod(tickEngine),engine.update()):engine.reqId=0},killEngine=()=>(engineCancelMethod(engine.reqId),engine.reqId=0,engine),parseInlineTransforms=(target$1,propName,animationInlineStyles)=>{let inlineTransforms=target$1.style.transform,inlinedStylesPropertyValue;if(inlineTransforms){let cachedTransforms=target$1[transformsSymbol],t$1;for(;t$1=transformsExecRgx.exec(inlineTransforms);){let inlinePropertyName=t$1[1],inlinePropertyValue=t$1[2].slice(1,-1);cachedTransforms[inlinePropertyName]=inlinePropertyValue,inlinePropertyName===propName&&(inlinedStylesPropertyValue=inlinePropertyValue,animationInlineStyles&&(animationInlineStyles[propName]=inlinePropertyValue))}}return inlineTransforms&&!isUnd(inlinedStylesPropertyValue)?inlinedStylesPropertyValue:stringStartsWith(propName,`scale`)?`1`:stringStartsWith(propName,`rotate`)||stringStartsWith(propName,`skew`)?`0deg`:`0px`};function getNodeList(v){let n=isStr(v)?scope.root.querySelectorAll(v):v;if(n instanceof NodeList||n instanceof HTMLCollection)return n}function parseTargets(targets){if(isNil(targets))return[];if(isArr(targets)){let flattened=targets.flat(1/0),parsed=[];for(let i=0,l=flattened.length;i{if(cssReservedProperties.includes(propertyName))return!1;if(el.getAttribute(propertyName)||propertyName in el){if(propertyName===`scale`){let elParentNode=el.parentNode;return elParentNode&&elParentNode.tagName===`filter`}return!0}},rgbToRgba=rgbValue=>{let rgba$1=rgbExecRgx.exec(rgbValue)||rgbaExecRgx.exec(rgbValue),a$1=isUnd(rgba$1[4])?1:+rgba$1[4];return[+rgba$1[1],+rgba$1[2],+rgba$1[3],a$1]},hexToRgba=hexValue=>{let hexLength=hexValue.length,isShort=hexLength===4||hexLength===5;return[+(`0x`+hexValue[1]+hexValue[isShort?1:2]),+(`0x`+hexValue[isShort?2:3]+hexValue[isShort?2:4]),+(`0x`+hexValue[isShort?3:5]+hexValue[isShort?3:6]),hexLength===5||hexLength===9?+((`0x`+hexValue[isShort?4:7]+hexValue[isShort?4:8])/255).toFixed(3):1]},hue2rgb=(p$4,q,t$1)=>(t$1<0&&(t$1+=1),t$1>1&&--t$1,t$1<1/6?p$4+(q-p$4)*6*t$1:t$1<1/2?q:t$1<2/3?p$4+(q-p$4)*(2/3-t$1)*6:p$4),hslToRgba=hslValue=>{let hsla$1=hslExecRgx.exec(hslValue)||hslaExecRgx.exec(hslValue),h$1=hsla$1[1]/360,s=hsla$1[2]/100,l=hsla$1[3]/100,a$1=isUnd(hsla$1[4])?1:+hsla$1[4],r$1,g,b$1;if(s===0)r$1=g=b$1=l;else{let q=l<.5?l*(1+s):l+s-l*s,p$4=2*l-q;r$1=round(hue2rgb(p$4,q,h$1+1/3)*255,0),g=round(hue2rgb(p$4,q,h$1)*255,0),b$1=round(hue2rgb(p$4,q,h$1-1/3)*255,0)}return[r$1,g,b$1,a$1]},convertColorStringValuesToRgbaArray=colorString=>isRgb(colorString)?rgbToRgba(colorString):isHex(colorString)?hexToRgba(colorString):isHsl(colorString)?hslToRgba(colorString):[0,0,0,1],setValue=(targetValue,defaultValue)=>isUnd(targetValue)?defaultValue:targetValue,getFunctionValue=(value$1,target$1,index$1,total,store)=>{if(isFnc(value$1)){let func=()=>{let computed$2=value$1(target$1,index$1,total);return isNaN(+computed$2)?computed$2||0:+computed$2};return store&&(store.func=func),func()}else return value$1},getTweenType=(target$1,prop)=>target$1[isDomSymbol]?target$1[isSvgSymbol]&&isValidSVGAttribute(target$1,prop)?tweenTypes.ATTRIBUTE:validTransforms.includes(prop)||shortTransforms.get(prop)?tweenTypes.TRANSFORM:stringStartsWith(prop,`--`)?tweenTypes.CSS_VAR:prop in target$1.style?tweenTypes.CSS:prop in target$1?tweenTypes.OBJECT:tweenTypes.ATTRIBUTE:tweenTypes.OBJECT,getCSSValue=(target$1,propName,animationInlineStyles)=>{let inlineStyles=target$1.style[propName];inlineStyles&&animationInlineStyles&&(animationInlineStyles[propName]=inlineStyles);let value$1=inlineStyles||getComputedStyle(target$1[proxyTargetSymbol]||target$1).getPropertyValue(propName);return value$1===`auto`?`0`:value$1},getOriginalAnimatableValue=(target$1,propName,tweenType,animationInlineStyles)=>{let type=isUnd(tweenType)?getTweenType(target$1,propName):tweenType;return type===tweenTypes.OBJECT?target$1[propName]||0:type===tweenTypes.ATTRIBUTE?target$1.getAttribute(propName):type===tweenTypes.TRANSFORM?parseInlineTransforms(target$1,propName,animationInlineStyles):type===tweenTypes.CSS_VAR?getCSSValue(target$1,propName,animationInlineStyles).trimStart():getCSSValue(target$1,propName,animationInlineStyles)},getRelativeValue=(x$1,y,operator)=>operator===`-`?x$1-y:operator===`+`?x$1+y:x$1*y,createDecomposedValueTargetObject=()=>({t:valueTypes.NUMBER,n:0,u:null,o:null,d:null,s:null}),decomposeRawValue=(rawValue,targetObject)=>{if(targetObject.t=valueTypes.NUMBER,targetObject.n=0,targetObject.u=null,targetObject.o=null,targetObject.d=null,targetObject.s=null,!rawValue)return targetObject;let num$2=+rawValue;if(isNaN(num$2)){let str=rawValue;str[1]===`=`&&(targetObject.o=str[0],str=str.slice(2));let unitMatch=str.includes(` `)?!1:unitsExecRgx.exec(str);if(unitMatch)return targetObject.t=valueTypes.UNIT,targetObject.n=+unitMatch[1],targetObject.u=unitMatch[2],targetObject;if(targetObject.o)return targetObject.n=+str,targetObject;if(isCol(str))return targetObject.t=valueTypes.COLOR,targetObject.d=convertColorStringValuesToRgbaArray(str),targetObject;{let matchedNumbers=str.match(digitWithExponentRgx);return targetObject.t=valueTypes.COMPLEX,targetObject.d=matchedNumbers?matchedNumbers.map(Number):[],targetObject.s=str.split(digitWithExponentRgx)||[],targetObject}}else return targetObject.n=num$2,targetObject},decomposeTweenValue=(tween,targetObject)=>(targetObject.t=tween._valueType,targetObject.n=tween._toNumber,targetObject.u=tween._unit,targetObject.o=null,targetObject.d=cloneArray(tween._toNumbers),targetObject.s=cloneArray(tween._strings),targetObject),decomposedOriginalValue=createDecomposedValueTargetObject(),lookups={_rep:new WeakMap,_add:new Map},getTweenSiblings=(target$1,property,lookup=`_rep`)=>{let lookupMap=lookups[lookup],targetLookup=lookupMap.get(target$1);return targetLookup||(targetLookup={},lookupMap.set(target$1,targetLookup)),targetLookup[property]?targetLookup[property]:targetLookup[property]={_head:null,_tail:null}},addTweenSortMethod=(p$4,c$3)=>p$4._isOverridden||p$4._absoluteStartTime>c$3._absoluteStartTime,overrideTween=tween=>{tween._isOverlapped=1,tween._isOverridden=1,tween._changeDuration=minValue,tween._currentTime=minValue},composeTween=(tween,siblings$2)=>{let tweenCompositionType=tween._composition;if(tweenCompositionType===compositionTypes.replace){let tweenAbsStartTime=tween._absoluteStartTime;addChild(siblings$2,tween,addTweenSortMethod,`_prevRep`,`_nextRep`);let prevSibling=tween._prevRep;if(prevSibling){let prevParent=prevSibling.parent,prevAbsEndTime=prevSibling._absoluteStartTime+prevSibling._changeDuration;if(tween.parent.id!==prevParent.id&&prevParent.iterationCount>1&&prevAbsEndTime+(prevParent.duration-prevParent.iterationDuration)>tweenAbsStartTime){overrideTween(prevSibling);let prevPrevSibling=prevSibling._prevRep;for(;prevPrevSibling&&prevPrevSibling.parent.id===prevParent.id;)overrideTween(prevPrevSibling),prevPrevSibling=prevPrevSibling._prevRep}let absoluteUpdateStartTime=tweenAbsStartTime-tween._delay;if(prevAbsEndTime>absoluteUpdateStartTime){let prevChangeStartTime=prevSibling._startTime,prevTLOffset=prevAbsEndTime-(prevChangeStartTime+prevSibling._updateDuration);prevSibling._changeDuration=absoluteUpdateStartTime-prevTLOffset-prevChangeStartTime,prevSibling._currentTime=prevSibling._changeDuration,prevSibling._isOverlapped=1,prevSibling._changeDuration{t$1._isOverlapped||(pausePrevParentAnimation=!1)}),pausePrevParentAnimation){let prevParentTL=prevParent.parent;if(prevParentTL){let pausePrevParentTL=!0;forEachChildren(prevParentTL,a$1=>{a$1!==prevParent&&forEachChildren(a$1,t$1=>{t$1._isOverlapped||(pausePrevParentTL=!1)})}),pausePrevParentTL&&prevParentTL.cancel()}else prevParent.cancel()}}}else if(tweenCompositionType===compositionTypes.blend){let additiveTweenSiblings=getTweenSiblings(tween.target,tween.property,`_add`),additiveAnimation=addAdditiveAnimation(lookups._add),lookupTween=additiveTweenSiblings._head;lookupTween||(lookupTween={...tween},lookupTween._composition=compositionTypes.replace,lookupTween._updateDuration=minValue,lookupTween._startTime=0,lookupTween._numbers=cloneArray(tween._fromNumbers),lookupTween._number=0,lookupTween._next=null,lookupTween._prev=null,addChild(additiveTweenSiblings,lookupTween),addChild(additiveAnimation,lookupTween));let toNumber$1=tween._toNumber;if(tween._fromNumber=lookupTween._fromNumber-toNumber$1,tween._toNumber=0,tween._numbers=cloneArray(tween._fromNumbers),tween._number=0,lookupTween._fromNumber=toNumber$1,tween._toNumbers){let toNumbers=cloneArray(tween._toNumbers);toNumbers&&toNumbers.forEach((value$1,i)=>{tween._fromNumbers[i]=lookupTween._fromNumbers[i]-value$1,tween._toNumbers[i]=0}),lookupTween._fromNumbers=toNumbers}addChild(additiveTweenSiblings,tween,null,`_prevAdd`,`_nextAdd`)}return tween},removeTweenSliblings=tween=>{let tweenComposition=tween._composition;if(tweenComposition!==compositionTypes.none){let tweenTarget=tween.target,tweenProperty=tween.property,replaceTweensLookup=lookups._rep,replaceTargetProps=replaceTweensLookup.get(tweenTarget),tweenReplaceSiblings=replaceTargetProps[tweenProperty];if(removeChild(tweenReplaceSiblings,tween,`_prevRep`,`_nextRep`),tweenComposition===compositionTypes.blend){let addTweensLookup=lookups._add,addTargetProps=addTweensLookup.get(tweenTarget);if(!addTargetProps)return;let additiveTweenSiblings=addTargetProps[tweenProperty],additiveAnimation=additive.animation;removeChild(additiveTweenSiblings,tween,`_prevAdd`,`_nextAdd`);let lookupTween=additiveTweenSiblings._head;if(lookupTween&&lookupTween===additiveTweenSiblings._tail){removeChild(additiveTweenSiblings,lookupTween,`_prevAdd`,`_nextAdd`),removeChild(additiveAnimation,lookupTween);let shouldClean=!0;for(let prop in addTargetProps)if(addTargetProps[prop]._head){shouldClean=!1;break}shouldClean&&addTweensLookup.delete(tweenTarget)}}}return tween},resetTimerProperties=timer=>(timer.paused=!0,timer.began=!1,timer.completed=!1,timer),reviveTimer=timer=>timer._cancelled?(timer._hasChildren?forEachChildren(timer,reviveTimer):forEachChildren(timer,tween=>{tween._composition!==compositionTypes.none&&composeTween(tween,getTweenSiblings(tween.target,tween.property))}),timer._cancelled=0,timer):timer;let timerId=0;var Timer=class extends Clock{constructor(parameters={},parent=null,parentPosition=0){super(0);let{id,delay,duration:duration$2,reversed,alternate,loop,loopDelay,autoplay,frameRate,playbackRate,onComplete,onLoop,onPause,onBegin,onBeforeUpdate:onBeforeUpdate$1,onUpdate}=parameters;scope.current&&scope.current.register(this);let timerInitTime=parent?0:engine._elapsedTime,timerDefaults=parent?parent.defaults:globals.defaults,timerDelay=isFnc(delay)||isUnd(delay)?timerDefaults.delay:+delay,timerDuration=isFnc(duration$2)||isUnd(duration$2)?1/0:+duration$2,timerLoop=setValue(loop,timerDefaults.loop),timerLoopDelay=setValue(loopDelay,timerDefaults.loopDelay),timerIterationCount=timerLoop===!0||timerLoop===1/0||timerLoop<0?1/0:timerLoop+1,offsetPosition=0;if(parent)offsetPosition=parentPosition;else{let startTime=now();engine.paused&&(engine.requestTick(startTime),startTime=engine._elapsedTime),offsetPosition=startTime-engine._startTime}this.id=isUnd(id)?++timerId:id,this.parent=parent,this.duration=clampInfinity((timerDuration+timerLoopDelay)*timerIterationCount-timerLoopDelay)||minValue,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=onBegin||timerDefaults.onBegin,this.onBeforeUpdate=onBeforeUpdate$1||timerDefaults.onBeforeUpdate,this.onUpdate=onUpdate||timerDefaults.onUpdate,this.onLoop=onLoop||timerDefaults.onLoop,this.onPause=onPause||timerDefaults.onPause,this.onComplete=onComplete||timerDefaults.onComplete,this.iterationDuration=timerDuration,this.iterationCount=timerIterationCount,this._autoplay=parent?!1:setValue(autoplay,timerDefaults.autoplay),this._offset=offsetPosition,this._delay=timerDelay,this._loopDelay=timerLoopDelay,this._iterationTime=0,this._currentIteration=0,this._resolve=noop,this._running=!1,this._reversed=+setValue(reversed,timerDefaults.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=setValue(alternate,timerDefaults.alternate),this._prev=null,this._next=null,this._elapsedTime=timerInitTime,this._startTime=timerInitTime,this._lastTime=timerInitTime,this._fps=setValue(frameRate,timerDefaults.frameRate),this._speed=setValue(playbackRate,timerDefaults.playbackRate)}get cancelled(){return!!this._cancelled}set cancelled(cancelled){cancelled?this.cancel():this.reset(1).play()}get currentTime(){return clamp(round(this._currentTime,globals.precision),-this._delay,this.duration)}set currentTime(time$2){let paused=this.paused;this.pause().seek(+time$2),paused||this.resume()}get iterationCurrentTime(){return round(this._iterationTime,globals.precision)}set iterationCurrentTime(time$2){this.currentTime=this.iterationDuration*this._currentIteration+time$2}get progress(){return clamp(round(this._currentTime/this.duration,10),0,1)}set progress(progress$1){this.currentTime=this.duration*progress$1}get iterationProgress(){return clamp(round(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(progress$1){let iterationDuration=this.iterationDuration;this.currentTime=iterationDuration*this._currentIteration+iterationDuration*progress$1}get currentIteration(){return this._currentIteration}set currentIteration(iterationCount){this.currentTime=this.iterationDuration*clamp(+iterationCount,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(reverse){reverse?this.reverse():this.play()}get speed(){return super.speed}set speed(playbackRate){super.speed=playbackRate,this.resetTime()}reset(internalRender=0){return reviveTimer(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,tick(this,0,1,internalRender,tickModes.FORCE),resetTimerProperties(this),this._hasChildren&&forEachChildren(this,resetTimerProperties),this}init(internalRender=0){this.fps=this._fps,this.speed=this._speed,!internalRender&&this._hasChildren&&tick(this,this.duration,1,internalRender,tickModes.FORCE),this.reset(internalRender);let autoplay=this._autoplay;return autoplay===!0?this.resume():autoplay&&!isUnd(autoplay.linked)&&autoplay.link(this),this}resetTime(){let timeScale=1/(this._speed*engine._speed);return this._startTime=now()-(this._currentTime+this._delay)*timeScale,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=minValue&&!this._hasChildren?tick(this,minValue,0,0,tickModes.FORCE):(this._running||(addChild(engine,this),engine._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,engine.wake()),this):this}restart(){return this.reset(0).resume()}seek(time$2,muteCallbacks=0,internalRender=0){reviveTimer(this),this.completed=!1;let isPaused=this.paused;return this.paused=!0,tick(this,time$2+this._delay,~~muteCallbacks,~~internalRender,tickModes.AUTO),isPaused?this:this.resume()}alternate(){let reversed=this._reversed,count$1=this.iterationCount,duration$2=this.iterationDuration,iterations=count$1===1/0?floor(maxValue/duration$2):count$1;return this._reversed=+(this._alternate&&!(iterations%2)?reversed:!reversed),count$1===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(duration$2*iterations-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?forEachChildren(this,child=>child.cancel(),!0):forEachChildren(this,removeTweenSliblings),this._cancelled=1,this.pause()}stretch(newDuration){let currentDuration=this.duration,normlizedDuration=normalizeTime(newDuration);if(currentDuration===normlizedDuration)return this;let timeScale=newDuration/currentDuration,isSetter=newDuration<=minValue;return this.duration=isSetter?minValue:normlizedDuration,this.iterationDuration=isSetter?minValue:normalizeTime(this.iterationDuration*timeScale),this._offset*=timeScale,this._delay*=timeScale,this._loopDelay*=timeScale,this}revert(){tick(this,0,1,0,tickModes.AUTO);let ap=this._autoplay;return ap&&ap.linked&&ap.linked===this&&ap.revert(),this.cancel()}complete(){return this.seek(this.duration).cancel()}then(callback=noop){let then=this.then,onResolve=()=>{this.then=null,callback(this),this.then=then,this._resolve=noop};return new Promise(r$1=>(this._resolve=()=>r$1(onResolve()),this.completed&&this._resolve(),this))}};const none=t$1=>t$1,calcBezier=(aT,aA1,aA2)=>(((1-3*aA2+3*aA1)*aT+(3*aA2-6*aA1))*aT+3*aA1)*aT,binarySubdivide=(aX,mX1,mX2)=>{let aA=0,aB=1,currentX,currentT,i=0;do currentT=aA+(aB-aA)/2,currentX=calcBezier(currentT,mX1,mX2)-aX,currentX>0?aB=currentT:aA=currentT;while(abs(currentX)>1e-7&&++i<100);return currentT},cubicBezier=(mX1=.5,mY1=0,mX2=.5,mY2=1)=>mX1===mY1&&mX2===mY2?none:t$1=>t$1===0||t$1===1?t$1:calcBezier(binarySubdivide(t$1,mX1,mX2),mY1,mY2),steps=(steps$2=10,fromStart)=>{let roundMethod=fromStart?ceil:floor;return t$1=>roundMethod(clamp(t$1,0,1)*steps$2)*(1/steps$2)},linear=(...args)=>{let argsLength=args.length;if(!argsLength)return none;let totalPoints=argsLength-1,firstArg=args[0],lastArg=args[totalPoints],xPoints=[0],yPoints=[parseNumber(firstArg)];for(let i=1;i{let values=[0],total=length-1;for(let i=1;it$1=>pow(t$1,+p$4),easeInFunctions={[emptyString]:easeInPower,Quad:easeInPower(2),Cubic:easeInPower(3),Quart:easeInPower(4),Quint:easeInPower(5),Sine:t$1=>1-cos(t$1*halfPI),Circ:t$1=>1-sqrt(1-t$1*t$1),Expo:t$1=>t$1?pow(2,10*t$1-10):0,Bounce:t$1=>{let pow2,b$1=4;for(;t$1<((pow2=pow(2,--b$1))-1)/11;);return 1/pow(4,3-b$1)-7.5625*pow((pow2*3-2)/22-t$1,2)},Back:(overshoot=1.70158)=>t$1=>(+overshoot+1)*t$1*t$1*t$1-+overshoot*t$1*t$1,Elastic:(amplitude=1,period=.3)=>{let a$1=clamp(+amplitude,1,10),p$4=clamp(+period,minValue,2),s=p$4/doublePI*asin(1/a$1),e$4=doublePI/p$4;return t$1=>t$1===0||t$1===1?t$1:-a$1*pow(2,-10*(1-t$1))*sin((1-t$1-s)*e$4)}},easeTypes={in:easeIn$1=>t$1=>easeIn$1(t$1),out:easeIn$1=>t$1=>1-easeIn$1(1-t$1),inOut:easeIn$1=>t$1=>t$1<.5?easeIn$1(t$1*2)/2:1-easeIn$1(t$1*-2+2)/2,outIn:easeIn$1=>t$1=>t$1<.5?(1-easeIn$1(1-t$1*2))/2:(easeIn$1(t$1*2-1)+1)/2},parseEaseString=(string$4,easesFunctions,easesLookups)=>{if(easesLookups[string$4])return easesLookups[string$4];if(string$4.indexOf(`(`)<=-1){let hasParams=easeTypes[string$4]||string$4.includes(`Back`)||string$4.includes(`Elastic`),parsedFn=hasParams?easesFunctions[string$4]():easesFunctions[string$4];return parsedFn?easesLookups[string$4]=parsedFn:none}else{let split=string$4.slice(0,-1).split(`(`),parsedFn=easesFunctions[split[0]];return parsedFn?easesLookups[string$4]=parsedFn(...split[1].split(`,`)):none}},eases=(()=>{let list$2={linear,irregular,steps,cubicBezier};for(let type in easeTypes)for(let name$2 in easeInFunctions){let easeIn$1=easeInFunctions[name$2],easeType=easeTypes[type];list$2[type+name$2]=name$2===emptyString||name$2===`Back`||name$2===`Elastic`?(a$1,b$1)=>easeType(easeIn$1(a$1,b$1)):easeType(easeIn$1)}return list$2})(),JSEasesLookups={linear:none},parseEasings=ease=>isFnc(ease)?ease:isStr(ease)?parseEaseString(ease,eases,JSEasesLookups):none,propertyNamesCache={},sanitizePropertyName=(propertyName,target$1,tweenType)=>{if(tweenType===tweenTypes.TRANSFORM){let t$1=shortTransforms.get(propertyName);return t$1||propertyName}else if(tweenType===tweenTypes.CSS||tweenType===tweenTypes.ATTRIBUTE&&isSvg(target$1)&&propertyName in target$1.style){let cachedPropertyName=propertyNamesCache[propertyName];if(cachedPropertyName)return cachedPropertyName;{let lowerCaseName=propertyName&&toLowerCase(propertyName);return propertyNamesCache[propertyName]=lowerCaseName,lowerCaseName}}else return propertyName},angleUnitsMap={deg:1,rad:180/PI,turn:360},convertedValuesCache={},convertValueUnit=(el,decomposedValue,unit,force=!1)=>{let currentUnit=decomposedValue.u,currentNumber=decomposedValue.n;if(decomposedValue.t===valueTypes.UNIT&¤tUnit===unit)return decomposedValue;let cachedKey=currentNumber+currentUnit+unit,cached$1=convertedValuesCache[cachedKey];if(!isUnd(cached$1)&&!force)decomposedValue.n=cached$1;else{let convertedValue;if(currentUnit in angleUnitsMap)convertedValue=currentNumber*angleUnitsMap[currentUnit]/angleUnitsMap[unit];else{let baseline=100,tempEl=el.cloneNode(),parentNode=el.parentNode,parentEl=parentNode&&parentNode!==doc?parentNode:doc.body;parentEl.appendChild(tempEl);let elStyle=tempEl.style;elStyle.width=baseline+currentUnit;let currentUnitWidth=tempEl.offsetWidth||baseline;elStyle.width=baseline+unit;let newUnitWidth=tempEl.offsetWidth||baseline,factor$1=currentUnitWidth/newUnitWidth;parentEl.removeChild(tempEl),convertedValue=factor$1*currentNumber}decomposedValue.n=convertedValue,convertedValuesCache[cachedKey]=convertedValue}return decomposedValue.t,valueTypes.UNIT,decomposedValue.u=unit,decomposedValue},cleanInlineStyles=renderable=>{if(renderable._hasChildren)forEachChildren(renderable,cleanInlineStyles,!0);else{let animation=renderable;animation.pause(),forEachChildren(animation,tween=>{let tweenProperty=tween.property,tweenTarget=tween.target;if(tweenTarget[isDomSymbol]){let targetStyle=tweenTarget.style,originalInlinedValue=animation._inlineStyles[tweenProperty];if(tween._tweenType===tweenTypes.TRANSFORM){let cachedTransforms=tweenTarget[transformsSymbol];if(isUnd(originalInlinedValue)||originalInlinedValue===emptyString?delete cachedTransforms[tweenProperty]:cachedTransforms[tweenProperty]=originalInlinedValue,tween._renderTransforms)if(!Object.keys(cachedTransforms).length)targetStyle.removeProperty(`transform`);else{let str=emptyString;for(let key$2 in cachedTransforms)str+=transformsFragmentStrings[key$2]+cachedTransforms[key$2]+`) `;targetStyle.transform=str}}else isUnd(originalInlinedValue)||originalInlinedValue===emptyString?targetStyle.removeProperty(tweenProperty):targetStyle[tweenProperty]=originalInlinedValue;animation._tail===tween&&animation.targets.forEach(t$1=>{t$1.getAttribute&&t$1.getAttribute(`style`)===emptyString&&t$1.removeAttribute(`style`)})}})}return renderable},fromTargetObject=createDecomposedValueTargetObject(),toTargetObject=createDecomposedValueTargetObject(),toFunctionStore={func:null},keyframesTargetArray=[null],fastSetValuesArray=[null,null],keyObjectTarget={to:null};let tweenId=0,keyframes,key;const generateKeyframes=(keyframes$4,parameters)=>{let properties={};if(isArr(keyframes$4)){let propertyNames=[].concat(...keyframes$4.map(key$2=>Object.keys(key$2))).filter(isKey);for(let i=0,l=propertyNames.length;i{let newKey={};for(let p$4 in key$2){let keyValue=key$2[p$4];isKey(p$4)?p$4===propName&&(newKey.to=keyValue):newKey[p$4]=keyValue}return newKey});properties[propName]=propArray}}else{let totalDuration=setValue(parameters.duration,globals.defaults.duration),keys$3=Object.keys(keyframes$4).map(key$2=>({o:parseFloat(key$2)/100,p:keyframes$4[key$2]})).sort((a$1,b$1)=>a$1.o-b$1.o);for(let name$2 in keys$3.forEach(key$2=>{let offset$2=key$2.o,prop=key$2.p;for(let name$2 in prop)if(isKey(name$2)){let propArray=properties[name$2];propArray||=properties[name$2]=[];let duration$2=offset$2*totalDuration,length=propArray.length,prevKey=propArray[length-1],keyObj={to:prop[name$2]},durProgress=0;for(let i=0;i=K?compositionTypes.none:isUnd(composition)?animDefaults.composition:composition,animInlineStyles={},absoluteOffsetTime=this._offset+(parent?parent._offset:0),iterationDuration=NaN,iterationDelay=NaN,animationAnimationLength=0,shouldTriggerRender=0;for(let targetIndex=0;targetIndex2&&isNotObjectValue?(keyframes=[],propValue.forEach((v,i)=>{i?i===1?(fastSetValuesArray[1]=v,keyframes.push(fastSetValuesArray)):keyframes.push(v):fastSetValuesArray[0]=v})):keyframes=propValue}else keyframesTargetArray[0]=propValue,keyframes=keyframesTargetArray;let siblings$2=null,prevTween=null,firstTweenChangeStartTime=NaN,lastTweenChangeEndTime=0,tweenIndex=0;for(let l=keyframes.length;tweenIndex1?getFunctionValue(tDuration,target$1,ti,tl)/l:tDuration),target$1,ti,tl),tweenDelay=getFunctionValue(setValue(key.delay,tweenIndex?0:tDelay),target$1,ti,tl),computedComposition=getFunctionValue(setValue(key.composition,tComposition),target$1,ti,tl),tweenComposition=isNum(computedComposition)?computedComposition:compositionTypes[computedComposition],tweenModifier=key.modifier||tModifier,hasFromvalue=!isUnd(tweenFromValue),hasToValue=!isUnd(tweenToValue),isFromToArray=isArr(tweenToValue),isFromToValue=isFromToArray||hasFromvalue&&hasToValue,tweenStartTime=prevTween?lastTweenChangeEndTime+tweenDelay:tweenDelay,absoluteStartTime=absoluteOffsetTime+tweenStartTime;!shouldTriggerRender&&(hasFromvalue||isFromToArray)&&(shouldTriggerRender=1);let prevSibling=prevTween;if(tweenComposition!==compositionTypes.none){siblings$2||=getTweenSiblings(target$1,propName);let nextSibling=siblings$2._head;for(;nextSibling&&!nextSibling._isOverridden&&nextSibling._absoluteStartTime<=absoluteStartTime;)if(prevSibling=nextSibling,nextSibling=nextSibling._nextRep,nextSibling&&nextSibling._absoluteStartTime>=absoluteStartTime)for(;nextSibling;)overrideTween(nextSibling),nextSibling=nextSibling._nextRep}if(isFromToValue?(decomposeRawValue(isFromToArray?getFunctionValue(tweenToValue[0],target$1,ti,tl):tweenFromValue,fromTargetObject),decomposeRawValue(isFromToArray?getFunctionValue(tweenToValue[1],target$1,ti,tl,toFunctionStore):tweenToValue,toTargetObject),fromTargetObject.t===valueTypes.NUMBER&&(prevSibling?prevSibling._valueType===valueTypes.UNIT&&(fromTargetObject.t=valueTypes.UNIT,fromTargetObject.u=prevSibling._unit):(decomposeRawValue(getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),decomposedOriginalValue),decomposedOriginalValue.t===valueTypes.UNIT&&(fromTargetObject.t=valueTypes.UNIT,fromTargetObject.u=decomposedOriginalValue.u)))):(hasToValue?decomposeRawValue(tweenToValue,toTargetObject):prevTween?decomposeTweenValue(prevTween,toTargetObject):decomposeRawValue(parent&&prevSibling&&prevSibling.parent.parent===parent?prevSibling._value:getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),toTargetObject),hasFromvalue?decomposeRawValue(tweenFromValue,fromTargetObject):prevTween?decomposeTweenValue(prevTween,fromTargetObject):decomposeRawValue(parent&&prevSibling&&prevSibling.parent.parent===parent?prevSibling._value:getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),fromTargetObject)),fromTargetObject.o&&(fromTargetObject.n=getRelativeValue(prevSibling?prevSibling._toNumber:decomposeRawValue(getOriginalAnimatableValue(target$1,propName,tweenType,animInlineStyles),decomposedOriginalValue).n,fromTargetObject.n,fromTargetObject.o)),toTargetObject.o&&(toTargetObject.n=getRelativeValue(fromTargetObject.n,toTargetObject.n,toTargetObject.o)),fromTargetObject.t!==toTargetObject.t){if(fromTargetObject.t===valueTypes.COMPLEX||toTargetObject.t===valueTypes.COMPLEX){let complexValue=fromTargetObject.t===valueTypes.COMPLEX?fromTargetObject:toTargetObject,notComplexValue=fromTargetObject.t===valueTypes.COMPLEX?toTargetObject:fromTargetObject;notComplexValue.t=valueTypes.COMPLEX,notComplexValue.s=cloneArray(complexValue.s),notComplexValue.d=complexValue.d.map(()=>notComplexValue.n)}else if(fromTargetObject.t===valueTypes.UNIT||toTargetObject.t===valueTypes.UNIT){let unitValue=fromTargetObject.t===valueTypes.UNIT?fromTargetObject:toTargetObject,notUnitValue=fromTargetObject.t===valueTypes.UNIT?toTargetObject:fromTargetObject;notUnitValue.t=valueTypes.UNIT,notUnitValue.u=unitValue.u}else if(fromTargetObject.t===valueTypes.COLOR||toTargetObject.t===valueTypes.COLOR){let colorValue=fromTargetObject.t===valueTypes.COLOR?fromTargetObject:toTargetObject,notColorValue=fromTargetObject.t===valueTypes.COLOR?toTargetObject:fromTargetObject;notColorValue.t=valueTypes.COLOR,notColorValue.s=colorValue.s,notColorValue.d=[0,0,0,1]}}if(fromTargetObject.u!==toTargetObject.u){let valueToConvert=toTargetObject.u?fromTargetObject:toTargetObject;valueToConvert=convertValueUnit(target$1,valueToConvert,toTargetObject.u?toTargetObject.u:fromTargetObject.u,!1)}if(toTargetObject.d&&fromTargetObject.d&&toTargetObject.d.length!==fromTargetObject.d.length){let longestValue=fromTargetObject.d.length>toTargetObject.d.length?fromTargetObject:toTargetObject,shortestValue=longestValue===fromTargetObject?toTargetObject:fromTargetObject;shortestValue.d=longestValue.d.map((_$1,i)=>isUnd(shortestValue.d[i])?0:shortestValue.d[i]),shortestValue.s=cloneArray(longestValue.s)}let tweenUpdateDuration=round(+tweenDuration||minValue,12),tween={parent:this,id:tweenId++,property:propName,target:target$1,_value:null,_func:toFunctionStore.func,_ease:parseEasings(tweenEasing),_fromNumbers:cloneArray(fromTargetObject.d),_toNumbers:cloneArray(toTargetObject.d),_strings:cloneArray(toTargetObject.s),_fromNumber:fromTargetObject.n,_toNumber:toTargetObject.n,_numbers:cloneArray(fromTargetObject.d),_number:fromTargetObject.n,_unit:toTargetObject.u,_modifier:tweenModifier,_currentTime:0,_startTime:tweenStartTime,_delay:+tweenDelay,_updateDuration:tweenUpdateDuration,_changeDuration:tweenUpdateDuration,_absoluteStartTime:absoluteStartTime,_tweenType:tweenType,_valueType:toTargetObject.t,_composition:tweenComposition,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};tweenComposition!==compositionTypes.none&&composeTween(tween,siblings$2),isNaN(firstTweenChangeStartTime)&&(firstTweenChangeStartTime=tween._startTime),lastTweenChangeEndTime=round(tweenStartTime+tweenUpdateDuration,12),prevTween=tween,animationAnimationLength++,addChild(this,tween)}(isNaN(iterationDelay)||firstTweenChangeStartTimeiterationDuration)&&(iterationDuration=lastTweenChangeEndTime),tweenType===tweenTypes.TRANSFORM&&(lastTransformGroupIndex=animationAnimationLength-tweenIndex,lastTransformGroupLength=animationAnimationLength)}if(!isNaN(lastTransformGroupIndex)){let i=0;forEachChildren(this,tween=>{i>=lastTransformGroupIndex&&i{additiveTween.id===tween.id&&(additiveTween._renderTransforms=1)})),i++})}}targetsLength||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),iterationDelay?(forEachChildren(this,tween=>{tween._startTime-tween._delay||(tween._delay-=iterationDelay),tween._startTime-=iterationDelay}),iterationDuration-=iterationDelay):iterationDelay=0,iterationDuration||(iterationDuration=minValue,this.iterationCount=0),this.targets=parsedTargets,this.duration=iterationDuration===minValue?minValue:clampInfinity((iterationDuration+this._loopDelay)*this.iterationCount-this._loopDelay)||minValue,this.onRender=onRender||animDefaults.onRender,this._ease=animEase,this._delay=iterationDelay,this.iterationDuration=iterationDuration,this._inlineStyles=animInlineStyles,!this._autoplay&&shouldTriggerRender&&this.onRender(this)}stretch(newDuration){let currentDuration=this.duration;if(currentDuration===normalizeTime(newDuration))return this;let timeScale=newDuration/currentDuration;return forEachChildren(this,tween=>{tween._updateDuration=normalizeTime(tween._updateDuration*timeScale),tween._changeDuration=normalizeTime(tween._changeDuration*timeScale),tween._currentTime*=timeScale,tween._startTime*=timeScale,tween._absoluteStartTime*=timeScale}),super.stretch(newDuration)}refresh(){return forEachChildren(this,tween=>{let tweenFunc=tween._func;if(tweenFunc){let ogValue=getOriginalAnimatableValue(tween.target,tween.property,tween._tweenType);decomposeRawValue(ogValue,decomposedOriginalValue),decomposeRawValue(tweenFunc(),toTargetObject),tween._fromNumbers=cloneArray(decomposedOriginalValue.d),tween._fromNumber=decomposedOriginalValue.n,tween._toNumbers=cloneArray(toTargetObject.d),tween._strings=cloneArray(toTargetObject.s),tween._toNumber=toTargetObject.o?getRelativeValue(decomposedOriginalValue.n,toTargetObject.n,toTargetObject.o):toTargetObject.n}}),this}revert(){return super.revert(),cleanInlineStyles(this)}then(callback){return super.then(callback)}};const animate=(targets,parameters)=>new JSAnimation(targets,parameters,null,0,!1).init(),transformsShorthands=[`x`,`y`,`z`],commonDefaultPXProperties=[`perspective`,`width`,`height`,`margin`,`padding`,`top`,`right`,`bottom`,`left`,`borderWidth`,`fontSize`,`borderRadius`,...transformsShorthands],WAAPIAnimationsLookups={_head:null,_tail:null},removeWAAPIAnimation=($el,property,parent)=>{let nextLookup=WAAPIAnimationsLookups._head;for(;nextLookup;){let next=nextLookup._next,matchTarget=nextLookup.$el===$el,matchProperty=!property||nextLookup.property===property,matchParent=!parent||nextLookup.parent===parent;if(matchTarget&&matchProperty&&matchParent){let anim=nextLookup.animation;try{anim.commitStyles()}catch{}anim.cancel(),removeChild(WAAPIAnimationsLookups,nextLookup);let lookupParent=nextLookup.parent;lookupParent&&(lookupParent._completed++,lookupParent.animations.length===lookupParent._completed&&(lookupParent.completed=!0,lookupParent.muteCallbacks||(lookupParent.paused=!0,lookupParent.onComplete(lookupParent),lookupParent._resolve(lookupParent))))}nextLookup=next}},sync=(callback=noop)=>new Timer({duration:1*globals.timeScale,onComplete:callback},null,0).resume();function getTargetValue(targetSelector,propName,unit){let targets=registerTargets(targetSelector);if(!targets.length)return;let[target$1]=targets,tweenType=getTweenType(target$1,propName),normalizePropName=sanitizePropertyName(propName,target$1,tweenType),originalValue=getOriginalAnimatableValue(target$1,normalizePropName);if(isUnd(unit))return originalValue;if(decomposeRawValue(originalValue,decomposedOriginalValue),decomposedOriginalValue.t===valueTypes.NUMBER||decomposedOriginalValue.t===valueTypes.UNIT){if(unit===!1)return decomposedOriginalValue.n;{let convertedValue=convertValueUnit(target$1,decomposedOriginalValue,unit,!1);return`${round(convertedValue.n,globals.precision)}${convertedValue.u}`}}}const setTargetValues=(targets,parameters)=>{if(!isUnd(parameters))return parameters.duration=minValue,parameters.composition=setValue(parameters.composition,compositionTypes.none),new JSAnimation(targets,parameters,null,0,!0).resume()},removeTargetsFromAnimation=(targetsArray,animation,propertyName)=>{let tweensMatchesTargets=!1;return forEachChildren(animation,tween=>{let tweenTarget=tween.target;if(targetsArray.includes(tweenTarget)){let tweenName=tween.property,tweenType=tween._tweenType,normalizePropName=sanitizePropertyName(propertyName,tweenTarget,tweenType);(!normalizePropName||normalizePropName&&normalizePropName===tweenName)&&(tween.parent._tail===tween&&tween._tweenType===tweenTypes.TRANSFORM&&tween._prev&&tween._prev._tweenType===tweenTypes.TRANSFORM&&(tween._prev._renderTransforms=1),removeChild(animation,tween),removeTweenSliblings(tween),tweensMatchesTargets=!0)}},!0),tweensMatchesTargets},remove=(targets,renderable,propertyName)=>{let targetsArray=parseTargets(targets),parent=renderable||engine,waapiAnimation=renderable&&renderable.controlAnimation&&renderable;for(let i=0,l=targetsArray.length;i{if(!child._hasChildren)if(removeMatches=removeTargetsFromAnimation(targetsArray,child,propertyName),removeMatches&&!child._head)child.cancel(),removeChild(parent,child);else{let childTLOffset=child._offset+child._delay,childDur=childTLOffset+child.duration;childDur>iterationDuration&&(iterationDuration=childDur)}child._head?remove(targets,child,propertyName):child._hasChildren=!1},!0),isUnd(parent.iterationDuration)||(parent.iterationDuration=iterationDuration)}else removeMatches=removeTargetsFromAnimation(targetsArray,parent,propertyName);return removeMatches&&!parent._head&&(parent._hasChildren=!1,parent.cancel&&parent.cancel()),targetsArray},keepTime=createRefreshable,randomPick=items=>items[random(0,items.length-1)],roundPad=(v,decimalLength)=>(+v).toFixed(decimalLength),padStart=(v,totalLength,padString)=>`${v}`.padStart(totalLength,padString),padEnd=(v,totalLength,padString)=>`${v}`.padEnd(totalLength,padString),wrap=(v,min$1,max$1)=>((v-min$1)%(max$1-min$1)+(max$1-min$1))%(max$1-min$1)+min$1,mapRange=(value$1,inLow,inHigh,outLow,outHigh)=>outLow+(value$1-inLow)/(inHigh-inLow)*(outHigh-outLow),degToRad=degrees$1=>degrees$1*PI/180,radToDeg=radians=>radians*180/PI,lerp=(start,end,amount,renderable)=>{let dt$3=K/globals.defaults.frameRate;if(renderable!==!1){let ticker=renderable||engine._hasChildren&&engine;ticker&&ticker.deltaTime&&(dt$3=ticker.deltaTime)}let t$1=1-Math.exp(-amount*dt$3*.1);return amount?amount===1?end:(1-t$1)*start+t$1*end:start},curry=(fn$5,last=0)=>(...args)=>last?v=>fn$5(...args,v):v=>fn$5(v,...args),chain=fn$5=>(...args)=>{let result=fn$5(...args);return new Proxy(noop,{apply:(_$1,__,[v])=>result(v),get:(_$1,prop)=>chain((...nextArgs)=>{let nextResult=utils[prop](...nextArgs);return v=>nextResult(result(v))})})},makeChainable=(fn$5,right=0)=>(...args)=>(args.lengthnew Promise(resolve$1=>{let source=audioContext.createBufferSource();source.buffer=ctx.data.audioBuffer,source.connect(audioContext.destination),nowSpeaking.value=!0,source.start(0),source.onended=()=>{nowSpeaking.value=!1,resolve$1()}})]});async function handleSpeechGeneration(ctx){speechGenerationIndex.value++;try{let input=ctx.data,res=await props.generateSpeech(input,props.voice,!1),audioBuffer=await audioContext.decodeAudioData(res);await audioQueue.add({audioBuffer,text:ctx.data})}catch(error){console.error(`Speech generation failed:`,error)}}let ttsQueue=useQueue({handlers:[handleSpeechGeneration]}),messageContentQueue=useMessageContentQueue(ttsQueue);async function testStreaming(){await messageContentQueue.add(props.text)}async function testChunking(){let chunks=[],stream=new ReadableStream({start(controller){controller.enqueue(new TextEncoder().encode(props.text)),controller.close()}});for await(let chunk of chunkTTSInput(stream.getReader(),{boost:1,minimumWords:4,maximumWords:12}))chunks.push(chunk);ttsInputChunks.value=chunks}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[_cache$1[4]||=createBaseVNode(`div`,{class:`flex items-center gap-1 text-sm font-medium`},` Streaming Playground `,-1),createBaseVNode(`div`,_hoisted_1$14,[createBaseVNode(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,bg:`neutral-700 dark:neutral-300`,onClick:testChunking},_cache$1[1]||=[createBaseVNode(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[createBaseVNode(`div`,{"i-solar:round-double-alt-arrow-right-bold-duotone":``}),createBaseVNode(`span`,null,`Test chunking`)],-1)]),ttsInputChunks.value.length>0?(openBlock(),createElementBlock(`button`,{key:0,border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,bg:`neutral-700 dark:neutral-300`,onClick:testStreaming},_cache$1[2]||=[createBaseVNode(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[createBaseVNode(`div`,{"i-solar:round-double-alt-arrow-right-bold-duotone":``}),createBaseVNode(`span`,null,`Test streaming`)],-1)])):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_2$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(ttsInputChunks.value,(chunk,i)=>(openBlock(),createElementBlock(`div`,{key:i,flex:`~ row gap-2 items-center`},[createBaseVNode(`div`,{flex:`~ row gap-2 items-center`,"rounded-xl":``,"px-2":``,"py-1.5":``,class:normalizeClass({"bg-neutral-100 dark:bg-neutral-800":speechGenerationIndex.value=i})},[createBaseVNode(`span`,_hoisted_3$5,toDisplayString(chunk.text),1),createBaseVNode(`span`,{"rounded-full":``,"px-2":``,"py-.5":``,"text-nowrap":``,"text-xs":``,b:`~ dashed`,class:normalizeClass({"b-green text-green":chunk.reason===`boost`,"b-orange text-orange":chunk.reason===`limit`,"b-red text-red":chunk.reason===`hard`,"b-purple text-purple":chunk.reason===`flush`})},toDisplayString(chunk.words)+` words, `+toDisplayString(chunk.reason),3)],2),createVNode(Transition,{css:!1,onEnter:_cache$1[0]||=el=>unref(animate)(el,{opacity:[0,1],translateX:[10,0],duration:200,ease:`inOut`})},{default:withCtx(()=>[speechGenerationIndex.value>=i?(openBlock(),createElementBlock(`div`,_hoisted_4$4,_cache$1[3]||=[createBaseVNode(`div`,{"i-solar-check-circle-line-duotone":``},null,-1),createBaseVNode(`div`,null,`Queued`,-1)])):createCommentVNode(``,!0)]),_:2},1024)]))),128))])],64))}}),SpeechStreamingPlayground_default=SpeechStreamingPlayground_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$13={"w-full":``,"rounded-xl":``},_hoisted_2$7={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},_hoisted_3$4={class:`inline-flex items-center gap-4`},_hoisted_4$3={flex:`~ col gap-4`},_hoisted_5$3=[`placeholder`],_hoisted_6$3=[`placeholder`],_hoisted_7$2={flex:`~ row`,"gap-4":``},_hoisted_8$2=[`disabled`],_hoisted_9$2={flex:`~ row`,"items-center":``,"gap-2":``},_hoisted_10$2={flex:`~ row`,"items-center":``,"gap-2":``},_hoisted_11$1={key:2,class:`mt-2 text-sm text-red-500`},_hoisted_12$1={key:3,class:`mt-2 text-sm text-red-500`},_hoisted_13$1={key:4,class:`mt-2 text-sm text-red-500`},_hoisted_14$1=[`src`];var SpeechPlayground_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SpeechPlayground`,props:{defaultText:{},availableVoices:{},generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(__props,{expose:__expose}){let props=__props,{t:t$1}=useI18n(),testText=ref(props.defaultText||`Hello! This is a test of the voice synthesis.`),isGenerating=ref(!1),audioUrl=ref(``),errorMessage=ref(``),audioPlayer=ref(null),useSSML=ref(!1),ssmlText=ref(``),selectedVoice=ref(``);watch(()=>props.availableVoices,newVoices=>{newVoices.length>0&&!selectedVoice.value&&(selectedVoice.value=newVoices[0]?.id||``)},{immediate:!0});let voiceOptions=computed(()=>props.availableVoices.map(voice=>({value:voice.id,label:voice.name})));async function handleGenerateTestSpeech(){if(!(!testText.value.trim()&&!useSSML.value||useSSML.value&&!ssmlText.value.trim()||!selectedVoice.value)){isGenerating.value=!0,errorMessage.value=``;try{audioUrl.value&&stopTestAudio();let input=useSSML.value?ssmlText.value:testText.value,response=await props.generateSpeech(input,selectedVoice.value,useSSML.value);audioUrl.value=URL.createObjectURL(new Blob([response])),setTimeout(()=>{audioPlayer.value&&audioPlayer.value.play()},100)}catch(error){console.error(`Error generating speech:`,error),errorMessage.value=error instanceof Error?error.message:`An unknown error occurred`}finally{isGenerating.value=!1}}}function stopTestAudio(){audioPlayer.value&&(audioPlayer.value.pause(),audioPlayer.value.currentTime=0),audioUrl.value&&(URL.revokeObjectURL(audioUrl.value),audioUrl.value=``)}return onUnmounted(()=>{audioUrl.value&&URL.revokeObjectURL(audioUrl.value)}),__expose({testText,ssmlText,useSSML,selectedVoice,isGenerating,audioUrl,errorMessage,audioPlayer,generateTestSpeech:handleGenerateTestSpeech,stopTestAudio}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$13,[createBaseVNode(`h2`,_hoisted_2$7,[createBaseVNode(`div`,_hoisted_3$4,[createVNode(unref(TestDummyMarker_default)),createBaseVNode(`div`,null,toDisplayString(unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),createBaseVNode(`div`,_hoisted_4$3,[createVNode(unref(FieldCheckbox_default),{modelValue:useSSML.value,"onUpdate:modelValue":_cache$1[0]||=$event=>useSSML.value=$event,label:unref(t$1)(`settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label`),description:unref(t$1)(`settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description`)},null,8,[`modelValue`,`label`,`description`]),useSSML.value?withDirectives((openBlock(),createElementBlock(`textarea`,{key:1,"onUpdate:modelValue":_cache$1[2]||=$event=>ssmlText.value=$event,placeholder:unref(t$1)(`settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder`),border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,8,_hoisted_6$3)),[[vModelText,ssmlText.value]]):withDirectives((openBlock(),createElementBlock(`textarea`,{key:0,"onUpdate:modelValue":_cache$1[1]||=$event=>testText.value=$event,placeholder:unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`),border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-24":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"outline-none":``},null,8,_hoisted_5$3)),[[vModelText,testText.value]]),createVNode(unref(FieldSelect_default),{modelValue:selectedVoice.value,"onUpdate:modelValue":_cache$1[3]||=$event=>selectedVoice.value=$event,class:`[&>div]:grid [&>div]:grid-cols-[4fr_2fr]`,options:voiceOptions.value,label:unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label`),description:unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description`),layout:`horizontal`},null,8,[`modelValue`,`options`,`label`,`description`]),createBaseVNode(`div`,_hoisted_7$2,[createBaseVNode(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:isGenerating.value||!testText.value.trim()&&!useSSML.value||useSSML.value&&!ssmlText.value.trim()||!selectedVoice.value||!_ctx.apiKeyConfigured,class:normalizeClass({"opacity-50 cursor-not-allowed":isGenerating.value||!testText.value.trim()&&!useSSML.value||useSSML.value&&!ssmlText.value.trim()||!selectedVoice.value||!_ctx.apiKeyConfigured}),bg:`neutral-700 dark:neutral-300`,onClick:handleGenerateTestSpeech},[createBaseVNode(`div`,_hoisted_9$2,[_cache$1[4]||=createBaseVNode(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),createBaseVNode(`span`,null,toDisplayString(isGenerating.value?unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,_hoisted_8$2),audioUrl.value?(openBlock(),createElementBlock(`button`,{key:0,border:`primary-300 dark:primary-800 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,"py-2":``,"text-sm":``,onClick:stopTestAudio},[createBaseVNode(`div`,_hoisted_10$2,[_cache$1[5]||=createBaseVNode(`div`,{"i-solar:stop-circle-bold-duotone":``},null,-1),createBaseVNode(`span`,null,toDisplayString(unref(t$1)(`settings.pages.modules.speech.sections.section.playground.buttons.stop.label`)),1)])])):createCommentVNode(``,!0)]),_ctx.apiKeyConfigured?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_11$1,toDisplayString(unref(t$1)(`settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key`)),1)),selectedVoice.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_12$1,toDisplayString(unref(t$1)(`settings.pages.modules.speech.sections.section.playground.select-voice.required`)),1)),errorMessage.value?(openBlock(),createElementBlock(`div`,_hoisted_13$1,toDisplayString(errorMessage.value),1)):createCommentVNode(``,!0),audioUrl.value?(openBlock(),createElementBlock(`audio`,{key:5,ref_key:`audioPlayer`,ref:audioPlayer,src:audioUrl.value,controls:``,class:`mt-2 w-full`},null,8,_hoisted_14$1)):createCommentVNode(``,!0),createVNode(SpeechStreamingPlayground_default,{text:testText.value,voice:selectedVoice.value,"generate-speech":_ctx.generateSpeech},null,8,[`text`,`voice`,`generate-speech`])]),renderSlot(_ctx.$slots,`default`)]))}}),SpeechPlayground_default=SpeechPlayground_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$12={flex:`~ col md:row gap-6`},_hoisted_2$6={flex:`~ col gap-6`},_hoisted_3$3={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},_hoisted_4$2={flex:`~ col gap-4`},_hoisted_5$2={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},_hoisted_6$2={"w-full":``,"rounded-xl":``};var SpeechProviderSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SpeechProviderSettings`,props:{providerId:{},defaultModel:{},additionalSettings:{},placeholder:{}},setup(__props){let props=__props,{t:t$1}=useI18n(),router$1=useRouter(),providersStore=useProvidersStore(),speechStore=useSpeechStore(),{providers}=storeToRefs(providersStore),providerMetadata=computed(()=>providersStore.getProviderMetadata(props.providerId)),apiKey=computed({get:()=>providers.value[props.providerId]?.apiKey||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].apiKey=value$1}}),baseUrl=computed({get:()=>providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].baseUrl=value$1}}),voiceSettings=ref({});function initializeVoiceSettings(){providers.value[props.providerId]?.voiceSettings?voiceSettings.value={...providers.value[props.providerId].voiceSettings}:voiceSettings.value={pitch:0,speed:1,volume:0,...props.additionalSettings}}onMounted(()=>{providersStore.initializeProvider(props.providerId),apiKey.value=providers.value[props.providerId]?.apiKey||``,baseUrl.value=providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``,initializeVoiceSettings(),providersStore.configuredProviders[props.providerId]&&speechStore.loadVoicesForProvider(props.providerId)});let debouncedUpdate=useDebounceFn(()=>{providers.value[props.providerId]={...providers.value[props.providerId],apiKey:apiKey.value,baseUrl:baseUrl.value||providerMetadata.value?.defaultOptions?.().baseUrl||``,voiceSettings:{...voiceSettings.value}}},1e3);watch([apiKey,baseUrl],debouncedUpdate),watch(voiceSettings,debouncedUpdate,{deep:!0});function handleResetVoiceSettings(){voiceSettings.value={...providerMetadata.value?.defaultOptions?.().voiceSettings||{}},debouncedUpdate()}return(_ctx,_cache$1)=>(openBlock(),createBlock(ProviderSettingsLayout2_default,{"provider-name":providerMetadata.value?.localizedName,"provider-icon":providerMetadata.value?.icon,"on-back":()=>unref(router$1).back()},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$12,[createVNode(unref(ProviderSettingsContainer_default),{class:`w-full md:w-[40%]`},{default:withCtx(()=>[createVNode(unref(ProviderBasicSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.basic.title`),description:unref(t$1)(`settings.pages.providers.common.section.basic.description`),"on-reset":handleResetVoiceSettings},{default:withCtx(()=>[createVNode(unref(ProviderApiKeyInput_default),{modelValue:apiKey.value,"onUpdate:modelValue":_cache$1[0]||=$event=>apiKey.value=$event,"provider-name":providerMetadata.value?.localizedName,placeholder:props.placeholder||`API Key`},null,8,[`modelValue`,`provider-name`,`placeholder`]),renderSlot(_ctx.$slots,`basic-settings`)]),_:3},8,[`title`,`description`]),createBaseVNode(`div`,_hoisted_2$6,[createBaseVNode(`h2`,_hoisted_3$3,toDisplayString(unref(t$1)(`settings.pages.providers.common.section.voice.title`)),1),createBaseVNode(`div`,_hoisted_4$2,[renderSlot(_ctx.$slots,`voice-settings`)])]),createVNode(unref(ProviderAdvancedSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.advanced.title`)},{default:withCtx(()=>[createVNode(unref(ProviderBaseUrlInput_default),{modelValue:baseUrl.value,"onUpdate:modelValue":_cache$1[1]||=$event=>baseUrl.value=$event,placeholder:providerMetadata.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`]),renderSlot(_ctx.$slots,`advanced-settings`)]),_:3},8,[`title`])]),_:3}),createBaseVNode(`div`,_hoisted_5$2,[createBaseVNode(`div`,_hoisted_6$2,[renderSlot(_ctx.$slots,`playground`)])])])]),_:3},8,[`provider-name`,`provider-icon`,`on-back`]))}}),SpeechProviderSettings_default=SpeechProviderSettings_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$11={"w-full":``,"pt-1":``},_hoisted_2$5={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},_hoisted_3$2={class:`inline-flex items-center gap-4`},_hoisted_4$1={"mb-2":``},_hoisted_5$1=[`src`],_hoisted_6$1={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},_hoisted_7$1={class:`space-y-3`},_hoisted_8$1={class:`space-y-3`},_hoisted_9$1={class:`flex items-center gap-3`},_hoisted_10$1={class:`text-sm font-medium`};var TranscriptionPlayground_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TranscriptionPlayground`,props:{generateTranscription:{type:Function},apiKeyConfigured:{type:Boolean}},setup(__props){let props=__props,{t:t$1}=useI18n(),{audioInputs,selectedAudioInput,stream,stopStream,startStream}=useAudioDevice(),speakingThreshold=ref(25),isMonitoring=ref(!1),isSpeaking=ref(!1),errorMessage=ref(``),audioContext=ref(),analyser=ref(),dataArray=ref(),animationFrame=ref(),volumeLevel=ref(0),audios=ref([]),audioCleanups=ref([]),audioURLs=computed(()=>audios.value.map(blob=>{let url=URL.createObjectURL(blob);return audioCleanups.value.push(()=>URL.revokeObjectURL(url)),url})),transcriptions=ref([]),{startRecord,stopRecord,onStopRecord}=useAudioRecorder(stream);async function setupAudioMonitoring(){try{await stopAudioMonitoring(),await startStream(),await until(stream).toBeTruthy(),audioContext.value=new AudioContext;let source=audioContext.value.createMediaStreamSource(stream.value);analyser.value=audioContext.value.createAnalyser(),analyser.value.fftSize=256,analyser.value.smoothingTimeConstant=.3,source.connect(analyser.value);let bufferLength=analyser.value.frequencyBinCount;dataArray.value=new Uint8Array(bufferLength),startAudioAnalysis()}catch(error){console.error(`Error setting up audio monitoring:`,error),errorMessage.value=error instanceof Error?error.message:String(error)}}async function stopAudioMonitoring(){animationFrame.value&&(cancelAnimationFrame(animationFrame.value),animationFrame.value=void 0),stream.value&&(stream.value.getTracks().forEach(track$1=>track$1.stop()),stream.value=void 0),audioContext.value&&(await audioContext.value.close(),audioContext.value=void 0),await stopRecord(),await stopStream(),analyser.value=void 0,dataArray.value=void 0,volumeLevel.value=0,isSpeaking.value=!1}function startAudioAnalysis(){let analyze=()=>{if(!analyser.value||!dataArray.value)return;analyser.value.getByteFrequencyData(dataArray.value);let sum=0;for(let i=0;ispeakingThreshold.value,animationFrame.value=requestAnimationFrame(analyze)};analyze()}watch(selectedAudioInput,async()=>{isMonitoring.value&&await setupAudioMonitoring()}),watch(audioInputs,()=>{!selectedAudioInput.value&&audioInputs.value.length>0&&(selectedAudioInput.value=audioInputs.value.find(input=>input.deviceId===`default`)?.deviceId||audioInputs.value[0].deviceId)});async function toggleMonitoring(){isMonitoring.value?(await stopAudioMonitoring(),await stopRecord(),isMonitoring.value=!1):(onStopRecord(async recording=>{try{if(recording&&recording.size>0){audios.value.push(recording);let res=await props.generateTranscription(new File([recording],`recording.wav`));transcriptions.value.push(res.text)}}catch(err){errorMessage.value=err instanceof Error?err.message:String(err),console.error(`Error generating transcription:`,errorMessage.value)}}),await setupAudioMonitoring(),await startRecord(),isMonitoring.value=!0)}let speakingIndicatorClass=computed(()=>isSpeaking.value?`bg-green-500 shadow-lg shadow-green-500/50`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`);return onUnmounted(()=>{stopAudioMonitoring()}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$11,[createBaseVNode(`h2`,_hoisted_2$5,[createBaseVNode(`div`,_hoisted_3$2,[createVNode(unref(TestDummyMarker_default)),createBaseVNode(`div`,null,toDisplayString(unref(t$1)(`settings.pages.providers.provider.transcriptions.playground.title`)),1)])]),createBaseVNode(`div`,_hoisted_4$1,[createVNode(unref(FieldSelect_default),{modelValue:unref(selectedAudioInput),"onUpdate:modelValue":_cache$1[0]||=$event=>isRef(selectedAudioInput)?selectedAudioInput.value=$event:null,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:unref(audioInputs).map(input=>({label:input.label||input.deviceId,value:input.deviceId})),placeholder:`Select an audio input device`,layout:`vertical`,"h-fit":``,"w-full":``},null,8,[`modelValue`,`options`])]),createVNode(unref(Button_default),{class:`my-4`,"w-full":``,onClick:toggleMonitoring},{default:withCtx(()=>[createTextVNode(toDisplayString(isMonitoring.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(audioURLs.value,(audio,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,class:`mb-2`},[createBaseVNode(`audio`,{src:audio,controls:``,class:`w-full`},null,8,_hoisted_5$1),transcriptions.value[index$1]?(openBlock(),createElementBlock(`div`,_hoisted_6$1,toDisplayString(transcriptions.value[index$1]),1)):createCommentVNode(``,!0)]))),128))]),createBaseVNode(`div`,_hoisted_7$1,[createVNode(unref(LevelMeter_default),{level:volumeLevel.value,label:`Input Level`},null,8,[`level`]),createVNode(unref(ThresholdMeter_default),{value:volumeLevel.value/100,threshold:speakingThreshold.value/100,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`]),createBaseVNode(`div`,_hoisted_8$1,[createVNode(unref(FieldRange_default),{modelValue:speakingThreshold.value,"onUpdate:modelValue":_cache$1[1]||=$event=>speakingThreshold.value=$event,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:1,max:80,step:1,"format-value":value$1=>`${value$1}%`},null,8,[`modelValue`,`format-value`])]),createBaseVNode(`div`,_hoisted_9$1,[createBaseVNode(`div`,{class:normalizeClass([`h-4 w-4 rounded-full transition-all duration-200`,speakingIndicatorClass.value])},null,2),createBaseVNode(`span`,_hoisted_10$1,toDisplayString(isSpeaking.value?`Speaking Detected`:`Silence`),1)])])]))}}),TranscriptionPlayground_default=TranscriptionPlayground_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$10={flex:`~ col md:row gap-6`},_hoisted_2$4={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},_hoisted_3$1={"w-full":``,"rounded-xl":``};var TranscriptionProviderSettings_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TranscriptionProviderSettings`,props:{providerId:{},defaultModel:{},additionalSettings:{},placeholder:{}},setup(__props){let props=__props,{t:t$1}=useI18n(),router$1=useRouter(),providersStore=useProvidersStore(),{providers}=storeToRefs(providersStore),providerMetadata=computed(()=>providersStore.getProviderMetadata(props.providerId)),apiKey=computed({get:()=>providers.value[props.providerId]?.apiKey||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].apiKey=value$1}}),baseUrl=computed({get:()=>providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``,set:value$1=>{providers.value[props.providerId]||(providers.value[props.providerId]={}),providers.value[props.providerId].baseUrl=value$1}});return onMounted(()=>{providersStore.initializeProvider(props.providerId),apiKey.value=providers.value[props.providerId]?.apiKey||``,baseUrl.value=providers.value[props.providerId]?.baseUrl||providerMetadata.value?.defaultOptions?.().baseUrl||``}),(_ctx,_cache$1)=>(openBlock(),createBlock(unref(ProviderSettingsLayout2_default),{"provider-name":providerMetadata.value?.localizedName,"provider-icon":providerMetadata.value?.icon,"on-back":()=>unref(router$1).back()},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$10,[createVNode(unref(ProviderSettingsContainer_default),{class:`w-full md:w-[40%]`},{default:withCtx(()=>[createVNode(unref(ProviderBasicSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.basic.title`),description:unref(t$1)(`settings.pages.providers.common.section.basic.description`)},{default:withCtx(()=>[createVNode(unref(ProviderApiKeyInput_default),{modelValue:apiKey.value,"onUpdate:modelValue":_cache$1[0]||=$event=>apiKey.value=$event,"provider-name":providerMetadata.value?.localizedName,placeholder:props.placeholder||`API Key`},null,8,[`modelValue`,`provider-name`,`placeholder`]),renderSlot(_ctx.$slots,`basic-settings`)]),_:3},8,[`title`,`description`]),createVNode(unref(ProviderAdvancedSettings_default),{title:unref(t$1)(`settings.pages.providers.common.section.advanced.title`)},{default:withCtx(()=>[createVNode(unref(ProviderBaseUrlInput_default),{modelValue:baseUrl.value,"onUpdate:modelValue":_cache$1[1]||=$event=>baseUrl.value=$event,placeholder:providerMetadata.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`]),renderSlot(_ctx.$slots,`advanced-settings`)]),_:3},8,[`title`])]),_:3}),createBaseVNode(`div`,_hoisted_2$4,[createBaseVNode(`div`,_hoisted_3$1,[renderSlot(_ctx.$slots,`playground`)])])])]),_:3},8,[`provider-name`,`provider-icon`,`on-back`]))}}),TranscriptionProviderSettings_default=TranscriptionProviderSettings_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$9={"h-full":``,"w-full":``},_hoisted_2$3={key:0,"h-full":``,flex:``,"flex-col":``},_hoisted_3={class:`mb-2 text-center md:mb-8`,flex:``,"flex-1":``,"flex-col":``,"justify-center":``},_hoisted_4={initial:{opacity:0,scale:.5},visible:{opacity:1,scale:1},duration:500,class:`mb-1 flex justify-center md:mb-4 lg:pt-16 md:pt-8`},_hoisted_5=[`src`],_hoisted_6={initial:{opacity:0,y:10},visible:{opacity:1,y:0},duration:500,class:`mb-0 text-3xl text-neutral-800 font-bold md:mb-2 dark:text-neutral-100`},_hoisted_7={initial:{opacity:0,y:10},visible:{opacity:1,y:0},duration:500,delay:100,class:`text-sm text-neutral-600 md:text-lg dark:text-neutral-400`},_hoisted_8={key:1,"h-full":``,flex:``,"flex-col":``,"gap-4":``},_hoisted_9={sticky:``,"top-0":``,"z-100":``,flex:``,"flex-shrink-0":``,"items-center":``,"gap-2":``},_hoisted_10={class:`flex-1 text-center text-xl text-neutral-800 font-semibold md:text-left md:text-2xl dark:text-neutral-100`},_hoisted_11={class:`flex-1 overflow-y-auto`},_hoisted_12={class:`grid grid-cols-1 gap-3 sm:grid-cols-2`},_hoisted_13={key:2,"h-full":``,flex:``,"flex-col":``,"gap-4":``},_hoisted_14={sticky:``,"top-0":``,"z-100":``,flex:``,"flex-shrink-0":``,"items-center":``,"gap-2":``},_hoisted_15={class:`flex-1 text-center text-xl text-neutral-800 font-semibold md:text-left md:text-2xl dark:text-neutral-100`},_hoisted_16={key:0,"flex-1":``,"overflow-y-auto":``},_hoisted_17={class:`space-y-4`},_hoisted_18={key:0},_hoisted_19={key:1},_hoisted_20={key:2},_hoisted_21={key:0,class:`mt-4`},_hoisted_22={key:3,"h-full":``,flex:``,"flex-col":``,"gap-4":``},_hoisted_23={sticky:``,"top-0":``,"z-100":``,flex:``,"flex-shrink-0":``,"items-center":``,"gap-2":``},_hoisted_24={class:`flex-1 text-center text-xl text-neutral-800 font-semibold md:text-left md:text-2xl dark:text-neutral-100`},_hoisted_25={"flex-1":``};var Onboarding_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Onboarding`,emits:[`configured`,`skipped`],setup(__props,{emit:__emit}){let emit$1=__emit,step=ref(1),direction=ref(`next`),{t:t$1}=useI18n(),providersStore=useProvidersStore(),{providers,allChatProvidersMetadata}=storeToRefs(providersStore),consciousnessStore=useConsciousnessStore(),{activeModel,activeProvider,modelSearchQuery,providerModels,isLoadingActiveProviderModels}=storeToRefs(consciousnessStore),popularProviders=computed(()=>{let popular=[`openai`,`anthropic`,`google-generative-ai`,`openrouter-ai`,`ollama`,`deepseek`,`player2`];return allChatProvidersMetadata.value.filter(provider=>popular.includes(provider.id)).sort((a$1,b$1)=>popular.indexOf(a$1.id)-popular.indexOf(b$1.id))}),selectedProviderId=ref(``),apiKey=ref(``),baseUrl=ref(``),accountId=ref(``),selectedProvider=computed(()=>allChatProvidersMetadata.value.find(p$4=>p$4.id===selectedProviderId.value)||null),isValidating=ref(!1),isValid=ref(!1),validationMessage=ref(``),needsApiKey=computed(()=>selectedProvider.value?selectedProvider.value.id!==`ollama`&&selectedProvider.value.id!==`player2`:!1),needsBaseUrl=computed(()=>selectedProvider.value?selectedProvider.value.id!==`cloudflare-workers-ai`:!1),canSave=computed(()=>!selectedProvider.value||needsApiKey.value&&!apiKey.value.trim()||needsBaseUrl.value&&!baseUrl.value.trim()||selectedProvider.value.id===`cloudflare-workers-ai`&&!accountId.value.trim()||!activeModel.value?!1:isValid.value);function selectProvider(provider){selectedProviderId.value=provider.id;let defaultOptions=provider.defaultOptions?.()||{};baseUrl.value=defaultOptions?.baseUrl||``,apiKey.value=``,accountId.value=``,isValid.value=!1,validationMessage.value=``}function getApiKeyPlaceholder(_providerId){let placeholders={openai:`sk-...`,anthropic:`sk-ant-...`,"google-generative-ai":`GEMINI_API_KEY`,"openrouter-ai":`sk-or-...`,deepseek:`sk-...`,xai:`xai-...`,"together-ai":`togetherapi-...`,"mistral-ai":`mis-...`,"moonshot-ai":`ms-...`,"fireworks-ai":`fw-...`,"featherless-ai":`fw-...`,"novita-ai":`nvt-...`};return placeholders[_providerId]||`API Key`}function getBaseUrlPlaceholder(_providerId){let defaultOptions=selectedProvider.value?.defaultOptions?.()||{};return defaultOptions?.baseUrl||`https://api.example.com/v1/`}async function validateConfiguration(){if(selectedProvider.value){isValidating.value=!0,validationMessage.value=t$1(`settings.dialogs.onboarding.validating`);try{let config$1={};needsApiKey.value&&(config$1.apiKey=apiKey.value.trim()),needsBaseUrl.value&&(config$1.baseUrl=baseUrl.value.trim()),selectedProvider.value.id===`cloudflare-workers-ai`&&(config$1.accountId=accountId.value.trim());let metadata=providersStore.getProviderMetadata(selectedProvider.value.id);isValid.value=await metadata.validators.validateProviderConfig(config$1),isValid.value?validationMessage.value=t$1(`settings.dialogs.onboarding.validationSuccess`):validationMessage.value=t$1(`settings.dialogs.onboarding.validationFailed`)}catch(error){isValid.value=!1,validationMessage.value=t$1(`settings.dialogs.onboarding.validationError`,{error:error instanceof Error?error.message:String(error)})}finally{isValidating.value=!1}}}let debouncedValidateConfiguration=useDebounceFn(()=>{selectedProvider.value&&(needsApiKey.value&&!apiKey.value.trim()||needsBaseUrl.value&&!baseUrl.value.trim()||selectedProvider.value.id===`cloudflare-workers-ai`&&!accountId.value.trim()||validateConfiguration())},500);watch([apiKey,baseUrl,accountId],()=>{selectedProvider.value&&(apiKey.value||baseUrl.value||accountId.value)&&debouncedValidateConfiguration()},{deep:!0});function handlePreviousStep(){step.value>1&&(direction.value=`previous`,step.value--)}function handleNextStep(){step.value<4?(direction.value=`next`,step.value++):handleSave()}async function handleFinishProviderConfiguration(){if(!selectedProvider.value)return;let config$1={};needsApiKey.value&&(config$1.apiKey=apiKey.value.trim()),needsBaseUrl.value&&(config$1.baseUrl=baseUrl.value.trim()),selectedProvider.value.id===`cloudflare-workers-ai`&&(config$1.accountId=accountId.value.trim()),providers.value[selectedProvider.value.id]={...providers.value[selectedProvider.value.id],...config$1},activeProvider.value=selectedProvider.value.id,await nextTick(),await consciousnessStore.loadModelsForProvider(selectedProvider.value.id),handleNextStep()}async function handleSave(){emit$1(`configured`)}return onMounted(()=>{popularProviders.value.length>0&&(selectedProviderId.value=popularProviders.value[0].id,selectProvider(popularProviders.value[0]))}),(_ctx,_cache$1)=>{let _directive_motion=resolveDirective(`motion`);return openBlock(),createElementBlock(`div`,_hoisted_1$9,[createVNode(Transition,{name:direction.value===`next`?`slide-next`:`slide-prev`,mode:`out-in`},{default:withCtx(()=>[step.value===1?(openBlock(),createElementBlock(`div`,_hoisted_2$3,[createBaseVNode(`div`,_hoisted_3,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_4,[createBaseVNode(`img`,{src:unref(onboarding_default),"max-h":`50`,"aspect-square":``,"h-auto":``,"w-auto":``,"object-cover":``},null,8,_hoisted_5)])),[[_directive_motion]]),withDirectives((openBlock(),createElementBlock(`h2`,_hoisted_6,[createTextVNode(toDisplayString(unref(t$1)(`settings.dialogs.onboarding.title`)),1)])),[[_directive_motion]]),withDirectives((openBlock(),createElementBlock(`p`,_hoisted_7,[createTextVNode(toDisplayString(unref(t$1)(`settings.dialogs.onboarding.description`)),1)])),[[_directive_motion]])]),withDirectives(createVNode(unref(Button_default),{initial:{opacity:0},visible:{opacity:1},duration:500,delay:200,label:unref(t$1)(`settings.dialogs.onboarding.start`),onClick:handleNextStep},null,8,[`label`]),[[_directive_motion]])])):step.value===2?(openBlock(),createElementBlock(`div`,_hoisted_8,[createBaseVNode(`div`,_hoisted_9,[createBaseVNode(`button`,{"outline-none":``,onClick:handlePreviousStep},_cache$1[6]||=[createBaseVNode(`div`,{class:`i-solar:alt-arrow-left-line-duotone h-5 w-5`},null,-1)]),createBaseVNode(`h2`,_hoisted_10,toDisplayString(unref(t$1)(`settings.dialogs.onboarding.selectProvider`)),1),_cache$1[7]||=createBaseVNode(`div`,{class:`h-5 w-5`},null,-1)]),createBaseVNode(`div`,_hoisted_11,[createBaseVNode(`div`,_hoisted_12,[(openBlock(!0),createElementBlock(Fragment,null,renderList(popularProviders.value,provider=>(openBlock(),createBlock(unref(RadioCardDetail_default),{id:provider.id,key:provider.id,modelValue:selectedProviderId.value,"onUpdate:modelValue":_cache$1[0]||=$event=>selectedProviderId.value=$event,name:`provider-selection`,value:provider.id,title:provider.localizedName||provider.id,description:provider.localizedDescription||``,onClick:$event=>selectProvider(provider)},null,8,[`id`,`modelValue`,`value`,`title`,`description`,`onClick`]))),128))])]),createVNode(unref(Button_default),{label:unref(t$1)(`settings.dialogs.onboarding.next`),disabled:!selectedProviderId.value,onClick:handleNextStep},null,8,[`label`,`disabled`])])):step.value===3&&selectedProvider.value?(openBlock(),createElementBlock(`div`,_hoisted_13,[createBaseVNode(`div`,_hoisted_14,[createBaseVNode(`button`,{"outline-none":``,onClick:handlePreviousStep},_cache$1[8]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-left-line-duotone":``,"h-5":``,"w-5":``},null,-1)]),createBaseVNode(`h2`,_hoisted_15,toDisplayString(unref(t$1)(`settings.dialogs.onboarding.configureProvider`,{provider:selectedProvider.value.localizedName})),1),_cache$1[9]||=createBaseVNode(`div`,{"h-5":``,"w-5":``},null,-1)]),selectedProvider.value?(openBlock(),createElementBlock(`div`,_hoisted_16,[createVNode(unref(Callout_default),{label:`Keep your API keys and credentials safe!`,theme:`violet`},{default:withCtx(()=>_cache$1[10]||=[createBaseVNode(`div`,null,[createBaseVNode(`div`,null,` AIRI is running pure locally in your browser, and we will never steal your credentials for AI / LLM providers. But keep in mind that your API keys are sensitive information. Make sure to keep them safe and do not share them with anyone. `),createBaseVNode(`div`,null,[createTextVNode(` AIRI is open sourced at `),createBaseVNode(`div`,{"inline-flex":``,"translate-y-1":``,"items-center":``,"gap-1":``},[createBaseVNode(`div`,{"i-simple-icons:github":``,"inline-block":``}),createBaseVNode(`a`,{"decoration-underline":``,"decoration-dashed":``,href:`https://github.com/moeru-ai/airi`,target:`_blank`,rel:`noopener noreferrer`},`GitHub`)]),createTextVNode(`, if you want to check how we handle your credentials, feel free to inspect our code. `)])],-1)]),_:1,__:[10]}),createBaseVNode(`div`,_hoisted_17,[needsApiKey.value?(openBlock(),createElementBlock(`div`,_hoisted_18,[createVNode(unref(FieldInput_default),{modelValue:apiKey.value,"onUpdate:modelValue":_cache$1[1]||=$event=>apiKey.value=$event,placeholder:getApiKeyPlaceholder(selectedProvider.value.id),type:`password`,label:`API Key`,description:`Enter your API key for the selected provider.`,required:``},null,8,[`modelValue`,`placeholder`])])):createCommentVNode(``,!0),needsBaseUrl.value?(openBlock(),createElementBlock(`div`,_hoisted_19,[createVNode(unref(FieldInput_default),{modelValue:baseUrl.value,"onUpdate:modelValue":_cache$1[2]||=$event=>baseUrl.value=$event,placeholder:getBaseUrlPlaceholder(selectedProvider.value.id),type:`text`,label:`Base URL`,description:`Enter the base URL for the provider's API.`},null,8,[`modelValue`,`placeholder`])])):createCommentVNode(``,!0),selectedProvider.value.id===`cloudflare-workers-ai`?(openBlock(),createElementBlock(`div`,_hoisted_20,[createVNode(unref(ProviderAccountIdInput_default),{modelValue:accountId.value,"onUpdate:modelValue":_cache$1[3]||=$event=>accountId.value=$event},null,8,[`modelValue`])])):createCommentVNode(``,!0)]),validationMessage.value?(openBlock(),createElementBlock(`div`,_hoisted_21,[createBaseVNode(`div`,{class:normalizeClass([`flex items-center rounded-lg p-3`,[isValidating.value?`bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300`:isValid.value?`bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300`:`bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300`]])},[createBaseVNode(`div`,{class:normalizeClass([`mr-2 text-lg`,[isValidating.value?`i-svg-spinners:3-dots-fade`:isValid.value?`i-solar:check-circle-bold-duotone`:`i-solar:danger-circle-bold-duotone`]])},null,2),createTextVNode(` `+toDisplayString(validationMessage.value),1)],2)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createVNode(unref(Button_default),{label:unref(t$1)(`settings.dialogs.onboarding.next`),disabled:!selectedProviderId.value,loading:unref(isLoadingActiveProviderModels),onClick:handleFinishProviderConfiguration},null,8,[`label`,`disabled`,`loading`])])):step.value===4&&selectedProvider.value?(openBlock(),createElementBlock(`div`,_hoisted_22,[createBaseVNode(`div`,_hoisted_23,[createBaseVNode(`button`,{"outline-none":``,onClick:handlePreviousStep},_cache$1[11]||=[createBaseVNode(`div`,{"i-solar:alt-arrow-left-line-duotone":``,"h-5":``,"w-5":``},null,-1)]),createBaseVNode(`h2`,_hoisted_24,toDisplayString(unref(t$1)(`settings.dialogs.onboarding.select-model`)),1),_cache$1[12]||=createBaseVNode(`div`,{"h-5":``,"w-5":``},null,-1)]),createBaseVNode(`div`,_hoisted_25,[createVNode(unref(RadioCardManySelect_default),{modelValue:unref(activeModel),"onUpdate:modelValue":_cache$1[4]||=$event=>isRef(activeModel)?activeModel.value=$event:null,"search-query":unref(modelSearchQuery),"onUpdate:searchQuery":_cache$1[5]||=$event=>isRef(modelSearchQuery)?modelSearchQuery.value=$event:null,items:unref(providerModels).sort((a$1,b$1)=>a$1.id===unref(activeModel)?-1:b$1.id===unref(activeModel)?1:0),searchable:!0,"search-placeholder":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:unref(modelSearchQuery)}),"search-results-text":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":unref(t$1)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"list-class":`max-h-[calc(100dvh-17rem)] sm:max-h-120`},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])]),createVNode(unref(Button_default),{variant:`primary`,disabled:!canSave.value,label:unref(t$1)(`settings.dialogs.onboarding.saveAndContinue`),onClick:handleSave},null,8,[`disabled`,`label`])])):createCommentVNode(``,!0)]),_:1},8,[`name`])])}}}),Onboarding_default=__plugin_vue_export_helper_default(Onboarding_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-181bca39`]]),OnboardingDialog_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`OnboardingDialog`,props:{modelValue:{type:Boolean,default:!1,required:!1},modelModifiers:{}},emits:mergeModels([`configured`,`skipped`],[`update:modelValue`]),setup(__props,{emit:__emit}){let emit$1=__emit,showDialog=useModel(__props,`modelValue`),isDesktop=useMediaQuery(`(min-width: 768px)`),screenSafeArea=useScreenSafeArea();return useResizeObserver(document.documentElement,()=>screenSafeArea.update()),onMounted(()=>screenSafeArea.update()),(_ctx,_cache$1)=>unref(isDesktop)?(openBlock(),createBlock(unref(DialogRoot_default),{key:0,open:showDialog.value,"onUpdate:open":_cache$1[2]||=value$1=>showDialog.value=value$1},{default:withCtx(()=>[createVNode(unref(DialogPortal_default),null,{default:withCtx(()=>[createVNode(unref(DialogOverlay_default),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm`}),createVNode(unref(DialogContent_default),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-[9999] max-h-full max-w-2xl w-[92dvw] transform overflow-y-scroll rounded-2xl bg-white p-6 shadow-xl outline-none backdrop-blur-md scrollbar-none -translate-x-1/2 -translate-y-1/2 dark:bg-neutral-900`},{default:withCtx(()=>[createVNode(Onboarding_default,{onConfigured:_cache$1[0]||=$event=>emit$1(`configured`),onSkipped:_cache$1[1]||=$event=>emit$1(`skipped`)})]),_:1})]),_:1})]),_:1},8,[`open`])):(openBlock(),createBlock(unref(St),{key:1,open:showDialog.value,"should-scale-background":``,"onUpdate:open":_cache$1[5]||=value$1=>showDialog.value=value$1},{default:withCtx(()=>[createVNode(unref(DialogPortal_default),null,{default:withCtx(()=>[createVNode(unref(Bt),{class:`fixed inset-0`}),createVNode(unref(Ct),{class:`fixed bottom-0 left-0 right-0 z-1000 mt-20 h-full max-h-[96%] flex flex-col rounded-t-2xl bg-neutral-50 px-4 pt-4 outline-none backdrop-blur-md dark:bg-neutral-900/95`,style:normalizeStyle({paddingBottom:`${Math.max(Number.parseFloat(unref(screenSafeArea).bottom.value.replace(`px`,``)),24)}px`})},{default:withCtx(()=>[createVNode(unref(Nt)),createVNode(Onboarding_default,{onConfigured:_cache$1[3]||=$event=>emit$1(`configured`),onSkipped:_cache$1[4]||=$event=>emit$1(`skipped`)})]),_:1},8,[`style`])]),_:1})]),_:1},8,[`open`]))}}),OnboardingDialog_default=OnboardingDialog_vue_vue_type_script_setup_true_lang_default;const ToasterRootInjectionKey=Symbol(`ToasterRoot`);var ToasterRoot_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ToasterRoot`,emits:[`close`],setup(__props,{emit:__emit}){let emits=__emit;return provide(ToasterRootInjectionKey,{close:id=>emits(`close`,id)}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`)}}),ToasterRoot_default=ToasterRoot_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$8={key:0,flex:``,"gap-2":``};var ColorPalette_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ColorPalette`,props:{colors:{}},setup(__props){let settings=useSettings();return(_ctx,_cache$1)=>_ctx.colors.length?(openBlock(),createElementBlock(`div`,_hoisted_1$8,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_ctx.colors,({hex:hex$2,name:name$2})=>(openBlock(),createBlock(unref(TooltipProvider_default),{key:hex$2||`default`},{default:withCtx(()=>[createVNode(unref(TooltipRoot_default),null,{default:withCtx(()=>[createVNode(unref(TooltipTrigger_default),{transition:`all ease-in-out duration-250`,"size-8":``,"cursor-pointer":``,"rounded-full":``,"bg-primary-500":``,style:normalizeStyle(hex$2?{background:hex$2}:{"--chromatic-hue":unref(DEFAULT_THEME_COLORS_HUE)}),class:normalizeClass(unref(settings).isColorSelectedForPrimary(hex$2)?`scale-120 md:scale-150 mx-1`:`hover:scale-110`),onClick:$event=>unref(settings).applyPrimaryColorFrom(hex$2)},null,8,[`style`,`class`,`onClick`]),createVNode(unref(TooltipPortal_default),null,{default:withCtx(()=>[createVNode(unref(TooltipContent_default),{bg:`white dark:neutral-800`,"rounded-lg":``,"px-3":``,"py-1.5":``,"text-sm":``,"shadow-md":``},{default:withCtx(()=>[createTextVNode(toDisplayString(name$2)+` `,1),createVNode(unref(TooltipArrow_default),{"fill-white":``,"dark:fill-neutral-800":``})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):createCommentVNode(``,!0)}}),ColorPalette_default=ColorPalette_vue_vue_type_script_setup_true_lang_default,ArrowTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ArrowTransition`,props:{stageTransition:{default:()=>({primaryColor:`#666`,secondaryColor:`#ccc`})}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value.primaryColor||`#666`),overlayColor2=computed(()=>stageTransition.value.secondaryColor||`#ccc`);return onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-3`,style:normalizeStyle({zIndex:stageTransition.value.zIndex||100})},null,4))}}),ArrowTransition_default=__plugin_vue_export_helper_default(ArrowTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-17464329`]]),BubbleWaveOutTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`BubbleWaveOutTransition`,props:{stageTransition:{}},setup(__props){let props=__props,colors=computed(()=>props.stageTransition?.colors||[`#eee`,`#ebcb8b`,`#c56370`,`#3f3b52`]);return onMounted(()=>{document.documentElement.style.setProperty(`--circle-expansion-delay`,`${props.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--circle-expansion-duration`,`${props.stageTransition?.duration||.4}s`),colors.value.forEach((color$2,index$1)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${index$1+1}`,color$2)})}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`circle-expansion-transition`,style:normalizeStyle({zIndex:_ctx.stageTransition?.zIndex||100})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(colors.value,(_$1,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1}))),128))],4))}}),BubbleWaveOutTransition_default=__plugin_vue_export_helper_default(BubbleWaveOutTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-4624be9e`]]),FantasyFallTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`FantasyFallTransition`,props:{stageTransition:{}},setup(__props){let props=__props,direction=computed(()=>props.stageTransition?.direction||`up`),directionClass=computed(()=>`fantasy-fall-${direction.value}`);return onMounted(()=>{document.documentElement.style.setProperty(`--fantasy-fall-color`,props.stageTransition?.primaryColor||`#eee`),document.documentElement.style.setProperty(`--fantasy-fall-duration`,`${props.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--fantasy-fall-delay`,`${props.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--fantasy-fall-radius-sm`,`${props.stageTransition?.borderRadius?.sm||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-md`,`${props.stageTransition?.borderRadius?.md||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-lg`,`${props.stageTransition?.borderRadius?.lg||`50%`}`)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`fantasy-fall-transition`,directionClass.value]),style:normalizeStyle({zIndex:_ctx.stageTransition?.zIndex??100})},null,6))}}),FantasyFallTransition_default=__plugin_vue_export_helper_default(FantasyFallTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-826171f5`]]),MultipleBlocksRevealTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`MultipleBlocksRevealTransition`,props:{stageTransition:{}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value?.primaryColor||`#666`),overlayColor2=computed(()=>stageTransition.value?.secondaryColor||`#ccc`);return onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-4`,style:normalizeStyle({zIndex:stageTransition.value?.zIndex??100})},_cache$1[0]||=[createStaticVNode(`
`,5)],4))}}),MultipleBlocksRevealTransition_default=__plugin_vue_export_helper_default(MultipleBlocksRevealTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-4221f976`]]),SlideTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SlideTransition`,props:{stageTransition:{}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value?.primaryColor||`#666`),overlayColor2=computed(()=>stageTransition.value?.secondaryColor||`#ccc`);return watch([stageTransition,overlayColor1,overlayColor2],()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,overlayColor2.value)}),onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-1`,style:normalizeStyle({zIndex:stageTransition.value?.zIndex??100})},null,4))}}),SlideTransition_default=__plugin_vue_export_helper_default(SlideTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-81c0af14`]]),SlopeSlideTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`SlopeSlideTransition`,props:{stageTransition:{}},setup(__props){let props=__props,stageTransition=computed(()=>props.stageTransition),overlayColor1=computed(()=>stageTransition.value?.primaryColor??`#666`),overlayColor2=computed(()=>stageTransition.value?.secondaryColor??`#ccc`);return onMounted(()=>{document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-1`,overlayColor1.value),document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-2`,overlayColor2.value)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`stage-transition-2`,style:normalizeStyle({zIndex:stageTransition.value?.zIndex??100})},null,4))}}),SlopeSlideTransition_default=__plugin_vue_export_helper_default(SlopeSlideTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-9e8b66c8`]]),RectanglesRotateTransition_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`RectanglesRotateTransition`,props:{stageTransition:{}},setup(__props){let props=__props;return onMounted(()=>{document.documentElement.style.setProperty(`--rectangle-rotate-1-color`,props.stageTransition?.primaryColor||`#ebcb8b`),document.documentElement.style.setProperty(`--rectangle-rotate-2-color`,props.stageTransition?.secondaryColor||`#c56370`),document.documentElement.style.setProperty(`--rectangle-rotate-3-color`,props.stageTransition?.tertiaryColor||`#43445b`),document.documentElement.style.setProperty(`--rectangle-rotate-duration`,`${props.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--rectangle-rotate-delay`,`${props.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--rectangle-rotate-stagger`,`${props.stageTransition?.staggerDelay||.1}s`),document.documentElement.style.setProperty(`--rectangle-rotate-rotation`,`${props.stageTransition?.rotation||270}deg`)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`rectangle-rotate-transition`,style:normalizeStyle({zIndex:_ctx.stageTransition?.zIndex??100})},_cache$1[0]||=[createBaseVNode(`div`,{class:`rectangle rectangle-rotate-1`},[createBaseVNode(`div`)],-1),createBaseVNode(`div`,{class:`rectangle rectangle-rotate-2`},[createBaseVNode(`div`)],-1),createBaseVNode(`div`,{class:`rectangle rectangle-rotate-3`},[createBaseVNode(`div`)],-1)],4))}}),RectanglesRotateTransition_default=__plugin_vue_export_helper_default(RectanglesRotateTransition_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-45ea2f7f`]]),StageTransitionGroup_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`StageTransitionGroup`,props:{primaryColor:{},secondaryColor:{},tertiaryColor:{},colors:{},zIndex:{},disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(__props){let props=__props,router$1=useRouter(),showTransition=ref(!1),transitionStage=ref(),activeTransitionName=ref(``),activeStageTransitionParams=ref(),transitions=shallowRef({slide:{component:SlideTransition_default,duration:2700},"slope-slide":{component:SlopeSlideTransition_default,duration:2700},arrow:{component:ArrowTransition_default,duration:2700},"multiple-blocks-reveal":{component:MultipleBlocksRevealTransition_default,duration:2800},"fantasy-fall":{component:FantasyFallTransition_default,duration:2700},"rectangles-rotate":{component:RectanglesRotateTransition_default,duration:2700},"bubble-wave-out":{component:BubbleWaveOutTransition_default,duration:1e3}}),lifecycleHooks=ref([]);function addTransitionHook(hook){return lifecycleHooks.value.push(hook),()=>{let index$1=lifecycleHooks.value.indexOf(hook);index$1>=0&&lifecycleHooks.value.splice(index$1,1)}}async function triggerHooks(stage,data$12={}){transitionStage.value=stage;for(let hook of lifecycleHooks.value)try{await Promise.resolve(hook(stage,data$12))}catch(error){console.error(`Error in transition hook at stage "${stage}":`,error)}}async function triggerTransitionAsyncFn(params,next,resolve$1){if(params.name===`none`||!params.name){next(),resolve$1();return}let transition=transitions.value[params.name];if(!transition){console.error(`Transition ${params.name} not found`),next(),resolve$1();return}let navTiming=transition.nextDelay===void 0?transition.duration/3:transition.nextDelay,hasNavigated=!1,navigationHook=stage=>{stage===`navigation`&&!hasNavigated&&(hasNavigated=!0,next())},removeNavHook=addTransitionHook(navigationHook);try{await triggerHooks(`before-enter`,{transitionName:params.name}),showTransition.value&&(await triggerHooks(`before-leave`,{transitionName:activeTransitionName.value}),activeTransitionName.value=``,activeStageTransitionParams.value=void 0,showTransition.value=!1,await triggerHooks(`after-leave`,{transitionName:activeTransitionName.value}),await new Promise(r$1=>setTimeout(r$1,50))),activeTransitionName.value=params.name,activeStageTransitionParams.value=params,showTransition.value=!0,await triggerHooks(`enter-active`,{transitionName:name}),setTimeout(async()=>{await triggerHooks(`navigation`,{transitionName:params.name,config:transition}),hasNavigated||(hasNavigated=!0,next())},navTiming),setTimeout(async()=>{await triggerHooks(`after-enter`,{transitionName:params.name})},transition.duration),setTimeout(async()=>{await triggerHooks(`before-leave`,{transitionName:params.name})},transition.duration+10),setTimeout(async()=>{await triggerHooks(`leave-active`,{transitionName:params.name})},transition.duration+20);let totalDuration=transition.exitDuration??0;setTimeout(async()=>{showTransition.value=!1,activeTransitionName.value=``,activeStageTransitionParams.value=void 0,await triggerHooks(`after-leave`,{transitionName:params.name}),resolve$1()},transition.duration+totalDuration)}catch(error){console.error(error)}finally{removeNavHook(),setTimeout(()=>{hasNavigated||(hasNavigated=!0,next())},transition.duration*2)}}function triggerTransition(params,next){return new Promise(resolve$1=>{triggerTransitionAsyncFn(params,next,resolve$1)})}return router$1.beforeEach((to$1,_from,next)=>{if(props.disableTransitions){next();return}if(typeof to$1.meta.stageTransition!=`object`){next();return}let stageTransition=to$1.meta.stageTransition;if(props.usePageSpecificTransitions&&stageTransition.pageSpecificAvailable){next();return}props.primaryColor!==void 0&&(stageTransition.primaryColor=props.primaryColor),props.secondaryColor!==void 0&&(stageTransition.secondaryColor=props.secondaryColor),props.tertiaryColor!==void 0&&(stageTransition.tertiaryColor=props.tertiaryColor),props.colors!==void 0&&(stageTransition.colors=props.colors),props.zIndex!==void 0&&(stageTransition.zIndex=props.zIndex),triggerTransition(stageTransition,next)}),(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[renderSlot(_ctx.$slots,`default`),showTransition.value?(openBlock(),createElementBlock(Fragment,{key:0},[transitions.value[activeTransitionName.value]?(openBlock(),createBlock(resolveDynamicComponent(transitions.value[activeTransitionName.value].component),{key:0,"stage-transition":activeStageTransitionParams.value},null,8,[`stage-transition`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0)],64))}}),StageTransitionGroup_default=StageTransitionGroup_vue_vue_type_script_setup_true_lang_default;let toastsCounter=1;var Observer=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=subscriber=>(this.subscribers.push(subscriber),()=>{let index$1=this.subscribers.indexOf(subscriber);this.subscribers.splice(index$1,1)});publish=data$12=>{this.subscribers.forEach(subscriber=>subscriber(data$12))};addToast=data$12=>{this.publish(data$12),this.toasts=[...this.toasts,data$12]};create=data$12=>{let{message:message$1,...rest}=data$12,id=typeof data$12.id==`number`||data$12.id&&data$12.id?.length>0?data$12.id:toastsCounter++,alreadyExists=this.toasts.find(toast$1=>toast$1.id===id),dismissible=data$12.dismissible===void 0?!0:data$12.dismissible;return this.dismissedToasts.has(id)&&this.dismissedToasts.delete(id),alreadyExists?this.toasts=this.toasts.map(toast$1=>toast$1.id===id?(this.publish({...toast$1,...data$12,id,title:message$1}),{...toast$1,...data$12,id,dismissible,title:message$1}):toast$1):this.addToast({title:message$1,...rest,dismissible,id}),id};dismiss=id=>(id?(this.dismissedToasts.add(id),requestAnimationFrame(()=>this.subscribers.forEach(subscriber=>subscriber({id,dismiss:!0})))):this.toasts.forEach(toast$1=>{this.subscribers.forEach(subscriber=>subscriber({id:toast$1.id,dismiss:!0}))}),id);message=(message$1,data$12)=>this.create({...data$12,message:message$1,type:`default`});error=(message$1,data$12)=>this.create({...data$12,type:`error`,message:message$1});success=(message$1,data$12)=>this.create({...data$12,type:`success`,message:message$1});info=(message$1,data$12)=>this.create({...data$12,type:`info`,message:message$1});warning=(message$1,data$12)=>this.create({...data$12,type:`warning`,message:message$1});loading=(message$1,data$12)=>this.create({...data$12,type:`loading`,message:message$1});promise=(promise,data$12)=>{if(!data$12)return;let id;data$12.loading!==void 0&&(id=this.create({...data$12,promise,type:`loading`,message:data$12.loading,description:typeof data$12.description==`function`?void 0:data$12.description}));let p$4=Promise.resolve(promise instanceof Function?promise():promise),shouldDismiss=id!==void 0,result,originalPromise=p$4.then(async response=>{result=[`resolve`,response];let isVueComponent=isVNode(response);if(isVueComponent)shouldDismiss=!1,this.create({id,type:`default`,message:response});else if(isHttpResponse(response)&&!response.ok){shouldDismiss=!1;let promiseData=typeof data$12.error==`function`?await data$12.error(`HTTP error! status: ${response.status}`):data$12.error,description=typeof data$12.description==`function`?await data$12.description(`HTTP error! status: ${response.status}`):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`error`,description,...toastSettings})}else if(response instanceof Error){shouldDismiss=!1;let promiseData=typeof data$12.error==`function`?await data$12.error(response):data$12.error,description=typeof data$12.description==`function`?await data$12.description(response):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`error`,description,...toastSettings})}else if(data$12.success!==void 0){shouldDismiss=!1;let promiseData=typeof data$12.success==`function`?await data$12.success(response):data$12.success,description=typeof data$12.description==`function`?await data$12.description(response):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`success`,description,...toastSettings})}}).catch(async error=>{if(result=[`reject`,error],data$12.error!==void 0){shouldDismiss=!1;let promiseData=typeof data$12.error==`function`?await data$12.error(error):data$12.error,description=typeof data$12.description==`function`?await data$12.description(error):data$12.description,isExtendedResult=typeof promiseData==`object`&&!isVNode(promiseData),toastSettings=isExtendedResult?promiseData:{message:promiseData||``,id:id||``};this.create({id,type:`error`,description,...toastSettings})}}).finally(()=>{shouldDismiss&&(this.dismiss(id),id=void 0),data$12.finally?.()}),unwrap=()=>new Promise((resolve$1,reject)=>originalPromise.then(()=>result[0]===`reject`?reject(result[1]):resolve$1(result[1])).catch(reject));return typeof id!=`string`&&typeof id!=`number`?{unwrap}:Object.assign(id,{unwrap})};custom=(component,data$12)=>{let id=data$12?.id||toastsCounter++;return this.publish({component,id,...data$12}),id};getActiveToasts=()=>this.toasts.filter(toast$1=>!this.dismissedToasts.has(toast$1.id))};const ToastState=new Observer;function toastFunction(message$1,data$12){let id=data$12?.id||toastsCounter++;return ToastState.create({message:message$1,id,type:`default`,...data$12}),id}const isHttpResponse=data$12=>data$12&&typeof data$12==`object`&&`ok`in data$12&&typeof data$12.ok==`boolean`&&`status`in data$12&&typeof data$12.status==`number`,basicToast=toastFunction,getHistory=()=>ToastState.toasts,getToasts=()=>ToastState.getActiveToasts(),toast=Object.assign(basicToast,{success:ToastState.success,info:ToastState.info,warning:ToastState.warning,error:ToastState.error,custom:ToastState.custom,message:ToastState.message,promise:ToastState.promise,dismiss:ToastState.dismiss,loading:ToastState.loading},{getHistory,getToasts});function isAction(action){return action.label!==void 0}const VISIBLE_TOASTS_AMOUNT=3,VIEWPORT_OFFSET=`24px`,MOBILE_VIEWPORT_OFFSET=`16px`,TOAST_LIFETIME=4e3,TOAST_WIDTH=356,GAP=14,SWIPE_THRESHOLD=45,TIME_BEFORE_UNMOUNT=200;function useIsDocumentHidden(){let isDocumentHidden=ref(!1);return watchEffect(()=>{let callback=()=>{isDocumentHidden.value=document.hidden};return document.addEventListener(`visibilitychange`,callback),()=>window.removeEventListener(`visibilitychange`,callback)}),{isDocumentHidden}}function cn(...classes){return classes.filter(Boolean).join(` `)}function getDefaultSwipeDirections(position$2){let[y,x$1]=position$2.split(`-`),directions=[];return y&&directions.push(y),x$1&&directions.push(x$1),directions}function assignOffset(defaultOffset$1,mobileOffset){let styles={};return[defaultOffset$1,mobileOffset].forEach((offset$2,index$1)=>{let isMobile=index$1===1,prefix=isMobile?`--mobile-offset`:`--offset`,defaultValue=isMobile?MOBILE_VIEWPORT_OFFSET:VIEWPORT_OFFSET;function assignAll(offset$1$1){[`top`,`right`,`bottom`,`left`].forEach(key$2=>{styles[`${prefix}-${key$2}`]=typeof offset$1$1==`number`?`${offset$1$1}px`:offset$1$1})}typeof offset$2==`number`||typeof offset$2==`string`?assignAll(offset$2):typeof offset$2==`object`?[`top`,`right`,`bottom`,`left`].forEach(key$2=>{offset$2[key$2]===void 0?styles[`${prefix}-${key$2}`]=defaultValue:styles[`${prefix}-${key$2}`]=typeof offset$2[key$2]==`number`?`${offset$2[key$2]}px`:offset$2[key$2]}):assignAll(defaultValue)}),styles}const _hoisted_1$7=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`],_hoisted_2$2=[`aria-label`,`data-disabled`];var Toast_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,swipeDirection=ref(null),swipeOutDirection=ref(null),mounted=ref(!1),removed=ref(!1),swiping=ref(!1),swipeOut=ref(!1),swiped=ref(!1),offsetBeforeRemove=ref(0),initialHeight=ref(0),remainingTime=ref(props.toast.duration||props.duration||TOAST_LIFETIME),dragStartTime=ref(null),toastRef=ref(null),isFront=computed(()=>props.index===0),isVisible=computed(()=>props.index+1<=props.visibleToasts),toastType=computed(()=>props.toast.type),dismissible=computed(()=>props.toast.dismissible!==!1),toastClass=computed(()=>props.toast.class||``),toastDescriptionClass=computed(()=>props.descriptionClass||``),heightIndex=computed(()=>{let currentPosition=props.toast.position||props.position,samePositionHeights=props.heights.filter(h$1=>h$1.position===currentPosition),index$1=samePositionHeights.findIndex(height=>height.toastId===props.toast.id);return index$1>=0?index$1:0}),toastsHeightBefore=computed(()=>{let currentPosition=props.toast.position||props.position,samePositionHeights=props.heights.filter(h$1=>h$1.position===currentPosition);return samePositionHeights.reduce((prev,curr,reducerIndex)=>reducerIndex>=heightIndex.value?prev:prev+curr.height,0)}),offset$2=computed(()=>heightIndex.value*props.gap+toastsHeightBefore.value||0),closeButton=computed(()=>props.toast.closeButton??props.closeButton),duration$2=computed(()=>props.toast.duration||props.duration||TOAST_LIFETIME),closeTimerStartTimeRef=ref(0),lastCloseTimerStartTimeRef=ref(0),pointerStartRef=ref(null),coords$1=computed(()=>props.position.split(`-`)),y=computed(()=>coords$1.value[0]),x$1=computed(()=>coords$1.value[1]),isStringOfTitle=computed(()=>typeof props.toast.title!=`string`),isStringOfDescription=computed(()=>typeof props.toast.description!=`string`),{isDocumentHidden}=useIsDocumentHidden(),disabled=computed(()=>toastType.value&&toastType.value===`loading`);onMounted(()=>{mounted.value=!0,remainingTime.value=duration$2.value}),watchEffect(async()=>{if(!mounted.value||!toastRef.value)return;await nextTick();let toastNode=toastRef.value,originalHeight=toastNode.style.height;toastNode.style.height=`auto`;let newHeight=toastNode.getBoundingClientRect().height;toastNode.style.height=originalHeight,initialHeight.value=newHeight,emit$1(`update:height`,{toastId:props.toast.id,height:newHeight,position:props.toast.position||props.position})});function deleteToast(){removed.value=!0,offsetBeforeRemove.value=offset$2.value,setTimeout(()=>{emit$1(`removeToast`,props.toast)},TIME_BEFORE_UNMOUNT)}function handleCloseToast(){if(disabled.value||!dismissible.value)return{};deleteToast(),props.toast.onDismiss?.(props.toast)}function onPointerDown(event){disabled.value||!dismissible.value||(dragStartTime.value=new Date,offsetBeforeRemove.value=offset$2.value,event.target.setPointerCapture(event.pointerId),event.target.tagName!==`BUTTON`&&(swiping.value=!0,pointerStartRef.value={x:event.clientX,y:event.clientY}))}function onPointerUp(){if(swipeOut.value||!dismissible.value)return;pointerStartRef.value=null;let swipeAmountX=Number(toastRef.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),swipeAmountY=Number(toastRef.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),timeTaken=new Date().getTime()-(dragStartTime.value?.getTime()||0),swipeAmount=swipeDirection.value===`x`?swipeAmountX:swipeAmountY,velocity=Math.abs(swipeAmount)/timeTaken;if(Math.abs(swipeAmount)>=SWIPE_THRESHOLD||velocity>.11){offsetBeforeRemove.value=offset$2.value,props.toast.onDismiss?.(props.toast),swipeDirection.value===`x`?swipeOutDirection.value=swipeAmountX>0?`right`:`left`:swipeOutDirection.value=swipeAmountY>0?`down`:`up`,deleteToast(),swipeOut.value=!0;return}else toastRef.value?.style.setProperty(`--swipe-amount-x`,`0px`),toastRef.value?.style.setProperty(`--swipe-amount-y`,`0px`);swiped.value=!1,swiping.value=!1,swipeDirection.value=null}function onPointerMove(event){if(!pointerStartRef.value||!dismissible.value)return;let isHighlighted=window?.getSelection()?.toString()?.length??!1;if(isHighlighted)return;let yDelta=event.clientY-pointerStartRef.value.y,xDelta=event.clientX-pointerStartRef.value.x,swipeDirections=props.swipeDirections??getDefaultSwipeDirections(props.position);!swipeDirection.value&&(Math.abs(xDelta)>1||Math.abs(yDelta)>1)&&(swipeDirection.value=Math.abs(xDelta)>Math.abs(yDelta)?`x`:`y`);let swipeAmount={x:0,y:0},getDampening=delta=>{let factor$1=Math.abs(delta)/20;return 1/(1.5+factor$1)};if(swipeDirection.value===`y`){if(swipeDirections.includes(`top`)||swipeDirections.includes(`bottom`))if(swipeDirections.includes(`top`)&&yDelta<0||swipeDirections.includes(`bottom`)&&yDelta>0)swipeAmount.y=yDelta;else{let dampenedDelta=yDelta*getDampening(yDelta);swipeAmount.y=Math.abs(dampenedDelta)0)swipeAmount.x=xDelta;else{let dampenedDelta=xDelta*getDampening(xDelta);swipeAmount.x=Math.abs(dampenedDelta)0||Math.abs(swipeAmount.y)>0)&&(swiped.value=!0),toastRef.value?.style.setProperty(`--swipe-amount-x`,`${swipeAmount.x}px`),toastRef.value?.style.setProperty(`--swipe-amount-y`,`${swipeAmount.y}px`)}onMounted(()=>{if(mounted.value=!0,!toastRef.value)return;let height=toastRef.value.getBoundingClientRect().height;initialHeight.value=height;let newHeights=[{toastId:props.toast.id,height,position:props.toast.position},...props.heights];emit$1(`update:heights`,newHeights)}),onBeforeUnmount(()=>{toastRef.value&&emit$1(`removeToast`,props.toast)}),watchEffect(onInvalidate=>{if(props.toast.promise&&toastType.value===`loading`||props.toast.duration===1/0||props.toast.type===`loading`)return;let timeoutId,pauseTimer=()=>{if(lastCloseTimerStartTimeRef.value{remainingTime.value!==1/0&&(closeTimerStartTimeRef.value=new Date().getTime(),timeoutId=setTimeout(()=>{props.toast.onAutoClose?.(props.toast),deleteToast()},remainingTime.value))};props.expanded||props.interacting||isDocumentHidden.value?pauseTimer():startTimer(),onInvalidate(()=>{clearTimeout(timeoutId)})}),watch(()=>props.toast.delete,value$1=>{value$1!==void 0&&value$1&&deleteToast()},{deep:!0});function handleDragEnd(){swiping.value=!1,swipeDirection.value=null,pointerStartRef.value=null}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:toastRef,class:normalizeClass(unref(cn)(props.class,toastClass.value,_ctx.classes?.toast,_ctx.toast.classes?.toast,_ctx.classes?.[toastType.value],_ctx.toast?.classes?.[toastType.value])),"data-sonner-toast":``,"data-rich-colors":_ctx.toast.richColors??_ctx.defaultRichColors,"data-styled":!(_ctx.toast.component||_ctx.toast?.unstyled||_ctx.unstyled),"data-mounted":mounted.value,"data-promise":!!_ctx.toast.promise,"data-swiped":swiped.value,"data-removed":removed.value,"data-visible":isVisible.value,"data-y-position":y.value,"data-x-position":x$1.value,"data-index":_ctx.index,"data-front":isFront.value,"data-swiping":swiping.value,"data-dismissible":dismissible.value,"data-type":toastType.value,"data-invert":_ctx.toast.invert||_ctx.invert,"data-swipe-out":swipeOut.value,"data-swipe-direction":swipeOutDirection.value,"data-expanded":!!(_ctx.expanded||_ctx.expandByDefault&&mounted.value),style:normalizeStyle({"--index":_ctx.index,"--toasts-before":_ctx.index,"--z-index":_ctx.toasts.length-_ctx.index,"--offset":`${removed.value?offsetBeforeRemove.value:offset$2.value}px`,"--initial-height":_ctx.expandByDefault?`auto`:`${initialHeight.value}px`,..._ctx.style,...props.toast.style}),onDragend:handleDragEnd,onPointerdown:onPointerDown,onPointerup:onPointerUp,onPointermove:onPointerMove},[closeButton.value&&!_ctx.toast.component&&toastType.value!==`loading`?(openBlock(),createElementBlock(`button`,{key:0,"aria-label":_ctx.closeButtonAriaLabel||`Close toast`,"data-disabled":disabled.value,"data-close-button":`true`,class:normalizeClass(unref(cn)(_ctx.classes?.closeButton,_ctx.toast?.classes?.closeButton)),onClick:handleCloseToast},[_ctx.icons?.close?(openBlock(),createBlock(resolveDynamicComponent(_ctx.icons?.close),{key:0})):renderSlot(_ctx.$slots,`close-icon`,{key:1})],10,_hoisted_2$2)):createCommentVNode(`v-if`,!0),_ctx.toast.component?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.component),mergeProps({key:1},_ctx.toast.componentProps,{onCloseToast:handleCloseToast}),null,16)):(openBlock(),createElementBlock(Fragment,{key:2},[toastType.value!==`default`||_ctx.toast.icon||_ctx.toast.promise?(openBlock(),createElementBlock(`div`,{key:0,"data-icon":``,class:normalizeClass(unref(cn)(_ctx.classes?.icon,_ctx.toast?.classes?.icon))},[_ctx.toast.icon?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.icon),{key:0})):(openBlock(),createElementBlock(Fragment,{key:1},[toastType.value===`loading`?renderSlot(_ctx.$slots,`loading-icon`,{key:0}):toastType.value===`success`?renderSlot(_ctx.$slots,`success-icon`,{key:1}):toastType.value===`error`?renderSlot(_ctx.$slots,`error-icon`,{key:2}):toastType.value===`warning`?renderSlot(_ctx.$slots,`warning-icon`,{key:3}):toastType.value===`info`?renderSlot(_ctx.$slots,`info-icon`,{key:4}):createCommentVNode(`v-if`,!0)],64))],2)):createCommentVNode(`v-if`,!0),createBaseVNode(`div`,{"data-content":``,class:normalizeClass(unref(cn)(_ctx.classes?.content,_ctx.toast?.classes?.content))},[createBaseVNode(`div`,{"data-title":``,class:normalizeClass(unref(cn)(_ctx.classes?.title,_ctx.toast.classes?.title))},[isStringOfTitle.value?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.title),normalizeProps(mergeProps({key:0},_ctx.toast.componentProps)),null,16)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.toast.title),1)],64))],2),_ctx.toast.description?(openBlock(),createElementBlock(`div`,{key:0,"data-description":``,class:normalizeClass(unref(cn)(_ctx.descriptionClass,toastDescriptionClass.value,_ctx.classes?.description,_ctx.toast.classes?.description))},[isStringOfDescription.value?(openBlock(),createBlock(resolveDynamicComponent(_ctx.toast.description),normalizeProps(mergeProps({key:0},_ctx.toast.componentProps)),null,16)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(_ctx.toast.description),1)],64))],2)):createCommentVNode(`v-if`,!0)],2),_ctx.toast.cancel?(openBlock(),createElementBlock(`button`,{key:1,style:normalizeStyle(_ctx.toast.cancelButtonStyle||_ctx.cancelButtonStyle),class:normalizeClass(unref(cn)(_ctx.classes?.cancelButton,_ctx.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:_cache$1[0]||=event=>{unref(isAction)(_ctx.toast.cancel)&&dismissible.value&&(_ctx.toast.cancel.onClick?.(event),deleteToast())}},toDisplayString(unref(isAction)(_ctx.toast.cancel)?_ctx.toast.cancel?.label:_ctx.toast.cancel),7)):createCommentVNode(`v-if`,!0),_ctx.toast.action?(openBlock(),createElementBlock(`button`,{key:2,style:normalizeStyle(_ctx.toast.actionButtonStyle||_ctx.actionButtonStyle),class:normalizeClass(unref(cn)(_ctx.classes?.actionButton,_ctx.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:_cache$1[1]||=event=>{unref(isAction)(_ctx.toast.action)&&(_ctx.toast.action.onClick?.(event),!event.defaultPrevented&&deleteToast())}},toDisplayString(unref(isAction)(_ctx.toast.action)?_ctx.toast.action?.label:_ctx.toast.action),7)):createCommentVNode(`v-if`,!0)],64))],46,_hoisted_1$7))}}),Toast_default=Toast_vue_vue_type_script_setup_true_lang_default,export_helper_default=(sfc,props)=>{let target$1=sfc.__vccOpts||sfc;for(let[key$2,val]of props)target$1[key$2]=val;return target$1};const _sfc_main$4={},_hoisted_1$6={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function _sfc_render$4(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$6,_cache$1[0]||=[createBaseVNode(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),createBaseVNode(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var CloseIcon_default=export_helper_default(_sfc_main$4,[[`render`,_sfc_render$4]]);const _hoisted_1$5=[`data-visible`],_hoisted_2$1={class:`sonner-spinner`};var Loader_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Loader`,props:{visible:{type:Boolean}},setup(__props){let bars=Array(12).fill(0);return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`sonner-loading-wrapper`,"data-visible":_ctx.visible},[createBaseVNode(`div`,_hoisted_2$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(bars),bar=>(openBlock(),createElementBlock(`div`,{key:`spinner-bar-${bar}`,class:`sonner-loading-bar`}))),128))])],8,_hoisted_1$5))}}),Loader_default=Loader_vue_vue_type_script_setup_true_lang_default;const _sfc_main$3={},_hoisted_1$4={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render$3(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$4,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var SuccessIcon_default=export_helper_default(_sfc_main$3,[[`render`,_sfc_render$3]]);const _sfc_main$2={},_hoisted_1$3={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render$2(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$3,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var InfoIcon_default=export_helper_default(_sfc_main$2,[[`render`,_sfc_render$2]]);const _sfc_main$1={},_hoisted_1$2={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render$1(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$2,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var WarningIcon_default=export_helper_default(_sfc_main$1,[[`render`,_sfc_render$1]]);const _sfc_main={},_hoisted_1$1={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function _sfc_render(_ctx,_cache$1){return openBlock(),createElementBlock(`svg`,_hoisted_1$1,_cache$1[0]||=[createBaseVNode(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var ErrorIcon_default=export_helper_default(_sfc_main,[[`render`,_sfc_render]]);const _hoisted_1=[`aria-label`],_hoisted_2=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`,`data-lifted`],isClient=typeof window<`u`&&typeof document<`u`;function getDocumentDirection(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let dirAttribute=document.documentElement.getAttribute(`dir`);return dirAttribute===`auto`||!dirAttribute?window.getComputedStyle(document.documentElement).direction:dirAttribute}var Toaster_vue_vue_type_script_setup_true_lang_default=defineComponent({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:GAP},visibleToasts:{default:VISIBLE_TOASTS_AMOUNT},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:VIEWPORT_OFFSET},mobileOffset:{default:MOBILE_VIEWPORT_OFFSET},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(__props){let props=__props,attrs=useAttrs(),toasts=ref([]);function filteredToasts(pos,index$1){return toasts.value.filter(toast$1=>!toast$1.position&&index$1===0||toast$1.position===pos)}let possiblePositions=computed(()=>{let posList=toasts.value.filter(toast$1=>toast$1.position).map(toast$1=>toast$1.position);return posList.length>0?Array.from(new Set([props.position].concat(posList))):[props.position]}),toastsByPosition=computed(()=>{let result={};return possiblePositions.value.forEach(pos=>{result[pos]=toasts.value.filter(t$1=>t$1.position===pos)}),result}),heights=ref([]),expanded=ref(!1),interacting=ref(!1),actualTheme=ref(props.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:props.theme),listRef=ref(null),lastFocusedElementRef=ref(null),isFocusWithinRef=ref(!1),hotkeyLabel=props.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function removeToast(toastToRemove){toasts.value.find(toast$1=>toast$1.id===toastToRemove.id)?.delete||ToastState.dismiss(toastToRemove.id),toasts.value=toasts.value.filter(({id})=>id!==toastToRemove.id),setTimeout(()=>{toasts.value.find(t$1=>t$1.id===toastToRemove.id)||(heights.value=heights.value.filter(h$1=>h$1.toastId!==toastToRemove.id))},TIME_BEFORE_UNMOUNT+50)}function onBlur(event){isFocusWithinRef.value&&!event.currentTarget?.contains?.(event.relatedTarget)&&(isFocusWithinRef.value=!1,lastFocusedElementRef.value&&(lastFocusedElementRef.value.focus({preventScroll:!0}),lastFocusedElementRef.value=null))}function onFocus(event){let isNotDismissible=event.target instanceof HTMLElement&&event.target.dataset.dismissible===`false`;isNotDismissible||isFocusWithinRef.value||(isFocusWithinRef.value=!0,lastFocusedElementRef.value=event.relatedTarget)}function onPointerDown(event){if(event.target){let isNotDismissible=event.target instanceof HTMLElement&&event.target.dataset.dismissible===`false`;if(isNotDismissible)return}interacting.value=!0}watchEffect(onInvalidate=>{let unsubscribe=ToastState.subscribe(toast$1=>{if(toast$1.dismiss){requestAnimationFrame(()=>{toasts.value=toasts.value.map(t$1=>t$1.id===toast$1.id?{...t$1,delete:!0}:t$1)});return}nextTick(()=>{let indexOfExistingToast=toasts.value.findIndex(t$1=>t$1.id===toast$1.id);indexOfExistingToast===-1?toasts.value=[toast$1,...toasts.value]:toasts.value=[...toasts.value.slice(0,indexOfExistingToast),{...toasts.value[indexOfExistingToast],...toast$1},...toasts.value.slice(indexOfExistingToast+1)]})});onInvalidate(unsubscribe)}),watchEffect(onInvalidate=>{if(typeof window>`u`)return;if(props.theme!==`system`){actualTheme.value=props.theme;return}let darkMediaQuery=window.matchMedia(`(prefers-color-scheme: dark)`),updateTheme=matches$1=>{actualTheme.value=matches$1?`dark`:`light`};updateTheme(darkMediaQuery.matches);let handler=event=>{updateTheme(event.matches)};try{darkMediaQuery.addEventListener(`change`,handler)}catch{darkMediaQuery.addListener(handler)}onInvalidate(()=>{try{darkMediaQuery.removeEventListener(`change`,handler)}catch{darkMediaQuery.removeListener(handler)}})}),watchEffect(()=>{listRef.value&&lastFocusedElementRef.value&&(lastFocusedElementRef.value.focus({preventScroll:!0}),lastFocusedElementRef.value=null,isFocusWithinRef.value=!1)}),watchEffect(()=>{toasts.value.length<=1&&(expanded.value=!1)}),watchEffect(onInvalidate=>{function handleKeyDown(event){let isHotkeyPressed=props.hotkey.every(key$2=>event[key$2]||event.code===key$2),listRefItem=Array.isArray(listRef.value)?listRef.value[0]:listRef.value;isHotkeyPressed&&(expanded.value=!0,listRefItem?.focus());let isItemActive=document.activeElement===listRef.value||listRefItem?.contains(document.activeElement);event.code===`Escape`&&isItemActive&&(expanded.value=!1)}isClient&&(document.addEventListener(`keydown`,handleKeyDown),onInvalidate(()=>{document.removeEventListener(`keydown`,handleKeyDown)}))});function handleMouseEnter(){expanded.value=!0}function handleMouseLeave(){interacting.value||(expanded.value=!1)}function handleDragEnd(){expanded.value=!1}function handlePointerUp(){interacting.value=!1}function updateHeights(h$1){heights.value=h$1}function updateHeight(h$1){let index$1=heights.value.findIndex(item=>item.toastId===h$1.toastId);if(index$1!==-1)heights.value[index$1]=h$1;else{let samePositionIndex=heights.value.findIndex(item=>item.position===h$1.position);samePositionIndex===-1?heights.value.unshift(h$1):heights.value.splice(samePositionIndex,0,h$1)}}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createCommentVNode(` Remove item from normal navigation flow, only available via hotkey `),createBaseVNode(`section`,{"aria-label":`${_ctx.containerAriaLabel} ${unref(hotkeyLabel)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(openBlock(!0),createElementBlock(Fragment,null,renderList(possiblePositions.value,(pos,index$1)=>(openBlock(),createElementBlock(`ol`,mergeProps({key:pos,ref_for:!0,ref_key:`listRef`,ref:listRef,"data-sonner-toaster":``,"data-sonner-theme":actualTheme.value,class:props.class,dir:_ctx.dir===`auto`?getDocumentDirection():_ctx.dir,tabIndex:-1,"data-theme":_ctx.theme,"data-rich-colors":_ctx.richColors,"data-y-position":pos.split(`-`)[0],"data-x-position":pos.split(`-`)[1],"data-lifted":expanded.value&&toasts.value.length>1&&!_ctx.expand,style:{"--front-toast-height":`${heights.value[0]?.height||0}px`,"--width":`${unref(TOAST_WIDTH)}px`,"--gap":`${_ctx.gap}px`,..._ctx.style,...unref(attrs).style,...unref(assignOffset)(_ctx.offset,_ctx.mobileOffset)}},_ctx.$attrs,{onBlur,onFocus,onMouseenter:handleMouseEnter,onMousemove:handleMouseEnter,onMouseleave:handleMouseLeave,onDragend:handleDragEnd,onPointerdown:onPointerDown,onPointerup:handlePointerUp}),[(openBlock(!0),createElementBlock(Fragment,null,renderList(filteredToasts(pos,index$1),(toast$1,idx)=>(openBlock(),createBlock(Toast_default,{key:toast$1.id,heights:heights.value,icons:_ctx.icons,index:idx,toast:toast$1,defaultRichColors:_ctx.richColors,duration:_ctx.toastOptions?.duration??_ctx.duration,class:normalizeClass(_ctx.toastOptions?.class??``),descriptionClass:_ctx.toastOptions?.descriptionClass,invert:_ctx.invert,visibleToasts:_ctx.visibleToasts,closeButton:_ctx.toastOptions?.closeButton??_ctx.closeButton,interacting:interacting.value,position:pos,style:normalizeStyle(_ctx.toastOptions?.style),unstyled:_ctx.toastOptions?.unstyled,classes:_ctx.toastOptions?.classes,cancelButtonStyle:_ctx.toastOptions?.cancelButtonStyle,actionButtonStyle:_ctx.toastOptions?.actionButtonStyle,"close-button-aria-label":_ctx.toastOptions?.closeButtonAriaLabel,toasts:toastsByPosition.value[pos],expandByDefault:_ctx.expand,gap:_ctx.gap,expanded:expanded.value,swipeDirections:props.swipeDirections,"onUpdate:heights":updateHeights,"onUpdate:height":updateHeight,onRemoveToast:removeToast},{"close-icon":withCtx(()=>[renderSlot(_ctx.$slots,`close-icon`,{},()=>[createVNode(CloseIcon_default)])]),"loading-icon":withCtx(()=>[renderSlot(_ctx.$slots,`loading-icon`,{},()=>[createVNode(Loader_default,{visible:toast$1.type===`loading`},null,8,[`visible`])])]),"success-icon":withCtx(()=>[renderSlot(_ctx.$slots,`success-icon`,{},()=>[createVNode(SuccessIcon_default)])]),"error-icon":withCtx(()=>[renderSlot(_ctx.$slots,`error-icon`,{},()=>[createVNode(ErrorIcon_default)])]),"warning-icon":withCtx(()=>[renderSlot(_ctx.$slots,`warning-icon`,{},()=>[createVNode(WarningIcon_default)])]),"info-icon":withCtx(()=>[renderSlot(_ctx.$slots,`info-icon`,{},()=>[createVNode(InfoIcon_default)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,_hoisted_2))),128))],8,_hoisted_1)],2112))}}),Toaster_default=Toaster_vue_vue_type_script_setup_true_lang_default;const usePWAStore=defineStore(`pwa`,()=>{ref([]);let breakpoints=useBreakpoints(breakpointsTailwind);breakpoints.smaller(`md`),onMounted(async()=>{})});var App_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`App`,setup(__props){usePWAStore();let i18n$1=useI18n(),settings=storeToRefs(useSettings()),onboardingStore=useOnboardingStore(),{shouldShowSetup}=storeToRefs(onboardingStore),isDark=useDark(),primaryColor=computed(()=>isDark.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 90%, oklch(90% 0 360))`),secondaryColor=computed(()=>isDark.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 90%, oklch(90% 0 360))`),tertiaryColor=computed(()=>isDark.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 90%, oklch(90% 0 360))`),colors=computed(()=>[primaryColor.value,secondaryColor.value,tertiaryColor.value,isDark.value?`#121212`:`#FFFFFF`]);watch(settings.language,()=>{i18n$1.locale.value=settings.language.value}),watch(settings.themeColorsHue,()=>{document.documentElement.style.setProperty(`--chromatic-hue`,settings.themeColorsHue.value.toString())},{immediate:!0}),watch(settings.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle(`dynamic-hue`,settings.themeColorsHueDynamic.value)},{immediate:!0}),onMounted(()=>{onboardingStore.initializeSetupCheck()});function handleSetupConfigured(){onboardingStore.markSetupCompleted()}function handleSetupSkipped(){onboardingStore.markSetupSkipped()}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(unref(StageTransitionGroup_default),{"primary-color":primaryColor.value,"secondary-color":secondaryColor.value,"tertiary-color":tertiaryColor.value,colors:colors.value,"z-index":100,"disable-transitions":unref(settings).disableTransitions.value,"use-page-specific-transitions":unref(settings).usePageSpecificTransitions.value},{default:withCtx(()=>[createVNode(unref(RouterView),null,{default:withCtx(({Component})=>[(openBlock(),createBlock(KeepAlive,{include:/IndexScenePage|StageScenePage/},[(openBlock(),createBlock(resolveDynamicComponent(Component)))],1024))]),_:1})]),_:1},8,[`primary-color`,`secondary-color`,`tertiary-color`,`colors`,`disable-transitions`,`use-page-specific-transitions`]),createVNode(unref(ToasterRoot_default),{onClose:_cache$1[0]||=id=>unref(toast).dismiss(id)},{default:withCtx(()=>[createVNode(unref(Toaster_default))]),_:1}),createVNode(unref(OnboardingDialog_default),{modelValue:unref(shouldShowSetup),"onUpdate:modelValue":_cache$1[1]||=$event=>isRef(shouldShowSetup)?shouldShowSetup.value=$event:null,onConfigured:handleSetupConfigured,onSkipped:handleSetupSkipped},null,8,[`modelValue`])],64))}}),App_default=App_vue_vue_type_script_setup_true_lang_default;const languageRemap={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hans`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`};function getLocale(){let language=localStorage.getItem(`settings/language`);language||=navigator.language||`en`;let languages=Object.keys(locales_default);return languageRemap[language||`en`]!=null&&(language=languageRemap[language||`en`]),language&&languages.includes(language)?language:`en`}const i18n=createI18n({legacy:!1,locale:getLocale(),fallbackLocale:`en`,messages:locales_default});var import_nprogress=__toESM(require_nprogress());const pinia=createPinia(),routeRecords=setupLayouts(routes);let router;router=createRouter({routes:routeRecords,history:createWebHashHistory()}),router.beforeEach((to$1,from)=>{to$1.path!==from.path&&import_nprogress.default.start()}),router.afterEach(()=>{import_nprogress.default.done()}),router.isReady().then(async()=>{}).catch(()=>{}),createApp(App_default).use(MotionPlugin).use(autoAnimatePlugin).use(router).use(pinia).use(i18n).use(mo).mount(`#app`);export{_jwt as $,useI18n as A,JSONSchemaGenerator as B,toJSONSchema as C,_array as D,_base64 as E,_base64url as F,_boolean as G,_check as H,_cidrv4 as I,_cidrv6 as J,_cuid as K,_cuid2 as L,_e164 as M,_email as N,_emoji as O,_endsWith as P,_gt as Q,_gte as R,_guid as S,_includes as T,_int as U,_ipv4 as V,_ipv6 as W,_isoDate as X,_isoDateTime as Y,_isoDuration as Z,_isoTime as _,$ZodNumber as a$,_ksuid as a1,_length as a2,_lowercase as a3,_lt as a4,_lte as a5,_maxLength as a6,_minLength as a7,_multipleOf as a8,_nanoid as a9,$ZodBase64URL as aA,$ZodBoolean as aB,$ZodCIDRv4 as aC,$ZodCIDRv6 as aD,$ZodCUID as aE,$ZodCUID2 as aF,$ZodCatch as aG,$ZodCustom as aH,$ZodDefault as aI,$ZodE164 as aJ,$ZodEmail as aK,$ZodEmoji as aL,$ZodEnum as aM,$ZodGUID as aN,$ZodIPv4 as aO,$ZodIPv6 as aP,$ZodISODate as aQ,$ZodISODateTime as aR,$ZodISODuration as aS,$ZodISOTime as aT,$ZodIntersection as aU,$ZodJWT as aV,$ZodKSUID as aW,$ZodNanoID as aX,$ZodNever as aY,$ZodNonOptional as aZ,$ZodNullable as a_,_never as aa,_normalize as ab,_number as ac,_overwrite as ad,_refine as ae,_regex as af,_startsWith as ag,_string as ah,_superRefine as ai,_toLowerCase as aj,_toUpperCase as ak,_trim as al,_ulid as am,_unknown as an,_uppercase as ao,_url as ap,_uuid as aq,_uuidv4 as ar,_uuidv6 as as,_uuidv7 as at,_xid as au,$ZodRegistry as av,globalRegistry as aw,registry as ax,$ZodArray as ay,$ZodBase64 as az,ColorPalette_default as b,randomSaccadeInterval as b$,$ZodNumberFormat as b0,$ZodObject as b1,$ZodOptional as b2,$ZodPipe as b3,$ZodPrefault as b4,$ZodReadonly as b5,$ZodString as b6,$ZodStringFormat as b7,$ZodTransform as b8,$ZodType as b9,$ZodCheckUpperCase as bA,_parse as bB,_parseAsync as bC,_safeParse as bD,_safeParseAsync as bE,safeParse$1 as bF,safeParseAsync$1 as bG,$ZodError as bH,$ZodRealError as bI,flattenError as bJ,formatError as bK,clone as bL,$ZodAsyncError as bM,$constructor as bN,config as bO,globalConfig as bP,missingDependenciesUrl as bQ,tryImport as bR,streamText as bS,useWhisper as bT,useVRMEmote as bU,loadVrm as bV,clipFromVRMAnimation as bW,loadVRMAnimation as bX,useBlink as bY,useIdleEyeSaccades as bZ,VRMUtils as b_,$ZodULID as ba,$ZodURL as bb,$ZodUUID as bc,$ZodUnion as bd,$ZodUnknown as be,$ZodXID as bf,isValidBase64 as bg,isValidBase64URL as bh,isValidJWT as bi,version as bj,Doc as bk,$ZodCheck as bl,$ZodCheckEndsWith as bm,$ZodCheckGreaterThan as bn,$ZodCheckIncludes as bo,$ZodCheckLengthEquals as bp,$ZodCheckLessThan as bq,$ZodCheckLowerCase as br,$ZodCheckMaxLength as bs,$ZodCheckMinLength as bt,$ZodCheckMultipleOf as bu,$ZodCheckNumberFormat as bv,$ZodCheckOverwrite as bw,$ZodCheckRegex as bx,$ZodCheckStartsWith as by,$ZodCheckStringFormat as bz,TranscriptionProviderSettings_default as c,useForwardPropsEmits as c$,lerp$1 as c0,randFloat as c1,useDelayMessageQueue as c2,useEmotionsMessageQueue as c3,useMessageContentQueue as c4,useQueue as c5,useMicVAD as c6,useMarkdown as c7,useAudioRecorder as c8,toWAVBase64 as c9,formatHex as cA,average as cB,ThresholdMeter_default as cC,TestDummyMarker_default as cD,LevelMeter_default as cE,PropertyPoint_default as cF,PropertyNumber_default as cG,Container_default as cH,Select_default as cI,RoundRange_default as cJ,ColorHueRange_default as cK,FieldValues_default as cL,FieldSelect_default as cM,FieldRange_default as cN,__plugin_vue_export_helper_default as cO,FieldKeyValues_default as cP,FieldInput_default as cQ,Input_default as cR,FieldCheckbox_default as cS,Checkbox_default as cT,DialogPortal_default as cU,Teleport_default as cV,DialogOverlay_default as cW,DialogContent_default as cX,DialogRoot_default as cY,injectDialogRootContext as cZ,Primitive as c_,sleep$1 as ca,merge$3 as cb,useAudioContext as cc,useSpeakingStore as cd,Dialog_default as ce,CursorFloating_default as cf,Skeleton_default as cg,Screen_default as ch,ErrorContainer_default as ci,Button_default as cj,VoiceCardManySelect_default as ck,RadioCardSimple_default as cl,RadioCardManySelect_default as cm,Alert_default as cn,IconStatusItem_default as co,IconItem_default as cp,Section_default as cq,PageHeader_default as cr,Callout_default as cs,TimeSeriesChart_default as ct,llmInferenceEndToken as cu,EMOTION_EmotionMotionName_value as cv,EMOTION_VRMExpressionName_value as cw,Emotion as cx,EmotionNeutralMotionName as cy,EmotionThinkMotionName as cz,TranscriptionPlayground_default as d,defineComponent as d$,useForwardExpose as d0,useEmitAsProps as d1,createContext as d2,RouterLink as d3,RouterView as d4,useRoute as d5,useRouter as d6,__vitePreload as d7,storeToRefs as d8,breakpointsTailwind as d9,MOUSE as dA,MathUtils as dB,PerspectiveCamera as dC,Plane as dD,Quaternion as dE,Ray as dF,Raycaster as dG,Spherical as dH,TOUCH as dI,Vector2 as dJ,Vector3 as dK,VectorKeyframeTrack as dL,Transition as dM,vModelCheckbox as dN,vModelSelect as dO,vModelText as dP,vShow as dQ,withModifiers as dR,Fragment as dS,KeepAlive as dT,computed as dU,createBaseVNode as dV,createBlock as dW,createCommentVNode as dX,createElementBlock as dY,createTextVNode as dZ,createVNode as d_,useBreakpoints as da,useClipboard as db,useDark as dc,useDevicesList as dd,useElementBounding as de,useFileDialog as df,useLocalStorage as dg,useMouse as dh,useObjectUrl as di,usePointer as dj,useResizeObserver as dk,useScreenSafeArea as dl,useUserMedia as dm,refDebounced as dn,refThrottled as do,until as dp,useDebounceFn as dq,watchDebounced as dr,defu as ds,Ee$1 as dt,Vn as du,io as dv,pe as dw,AnimationMixer as dx,Controls as dy,DirectionalLightHelper as dz,SpeechProviderSettings_default as e,guardReactiveProps as e0,inject as e1,mergeModels as e2,mergeProps as e3,nextTick as e4,onMounted as e5,onUnmounted as e6,openBlock as e7,renderList as e8,renderSlot as e9,resolveComponent as ea,resolveDirective as eb,useModel as ec,useTemplateRef as ed,watch as ee,withCtx as ef,withDirectives as eg,isRef as eh,ref as ei,shallowRef as ej,toRaw as ek,toRef as el,unref as em,normalizeClass as en,normalizeProps as eo,normalizeStyle as ep,toDisplayString as eq,__commonJSMin as er,__export as es,__require as et,__toDynamicImportESM as eu,__toESM as ev,SpeechPlayground_default as f,ProviderSettingsLayout_default as g,ProviderSettingsContainer_default as h,ProviderBasicSettings_default as i,ProviderBaseUrlInput_default as j,ProviderApiKeyInput_default as k,ProviderAdvancedSettings_default as l,ProviderAccountIdInput_default as m,useVRM as n,useSettings as o,useSettingsAudioDevice as p,useLive2d as q,require_localforage as r,useChatStore as s,useHearingStore as t,useAiriCardStore as u,useSpeechStore as v,generateSpeech as w,useConsciousnessStore as x,useProvidersStore as y,check as z}; \ No newline at end of file diff --git a/assets/memory-Cz1bx8kl.js b/assets/memory-CrPU-NEp.js similarity index 51% rename from assets/memory-Cz1bx8kl.js rename to assets/memory-CrPU-NEp.js index 813a115287eecdd2c76ea063dfbc8372b5b5817c..66b5cc97ea25404c745a57e4d4f550ac5418a5da 100644 --- a/assets/memory-Cz1bx8kl.js +++ b/assets/memory-CrPU-NEp.js @@ -1 +1 @@ -import{cs as e,dR as t,dU as n,dX as r,dY as i,dZ as a,d_ as o,e6 as s,ea as c,ee as l,ef as u,el as d}from"./index-DEpwtsc8.js";import{b as f}from"./route-block-gWR0cCIm.js";const p={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var m=o({__name:`index`,setup(o){return(o,f)=>{let m=c(`motion`);return s(),r(t,null,[n(`div`,null,[a(d(e),{label:`In development, needs your help!`,theme:`orange`},{default:l(()=>f[0]||=[n(`div`,null,[i(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),n(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),i(`. The source code of this page is located at `),n(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),i(`. `)],-1)]),_:1,__:[0]})]),u((s(),r(`div`,p,f[1]||=[n(`div`,{text:`60`,"i-solar:leaf-bold-duotone":``},null,-1)])),[[m]])],64)}}});typeof f==`function`&&f(m);var h=m;export{h as default}; \ No newline at end of file +import{cs as e,d$ as t,dS as n,dV as r,dY as i,dZ as a,d_ as o,e7 as s,eb as c,ef as l,eg as u,em as d}from"./index-BF1-WNuF.js";import{b as f}from"./route-block-gWR0cCIm.js";const p={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var m=t({__name:`index`,setup(t){return(t,f)=>{let m=c(`motion`);return s(),i(n,null,[r(`div`,null,[o(d(e),{label:`In development, needs your help!`,theme:`orange`},{default:l(()=>f[0]||=[r(`div`,null,[a(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),r(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),a(`. The source code of this page is located at `),r(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),a(`. `)],-1)]),_:1,__:[0]})]),u((s(),i(`div`,p,f[1]||=[r(`div`,{text:`60`,"i-solar:leaf-bold-duotone":``},null,-1)])),[[m]])],64)}}});typeof f==`function`&&f(m);var h=m;export{h as default}; \ No newline at end of file diff --git a/assets/memory-long-term-DCk6zf2R.js b/assets/memory-long-term-DCk6zf2R.js new file mode 100644 index 0000000000000000000000000000000000000000..d09f1732e77cd28aea5495d946d8bb4a145db27c --- /dev/null +++ b/assets/memory-long-term-DCk6zf2R.js @@ -0,0 +1 @@ +import{d$ as e,dY as t,e7 as n}from"./index-BF1-WNuF.js";import{b as r}from"./route-block-gWR0cCIm.js";var i=e({__name:`memory-long-term`,setup(e){return(e,r)=>(n(),t(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-long-term-aOPg0SoZ.js b/assets/memory-long-term-aOPg0SoZ.js deleted file mode 100644 index a02ff2603eba62e072901fe143c36d15334903ed..0000000000000000000000000000000000000000 --- a/assets/memory-long-term-aOPg0SoZ.js +++ /dev/null @@ -1 +0,0 @@ -import{dX as e,d_ as t,e6 as n}from"./index-DEpwtsc8.js";import{b as r}from"./route-block-gWR0cCIm.js";var i=t({__name:`memory-long-term`,setup(t){return(t,r)=>(n(),e(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-short-term-3rd3oGvN.js b/assets/memory-short-term-3rd3oGvN.js deleted file mode 100644 index b84b82f40254ecaee68bd48bb9f9be91fb7f5310..0000000000000000000000000000000000000000 --- a/assets/memory-short-term-3rd3oGvN.js +++ /dev/null @@ -1 +0,0 @@ -import{dX as e,d_ as t,e6 as n}from"./index-DEpwtsc8.js";import{b as r}from"./route-block-gWR0cCIm.js";var i=t({__name:`memory-short-term`,setup(t){return(t,r)=>(n(),e(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-short-term-DvyQeTmq.js b/assets/memory-short-term-DvyQeTmq.js new file mode 100644 index 0000000000000000000000000000000000000000..ab04f78c64b6c924a79c39da9da75c3b9bbda619 --- /dev/null +++ b/assets/memory-short-term-DvyQeTmq.js @@ -0,0 +1 @@ +import{d$ as e,dY as t,e7 as n}from"./index-BF1-WNuF.js";import{b as r}from"./route-block-gWR0cCIm.js";var i=e({__name:`memory-short-term`,setup(e){return(e,r)=>(n(),t(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/messages-DlXkV5Rk.js b/assets/messages-DlXkV5Rk.js new file mode 100644 index 0000000000000000000000000000000000000000..1003e5252ef204130cef8df8fe870ce5d1800ce1 --- /dev/null +++ b/assets/messages-DlXkV5Rk.js @@ -0,0 +1 @@ +import"./Basic-kTOabOY_.js";import{b as e}from"./Textarea-DjE71tF2.js";import{c4 as t,c5 as n,cu as r,d$ as i,dS as a,dV as o,dY as s,d_ as c,e7 as l,e8 as u,ei as d,em as f,eq as p}from"./index-BF1-WNuF.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=i({__name:`messages`,setup(i){let y=d(``),b=d([]),x=d(!1),S=n({handlers:[async e=>{b.value.push(e.data)}]}),C=t(S);async function w(){x.value=!0,C.add(y.value),C.add(r),y.value=``,x.value=!1}return(t,n)=>(l(),s(`div`,m,[o(`div`,h,[c(f(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),o(`button`,g,p(x.value?`Processing...`:`Send`),1)]),o(`div`,_,[o(`div`,v,[n[1]||=o(`h3`,{"font-normal":``},` TTS Message `,-1),(l(!0),s(a,null,u(b.value,e=>(l(),s(`div`,{key:e},[o(`div`,null,p(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/messages-OFTKTDnc.js b/assets/messages-OFTKTDnc.js deleted file mode 100644 index 85c1c8d2811404b4dc9cfcd83bc587434b6873f3..0000000000000000000000000000000000000000 --- a/assets/messages-OFTKTDnc.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-DOfBA0ws.js";import{b as e}from"./Textarea-BXmK5gJR.js";import{c4 as t,c5 as n,cu as r,dR as i,dU as a,dX as o,dZ as s,d_ as c,e6 as l,e7 as u,eh as d,el as f,ep as p}from"./index-DEpwtsc8.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=c({__name:`messages`,setup(c){let y=d(``),b=d([]),x=d(!1),S=n({handlers:[async e=>{b.value.push(e.data)}]}),C=t(S);async function w(){x.value=!0,C.add(y.value),C.add(r),y.value=``,x.value=!1}return(t,n)=>(l(),o(`div`,m,[a(`div`,h,[s(f(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),a(`button`,g,p(x.value?`Processing...`:`Send`),1)]),a(`div`,_,[a(`div`,v,[n[1]||=a(`h3`,{"font-normal":``},` TTS Message `,-1),(l(!0),o(i,null,u(b.value,e=>(l(),o(`div`,{key:e},[a(`div`,null,p(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/microsoft-speech-bW0zpaDE.js b/assets/microsoft-speech-Bko6hWlU.js similarity index 69% rename from assets/microsoft-speech-bW0zpaDE.js rename to assets/microsoft-speech-Bko6hWlU.js index d47df298137bb2be41e24b3fe36739da2240414d..02e8764f948cf6b4af827ed34cc001dcb8afc6e1 100644 --- a/assets/microsoft-speech-bW0zpaDE.js +++ b/assets/microsoft-speech-Bko6hWlU.js @@ -1 +1 @@ -import{A as e,cN as t,cQ as n,d8 as r,dT as i,dU as a,dV as o,dZ as s,d_ as c,e as l,e4 as u,e6 as d,ed as f,ee as p,eh as m,el as h,f as g,v as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=c({__name:`microsoft-speech`,setup(c){let{t:y}=e(),C={pitch:0,speed:1,volume:0},w=_(),T=v(),{providers:E}=r(T),D=m(0),O=m(1),k=m(0),A=i({get:()=>E.value[x]?.region,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=i(()=>!!E.value[x]?.apiKey),M=i(()=>w.availableVoices[x]||[]);u(async()=>{A.value||=`eastasia`,E.value[x]?.region||(E.value[x]?E.value[x].region=A.value:E.value[x]={region:A.value}),await w.loadVoicesForProvider(x)}),f([j,A],async()=>{await w.loadVoicesForProvider(x)});async function N(e,t,n){let r=await T.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=T.getProviderConfig(x),a=i.model||S,o={...i,region:A.value,disableSsml:!n};if(!n&&t){let n=M.value.find(e=>e.id===t);if(n){let s=w.generateSSML(e,n,{...i,pitch:D.value});return await w.speech(r,a,s,t,o)}}return await w.speech(r,a,e,t,o)}return(e,r)=>(d(),o(h(l),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":p(()=>[s(h(n),{modelValue:A.value,"onUpdate:modelValue":r[0]||=e=>A.value=e,label:h(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:h(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":p(()=>[a(`div`,b,[s(h(t),{modelValue:D.value,"onUpdate:modelValue":r[1]||=e=>D.value=e,label:h(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:h(y)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),s(h(t),{modelValue:O.value,"onUpdate:modelValue":r[2]||=e=>O.value=e,label:h(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),s(h(t),{modelValue:k.value,"onUpdate:modelValue":r[3]||=e=>k.value=e,label:h(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:h(y)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:p(()=>[s(h(g),{"available-voices":M.value,"generate-speech":N,"api-key-configured":j.value,"default-text":`Hello! This is a test of the Microsoft Speech synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{A as e,cN as t,cQ as n,d$ as r,d8 as i,dU as a,dV as o,dW as s,d_ as c,e as l,e5 as u,e7 as d,ee as f,ef as p,ei as m,em as h,f as g,v as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=r({__name:`microsoft-speech`,setup(r){let{t:y}=e(),C={pitch:0,speed:1,volume:0},w=_(),T=v(),{providers:E}=i(T),D=m(0),O=m(1),k=m(0),A=a({get:()=>E.value[x]?.region,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=a(()=>!!E.value[x]?.apiKey),M=a(()=>w.availableVoices[x]||[]);u(async()=>{A.value||=`eastasia`,E.value[x]?.region||(E.value[x]?E.value[x].region=A.value:E.value[x]={region:A.value}),await w.loadVoicesForProvider(x)}),f([j,A],async()=>{await w.loadVoicesForProvider(x)});async function N(e,t,n){let r=await T.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=T.getProviderConfig(x),a=i.model||S,o={...i,region:A.value,disableSsml:!n};if(!n&&t){let n=M.value.find(e=>e.id===t);if(n){let s=w.generateSSML(e,n,{...i,pitch:D.value});return await w.speech(r,a,s,t,o)}}return await w.speech(r,a,e,t,o)}return(e,r)=>(d(),s(h(l),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":p(()=>[c(h(n),{modelValue:A.value,"onUpdate:modelValue":r[0]||=e=>A.value=e,label:h(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:h(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":p(()=>[o(`div`,b,[c(h(t),{modelValue:D.value,"onUpdate:modelValue":r[1]||=e=>D.value=e,label:h(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:h(y)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),c(h(t),{modelValue:O.value,"onUpdate:modelValue":r[2]||=e=>O.value=e,label:h(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),c(h(t),{modelValue:k.value,"onUpdate:modelValue":r[3]||=e=>k.value=e,label:h(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:h(y)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:p(()=>[c(h(g),{"available-voices":M.value,"generate-speech":N,"api-key-configured":j.value,"default-text":`Hello! This is a test of the Microsoft Speech synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/mistral-ai-BtAe5JTJ.js b/assets/mistral-ai-teLdtiwv.js similarity index 55% rename from assets/mistral-ai-BtAe5JTJ.js rename to assets/mistral-ai-teLdtiwv.js index 932b962f1d128859a029534583440d1f3a4ee58a..c13854dc8316415da60d735b9d5a1ab5ddd9f9fb 100644 --- a/assets/mistral-ai-BtAe5JTJ.js +++ b/assets/mistral-ai-teLdtiwv.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`mistral-ai`;var x=o({__name:`mistral-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`mis-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.mistral.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`mistral-ai`;var x=t({__name:`mistral-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`mis-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.mistral.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/models-BM2HFRNH.js b/assets/models-BM2HFRNH.js new file mode 100644 index 0000000000000000000000000000000000000000..8a0edd782e62bb947f9e60e3f61408f604e25680 --- /dev/null +++ b/assets/models-BM2HFRNH.js @@ -0,0 +1 @@ +import{A as e,b as t,cF as n,cG as r,cH as i,cN as a,cR as o,cT as s,cj as c,cq as l,cs as u,cx as d,cy as f,d$ as p,d8 as m,dO as h,dS as g,dU as _,dV as v,dW as y,dX as b,dY as x,dZ as S,d_ as C,df as w,di as T,e7 as E,e8 as D,eb as O,ee as k,ef as A,eg as j,eh as M,ei as N,em as P,en as F,eq as I,ev as L,n as R,o as z,q as B,r as V}from"./index-BF1-WNuF.js";import{b as H}from"./browser-bFm1l1qg.js";import{b as U}from"./route-block-gWR0cCIm.js";import{c as W,g as G,h as K}from"./Scenes-CogR6jTf.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";import{b as q}from"./IconAnimation-PgvikmZb.js";import{b as J}from"./icon-animation-DON3nMjf.js";var ee=L(K()),te=L(V());const ne={flex:``,"items-center":``,"gap-2":``},Y={"font-medium":``,"font-mono":``},X={flex:``,"gap-2":``},re=[`onUpdate:modelValue`],ie=[`href`,`download`],ae={flex:``,"items-center":``},oe={flex:``,"items-center":``},se={flex:``,"items-center":``};var Z=p({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToVRM`],setup(n){let{t:r}=e(),i=w({accept:`application/zip`}),u=z(),{live2dDisableFocus:p}=m(u),_=B(),{modelFile:O,motionMap:L,loadingModel:R,availableMotions:V,modelUrl:H,currentMotion:U,scale:W,position:G}=m(_),K=N(H.value);i.onChange(e=>{e&&e.length>0&&(L.value={},O.value=e[0],R.value=!0)}),k(R,e=>{e||O.value&&V.value.forEach(e=>{e.motionName in d?L.value[e.fileName]=e.motionName:L.value[e.fileName]=f})});async function q(e,t){if(!Object.keys(t).length)return e;let n=new ee.default,r=await n.loadAsync(e),i=Object.keys(r.files).find(e=>e.endsWith(`model3.json`));if(!i)throw Error(`model3.json not found`);let a=await r.file(i).async(`string`),o=JSON.parse(a),s={};Object.entries(t).forEach(([e,t])=>{if(s[t]){s[t].push({File:e});return}s[t]=[{File:e}]}),o.FileReferences.Motions=s,r.file(i,JSON.stringify(o,null,2));let c=await r.generateAsync({type:`blob`});return new File([c],e.name,{type:e.type,lastModified:e.lastModified})}async function J(){let e=await te.default.getItem(`live2dModel`);if(!e)return;let t=await q(e,L.value);O.value=t,R.value=!0}let Z=T(O);return(e,n)=>(E(),x(g,null,[C(P(l),{title:P(r)(`settings.live2d.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(c),{variant:`secondary`,onClick:n[0]||=t=>e.$emit(`switchToVRM`)},{default:A(()=>[S(I(P(r)(`settings.live2d.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),C(P(l),{title:P(r)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(c),{variant:`secondary`,onClick:n[1]||=e=>P(i).open()},{default:A(()=>[S(I(P(r)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),v(`div`,ne,[C(P(o),{modelValue:K.value,"onUpdate:modelValue":n[2]||=e=>K.value=e,disabled:P(R),class:`flex-1`,placeholder:P(r)(`settings.live2d.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),C(P(c),{size:`sm`,variant:`secondary`,onClick:n[3]||=e=>H.value=K.value},{default:A(()=>[S(I(P(r)(`settings.live2d.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),C(P(l),{title:P(r)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(t),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),C(P(c),{variant:`secondary`,onClick:n[4]||=t=>e.$emit(`extractColorsFromModel`)},{default:A(()=>[S(I(P(r)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),P(O)?(E(),y(P(l),{key:0,title:P(r)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[(E(!0),x(g,null,D(P(V),e=>(E(),x(`div`,{key:e.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[v(`span`,Y,I(e.fileName),1),v(`div`,X,[j(v(`select`,{"onUpdate:modelValue":t=>P(L)[e.fileName]=t},[(E(!0),x(g,null,D(Object.keys(P(d)),e=>(E(),x(`option`,{key:e},I(e),1))),128))],8,re),[[h,P(L)[e.fileName]]]),C(P(c),{class:`form-control`,onClick:t=>U.value={group:e.motionName,index:e.motionIndex}},{default:A(()=>n[12]||=[S(` Play `,-1)]),_:2,__:[12]},1032,[`onClick`])])]))),128)),C(P(c),{onClick:J},{default:A(()=>n[13]||=[S(` Save and patch `,-1)]),_:1,__:[13]}),v(`a`,{"mt-2":``,block:``,href:P(Z),download:`${P(O)?.name||`live2d`}-motion-edited.zip`},[C(P(c),{"w-full":``},{default:A(()=>n[14]||=[S(`Export`,-1)]),_:1,__:[14]})],8,ie)]),_:1},8,[`title`])):b(``,!0),C(P(l),{title:P(r)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(a),{modelValue:P(W),"onUpdate:modelValue":n[6]||=e=>M(W)?W.value=e:null,as:`div`,min:.5,max:2,step:.01,label:P(r)(`settings.live2d.scale-and-position.scale`)},{label:A(()=>[v(`div`,ae,[v(`div`,null,I(P(r)(`settings.live2d.scale-and-position.scale`)),1),v(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[5]||=()=>W.value=1},n[15]||=[v(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),C(P(a),{modelValue:P(G).x,"onUpdate:modelValue":n[8]||=e=>P(G).x=e,as:`div`,min:-100,max:100,step:1,label:P(r)(`settings.live2d.scale-and-position.x`)},{label:A(()=>[v(`div`,oe,[v(`div`,null,I(P(r)(`settings.live2d.scale-and-position.x`)),1),v(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[7]||=()=>P(G).x=0},n[16]||=[v(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),C(P(a),{modelValue:P(G).y,"onUpdate:modelValue":n[10]||=e=>P(G).y=e,as:`div`,min:-100,max:100,step:1,label:P(r)(`settings.live2d.scale-and-position.y`)},{label:A(()=>[v(`div`,se,[v(`div`,null,I(P(r)(`settings.live2d.scale-and-position.y`)),1),v(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[9]||=()=>P(G).y=0},n[17]||=[v(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`]),C(P(l),{title:P(r)(`settings.live2d.focus.title`),icon:`i-solar:eye-scan-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(s),{modelValue:P(p),"onUpdate:modelValue":n[11]||=e=>M(p)?p.value=e:null,label:P(r)(`settings.live2d.focus.button-disable.title`)},null,8,[`modelValue`,`label`])]),_:1},8,[`title`])],64))}}),ce=Z;const le={grid:`~ cols-5 gap-1`,"p-2":``},ue={class:`col-span-2 col-start-1 row-start-6 self-center text-xs leading-tight font-mono`},de={flex:``,"items-center":``,"gap-2":``},fe={class:`text-sm text-neutral-600 space-y-1`},pe={class:`flex justify-between`},me={class:`flex justify-between`},he={class:`flex justify-between`},ge={class:`text-sm text-neutral-600 space-y-1`};var _e=p({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToLive2D`],setup(a){let{t:s}=e(),l=w({accept:`.vrm`}),d=R(),{modelFile:f,modelUrl:p,modelSize:h,modelOffset:b,cameraFOV:O,modelRotationY:k,cameraDistance:j,trackingMode:N,directionalLightPosition:L,directionalLightTarget:z,directionalLightRotation:B,directionalLightIntensity:V,ambientLightIntensity:H,hemisphereLightPosition:U,hemisphereLightIntensity:W}=m(d),G=_(()=>[{value:`camera`,label:s(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.camera`),class:`col-start-3`},{value:`mouse`,label:s(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.mouse`),class:`col-start-4`},{value:`none`,label:s(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.disabled`),class:`col-start-5`}]);l.onChange(e=>{e&&e.length>0&&(f.value=e[0])});let K=T(f),q=_({get:()=>K.value||p.value||``,set:e=>{p.value=e}});function J(){let e=new URL(q.value,`https://example.com`);e.origin===`https://example.com`&&(p.value=q.value)}return(e,a)=>(E(),x(g,null,[C(P(i),{title:P(s)(`settings.pages.models.sections.section.scene`),icon:`i-solar:people-nearby-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(c),{variant:`secondary`,size:`sm`,onClick:a[0]||=t=>e.$emit(`switchToLive2D`)},{default:A(()=>[S(I(P(s)(`settings.vrm.switch-to-vrm.change-to-vrm`)),1)]),_:1}),C(P(t),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),C(P(c),{variant:`secondary`,onClick:a[1]||=t=>e.$emit(`extractColorsFromModel`)},{default:A(()=>[S(I(P(s)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1}),v(`div`,le,[C(P(n),{x:P(b).x,"onUpdate:x":a[2]||=e=>P(b).x=e,y:P(b).y,"onUpdate:y":a[3]||=e=>P(b).y=e,z:P(b).z,"onUpdate:z":a[4]||=e=>P(b).z=e,label:`Model Position`,"x-config":{min:-P(h).x*2,max:P(h).x*2,step:P(h).x/100,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{min:-P(h).y*2,max:P(h).y*2,step:P(h).y/100,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{min:-P(h).z*2,max:P(h).z*2,step:P(h).z/100,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),C(P(r),{modelValue:P(O),"onUpdate:modelValue":a[5]||=e=>M(O)?O.value=e:null,config:{min:1,max:180,step:1,label:P(s)(`settings.vrm.scale-and-position.fov`)},label:P(s)(`settings.vrm.scale-and-position.fov`)},null,8,[`modelValue`,`config`,`label`]),C(P(r),{modelValue:P(j),"onUpdate:modelValue":a[6]||=e=>M(j)?j.value=e:null,config:{min:P(h).z,max:P(h).z*20,step:P(h).z/100,label:P(s)(`settings.vrm.scale-and-position.camera-distance`),formatValue:e=>e?.toFixed(4)},label:P(s)(`settings.vrm.scale-and-position.camera-distance`)},null,8,[`modelValue`,`config`,`label`]),C(P(r),{modelValue:P(k),"onUpdate:modelValue":a[7]||=e=>M(k)?k.value=e:null,config:{min:-180,max:180,step:1,label:P(s)(`settings.vrm.scale-and-position.rotation-y`)},label:P(s)(`settings.vrm.scale-and-position.rotation-y`)},null,8,[`modelValue`,`config`,`label`]),v(`span`,ue,I(P(s)(`settings.vrm.scale-and-position.eye-tracking-mode.title`))+`: `,1),(E(!0),x(g,null,D(G.value,e=>(E(),y(P(c),{key:e.value,class:F([e.class,`row-start-6 w-auto`]),size:`sm`,variant:P(N)===e.value?`primary`:`secondary`,label:e.label,onClick:t=>N.value=e.value},null,8,[`class`,`variant`,`label`,`onClick`]))),128)),C(P(n),{x:P(L).x,"onUpdate:x":a[8]||=e=>P(L).x=e,y:P(L).y,"onUpdate:y":a[9]||=e=>P(L).y=e,z:P(L).z,"onUpdate:z":a[10]||=e=>P(L).z=e,label:`Directional Light Position`,"x-config":{step:.001,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{step:.001,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{step:.001,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),C(P(n),{x:P(z).x,"onUpdate:x":a[11]||=e=>P(z).x=e,y:P(z).y,"onUpdate:y":a[12]||=e=>P(z).y=e,z:P(z).z,"onUpdate:z":a[13]||=e=>P(z).z=e,label:`Directional Light Target`,"x-config":{step:.001,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{step:.001,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{step:.001,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),C(P(n),{x:P(B).x,"onUpdate:x":a[14]||=e=>P(B).x=e,y:P(B).y,"onUpdate:y":a[15]||=e=>P(B).y=e,z:P(B).z,"onUpdate:z":a[16]||=e=>P(B).z=e,label:`Directional Light Rotation`,"x-config":{step:.001,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{step:.001,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{step:.001,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),C(P(r),{modelValue:P(V),"onUpdate:modelValue":a[17]||=e=>M(V)?V.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Directional Light Intensity`},null,8,[`modelValue`]),C(P(r),{modelValue:P(H),"onUpdate:modelValue":a[18]||=e=>M(H)?H.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Ambient Light Intensity`},null,8,[`modelValue`]),C(P(n),{x:P(U).x,"onUpdate:x":a[19]||=e=>P(U).x=e,y:P(U).y,"onUpdate:y":a[20]||=e=>P(U).y=e,z:P(U).z,"onUpdate:z":a[21]||=e=>P(U).z=e,label:`Hemisphere Light Position`,"x-config":{step:.001,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{step:.001,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{step:.001,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),C(P(r),{modelValue:P(W),"onUpdate:modelValue":a[22]||=e=>M(W)?W.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Hemisphere Light Intensity`},null,8,[`modelValue`])])]),_:1},8,[`title`]),C(P(i),{title:P(s)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[C(P(c),{variant:`secondary`,onClick:a[23]||=()=>{P(l).reset(),P(l).open()}},{default:A(()=>[S(I(P(s)(`settings.vrm.change-model.from-file`))+`... `,1)]),_:1}),v(`div`,de,[C(P(o),{modelValue:q.value,"onUpdate:modelValue":a[24]||=e=>q.value=e,class:`flex-1`,placeholder:P(s)(`settings.vrm.change-model.from-url-placeholder`)},null,8,[`modelValue`,`placeholder`]),C(P(c),{size:`sm`,variant:`secondary`,onClick:J},{default:A(()=>[S(I(P(s)(`settings.vrm.change-model.from-url`)),1)]),_:1})]),C(P(u),{label:P(s)(`settings.vrm.scale-and-position.model-info-title`)},{default:A(()=>[v(`div`,null,[v(`div`,fe,[v(`div`,pe,[v(`span`,null,I(P(s)(`settings.vrm.scale-and-position.model-info-x`)),1),v(`span`,null,I(P(h).x.toFixed(4)),1)]),v(`div`,me,[v(`span`,null,I(P(s)(`settings.vrm.scale-and-position.model-info-y`)),1),v(`span`,null,I(P(h).y.toFixed(4)),1)]),v(`div`,he,[v(`span`,null,I(P(s)(`settings.vrm.scale-and-position.model-info-z`)),1),v(`span`,null,I(P(h).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),C(P(u),{theme:`lime`,label:`Tips!`},{default:A(()=>[v(`div`,ge,I(P(s)(`settings.vrm.scale-and-position.tips`)),1)]),_:1})]),_:1},8,[`title`])],64))}}),Q=_e;const ve={"h-full":``,"w-full":``,"p-2":``};var ye=p({__name:`index`,props:{palette:{},live2dSceneClass:{},live2dSettingsClass:{},vrmSceneClass:{},vrmSettingsClass:{}},emits:[`extractColorsFromModel`],setup(e){let t=e,{stageView:n}=m(z()),{modelFile:r,modelUrl:i}=m(B()),{modelFile:a,modelUrl:o}=m(R());return(e,s)=>(E(),x(g,null,[P(n)===`2d`?(E(),x(g,{key:0},[v(`div`,{class:F([...t.live2dSceneClass?typeof t.live2dSceneClass==`string`?[t.live2dSceneClass]:t.live2dSceneClass:[]])},[C(G,{"model-src":P(i),"model-file":P(r)},null,8,[`model-src`,`model-file`])],2),v(`div`,{flex:`~ col gap-2`,class:F([...t.live2dSettingsClass?typeof t.live2dSettingsClass==`string`?[t.live2dSettingsClass]:t.live2dSettingsClass:[]])},[C(ce,{palette:e.palette,onExtractColorsFromModel:s[0]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToVRM:s[1]||=e=>n.value=`3d`},null,8,[`palette`])],2)],64)):b(``,!0),P(n)===`3d`?(E(),x(g,{key:1},[v(`div`,{class:F([...t.vrmSceneClass?typeof t.vrmSceneClass==`string`?[t.vrmSceneClass]:t.vrmSceneClass:[]])},[C(W,{"model-src":P(o),"model-file":P(a)},null,8,[`model-src`,`model-file`])],2),v(`div`,ve,[v(`div`,{flex:`~ col gap-2`,class:F([...t.vrmSettingsClass?typeof t.vrmSettingsClass==`string`?[t.vrmSettingsClass]:t.vrmSettingsClass:[]])},[C(Q,{palette:e.palette,onExtractColorsFromModel:s[2]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToLive2D:s[3]||=e=>n.value=`2d`},null,8,[`palette`])],2)])],64)):b(``,!0)],64))}}),be=ye;const xe={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},Se={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var $=p({__name:`index`,setup(e){let t=N(),n=N([]);async function r(){if(!t.value)return;let e=await t.value.captureFrame();if(!e){console.error(`No frame captured`);return}let r=URL.createObjectURL(e);try{let e=new H(r),t=await e.getPalette();n.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(r)}}let{iconAnimationStarted:i,showIconAnimation:a,animationIcon:o}=J(`i-solar:people-nearby-bold-duotone`);return(e,t)=>{let s=O(`motion`);return E(),x(g,null,[v(`div`,xe,[C(P(be),{"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"live-2d-settings-class":`w-100% md:w-35% lg:w-25% xl:w-25% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,"vrm-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"vrm-settings-class":`w-100% md:w-35% lg:w-25% xl:w-25% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),P(a)?(E(),y(q,{key:0,"z-index":-1,icon:P(o),"icon-size":12,duration:1e3,started:P(i),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):j((E(),x(`div`,Se,t[0]||=[v(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof U==`function`&&U($);var Ce=$;export{Ce as default}; \ No newline at end of file diff --git a/assets/models-FPOqD7a1.js b/assets/models-FPOqD7a1.js deleted file mode 100644 index ad3b39a50cf50c6046ce65d2d7c13ff47c4e837b..0000000000000000000000000000000000000000 --- a/assets/models-FPOqD7a1.js +++ /dev/null @@ -1 +0,0 @@ -import{A as e,b as t,cF as n,cG as r,cH as i,cN as a,cR as o,cT as s,cj as c,cq as l,cs as u,cx as d,cy as f,d8 as p,dN as m,dR as h,dT as g,dU as _,dV as v,dW as y,dX as b,dY as x,dZ as S,d_ as C,df as w,di as T,e6 as E,e7 as D,ea as O,ed as k,ee as A,ef as j,eg as M,eh as N,el as P,em as F,ep as I,eu as L,n as R,o as z,q as B,r as V}from"./index-DEpwtsc8.js";import{b as H}from"./browser-bFm1l1qg.js";import{b as U}from"./route-block-gWR0cCIm.js";import{c as W,g as G,h as K}from"./Scenes-C-Sbq7ai.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";import{b as q}from"./IconAnimation-DufoONwd.js";import{b as J}from"./icon-animation-C4P_W_Br.js";var ee=L(K()),te=L(V());const ne={flex:``,"items-center":``,"gap-2":``},Y={"font-medium":``,"font-mono":``},X={flex:``,"gap-2":``},re=[`onUpdate:modelValue`],ie=[`href`,`download`],ae={flex:``,"items-center":``},oe={flex:``,"items-center":``},se={flex:``,"items-center":``};var Z=C({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToVRM`],setup(n){let{t:r}=e(),i=w({accept:`application/zip`}),u=z(),{live2dDisableFocus:g}=p(u),C=B(),{modelFile:O,motionMap:L,loadingModel:R,availableMotions:V,modelUrl:H,currentMotion:U,scale:W,position:G}=p(C),K=N(H.value);i.onChange(e=>{e&&e.length>0&&(L.value={},O.value=e[0],R.value=!0)}),k(R,e=>{e||O.value&&V.value.forEach(e=>{e.motionName in d?L.value[e.fileName]=e.motionName:L.value[e.fileName]=f})});async function q(e,t){if(!Object.keys(t).length)return e;let n=new ee.default,r=await n.loadAsync(e),i=Object.keys(r.files).find(e=>e.endsWith(`model3.json`));if(!i)throw Error(`model3.json not found`);let a=await r.file(i).async(`string`),o=JSON.parse(a),s={};Object.entries(t).forEach(([e,t])=>{if(s[t]){s[t].push({File:e});return}s[t]=[{File:e}]}),o.FileReferences.Motions=s,r.file(i,JSON.stringify(o,null,2));let c=await r.generateAsync({type:`blob`});return new File([c],e.name,{type:e.type,lastModified:e.lastModified})}async function J(){let e=await te.default.getItem(`live2dModel`);if(!e)return;let t=await q(e,L.value);O.value=t,R.value=!0}let Z=T(O);return(e,n)=>(E(),b(h,null,[S(P(l),{title:P(r)(`settings.live2d.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(c),{variant:`secondary`,onClick:n[0]||=t=>e.$emit(`switchToVRM`)},{default:A(()=>[x(I(P(r)(`settings.live2d.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),S(P(l),{title:P(r)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(c),{variant:`secondary`,onClick:n[1]||=e=>P(i).open()},{default:A(()=>[x(I(P(r)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),_(`div`,ne,[S(P(o),{modelValue:K.value,"onUpdate:modelValue":n[2]||=e=>K.value=e,disabled:P(R),class:`flex-1`,placeholder:P(r)(`settings.live2d.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),S(P(c),{size:`sm`,variant:`secondary`,onClick:n[3]||=e=>H.value=K.value},{default:A(()=>[x(I(P(r)(`settings.live2d.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),S(P(l),{title:P(r)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(t),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),S(P(c),{variant:`secondary`,onClick:n[4]||=t=>e.$emit(`extractColorsFromModel`)},{default:A(()=>[x(I(P(r)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),P(O)?(E(),v(P(l),{key:0,title:P(r)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[(E(!0),b(h,null,D(P(V),e=>(E(),b(`div`,{key:e.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[_(`span`,Y,I(e.fileName),1),_(`div`,X,[j(_(`select`,{"onUpdate:modelValue":t=>P(L)[e.fileName]=t},[(E(!0),b(h,null,D(Object.keys(P(d)),e=>(E(),b(`option`,{key:e},I(e),1))),128))],8,re),[[m,P(L)[e.fileName]]]),S(P(c),{class:`form-control`,onClick:t=>U.value={group:e.motionName,index:e.motionIndex}},{default:A(()=>n[12]||=[x(` Play `,-1)]),_:2,__:[12]},1032,[`onClick`])])]))),128)),S(P(c),{onClick:J},{default:A(()=>n[13]||=[x(` Save and patch `,-1)]),_:1,__:[13]}),_(`a`,{"mt-2":``,block:``,href:P(Z),download:`${P(O)?.name||`live2d`}-motion-edited.zip`},[S(P(c),{"w-full":``},{default:A(()=>n[14]||=[x(`Export`,-1)]),_:1,__:[14]})],8,ie)]),_:1},8,[`title`])):y(``,!0),S(P(l),{title:P(r)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(a),{modelValue:P(W),"onUpdate:modelValue":n[6]||=e=>M(W)?W.value=e:null,as:`div`,min:.5,max:2,step:.01,label:P(r)(`settings.live2d.scale-and-position.scale`)},{label:A(()=>[_(`div`,ae,[_(`div`,null,I(P(r)(`settings.live2d.scale-and-position.scale`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[5]||=()=>W.value=1},n[15]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),S(P(a),{modelValue:P(G).x,"onUpdate:modelValue":n[8]||=e=>P(G).x=e,as:`div`,min:-100,max:100,step:1,label:P(r)(`settings.live2d.scale-and-position.x`)},{label:A(()=>[_(`div`,oe,[_(`div`,null,I(P(r)(`settings.live2d.scale-and-position.x`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[7]||=()=>P(G).x=0},n[16]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),S(P(a),{modelValue:P(G).y,"onUpdate:modelValue":n[10]||=e=>P(G).y=e,as:`div`,min:-100,max:100,step:1,label:P(r)(`settings.live2d.scale-and-position.y`)},{label:A(()=>[_(`div`,se,[_(`div`,null,I(P(r)(`settings.live2d.scale-and-position.y`)),1),_(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[9]||=()=>P(G).y=0},n[17]||=[_(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`]),S(P(l),{title:P(r)(`settings.live2d.focus.title`),icon:`i-solar:eye-scan-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(s),{modelValue:P(g),"onUpdate:modelValue":n[11]||=e=>M(g)?g.value=e:null,label:P(r)(`settings.live2d.focus.button-disable.title`)},null,8,[`modelValue`,`label`])]),_:1},8,[`title`])],64))}}),ce=Z;const le={grid:`~ cols-5 gap-1`,"p-2":``},ue={class:`col-span-1 col-start-1 row-start-6 self-center text-xs leading-tight font-mono`},de={flex:``,"items-center":``,"gap-2":``},fe={class:`text-sm text-neutral-600 space-y-1`},pe={class:`flex justify-between`},me={class:`flex justify-between`},Q={class:`flex justify-between`},he={class:`text-sm text-neutral-600 space-y-1`};var ge=C({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToLive2D`],setup(a){let{t:s}=e(),l=w({accept:`.vrm`}),d=R(),{modelFile:f,modelUrl:m,modelSize:y,modelOffset:C,cameraFOV:O,modelRotationY:k,cameraDistance:j,trackingMode:N}=p(d),L=g(()=>[{value:`camera`,label:s(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.camera`),class:`col-start-3`},{value:`mouse`,label:s(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.mouse`),class:`col-start-4`},{value:`none`,label:s(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.disabled`),class:`col-start-5`}]);l.onChange(e=>{e&&e.length>0&&(f.value=e[0])});let z=T(f),B=g({get:()=>z.value||m.value||``,set:e=>{m.value=e}});function V(){let e=new URL(B.value,`https://example.com`);e.origin===`https://example.com`&&(m.value=B.value)}return(e,a)=>(E(),b(h,null,[S(P(i),{title:P(s)(`settings.pages.models.sections.section.scene`),icon:`i-solar:people-nearby-bold-duotone`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(c),{variant:`secondary`,size:`sm`,onClick:a[0]||=t=>e.$emit(`switchToLive2D`)},{default:A(()=>[x(I(P(s)(`settings.vrm.switch-to-vrm.change-to-vrm`)),1)]),_:1}),S(P(t),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),S(P(c),{variant:`secondary`,onClick:a[1]||=t=>e.$emit(`extractColorsFromModel`)},{default:A(()=>[x(I(P(s)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1}),_(`div`,le,[S(P(n),{x:P(C).x,"onUpdate:x":a[2]||=e=>P(C).x=e,y:P(C).y,"onUpdate:y":a[3]||=e=>P(C).y=e,z:P(C).z,"onUpdate:z":a[4]||=e=>P(C).z=e,label:`Model Position`,"x-config":{min:-P(y).x*2,max:P(y).x*2,step:P(y).x/100,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{min:-P(y).y*2,max:P(y).y*2,step:P(y).y/100,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{min:-P(y).z*2,max:P(y).z*2,step:P(y).z/100,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),S(P(r),{modelValue:P(O),"onUpdate:modelValue":a[5]||=e=>M(O)?O.value=e:null,config:{min:1,max:180,step:1,label:P(s)(`settings.vrm.scale-and-position.fov`)},label:P(s)(`settings.vrm.scale-and-position.fov`)},null,8,[`modelValue`,`config`,`label`]),S(P(r),{modelValue:P(j),"onUpdate:modelValue":a[6]||=e=>M(j)?j.value=e:null,config:{min:P(y).z,max:P(y).z*20,step:P(y).z/100,label:P(s)(`settings.vrm.scale-and-position.camera-distance`),formatValue:e=>e?.toFixed(4)},label:P(s)(`settings.vrm.scale-and-position.camera-distance`)},null,8,[`modelValue`,`config`,`label`]),S(P(r),{modelValue:P(k),"onUpdate:modelValue":a[7]||=e=>M(k)?k.value=e:null,config:{min:-180,max:180,step:1,label:P(s)(`settings.vrm.scale-and-position.rotation-y`)},label:P(s)(`settings.vrm.scale-and-position.rotation-y`)},null,8,[`modelValue`,`config`,`label`]),_(`span`,ue,I(P(s)(`settings.vrm.scale-and-position.eye-tracking-mode.title`))+`: `,1),(E(!0),b(h,null,D(L.value,e=>(E(),v(P(c),{key:e.value,class:F([e.class,`row-start-6 w-auto`]),size:`sm`,variant:P(N)===e.value?`primary`:`secondary`,label:e.label,onClick:t=>N.value=e.value},null,8,[`class`,`variant`,`label`,`onClick`]))),128))])]),_:1},8,[`title`]),S(P(i),{title:P(s)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:F([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:A(()=>[S(P(c),{variant:`secondary`,onClick:a[8]||=()=>{P(l).reset(),P(l).open()}},{default:A(()=>[x(I(P(s)(`settings.vrm.change-model.from-file`))+`... `,1)]),_:1}),_(`div`,de,[S(P(o),{modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,class:`flex-1`,placeholder:P(s)(`settings.vrm.change-model.from-url-placeholder`)},null,8,[`modelValue`,`placeholder`]),S(P(c),{size:`sm`,variant:`secondary`,onClick:V},{default:A(()=>[x(I(P(s)(`settings.vrm.change-model.from-url`)),1)]),_:1})]),S(P(u),{label:P(s)(`settings.vrm.scale-and-position.model-info-title`)},{default:A(()=>[_(`div`,null,[_(`div`,fe,[_(`div`,pe,[_(`span`,null,I(P(s)(`settings.vrm.scale-and-position.model-info-x`)),1),_(`span`,null,I(P(y).x.toFixed(4)),1)]),_(`div`,me,[_(`span`,null,I(P(s)(`settings.vrm.scale-and-position.model-info-y`)),1),_(`span`,null,I(P(y).y.toFixed(4)),1)]),_(`div`,Q,[_(`span`,null,I(P(s)(`settings.vrm.scale-and-position.model-info-z`)),1),_(`span`,null,I(P(y).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),S(P(u),{theme:`lime`,label:`Tips!`},{default:A(()=>[_(`div`,he,I(P(s)(`settings.vrm.scale-and-position.tips`)),1)]),_:1})]),_:1},8,[`title`])],64))}}),_e=ge;const ve={"h-full":``,"w-full":``,"p-2":``};var ye=C({__name:`index`,props:{palette:{},live2dSceneClass:{},live2dSettingsClass:{},vrmSceneClass:{},vrmSettingsClass:{}},emits:[`extractColorsFromModel`],setup(e){let t=e,{stageView:n}=p(z()),{modelFile:r,modelUrl:i}=p(B()),{modelFile:a,modelUrl:o}=p(R());return(e,s)=>(E(),b(h,null,[P(n)===`2d`?(E(),b(h,{key:0},[_(`div`,{class:F([...t.live2dSceneClass?typeof t.live2dSceneClass==`string`?[t.live2dSceneClass]:t.live2dSceneClass:[]])},[S(G,{"model-src":P(i),"model-file":P(r)},null,8,[`model-src`,`model-file`])],2),_(`div`,{flex:`~ col gap-2`,class:F([...t.live2dSettingsClass?typeof t.live2dSettingsClass==`string`?[t.live2dSettingsClass]:t.live2dSettingsClass:[]])},[S(ce,{palette:e.palette,onExtractColorsFromModel:s[0]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToVRM:s[1]||=e=>n.value=`3d`},null,8,[`palette`])],2)],64)):y(``,!0),P(n)===`3d`?(E(),b(h,{key:1},[_(`div`,{class:F([...t.vrmSceneClass?typeof t.vrmSceneClass==`string`?[t.vrmSceneClass]:t.vrmSceneClass:[]])},[S(W,{"model-src":P(o),"model-file":P(a)},null,8,[`model-src`,`model-file`])],2),_(`div`,ve,[_(`div`,{flex:`~ col gap-2`,class:F([...t.vrmSettingsClass?typeof t.vrmSettingsClass==`string`?[t.vrmSettingsClass]:t.vrmSettingsClass:[]])},[S(_e,{palette:e.palette,onExtractColorsFromModel:s[2]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToLive2D:s[3]||=e=>n.value=`2d`},null,8,[`palette`])],2)])],64)):y(``,!0)],64))}}),be=ye;const xe={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},Se={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var $=C({__name:`index`,setup(e){let t=N(),n=N([]);async function r(){if(!t.value)return;let e=await t.value.captureFrame();if(!e){console.error(`No frame captured`);return}let r=URL.createObjectURL(e);try{let e=new H(r),t=await e.getPalette();n.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(r)}}let{iconAnimationStarted:i,showIconAnimation:a,animationIcon:o}=J(`i-solar:people-nearby-bold-duotone`);return(e,t)=>{let s=O(`motion`);return E(),b(h,null,[_(`div`,xe,[S(P(be),{"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"live-2d-settings-class":`w-100% md:w-35% lg:w-25% xl:w-25% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,"vrm-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"vrm-settings-class":`w-100% md:w-35% lg:w-25% xl:w-25% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),P(a)?(E(),v(q,{key:0,"z-index":-1,icon:P(o),"icon-size":12,duration:1e3,started:P(i),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):j((E(),b(`div`,Se,t[0]||=[_(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof U==`function`&&U($);var Ce=$;export{Ce as default}; \ No newline at end of file diff --git a/assets/modules-Butv2iNA.js b/assets/modules-D6tOd0hQ.js similarity index 77% rename from assets/modules-Butv2iNA.js rename to assets/modules-D6tOd0hQ.js index f78a92e362aeb98e61bac70b1dc1c6e82441d4e2..1e8df60c2493347bce8f41a2d8516b0d69c5918f 100644 --- a/assets/modules-Butv2iNA.js +++ b/assets/modules-D6tOd0hQ.js @@ -1 +1 @@ -import{A as e,co as t,dR as n,dT as r,dU as i,dV as a,dX as o,d_ as s,e6 as c,e7 as l,ea as u,ef as d,el as f,v as p,x as m}from"./index-DEpwtsc8.js";import{b as h}from"./route-block-gWR0cCIm.js";import{b as g}from"./IconAnimation-DufoONwd.js";import{b as _}from"./icon-animation-C4P_W_Br.js";const v={grid:`~ cols-1 sm:cols-2 gap-4`},y={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var b=s({__name:`index`,setup(s){let{t:h}=e(),b=r(()=>[{id:`consciousness`,name:h(`settings.pages.modules.consciousness.title`),description:h(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:m().configured},{id:`speech`,name:h(`settings.pages.modules.speech.title`),description:h(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:p().configured},{id:`hearing`,name:h(`settings.pages.modules.hearing.title`),description:h(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:`/settings/modules/hearing`,configured:!1},{id:`vision`,name:h(`settings.pages.modules.vision.title`),description:h(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:``,configured:!1},{id:`memory-short-term`,name:h(`settings.pages.modules.memory-short-term.title`),description:h(`settings.pages.modules.memory-short-term.description`),icon:`i-solar:bookmark-bold-duotone`,to:`/settings/modules/memory-short-term`,configured:!1},{id:`memory-long-term`,name:h(`settings.pages.modules.memory-long-term.title`),description:h(`settings.pages.modules.memory-long-term.description`),icon:`i-solar:book-bookmark-bold-duotone`,to:`/settings/modules/memory-long-term`,configured:!1},{id:`messaging-discord`,name:h(`settings.pages.modules.messaging-discord.title`),description:h(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:``,configured:!1},{id:`x`,name:h(`settings.pages.modules.x.title`),description:h(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:``,configured:!1},{id:`game-minecraft`,name:h(`settings.pages.modules.gaming-minecraft.title`),description:h(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:``,configured:!1},{id:`game-factorio`,name:h(`settings.pages.modules.gaming-factorio.title`),description:h(`settings.pages.modules.gaming-factorio.description`),iconImage:``,to:``,configured:!1}]),{iconAnimationStarted:x,showIconAnimation:S,animationIcon:C}=_(`i-solar:layers-bold-duotone`);return(e,r)=>{let s=u(`motion`);return c(),o(n,null,[i(`div`,v,[(c(!0),o(n,null,l(b.value,(e,n)=>d((c(),a(f(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:n*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[s]])),128))]),f(S)?(c(),a(g,{key:0,icon:f(C),"icon-size":12,duration:1e3,started:f(x),"is-reverse":!0,"z-index":-1,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`},null,8,[`icon`,`started`])):d((c(),o(`div`,y,r[0]||=[i(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof h==`function`&&h(b);var x=b;export{x as default}; \ No newline at end of file +import{A as e,co as t,d$ as n,dS as r,dU as i,dV as a,dW as o,dY as s,e7 as c,e8 as l,eb as u,eg as d,em as f,v as p,x as m}from"./index-BF1-WNuF.js";import{b as h}from"./route-block-gWR0cCIm.js";import{b as g}from"./IconAnimation-PgvikmZb.js";import{b as _}from"./icon-animation-DON3nMjf.js";const v={grid:`~ cols-1 sm:cols-2 gap-4`},y={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var b=n({__name:`index`,setup(n){let{t:h}=e(),b=i(()=>[{id:`consciousness`,name:h(`settings.pages.modules.consciousness.title`),description:h(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:m().configured},{id:`speech`,name:h(`settings.pages.modules.speech.title`),description:h(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:p().configured},{id:`hearing`,name:h(`settings.pages.modules.hearing.title`),description:h(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:`/settings/modules/hearing`,configured:!1},{id:`vision`,name:h(`settings.pages.modules.vision.title`),description:h(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:``,configured:!1},{id:`memory-short-term`,name:h(`settings.pages.modules.memory-short-term.title`),description:h(`settings.pages.modules.memory-short-term.description`),icon:`i-solar:bookmark-bold-duotone`,to:`/settings/modules/memory-short-term`,configured:!1},{id:`memory-long-term`,name:h(`settings.pages.modules.memory-long-term.title`),description:h(`settings.pages.modules.memory-long-term.description`),icon:`i-solar:book-bookmark-bold-duotone`,to:`/settings/modules/memory-long-term`,configured:!1},{id:`messaging-discord`,name:h(`settings.pages.modules.messaging-discord.title`),description:h(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:``,configured:!1},{id:`x`,name:h(`settings.pages.modules.x.title`),description:h(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:``,configured:!1},{id:`game-minecraft`,name:h(`settings.pages.modules.gaming-minecraft.title`),description:h(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:``,configured:!1},{id:`game-factorio`,name:h(`settings.pages.modules.gaming-factorio.title`),description:h(`settings.pages.modules.gaming-factorio.description`),iconImage:``,to:``,configured:!1}]),{iconAnimationStarted:x,showIconAnimation:S,animationIcon:C}=_(`i-solar:layers-bold-duotone`);return(e,n)=>{let i=u(`motion`);return c(),s(r,null,[a(`div`,v,[(c(!0),s(r,null,l(b.value,(e,n)=>d((c(),o(f(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:n*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[i]])),128))]),f(S)?(c(),o(g,{key:0,icon:f(C),"icon-size":12,duration:1e3,started:f(x),"is-reverse":!0,"z-index":-1,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`},null,8,[`icon`,`started`])):d((c(),s(`div`,y,n[0]||=[a(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[i]])],64)}}});typeof h==`function`&&h(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/moonshot-ai-BTmYBRPo.js b/assets/moonshot-ai-u73XFCFi.js similarity index 54% rename from assets/moonshot-ai-BTmYBRPo.js rename to assets/moonshot-ai-u73XFCFi.js index 4b266e224f15a9e148fab3d2456d731549d0bb97..d98f2710ef72df7f65d2078d66d82da38c6fd8c2 100644 --- a/assets/moonshot-ai-BTmYBRPo.js +++ b/assets/moonshot-ai-u73XFCFi.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`moonshot-ai`;var x=o({__name:`moonshot-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`ms-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.moonshot.cn/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`moonshot-ai`;var x=t({__name:`moonshot-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`ms-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.moonshot.cn/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/novita-ai-DrCt992g.js b/assets/novita-ai-7ipBHksn.js similarity index 55% rename from assets/novita-ai-DrCt992g.js rename to assets/novita-ai-7ipBHksn.js index dcb21f7299ddd2aae28d425543d84d89bdf61722..6cbc79e2604d269392868384a19beee17c128241 100644 --- a/assets/novita-ai-DrCt992g.js +++ b/assets/novita-ai-7ipBHksn.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`novita-ai`;var x=o({__name:`novita-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`nvt-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.novita.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`novita-ai`;var x=t({__name:`novita-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`nvt-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.novita.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/ollama-DRW2bGA7.js b/assets/ollama-CuqQePdH.js similarity index 70% rename from assets/ollama-DRW2bGA7.js rename to assets/ollama-CuqQePdH.js index 18103643e70c6684618c68b70eda8be020f130b9..fa345a9fb6c3eb54faa7a9810796cadae53d56a7 100644 --- a/assets/ollama-DRW2bGA7.js +++ b/assets/ollama-CuqQePdH.js @@ -1 +1 @@ -import{A as e,cP as t,d6 as n,d8 as r,dT as i,dV as a,dZ as o,d_ as s,e4 as c,e6 as l,ed as u,ee as d,eh as f,el as p,g as m,h,i as g,j as _,l as v,y}from"./index-DEpwtsc8.js";import{b}from"./route-block-gWR0cCIm.js";const x=`ollama`;var S=s({__name:`ollama`,setup(s){let{t:b}=e(),S=n(),C=y(),{providers:w}=r(C),T=i(()=>C.getProviderMetadata(x)),E=i({get:()=>w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});c(()=>{C.initializeProvider(x),E.value=w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,w.value[x]?.headers||(w.value[x].headers={})});function D(){w.value[x]={...T.value?.defaultOptions}}let O=f([{key:``,value:``}]);function k(e,t,n){e&&e.push({key:t,value:n})}function A(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}return u(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,n)=>(l(),a(p(m),{"provider-name":T.value?.localizedName,"provider-icon":T.value?.icon,"on-back":()=>p(S).back()},{default:d(()=>[o(p(h),null,{default:d(()=>[o(p(g),{title:p(b)(`settings.pages.providers.common.section.basic.title`),description:p(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[o(p(_),{modelValue:E.value,"onUpdate:modelValue":n[0]||=e=>E.value=e,placeholder:T.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`,`description`]),o(p(v),{title:p(b)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[o(p(t),{modelValue:O.value,"onUpdate:modelValue":n[1]||=e=>O.value=e,label:p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:n[2]||=(e,t)=>k(O.value,e,t),onRemove:n[3]||=e=>A(e,O.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof b==`function`&&b(S);var C=S;export{C as default}; \ No newline at end of file +import{A as e,cP as t,d$ as n,d6 as r,d8 as i,dU as a,dW as o,d_ as s,e5 as c,e7 as l,ee as u,ef as d,ei as f,em as p,g as m,h,i as g,j as _,l as v,y}from"./index-BF1-WNuF.js";import{b}from"./route-block-gWR0cCIm.js";const x=`ollama`;var S=n({__name:`ollama`,setup(n){let{t:b}=e(),S=r(),C=y(),{providers:w}=i(C),T=a(()=>C.getProviderMetadata(x)),E=a({get:()=>w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});c(()=>{C.initializeProvider(x),E.value=w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,w.value[x]?.headers||(w.value[x].headers={})});function D(){w.value[x]={...T.value?.defaultOptions}}let O=f([{key:``,value:``}]);function k(e,t,n){e&&e.push({key:t,value:n})}function A(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}return u(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,n)=>(l(),o(p(m),{"provider-name":T.value?.localizedName,"provider-icon":T.value?.icon,"on-back":()=>p(S).back()},{default:d(()=>[s(p(h),null,{default:d(()=>[s(p(g),{title:p(b)(`settings.pages.providers.common.section.basic.title`),description:p(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[s(p(_),{modelValue:E.value,"onUpdate:modelValue":n[0]||=e=>E.value=e,placeholder:T.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`,`description`]),s(p(v),{title:p(b)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[s(p(t),{modelValue:O.value,"onUpdate:modelValue":n[1]||=e=>O.value=e,label:p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":p(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:n[2]||=(e,t)=>k(O.value,e,t),onRemove:n[3]||=e=>A(e,O.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof b==`function`&&b(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/openai-CgMQRKzs.js b/assets/openai-B9sunSqD.js similarity index 58% rename from assets/openai-CgMQRKzs.js rename to assets/openai-B9sunSqD.js index 1844c783421f50acd1f541b8d895d94cda2c8431..98681b620522a7dc4e9c11f609c1b75c6b5db3d5 100644 --- a/assets/openai-CgMQRKzs.js +++ b/assets/openai-B9sunSqD.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`openai`;var x=o({__name:`openai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||`https://api.openai.com/v1/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://api.openai.com/v1/`}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName||`OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`openai`;var x=t({__name:`openai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||`https://api.openai.com/v1/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://api.openai.com/v1/`}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName||`OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/openai-audio-speech-BJXomLm7.js b/assets/openai-audio-speech-CbGH6VQ3.js similarity index 58% rename from assets/openai-audio-speech-BJXomLm7.js rename to assets/openai-audio-speech-CbGH6VQ3.js index fcf2c154d7b18548e3f56ad5e70b41a52e3235cb..cac4682de84b613873a536a7b11eeae1cd5ff4dd 100644 --- a/assets/openai-audio-speech-BJXomLm7.js +++ b/assets/openai-audio-speech-CbGH6VQ3.js @@ -1 +1 @@ -import{A as e,cN as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e as s,e6 as c,ed as l,ee as u,eh as d,el as f,f as p,v as m,y as h}from"./index-DEpwtsc8.js";import{b as g}from"./route-block-gWR0cCIm.js";const _=`openai-audio-speech`,v=`gpt-4o-mini-tts`;var y=o({__name:`openai-audio-speech`,setup(o){let g=m(),y=h(),{providers:b}=n(y),{t:x}=e(),S={speed:1},C=d(1),w=r(()=>!!b.value[_]?.apiKey),T=r(()=>g.availableVoices[_]||[]);async function E(e,t,n){let r=await y.getProviderInstance(_);if(!r)throw Error(`Failed to initialize speech provider`);let i=y.getProviderConfig(_),a=i.model||v;return await g.speech(r,a,e,t,{...i,...S})}return l(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,n)=>(c(),i(f(s),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":u(()=>[a(f(t),{modelValue:C.value,"onUpdate:modelValue":n[0]||=e=>C.value=e,label:f(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:f(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:u(()=>[a(f(p),{"available-voices":T.value,"generate-speech":E,"api-key-configured":w.value,"default-text":`Hello! This is a test of the OpenAI Speech.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof g==`function`&&g(y);var b=y;export{b as default}; \ No newline at end of file +import{A as e,cN as t,d$ as n,d8 as r,dU as i,dW as a,d_ as o,e as s,e7 as c,ee as l,ef as u,ei as d,em as f,f as p,v as m,y as h}from"./index-BF1-WNuF.js";import{b as g}from"./route-block-gWR0cCIm.js";const _=`openai-audio-speech`,v=`gpt-4o-mini-tts`;var y=n({__name:`openai-audio-speech`,setup(n){let g=m(),y=h(),{providers:b}=r(y),{t:x}=e(),S={speed:1},C=d(1),w=i(()=>!!b.value[_]?.apiKey),T=i(()=>g.availableVoices[_]||[]);async function E(e,t,n){let r=await y.getProviderInstance(_);if(!r)throw Error(`Failed to initialize speech provider`);let i=y.getProviderConfig(_),a=i.model||v;return await g.speech(r,a,e,t,{...i,...S})}return l(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,n)=>(c(),a(f(s),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":u(()=>[o(f(t),{modelValue:C.value,"onUpdate:modelValue":n[0]||=e=>C.value=e,label:f(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:f(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:u(()=>[o(f(p),{"available-voices":T.value,"generate-speech":E,"api-key-configured":w.value,"default-text":`Hello! This is a test of the OpenAI Speech.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof g==`function`&&g(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/openai-audio-transcription-CNjeZbT4.js b/assets/openai-audio-transcription-BiCtqKwn.js similarity index 51% rename from assets/openai-audio-transcription-CNjeZbT4.js rename to assets/openai-audio-transcription-BiCtqKwn.js index 23f0c7df0483f57efb21f5e72c8aeec7c43d04d1..7a6b9073bd9816320e385db25dac0c3db44467ac 100644 --- a/assets/openai-audio-transcription-CNjeZbT4.js +++ b/assets/openai-audio-transcription-BiCtqKwn.js @@ -1 +1 @@ -import{c as e,d as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e6 as s,ee as c,el as l,t as u,y as d}from"./index-DEpwtsc8.js";import{b as f}from"./route-block-gWR0cCIm.js";const p=`openai-audio-transcription`,m=`whisper-1`;var h=o({__name:`openai-audio-transcription`,setup(o){let f=u(),h=d(),{providers:g}=n(h),_=r(()=>!!g.value[p]?.apiKey);async function v(e){let t=await h.getProviderInstance(p);if(!t)throw Error(`Failed to initialize speech provider`);let n=h.getProviderConfig(p),r=n.model||m;return await f.transcription(t,r,e,`json`)}return(n,r)=>(s(),i(l(e),{"provider-id":p,"default-model":m},{playground:c(()=>[a(l(t),{"generate-transcription":v,"api-key-configured":_.value},null,8,[`api-key-configured`])]),_:1}))}});typeof f==`function`&&f(h);var g=h;export{g as default}; \ No newline at end of file +import{c as e,d as t,d$ as n,d8 as r,dU as i,dW as a,d_ as o,e7 as s,ef as c,em as l,t as u,y as d}from"./index-BF1-WNuF.js";import{b as f}from"./route-block-gWR0cCIm.js";const p=`openai-audio-transcription`,m=`whisper-1`;var h=n({__name:`openai-audio-transcription`,setup(n){let f=u(),h=d(),{providers:g}=r(h),_=i(()=>!!g.value[p]?.apiKey);async function v(e){let t=await h.getProviderInstance(p);if(!t)throw Error(`Failed to initialize speech provider`);let n=h.getProviderConfig(p),r=n.model||m;return await f.transcription(t,r,e,`json`)}return(n,r)=>(s(),a(l(e),{"provider-id":p,"default-model":m},{playground:c(()=>[o(l(t),{"generate-transcription":v,"api-key-configured":_.value},null,8,[`api-key-configured`])]),_:1}))}});typeof f==`function`&&f(h);var g=h;export{g as default}; \ No newline at end of file diff --git a/assets/openrouter-ai-Db66h2nl.js b/assets/openrouter-ai-C4TWeOIO.js similarity index 58% rename from assets/openrouter-ai-Db66h2nl.js rename to assets/openrouter-ai-C4TWeOIO.js index 78509b73f6842b54399e94a79c822aa60acf0631..e1fd66bb4388497cd44d65bc8fc1b2800c97146f 100644 --- a/assets/openrouter-ai-Db66h2nl.js +++ b/assets/openrouter-ai-C4TWeOIO.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`openrouter-ai`;var x=o({__name:`openrouter-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||w.value?.defaultOptions?.().baseUrl||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-or-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:w.value?.defaultOptions?.().baseUrl||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`openrouter-ai`;var x=t({__name:`openrouter-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||w.value?.defaultOptions?.().baseUrl||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-or-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:w.value?.defaultOptions?.().baseUrl||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/pages-CjjKzga2.js b/assets/pages-CjjKzga2.js new file mode 100644 index 0000000000000000000000000000000000000000..a5d2f68db1b0954c76785d2741c875053b460e04 --- /dev/null +++ b/assets/pages-CjjKzga2.js @@ -0,0 +1 @@ +import"./Basic-kTOabOY_.js";import{b as e,d as t}from"./theme-color-DY2bNlFZ.js";import{d$ as n,d8 as r,d9 as i,dV as a,dW as o,dX as s,d_ as c,da as l,dc as u,dh as d,e5 as f,e7 as p,ee as m,ef as h,ei as g,em as _,q as v}from"./index-BF1-WNuF.js";import"./HeaderLink-DVkQgheP.js";import{b as y}from"./route-block-gWR0cCIm.js";import{b}from"./Scenes-CogR6jTf.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-wua8MzWE.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),f(()=>R()),(e,t)=>(p(),o(E,null,{default:h(()=>[c(x,{class:`widgets top-widgets`,"fill-color":_(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:h(()=>[a(`div`,D,[a(`div`,O,[c(T,{class:`hidden md:flex`}),c(C,{class:`flex md:hidden`})]),a(`div`,k,[c(_(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:_(M).x.value,y:_(M).y.value},"x-offset":`${_(L)?_(P).x:_(P).x-10}%`,"y-offset":_(F).y,scale:_(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),_(L)?s(``,!0):(p(),o(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),_(L)?(p(),o(S,{key:1,onSettingsOpen:j})):s(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/pages-DCVmkLmw.js b/assets/pages-DCVmkLmw.js deleted file mode 100644 index 0810a4d96612f4ec1395142142e157492e18aef4..0000000000000000000000000000000000000000 --- a/assets/pages-DCVmkLmw.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-DOfBA0ws.js";import{b as e,d as t}from"./theme-color-B02Jz7A8.js";import{d8 as n,d9 as r,dU as i,dV as a,dW as o,dZ as s,d_ as c,da as l,dc as u,dh as d,e4 as f,e6 as p,ed as m,ee as h,eh as g,el as _,q as v}from"./index-DEpwtsc8.js";import"./HeaderLink-Cg3P1d5b.js";import{b as y}from"./route-block-gWR0cCIm.js";import{b}from"./Scenes-C-Sbq7ai.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-BifePjRS.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),f(()=>R()),(e,t)=>(p(),a(E,null,{default:h(()=>[s(x,{class:`widgets top-widgets`,"fill-color":_(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:h(()=>[i(`div`,D,[i(`div`,O,[s(T,{class:`hidden md:flex`}),s(C,{class:`flex md:hidden`})]),i(`div`,k,[s(_(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:_(M).x.value,y:_(M).y.value},"x-offset":`${_(L)?_(P).x:_(P).x-10}%`,"y-offset":_(F).y,scale:_(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),_(L)?o(``,!0):(p(),a(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),_(L)?(p(),a(S,{key:1,onSettingsOpen:j})):o(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/plain-CAqIfj7b.js b/assets/plain-7iQYbl-w.js similarity index 63% rename from assets/plain-CAqIfj7b.js rename to assets/plain-7iQYbl-w.js index 4439c6aeb1c5851939ec41a44c5c0a2d187d9c8c..da9d525324b96997c505c6ad401903ac332f563c 100644 --- a/assets/plain-CAqIfj7b.js +++ b/assets/plain-7iQYbl-w.js @@ -1 +1 @@ -import{cO as e,dV as t,e6 as n,e9 as r}from"./index-DEpwtsc8.js";const i={};function a(e,i){let a=r(`RouterView`);return n(),t(a)}var o=e(i,[[`render`,a]]);export{o as default}; \ No newline at end of file +import{cO as e,dW as t,e7 as n,ea as r}from"./index-BF1-WNuF.js";const i={};function a(e,i){let a=r(`RouterView`);return n(),t(a)}var o=e(i,[[`render`,a]]);export{o as default}; \ No newline at end of file diff --git a/assets/player2-eDuFfc86.js b/assets/player2-ClAVJB5x.js similarity index 50% rename from assets/player2-eDuFfc86.js rename to assets/player2-ClAVJB5x.js index 0179548c237a2924e1b683493000e1ae8ab103f3..97823f035151b51c4b7f30e77a2c4608acc10805 100644 --- a/assets/player2-eDuFfc86.js +++ b/assets/player2-ClAVJB5x.js @@ -1 +1 @@ -import{A as e,cs as t,d6 as n,d8 as r,dR as i,dT as a,dU as o,dW as s,dX as c,dY as l,dZ as u,d_ as d,e4 as f,e6 as p,ed as m,ee as h,eh as g,el as _,g as v,h as y,i as b,j as x,y as S}from"./index-DEpwtsc8.js";import{b as C}from"./route-block-gWR0cCIm.js";const w={key:0,"mb-1":``},T=`player2`;var E=d({__name:`player2`,setup(d){let{t:C}=e(),E=n(),D=S(),{providers:O}=r(D),k=a(()=>D.getProviderMetadata(T)),A=a({get:()=>O.value[T]?.baseUrl||``,set:e=>{O.value[T]||(O.value[T]={}),O.value[T].baseUrl=e}}),j=g(!0);f(async()=>{D.initializeProvider(T),A.value=O.value[T]?.baseUrl||``;try{let e=await fetch(`${A.value}health`,{method:`GET`,headers:{"player2-game-key":`airi`}});j.value=e.status===200}catch(e){console.error(e),j.value=!1}}),m([A],()=>{O.value[T]={...O.value[T],baseUrl:A.value||``}});function M(){O.value[T]={...k.value?.defaultOptions}}return(e,n)=>(p(),c(i,null,[j.value?s(``,!0):(p(),c(`div`,w,[u(_(t),{theme:`orange`},{label:h(()=>n[1]||=[l(` Player 2 is not running `,-1)]),default:h(()=>[n[2]||=o(`div`,null,[l(` Please download and run the Player2 App: `),o(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),o(`div`,null,[l(` After downloading, if you still are having trouble, please reach out to us on Discord: `),o(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),l(`. `)])],-1)]),_:1,__:[2]})])),u(_(v),{"provider-name":k.value?.localizedName,"provider-icon":k.value?.icon,"on-back":()=>_(E).back()},{default:h(()=>[u(_(y),null,{default:h(()=>[u(_(b),{title:_(C)(`settings.pages.providers.common.section.basic.title`),description:_(C)(`settings.pages.providers.common.section.basic.description`),"on-reset":M},{default:h(()=>[u(_(x),{modelValue:A.value,"onUpdate:modelValue":n[0]||=e=>A.value=e,placeholder:`http://localhost:4315/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])],64))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file +import{A as e,cs as t,d$ as n,d6 as r,d8 as i,dS as a,dU as o,dV as s,dX as c,dY as l,dZ as u,d_ as d,e5 as f,e7 as p,ee as m,ef as h,ei as g,em as _,g as v,h as y,i as b,j as x,y as S}from"./index-BF1-WNuF.js";import{b as C}from"./route-block-gWR0cCIm.js";const w={key:0,"mb-1":``},T=`player2`;var E=n({__name:`player2`,setup(n){let{t:C}=e(),E=r(),D=S(),{providers:O}=i(D),k=o(()=>D.getProviderMetadata(T)),A=o({get:()=>O.value[T]?.baseUrl||``,set:e=>{O.value[T]||(O.value[T]={}),O.value[T].baseUrl=e}}),j=g(!0);f(async()=>{D.initializeProvider(T),A.value=O.value[T]?.baseUrl||``;try{let e=await fetch(`${A.value}health`,{method:`GET`,headers:{"player2-game-key":`airi`}});j.value=e.status===200}catch(e){console.error(e),j.value=!1}}),m([A],()=>{O.value[T]={...O.value[T],baseUrl:A.value||``}});function M(){O.value[T]={...k.value?.defaultOptions}}return(e,n)=>(p(),l(a,null,[j.value?c(``,!0):(p(),l(`div`,w,[d(_(t),{theme:`orange`},{label:h(()=>n[1]||=[u(` Player 2 is not running `,-1)]),default:h(()=>[n[2]||=s(`div`,null,[u(` Please download and run the Player2 App: `),s(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),s(`div`,null,[u(` After downloading, if you still are having trouble, please reach out to us on Discord: `),s(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),u(`. `)])],-1)]),_:1,__:[2]})])),d(_(v),{"provider-name":k.value?.localizedName,"provider-icon":k.value?.icon,"on-back":()=>_(E).back()},{default:h(()=>[d(_(y),null,{default:h(()=>[d(_(b),{title:_(C)(`settings.pages.providers.common.section.basic.title`),description:_(C)(`settings.pages.providers.common.section.basic.description`),"on-reset":M},{default:h(()=>[d(_(x),{modelValue:A.value,"onUpdate:modelValue":n[0]||=e=>A.value=e,placeholder:`http://localhost:4315/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])],64))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/player2-speech-66bux_II.js b/assets/player2-speech-BP2h--1L.js similarity index 55% rename from assets/player2-speech-66bux_II.js rename to assets/player2-speech-BP2h--1L.js index 54505a606a6860cc4f15394c20faa7a808f2091a..56e761210dc66909dbe2d249ade416a5d3e6ef3c 100644 --- a/assets/player2-speech-66bux_II.js +++ b/assets/player2-speech-BP2h--1L.js @@ -1 +1 @@ -import{A as e,cN as t,cs as n,dR as r,dT as i,dU as a,dW as o,dX as s,dY as c,dZ as l,d_ as u,e as d,e4 as f,e6 as p,ed as m,ee as h,eh as g,el as _,f as v,v as y,y as b}from"./index-DEpwtsc8.js";import{b as x}from"./route-block-gWR0cCIm.js";const S={key:0,style:{color:`red`,"margin-bottom":`1rem`}},C=`player2-speech`,w=`v1`;var T=u({__name:`player2-speech`,setup(u){let x=g(1),T=y(),E=b(),{t:D}=e(),O=i(()=>T.availableVoices[C]||[]);async function k(e,t,n){let r=await E.getProviderInstance(C);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(C),a=i.model||w;return await T.speech(r,a,e,t,{...i})}let A=g(!0);return f(async()=>{let e=E.getProviderConfig(C),t=E.getProviderMetadata(C);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(C):console.error(`Failed to validate provider config`,e);try{let t=await fetch(`${e.baseUrl}/v1/health`,{method:`GET`,headers:{"player2-game-key":`airi`}});A.value=t.status===200}catch(e){console.error(e),A.value=!1}}),m(x,async()=>{let e=E.getProviderConfig(C);e.speed=x.value}),(e,i)=>(p(),s(r,null,[A.value?o(``,!0):(p(),s(`div`,S,[l(_(n),{theme:`orange`},{label:h(()=>i[1]||=[c(` Player 2 is not running `,-1)]),default:h(()=>[i[2]||=a(`div`,null,[c(` Please download and run the Player2 App: `),a(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),a(`div`,null,[c(` After downloading, if you still are having trouble, please reach out to us on Discord: `),a(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),c(`. `)])],-1)]),_:1,__:[2]})])),l(_(d),{"provider-id":C,"default-model":w},{"voice-settings":h(()=>[l(_(t),{modelValue:x.value,"onUpdate:modelValue":i[0]||=e=>x.value=e,label:_(D)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:_(D)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:5,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:h(()=>[l(_(v),{"available-voices":O.value,"generate-speech":k,"api-key-configured":!0,"default-text":`Hello! This is a test of the Player 2 voice synthesis.`},null,8,[`available-voices`])]),_:1})],64))}});typeof x==`function`&&x(T);var E=T;export{E as default}; \ No newline at end of file +import{A as e,cN as t,cs as n,d$ as r,dS as i,dU as a,dV as o,dX as s,dY as c,dZ as l,d_ as u,e as d,e5 as f,e7 as p,ee as m,ef as h,ei as g,em as _,f as v,v as y,y as b}from"./index-BF1-WNuF.js";import{b as x}from"./route-block-gWR0cCIm.js";const S={key:0,style:{color:`red`,"margin-bottom":`1rem`}},C=`player2-speech`,w=`v1`;var T=r({__name:`player2-speech`,setup(r){let x=g(1),T=y(),E=b(),{t:D}=e(),O=a(()=>T.availableVoices[C]||[]);async function k(e,t,n){let r=await E.getProviderInstance(C);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(C),a=i.model||w;return await T.speech(r,a,e,t,{...i})}let A=g(!0);return f(async()=>{let e=E.getProviderConfig(C),t=E.getProviderMetadata(C);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(C):console.error(`Failed to validate provider config`,e);try{let t=await fetch(`${e.baseUrl}/v1/health`,{method:`GET`,headers:{"player2-game-key":`airi`}});A.value=t.status===200}catch(e){console.error(e),A.value=!1}}),m(x,async()=>{let e=E.getProviderConfig(C);e.speed=x.value}),(e,r)=>(p(),c(i,null,[A.value?s(``,!0):(p(),c(`div`,S,[u(_(n),{theme:`orange`},{label:h(()=>r[1]||=[l(` Player 2 is not running `,-1)]),default:h(()=>[r[2]||=o(`div`,null,[l(` Please download and run the Player2 App: `),o(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),o(`div`,null,[l(` After downloading, if you still are having trouble, please reach out to us on Discord: `),o(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),l(`. `)])],-1)]),_:1,__:[2]})])),u(_(d),{"provider-id":C,"default-model":w},{"voice-settings":h(()=>[u(_(t),{modelValue:x.value,"onUpdate:modelValue":r[0]||=e=>x.value=e,label:_(D)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:_(D)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:5,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:h(()=>[u(_(v),{"available-voices":O.value,"generate-speech":k,"api-key-configured":!0,"default-text":`Hello! This is a test of the Player 2 voice synthesis.`},null,8,[`available-voices`])]),_:1})],64))}});typeof x==`function`&&x(T);var E=T;export{E as default}; \ No newline at end of file diff --git a/assets/polaroid-D7wvNIY_.js b/assets/polaroid-BoV0pdO1.js similarity index 54% rename from assets/polaroid-D7wvNIY_.js rename to assets/polaroid-BoV0pdO1.js index 3cfdb1ab3c66f4ee19a3b5523690e0a45696458c..69bd26e872de5db69a5b8fb30dfb3925f9be69a7 100644 --- a/assets/polaroid-D7wvNIY_.js +++ b/assets/polaroid-BoV0pdO1.js @@ -1 +1 @@ -import{ch as e,dN as t,dR as n,dU as r,dX as i,dZ as a,d_ as o,e6 as s,e7 as c,ed as l,ee as u,ef as d,eh as f,el as p,ep as m}from"./index-DEpwtsc8.js";import{i as h,j as g}from"./Scenes-C-Sbq7ai.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=o({__name:`polaroid`,setup(o){let b=f(),x=f(),S=f(`idle`),C=f([]);function w(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function T(e){x.value?.setMotion(e)}l(x,e=>{C.value=e?.listMotionGroups()||[]},{immediate:!0});function E(){x.value&&(x.value?.setMotion(S.value),C.value=x.value.listMotionGroups())}function D(){if(!b.value||!x.value)return;let e=b.value.canvasElement(),t=e.toDataURL(`image/png`);w(t,`live2d-screenshot.png`)}return(o,l)=>(s(),i(`div`,_,[r(`div`,v,[a(p(e),{relative:``,"min-h-70dvh":``},{default:u(({width:e,height:t})=>[a(p(g),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:u(({app:n})=>[a(p(h),{ref_key:`live2dModelRef`,ref:x,app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:E},null,8,[`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),r(`div`,null,[d(r(`select`,{"onUpdate:modelValue":l[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:l[1]||=e=>T(S.value)},[(s(!0),i(n,null,c(C.value,e=>(s(),i(`option`,{key:e.motionIndex,value:e.motionName},m(e.fileName),9,y))),128))],544),[[t,S.value]])]),r(`div`,{border:`2px solid black dark:white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[r(`button`,{class:`h-15 w-15 md:h-18 md:w-18`,bg:`black active:neutral-950 dark:white dark:active:neutral-50`,"rounded-full":``,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:D})])]))}}),x=b;export{x as default}; \ No newline at end of file +import{ch as e,d$ as t,dO as n,dS as r,dV as i,dY as a,d_ as o,e7 as s,e8 as c,ee as l,ef as u,eg as d,ei as f,em as p,eq as m}from"./index-BF1-WNuF.js";import{i as h,j as g}from"./Scenes-CogR6jTf.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=t({__name:`polaroid`,setup(t){let b=f(),x=f(),S=f(`idle`),C=f([]);function w(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function T(e){x.value?.setMotion(e)}l(x,e=>{C.value=e?.listMotionGroups()||[]},{immediate:!0});function E(){x.value&&(x.value?.setMotion(S.value),C.value=x.value.listMotionGroups())}function D(){if(!b.value||!x.value)return;let e=b.value.canvasElement(),t=e.toDataURL(`image/png`);w(t,`live2d-screenshot.png`)}return(t,l)=>(s(),a(`div`,_,[i(`div`,v,[o(p(e),{relative:``,"min-h-70dvh":``},{default:u(({width:e,height:t})=>[o(p(g),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:u(({app:n})=>[o(p(h),{ref_key:`live2dModelRef`,ref:x,app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:E},null,8,[`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),i(`div`,null,[d(i(`select`,{"onUpdate:modelValue":l[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:l[1]||=e=>T(S.value)},[(s(!0),a(r,null,c(C.value,e=>(s(),a(`option`,{key:e.motionIndex,value:e.motionName},m(e.fileName),9,y))),128))],544),[[n,S.value]])]),i(`div`,{border:`2px solid black dark:white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[i(`button`,{class:`h-15 w-15 md:h-18 md:w-18`,bg:`black active:neutral-950 dark:white dark:active:neutral-50`,"rounded-full":``,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:D})])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/providers-piPjwyiC.js b/assets/providers-BRImID3U.js similarity index 57% rename from assets/providers-piPjwyiC.js rename to assets/providers-BRImID3U.js index e49e08a9dbb494886781079aba1c953bd1ec65aa..5f688253bb278b631ab7891454e098990ba1a1ce 100644 --- a/assets/providers-piPjwyiC.js +++ b/assets/providers-BRImID3U.js @@ -1 +1 @@ -import{A as e,co as t,d8 as n,dR as r,dU as i,dV as a,dX as o,dZ as s,d_ as c,e6 as l,e7 as u,e9 as d,ea as f,ee as p,ef as m,el as h,ep as g,y as _}from"./index-DEpwtsc8.js";import{b as v}from"./route-block-gWR0cCIm.js";import{b as y}from"./IconAnimation-DufoONwd.js";import{b}from"./icon-animation-C4P_W_Br.js";const x={flex:``,"flex-col":``,"gap-5":``,"pb-12":``},S={class:`rounded-lg bg-primary-500/10 p-4 dark:bg-primary-800/25`},C={class:`mb-2 text-xl text-primary-800 font-semibold dark:text-primary-100`},w={class:`text-primary-700 dark:text-primary-300`},T={flex:`~ row items-center gap-2`},E={text:`neutral-300 dark:neutral-500`},D={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},O={flex:`~ row items-center gap-2`,"my-5":``},k={text:`neutral-300 dark:neutral-500`},A={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},j={flex:`~ row items-center gap-2`,"my-5":``},M={text:`neutral-300 dark:neutral-500`},N={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},P={key:1,text:`neutral-500/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var F=c({__name:`index`,setup(c){let{t:v}=e(),F=_(),{allChatProvidersMetadata:I,allAudioSpeechProvidersMetadata:L,allAudioTranscriptionProvidersMetadata:R}=n(F),{iconAnimationStarted:z,showIconAnimation:B,animationIcon:V}=b(`i-solar:box-minimalistic-bold-duotone`);return(e,n)=>{let c=d(`i18n-t`),_=f(`motion`);return l(),o(r,null,[i(`div`,x,[i(`div`,S,[i(`div`,C,g(e.$t(`settings.pages.providers.helpinfo.title`)),1),i(`div`,w,[s(c,{keypath:`settings.pages.providers.helpinfo.description`},{chat:p(()=>n[0]||=[i(`span`,{class:`inline-flex translate-y-[0.25lh] items-center gap-1 rounded-lg bg-primary-500/10 px-2 py-0.5 dark:bg-primary-800/25`},[i(`div`,{class:`i-solar:chat-square-like-bold-duotone`}),i(`strong`,{class:`font-semibold`},`Chat`)],-1)]),_:1})])]),i(`div`,T,[n[2]||=i(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),i(`div`,null,[i(`div`,null,[i(`span`,E,g(h(v)(`settings.pages.providers.explained.chat`)),1)]),n[1]||=i(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[i(`div`,null,` Chat `)],-1)])]),i(`div`,D,[(l(!0),o(r,null,u(h(I),(e,n)=>m((l(),a(h(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:n*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[_]])),128))]),i(`div`,O,[n[4]||=i(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),i(`div`,null,[i(`div`,null,[i(`span`,k,g(h(v)(`settings.pages.providers.explained.Speech`)),1)]),n[3]||=i(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[i(`div`,null,` Speech `)],-1)])]),i(`div`,A,[(l(!0),o(r,null,u(h(L),(e,n)=>m((l(),a(h(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:(h(I).length+n)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[_]])),128))]),i(`div`,j,[n[6]||=i(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),i(`div`,null,[i(`div`,null,[i(`span`,M,g(h(v)(`settings.pages.providers.explained.Transcription`)),1)]),n[5]||=i(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[i(`div`,null,` Transcription `)],-1)])]),i(`div`,N,[(l(!0),o(r,null,u(h(R),(e,n)=>m((l(),a(h(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:(h(I).length+h(L).length+n)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[_]])),128))])]),h(B)?(l(),a(y,{key:0,"z-index":-1,icon:h(V),"icon-size":12,duration:1e3,started:h(z),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):m((l(),o(`div`,P,n[7]||=[i(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[_]])],64)}}});typeof v==`function`&&v(F);var I=F;export{I as default}; \ No newline at end of file +import{A as e,co as t,d$ as n,d8 as r,dS as i,dV as a,dW as o,dY as s,d_ as c,e7 as l,e8 as u,ea as d,eb as f,ef as p,eg as m,em as h,eq as g,y as _}from"./index-BF1-WNuF.js";import{b as v}from"./route-block-gWR0cCIm.js";import{b as y}from"./IconAnimation-PgvikmZb.js";import{b}from"./icon-animation-DON3nMjf.js";const x={flex:``,"flex-col":``,"gap-5":``,"pb-12":``},S={class:`rounded-lg bg-primary-500/10 p-4 dark:bg-primary-800/25`},C={class:`mb-2 text-xl text-primary-800 font-semibold dark:text-primary-100`},w={class:`text-primary-700 dark:text-primary-300`},T={flex:`~ row items-center gap-2`},E={text:`neutral-300 dark:neutral-500`},D={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},O={flex:`~ row items-center gap-2`,"my-5":``},k={text:`neutral-300 dark:neutral-500`},A={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},j={flex:`~ row items-center gap-2`,"my-5":``},M={text:`neutral-300 dark:neutral-500`},N={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},P={key:1,text:`neutral-500/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var F=n({__name:`index`,setup(n){let{t:v}=e(),F=_(),{allChatProvidersMetadata:I,allAudioSpeechProvidersMetadata:L,allAudioTranscriptionProvidersMetadata:R}=r(F),{iconAnimationStarted:z,showIconAnimation:B,animationIcon:V}=b(`i-solar:box-minimalistic-bold-duotone`);return(e,n)=>{let r=d(`i18n-t`),_=f(`motion`);return l(),s(i,null,[a(`div`,x,[a(`div`,S,[a(`div`,C,g(e.$t(`settings.pages.providers.helpinfo.title`)),1),a(`div`,w,[c(r,{keypath:`settings.pages.providers.helpinfo.description`},{chat:p(()=>n[0]||=[a(`span`,{class:`inline-flex translate-y-[0.25lh] items-center gap-1 rounded-lg bg-primary-500/10 px-2 py-0.5 dark:bg-primary-800/25`},[a(`div`,{class:`i-solar:chat-square-like-bold-duotone`}),a(`strong`,{class:`font-semibold`},`Chat`)],-1)]),_:1})])]),a(`div`,T,[n[2]||=a(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),a(`div`,null,[a(`div`,null,[a(`span`,E,g(h(v)(`settings.pages.providers.explained.chat`)),1)]),n[1]||=a(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[a(`div`,null,` Chat `)],-1)])]),a(`div`,D,[(l(!0),s(i,null,u(h(I),(e,n)=>m((l(),o(h(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:n*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[_]])),128))]),a(`div`,O,[n[4]||=a(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),a(`div`,null,[a(`div`,null,[a(`span`,k,g(h(v)(`settings.pages.providers.explained.Speech`)),1)]),n[3]||=a(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[a(`div`,null,` Speech `)],-1)])]),a(`div`,A,[(l(!0),s(i,null,u(h(L),(e,n)=>m((l(),o(h(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:(h(I).length+n)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[_]])),128))]),a(`div`,j,[n[6]||=a(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),a(`div`,null,[a(`div`,null,[a(`span`,M,g(h(v)(`settings.pages.providers.explained.Transcription`)),1)]),n[5]||=a(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[a(`div`,null,` Transcription `)],-1)])]),a(`div`,N,[(l(!0),s(i,null,u(h(R),(e,n)=>m((l(),o(h(t),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+n*10,delay:(h(I).length+h(L).length+n)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[_]])),128))])]),h(B)?(l(),o(y,{key:0,"z-index":-1,icon:h(V),"icon-size":12,duration:1e3,started:h(z),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):m((l(),s(`div`,P,n[7]||=[a(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[_]])],64)}}});typeof v==`function`&&v(F);var I=F;export{I as default}; \ No newline at end of file diff --git a/assets/queue-B8eo5pBS.js b/assets/queue-D90evycf.js similarity index 83% rename from assets/queue-B8eo5pBS.js rename to assets/queue-D90evycf.js index 2effb5979d40bdee53ac904deb864b0854e366b2..f2246ee08ebcc3ef0be2c0892c92ae086a66dbfe 100644 --- a/assets/queue-B8eo5pBS.js +++ b/assets/queue-D90evycf.js @@ -1 +1 @@ -import{c5 as e,ca as t,dU as n,dX as r,d_ as i,e4 as a,e6 as o,eh as s}from"./index-DEpwtsc8.js";var c=i({__name:`queue`,setup(i){let c=s(``),l=e({handlers:[async e=>{console.log(`ready to play speech audio for`,e)}]}),u=e({handlers:[async e=>{console.log(`ready to stream speech audio for`,e),l.add(e.data)}]}),d=e({handlers:[async e=>{let t=[`.`,`?`,`!`],n=!1;for(let r of t){if(!e.data.includes(r))continue;let t=e.data.indexOf(r),i=e.data.slice(0,t+1),a=e.data.slice(t+1);c.value+=i,u.add(c.value.trim()),c.value=a,n=!0}n||(c.value+=e.data)}]}),f=`Hello( N(eko(! I( am( an( AI( assistant( trained( to( help( with( a( variety( of( tasks( such( as( answering( questions(,( providing( information(,( giving( recommendations(,( and( more(. How( can( I( assist( you( today(?(Hello( N(eko(,( I( am( an( AI( assistant(.( I( can( help( answer( questions(,( provide( information(,( assist( with( tasks(,( and( engage( in( conversation(.( How( can( I( assist( you( today(?`.split(`(`);async function p(){for(let e of f)await t(100),d.add(e)}async function m(){p()}return a(()=>{m()}),(e,t)=>(o(),r(`div`,null,t[0]||=[n(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file +import{c5 as e,ca as t,d$ as n,dV as r,dY as i,e5 as a,e7 as o,ei as s}from"./index-BF1-WNuF.js";var c=n({__name:`queue`,setup(n){let c=s(``),l=e({handlers:[async e=>{console.log(`ready to play speech audio for`,e)}]}),u=e({handlers:[async e=>{console.log(`ready to stream speech audio for`,e),l.add(e.data)}]}),d=e({handlers:[async e=>{let t=[`.`,`?`,`!`],n=!1;for(let r of t){if(!e.data.includes(r))continue;let t=e.data.indexOf(r),i=e.data.slice(0,t+1),a=e.data.slice(t+1);c.value+=i,u.add(c.value.trim()),c.value=a,n=!0}n||(c.value+=e.data)}]}),f=`Hello( N(eko(! I( am( an( AI( assistant( trained( to( help( with( a( variety( of( tasks( such( as( answering( questions(,( providing( information(,( giving( recommendations(,( and( more(. How( can( I( assist( you( today(?(Hello( N(eko(,( I( am( an( AI( assistant(.( I( can( help( answer( questions(,( provide( information(,( assist( with( tasks(,( and( engage( in( conversation(.( How( can( I( assist( you( today(?`.split(`(`);async function p(){for(let e of f)await t(100),d.add(e)}async function m(){p()}return a(()=>{m()}),(e,t)=>(o(),i(`div`,null,t[0]||=[r(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/scene-DQODToDR.js b/assets/scene-DQODToDR.js new file mode 100644 index 0000000000000000000000000000000000000000..5a959264e1c591ee45aa94d4dc235d01e759ac44 --- /dev/null +++ b/assets/scene-DQODToDR.js @@ -0,0 +1 @@ +import{cs as e,d$ as t,dS as n,dV as r,dW as i,dY as a,dZ as o,d_ as s,e7 as c,eb as l,ef as u,eg as d,em as f}from"./index-BF1-WNuF.js";import{b as p}from"./route-block-gWR0cCIm.js";import{b as m}from"./IconAnimation-PgvikmZb.js";import{b as h}from"./icon-animation-DON3nMjf.js";const g={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var _=t({__name:`index`,setup(t){let{iconAnimationStarted:p,showIconAnimation:_,animationIcon:v}=h(`i-solar:armchair-2-bold-duotone`);return(t,h)=>{let y=l(`motion`);return c(),a(n,null,[r(`div`,null,[s(f(e),{label:`In development, needs your help!`,theme:`orange`},{default:u(()=>h[0]||=[r(`div`,null,[o(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),r(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),o(`. The source code of this page is located at `),r(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),o(`. `)],-1)]),_:1,__:[0]})]),f(_)?(c(),i(m,{key:0,"z-index":-1,icon:f(v),"icon-size":12,duration:1e3,started:f(p),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):d((c(),a(`div`,g,h[1]||=[r(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)])),[[y]])],64)}}});typeof p==`function`&&p(_);var v=_;export{v as default}; \ No newline at end of file diff --git a/assets/scene-D_ELFQMq.js b/assets/scene-D_ELFQMq.js deleted file mode 100644 index 0d46df857e53d5f6f65bad27b3b9c71abf3318f0..0000000000000000000000000000000000000000 --- a/assets/scene-D_ELFQMq.js +++ /dev/null @@ -1 +0,0 @@ -import{cs as e,dR as t,dU as n,dV as r,dX as i,dY as a,dZ as o,d_ as s,e6 as c,ea as l,ee as u,ef as d,el as f}from"./index-DEpwtsc8.js";import{b as p}from"./route-block-gWR0cCIm.js";import{b as m}from"./IconAnimation-DufoONwd.js";import{b as h}from"./icon-animation-C4P_W_Br.js";const g={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var _=s({__name:`index`,setup(s){let{iconAnimationStarted:p,showIconAnimation:_,animationIcon:v}=h(`i-solar:armchair-2-bold-duotone`);return(s,h)=>{let y=l(`motion`);return c(),i(t,null,[n(`div`,null,[o(f(e),{label:`In development, needs your help!`,theme:`orange`},{default:u(()=>h[0]||=[n(`div`,null,[a(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),n(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),a(`. The source code of this page is located at `),n(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),a(`. `)],-1)]),_:1,__:[0]})]),f(_)?(c(),r(m,{key:0,"z-index":-1,icon:f(v),"icon-size":12,duration:1e3,started:f(p),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):d((c(),i(`div`,g,h[1]||=[n(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)])),[[y]])],64)}}});typeof p==`function`&&p(_);var v=_;export{v as default}; \ No newline at end of file diff --git a/assets/settings-DZLC48Fg.js b/assets/settings-BayMzedR.js similarity index 73% rename from assets/settings-DZLC48Fg.js rename to assets/settings-BayMzedR.js index d83cb92340a8ecdd1506f5139c33a3df9cedd80d..57f44e146aa3bec66d986e0a11af87ea46de4bb7 100644 --- a/assets/settings-DZLC48Fg.js +++ b/assets/settings-BayMzedR.js @@ -1 +1 @@ -import{A as e,cp as t,d6 as n,dR as r,dT as i,dU as a,dV as o,dX as s,d_ as c,e3 as l,e6 as u,e7 as d,ea as f,ef as p,eh as m,el as h,eo as g,o as _}from"./index-DEpwtsc8.js";import{b as v}from"./route-block-gWR0cCIm.js";import{b as y}from"./IconAnimation-DufoONwd.js";const b={flex:`~ col gap-4`,"font-normal":``},x={flex:`~ col gap-4`,"pb-12":``},S={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},C={text:`60`,"i-solar:settings-bold-duotone":``};var w=c({__name:`index`,setup(c){let v=n(),w=m(!1),T=m(),E=m(),{t:D}=e(),O=m(``),k=m(``),A=m(!1),j=_();function M(){E.value?.()}async function N(e,t){let n=e.currentTarget,r=n.querySelector(`.menu-icon-item-icon`);if(!r)return;let i=r.getBoundingClientRect(),a=`${i.left}px, ${i.top}px`;O.value=t.icon,k.value=a,A.value=!0,await l(),w.value=!0}let P=v.beforeEach(async(e,t,n)=>{if(!j.usePageSpecificTransitions||j.disableTransitions){n();return}await new Promise(e=>{E.value=e}),P(),n()}),F=i(()=>[{title:D(`settings.pages.card.title`),description:D(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:D(`settings.pages.modules.title`),description:D(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:D(`settings.pages.scene.title`),description:D(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:D(`settings.pages.models.title`),description:D(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:D(`settings.pages.memory.title`),description:D(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:D(`settings.pages.providers.title`),description:D(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:D(`settings.pages.themes.title`),description:D(`settings.pages.themes.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/appearance`}]);return(e,n)=>{let i=f(`motion`);return u(),s(`div`,b,[n[0]||=a(`div`,null,null,-1),a(`div`,x,[(u(!0),s(r,null,d(F.value,(e,n)=>p((u(),o(h(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:g({transitionDelay:`${n*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:t=>N(t,e)},null,8,[`style`,`title`,`description`,`icon`,`to`,`onClick`])),[[i]])),128))]),A.value&&!h(j).disableTransitions&&h(j).usePageSpecificTransitions?(u(),o(y,{key:0,ref_key:`iconAnimation`,ref:T,icon:O.value,"icon-size":6*1.2,position:k.value,duration:1e3,"text-color":`text-neutral-400/50 dark:text-neutral-600/20`,started:w.value,onAnimationEndedOnce:M},null,8,[`icon`,`position`,`started`])):p((u(),s(`div`,S,[p(a(`div`,C,null,512),[[i]])])),[[i]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file +import{A as e,cp as t,d$ as n,d6 as r,dS as i,dU as a,dV as o,dW as s,dY as c,e4 as l,e7 as u,e8 as d,eb as f,eg as p,ei as m,em as h,ep as g,o as _}from"./index-BF1-WNuF.js";import{b as v}from"./route-block-gWR0cCIm.js";import{b as y}from"./IconAnimation-PgvikmZb.js";const b={flex:`~ col gap-4`,"font-normal":``},x={flex:`~ col gap-4`,"pb-12":``},S={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},C={text:`60`,"i-solar:settings-bold-duotone":``};var w=n({__name:`index`,setup(n){let v=r(),w=m(!1),T=m(),E=m(),{t:D}=e(),O=m(``),k=m(``),A=m(!1),j=_();function M(){E.value?.()}async function N(e,t){let n=e.currentTarget,r=n.querySelector(`.menu-icon-item-icon`);if(!r)return;let i=r.getBoundingClientRect(),a=`${i.left}px, ${i.top}px`;O.value=t.icon,k.value=a,A.value=!0,await l(),w.value=!0}let P=v.beforeEach(async(e,t,n)=>{if(!j.usePageSpecificTransitions||j.disableTransitions){n();return}await new Promise(e=>{E.value=e}),P(),n()}),F=a(()=>[{title:D(`settings.pages.card.title`),description:D(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:D(`settings.pages.modules.title`),description:D(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:D(`settings.pages.scene.title`),description:D(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:D(`settings.pages.models.title`),description:D(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:D(`settings.pages.memory.title`),description:D(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:D(`settings.pages.providers.title`),description:D(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:D(`settings.pages.themes.title`),description:D(`settings.pages.themes.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/appearance`}]);return(e,n)=>{let r=f(`motion`);return u(),c(`div`,b,[n[0]||=o(`div`,null,null,-1),o(`div`,x,[(u(!0),c(i,null,d(F.value,(e,n)=>p((u(),s(h(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:g({transitionDelay:`${n*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:t=>N(t,e)},null,8,[`style`,`title`,`description`,`icon`,`to`,`onClick`])),[[r]])),128))]),A.value&&!h(j).disableTransitions&&h(j).usePageSpecificTransitions?(u(),s(y,{key:0,ref_key:`iconAnimation`,ref:T,icon:O.value,"icon-size":6*1.2,position:k.value,duration:1e3,"text-color":`text-neutral-400/50 dark:text-neutral-600/20`,started:w.value,onAnimationEndedOnce:M},null,8,[`icon`,`position`,`started`])):p((u(),c(`div`,S,[p(o(`div`,C,null,512),[[r]])])),[[r]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file diff --git a/assets/settings-XapIzgYq.js b/assets/settings-DJ0YDc_8.js similarity index 80% rename from assets/settings-XapIzgYq.js rename to assets/settings-DJ0YDc_8.js index 34560767a8bc3e404b095a1acb291806255f09b5..ebb0b0799bc86de5a77889e15cbd34bec08eb039 100644 --- a/assets/settings-XapIzgYq.js +++ b/assets/settings-DJ0YDc_8.js @@ -1 +1 @@ -import{c as e,d as t}from"./theme-color-B02Jz7A8.js";import{A as n,cr as r,d4 as i,d5 as a,d8 as o,dT as s,dU as c,dX as l,dZ as u,d_ as d,dc as f,e4 as p,e6 as m,ed as h,el as g,y as _}from"./index-DEpwtsc8.js";import{b as v}from"./HeaderLink-Cg3P1d5b.js";const y={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``,"w-full":``},b={class:`px-0 py-1 hidden sm:block md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},x={class:`h-[calc(100%-40px)] px-3 py-0 2xl:max-w-[2160px] sm:h-[calc(100%-56px)] md:py-0 xl:px-4`,flex:`~ col`,"mx-auto":``};var S=d({__name:`settings`,setup(d){let S=a(),C=f(),{t:w}=n(),T=_(),{allProvidersMetadata:E}=o(T),D=s(()=>{let e={"/settings/airi-card":{subtitle:w(`settings.title`),title:w(`settings.pages.card.title`)},"/settings/appearance":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.title`)},"/settings/appearance/general":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.general.title`)},"/settings/appearance/color-scheme":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.color-scheme.title`)},"/settings/appearance/developer":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.developer.title`)},"/settings/memory":{subtitle:w(`settings.title`),title:w(`settings.pages.memory.title`)},"/settings/models":{subtitle:w(`settings.title`),title:w(`settings.pages.models.title`)},"/settings/modules":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.title`)},"/settings/modules/consciousness":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.consciousness.title`)},"/settings/modules/speech":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.speech.title`)},"/settings/modules/hearing":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.hearing.title`)},"/settings/modules/memory-short-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-short-term.title`)},"/settings/modules/memory-long-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-long-term.title`)},"/settings/modules/messaging-discord":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.messaging-discord.title`)},"/settings/modules/x":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.x.title`)},"/settings/modules/gaming-minecraft":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-minecraft.title`)},"/settings/modules/gaming-factorio":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-factorio.title`)},"/settings/providers":{subtitle:w(`settings.title`),title:w(`settings.pages.providers.title`)},"/settings/scene":{subtitle:w(`settings.title`),title:w(`settings.pages.scene.title`)},"/settings":{title:w(`settings.title`)}};for(let t of E.value)e[`/settings/providers/${t.id}`]={subtitle:w(`settings.title`),title:w(t.nameKey)};return e}),O=s(()=>D.value[S.path]),{updateThemeColor:k}=t(e({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return h(C,()=>k(),{immediate:!0}),h(S,()=>k(),{immediate:!0}),p(()=>k()),(e,t)=>(m(),l(`div`,y,[c(`div`,b,[u(v)]),c(`div`,x,[u(g(r),{title:O.value?.title,subtitle:O.value?.subtitle},null,8,[`title`,`subtitle`]),u(g(i))])]))}}),C=S;export{C as default}; \ No newline at end of file +import{c as e,d as t}from"./theme-color-DY2bNlFZ.js";import{A as n,cr as r,d$ as i,d4 as a,d5 as o,d8 as s,dU as c,dV as l,dY as u,d_ as d,dc as f,e5 as p,e7 as m,ee as h,em as g,y as _}from"./index-BF1-WNuF.js";import{b as v}from"./HeaderLink-DVkQgheP.js";const y={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``,"w-full":``},b={class:`px-0 py-1 hidden sm:block md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},x={class:`h-[calc(100%-40px)] px-3 py-0 2xl:max-w-[2160px] sm:h-[calc(100%-56px)] md:py-0 xl:px-4`,flex:`~ col`,"mx-auto":``};var S=i({__name:`settings`,setup(i){let S=o(),C=f(),{t:w}=n(),T=_(),{allProvidersMetadata:E}=s(T),D=c(()=>{let e={"/settings/airi-card":{subtitle:w(`settings.title`),title:w(`settings.pages.card.title`)},"/settings/appearance":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.title`)},"/settings/appearance/general":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.general.title`)},"/settings/appearance/color-scheme":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.color-scheme.title`)},"/settings/appearance/developer":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.developer.title`)},"/settings/memory":{subtitle:w(`settings.title`),title:w(`settings.pages.memory.title`)},"/settings/models":{subtitle:w(`settings.title`),title:w(`settings.pages.models.title`)},"/settings/modules":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.title`)},"/settings/modules/consciousness":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.consciousness.title`)},"/settings/modules/speech":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.speech.title`)},"/settings/modules/hearing":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.hearing.title`)},"/settings/modules/memory-short-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-short-term.title`)},"/settings/modules/memory-long-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-long-term.title`)},"/settings/modules/messaging-discord":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.messaging-discord.title`)},"/settings/modules/x":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.x.title`)},"/settings/modules/gaming-minecraft":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-minecraft.title`)},"/settings/modules/gaming-factorio":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-factorio.title`)},"/settings/providers":{subtitle:w(`settings.title`),title:w(`settings.pages.providers.title`)},"/settings/scene":{subtitle:w(`settings.title`),title:w(`settings.pages.scene.title`)},"/settings":{title:w(`settings.title`)}};for(let t of E.value)e[`/settings/providers/${t.id}`]={subtitle:w(`settings.title`),title:w(t.nameKey)};return e}),O=c(()=>D.value[S.path]),{updateThemeColor:k}=t(e({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return h(C,()=>k(),{immediate:!0}),h(S,()=>k(),{immediate:!0}),p(()=>k()),(e,t)=>(m(),u(`div`,y,[l(`div`,b,[d(v)]),l(`div`,x,[d(g(r),{title:O.value?.title,subtitle:O.value?.subtitle},null,8,[`title`,`subtitle`]),d(g(a))])]))}}),C=S;export{C as default}; \ No newline at end of file diff --git a/assets/speech-Bn9l8ac1.js b/assets/speech-Bn9l8ac1.js new file mode 100644 index 0000000000000000000000000000000000000000..ce96d4fd721f65944334aa45a4cfd0f39ac6c9ea --- /dev/null +++ b/assets/speech-Bn9l8ac1.js @@ -0,0 +1 @@ +import"./Basic-kTOabOY_.js";import{b as e}from"./Textarea-DjE71tF2.js";import{A as t,cD as n,cN as r,cQ as ee,cS as i,cg as a,ci as o,ck as te,cl as ne,cm as s,cn as c,d$ as l,d3 as re,d8 as u,dO as ie,dP as ae,dS as d,dV as f,dW as p,dX as m,dY as h,dZ as g,d_ as _,e5 as oe,e6 as se,e7 as v,e8 as ce,eb as le,ee as ue,ef as y,eg as b,eh as x,ei as S,em as C,en as de,eq as w,v as fe,w as pe,y as me}from"./index-BF1-WNuF.js";import{b as T}from"./route-block-gWR0cCIm.js";const he={flex:`~ col md:row gap-6`},ge={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},_e={flex:`~ col gap-4`},ve={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},ye={text:`neutral-400 dark:neutral-500`},be={"max-w-full":``},xe={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Se={key:1},Ce={key:0},we={flex:`~ col gap-4`},E={class:`text-lg md:text-2xl`},D={text:`neutral-400 dark:neutral-400`},O={key:0,class:`flex items-center justify-center py-4`},k={key:0},Te={flex:`~ col gap-4`},Ee={key:0},De={class:`flex flex-col gap-4`},Oe={flex:`~ row gap-4`},ke={key:1,class:`space-y-6`},Ae={flex:`~ col gap-4`},je={key:4,class:`mt-2 space-y-6`},Me={key:0},Ne={flex:`~ col gap-4`},Pe={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Fe={"w-full":``,"rounded-xl":``},Ie={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Le={class:`inline-flex items-center gap-4`},Re={flex:`~ col gap-4`},ze={flex:`~ row`,"gap-4":``},Be=[`disabled`],Ve={flex:`~ row`,"items-center":``,"gap-2":``},He=[`src`],Ue={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var A=l({__name:`speech`,setup(l){let{t:T}=t(),A=me(),j=fe(),{configuredSpeechProvidersMetadata:M}=u(A),{activeSpeechProvider:N,activeSpeechModel:P,activeSpeechVoice:F,activeSpeechVoiceId:I,pitch:L,isLoadingSpeechProviderVoices:We,supportsModelListing:Ge,providerModels:R,isLoadingActiveProviderModels:z,activeProviderModelError:B,modelSearchQuery:V,speechProviderError:H,ssmlEnabled:U,availableVoices:W}=u(j),G=S(``),K=S(!1),q=S(`Hello, my name is AI Assistant`),J=S(``),Y=S(!1),X=S(``),Z=S(null),Q=S(``);oe(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),ue(N,async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)});async function Ke(){if(!q.value.trim()&&!K.value||K.value&&!J.value.trim())return;if(!P.value){console.error(`No model selected`);return}if(!F.value){console.error(`No voice selected`);return}let e=await A.getProviderInstance(N.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=A.getProviderConfig(N.value);Y.value=!0,Q.value=``;try{X.value&&$();let n=K.value?J.value:j.supportsSSML?j.generateSSML(q.value,F.value,{...t,pitch:L.value}):q.value,r=await pe({...e.speech(P.value,t),input:n,voice:F.value.id});X.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{Z.value&&Z.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Q.value=e instanceof Error?e.message:`An unknown error occurred`}finally{Y.value=!1}}function $(){Z.value&&(Z.value.pause(),Z.value.currentTime=0),X.value&&(URL.revokeObjectURL(X.value),X.value=``)}se(()=>{X.value&&URL.revokeObjectURL(X.value)});function qe(e){F.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:N.value,gender:`male`}}function Je(e){P.value=e}return(t,l)=>{let u=le(`motion`);return v(),h(d,null,[f(`div`,he,[f(`div`,ge,[f(`div`,null,[f(`div`,_e,[f(`div`,null,[f(`h2`,ve,w(C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),f(`div`,ye,[f(`span`,null,w(C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),f(`div`,be,[C(M).length>0?(v(),h(`fieldset`,xe,[(v(!0),h(d,null,ce(C(M),e=>(v(),p(C(ne),{id:e.id,key:e.id,modelValue:C(N),"onUpdate:modelValue":l[0]||=e=>x(N)?N.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(v(),h(`div`,Se,[_(C(re),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:y(()=>l[13]||=[f(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),f(`div`,{class:`flex flex-col`},[f(`span`,{class:`font-medium`},`No Speech Providers Configured`),f(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),f(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),f(`div`,null,[C(N)&&C(Ge)?(v(),h(`div`,Ce,[f(`div`,we,[f(`div`,null,[f(`h2`,E,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),f(`div`,D,[f(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),C(z)?(v(),h(`div`,O,[l[14]||=f(`div`,{class:`mr-2 animate-spin`},[f(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),f(`span`,null,w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):C(B)?(v(),p(C(o),{key:1,title:C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:C(B)},null,8,[`title`,`error`])):C(R).length===0&&!C(z)?(v(),p(C(c),{key:2,type:`warning`},{title:y(()=>[g(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:y(()=>[g(w(C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):C(R).length>0?(v(),p(C(s),{key:3,modelValue:C(P),"onUpdate:modelValue":l[1]||=e=>x(P)?P.value=e:null,"search-query":C(V),"onUpdate:searchQuery":l[2]||=e=>x(V)?V.value=e:null,items:C(R),searchable:!0,"search-placeholder":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:C(V)}),"search-results-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":C(T)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":Je},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):m(``,!0)])])):m(``,!0)])]),C(N)?(v(),h(`div`,k,[f(`div`,Te,[l[24]||=f(`div`,null,[f(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),f(`div`,{text:`neutral-400 dark:neutral-500`},[f(`span`,null,`Customize how your AI assistant speaks`)])],-1),C(We)?(v(),h(`div`,Ee,[f(`div`,De,[_(C(a),{class:`w-full rounded-lg p-2.5 text-sm`},{default:y(()=>l[15]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[15]}),f(`div`,Oe,[_(C(a),{class:`w-full rounded-lg p-4 text-sm`},{default:y(()=>l[16]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[16]}),_(C(a),{class:`w-full rounded-lg p-4 text-sm`},{default:y(()=>l[17]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),_(C(a),{class:`w-full rounded-lg p-4 text-sm`},{default:y(()=>l[18]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]})]),_(C(a),{class:`w-full rounded-lg p-3 text-sm`},{default:y(()=>l[19]||=[f(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]})])])):C(W)[C(N)]&&C(W)[C(N)].length>0?(v(),h(`div`,ke,[_(C(te),{"search-query":G.value,"onUpdate:searchQuery":l[3]||=e=>G.value=e,"voice-id":C(I),"onUpdate:voiceId":l[4]||=e=>x(I)?I.value=e:null,voices:C(W)[C(N)]?.map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":C(T)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":qe},null,8,[`search-query`,`voice-id`,`voices`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`,`play-button-text`,`pause-button-text`])])):C(H)?(v(),p(C(o),{key:2,class:`mb-2`,title:`Error loading voices`,error:C(H)},null,8,[`error`])):(v(),p(C(c),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:y(()=>l[20]||=[g(` No voices available `,-1)]),content:y(()=>l[21]||=[g(` No voices were found for this provider. You can enter a custom voice name below. `,-1)]),_:1})),f(`div`,Ae,[_(C(r),{modelValue:C(L),"onUpdate:modelValue":l[5]||=e=>x(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`]),_(C(i),{modelValue:C(U),"onUpdate:modelValue":l[6]||=e=>x(U)?U.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!C(W)[C(N)]||C(W)[C(N)].length===0?(v(),h(`div`,je,[_(C(ee),{modelValue:C(I),"onUpdate:modelValue":l[7]||=e=>x(I)?I.value=e:null,type:`text`,label:`Voice ID`,description:`Enter the voice ID for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`},null,8,[`modelValue`]),C(N)===`elevenlabs`?(v(),h(`div`,Me,[l[23]||=f(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),b(f(`select`,{"onUpdate:modelValue":l[8]||=e=>x(P)?P.value=e:null,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`},l[22]||=[f(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),f(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),f(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[ie,C(P)]])])):m(``,!0),f(`div`,Ne,[_(C(r),{modelValue:C(L),"onUpdate:modelValue":l[9]||=e=>x(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])])):m(``,!0)])])):m(``,!0)]),f(`div`,Pe,[f(`div`,Fe,[f(`h2`,Ie,[f(`div`,Le,[_(C(n)),f(`div`,null,w(C(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),f(`div`,Re,[_(C(i),{modelValue:K.value,"onUpdate:modelValue":l[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?b((v(),h(`textarea`,{key:1,"onUpdate:modelValue":l[12]||=e=>J.value=e,placeholder:`Enter SSML text...`,border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,512)),[[ae,J.value]]):(v(),p(C(e),{key:0,modelValue:q.value,"onUpdate:modelValue":l[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:C(T)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),f(`div`,ze,[f(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!C(F),class:de({"opacity-50 cursor-not-allowed":Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!C(F)}),bg:`neutral-700 dark:neutral-300`,onClick:Ke},[f(`div`,Ve,[l[25]||=f(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),f(`span`,null,w(Y.value?C(T)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):C(T)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Be),X.value?(v(),h(`button`,{key:0,border:`primary-300 dark:primary-800 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,"py-2":``,"text-sm":``,onClick:$},l[26]||=[f(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[f(`div`,{"i-solar:stop-circle-bold-duotone":``}),f(`span`,null,`Stop`)],-1)])):m(``,!0)]),X.value?(v(),h(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,He)):m(``,!0)])])])]),b((v(),h(`div`,Ue,l[27]||=[f(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[u]])],64)}}});typeof T==`function`&&T(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/speech-CKJ0G9iZ.js b/assets/speech-CKJ0G9iZ.js deleted file mode 100644 index 75075c4875418755fdee665a1ce9333e3f6ee538..0000000000000000000000000000000000000000 --- a/assets/speech-CKJ0G9iZ.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-DOfBA0ws.js";import{b as e}from"./Textarea-BXmK5gJR.js";import{A as t,cD as n,cN as r,cQ as ee,cS as i,cg as a,ci as o,ck as te,cl as ne,cm as re,cn as s,d3 as ie,d8 as c,dN as ae,dO as oe,dR as l,dU as u,dV as d,dW as f,dX as p,dY as m,dZ as h,d_ as g,e4 as se,e5 as ce,e6 as _,e7 as le,ea as ue,ed as de,ee as v,ef as y,eg as b,eh as x,el as S,em as fe,ep as C,v as pe,w as me,y as he}from"./index-DEpwtsc8.js";import{b as w}from"./route-block-gWR0cCIm.js";const ge={flex:`~ col md:row gap-6`},_e={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},ve={flex:`~ col gap-4`},ye={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},be={text:`neutral-400 dark:neutral-500`},xe={"max-w-full":``},Se={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Ce={key:1},we={key:0},Te={flex:`~ col gap-4`},T={class:`text-lg md:text-2xl`},E={text:`neutral-400 dark:neutral-400`},D={key:0,class:`flex items-center justify-center py-4`},O={key:0},Ee={flex:`~ col gap-4`},De={key:0},Oe={class:`flex flex-col gap-4`},ke={flex:`~ row gap-4`},Ae={key:1,class:`space-y-6`},je={flex:`~ col gap-4`},Me={key:4,class:`mt-2 space-y-6`},Ne={key:0},Pe={flex:`~ col gap-4`},Fe={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ie={"w-full":``,"rounded-xl":``},Le={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Re={class:`inline-flex items-center gap-4`},ze={flex:`~ col gap-4`},Be={flex:`~ row`,"gap-4":``},Ve=[`disabled`],He={flex:`~ row`,"items-center":``,"gap-2":``},Ue=[`src`],k={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var A=g({__name:`speech`,setup(g){let{t:w}=t(),A=he(),j=pe(),{configuredSpeechProvidersMetadata:M}=c(A),{activeSpeechProvider:N,activeSpeechModel:P,activeSpeechVoice:F,activeSpeechVoiceId:I,pitch:L,isLoadingSpeechProviderVoices:We,supportsModelListing:Ge,providerModels:R,isLoadingActiveProviderModels:z,activeProviderModelError:B,modelSearchQuery:V,speechProviderError:H,ssmlEnabled:U,availableVoices:W}=c(j),G=x(``),K=x(!1),q=x(`Hello, my name is AI Assistant`),J=x(``),Y=x(!1),X=x(``),Z=x(null),Q=x(``);se(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),de(N,async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)});async function Ke(){if(!q.value.trim()&&!K.value||K.value&&!J.value.trim())return;if(!P.value){console.error(`No model selected`);return}if(!F.value){console.error(`No voice selected`);return}let e=await A.getProviderInstance(N.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=A.getProviderConfig(N.value);Y.value=!0,Q.value=``;try{X.value&&$();let n=K.value?J.value:j.supportsSSML?j.generateSSML(q.value,F.value,{...t,pitch:L.value}):q.value,r=await me({...e.speech(P.value,t),input:n,voice:F.value.id});X.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{Z.value&&Z.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Q.value=e instanceof Error?e.message:`An unknown error occurred`}finally{Y.value=!1}}function $(){Z.value&&(Z.value.pause(),Z.value.currentTime=0),X.value&&(URL.revokeObjectURL(X.value),X.value=``)}ce(()=>{X.value&&URL.revokeObjectURL(X.value)});function qe(e){F.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:N.value,gender:`male`}}function Je(e){P.value=e}return(t,c)=>{let g=ue(`motion`);return _(),p(l,null,[u(`div`,ge,[u(`div`,_e,[u(`div`,null,[u(`div`,ve,[u(`div`,null,[u(`h2`,ye,C(S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),u(`div`,be,[u(`span`,null,C(S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),u(`div`,xe,[S(M).length>0?(_(),p(`fieldset`,Se,[(_(!0),p(l,null,le(S(M),e=>(_(),d(S(ne),{id:e.id,key:e.id,modelValue:S(N),"onUpdate:modelValue":c[0]||=e=>b(N)?N.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(_(),p(`div`,Ce,[h(S(ie),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:v(()=>c[13]||=[u(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),u(`div`,{class:`flex flex-col`},[u(`span`,{class:`font-medium`},`No Speech Providers Configured`),u(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),u(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),u(`div`,null,[S(N)&&S(Ge)?(_(),p(`div`,we,[u(`div`,Te,[u(`div`,null,[u(`h2`,T,C(S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),u(`div`,E,[u(`span`,null,C(S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),S(z)?(_(),p(`div`,D,[c[14]||=u(`div`,{class:`mr-2 animate-spin`},[u(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),u(`span`,null,C(S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):S(B)?(_(),d(S(o),{key:1,title:S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:S(B)},null,8,[`title`,`error`])):S(R).length===0&&!S(z)?(_(),d(S(s),{key:2,type:`warning`},{title:v(()=>[m(C(S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:v(()=>[m(C(S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):S(R).length>0?(_(),d(S(re),{key:3,modelValue:S(P),"onUpdate:modelValue":c[1]||=e=>b(P)?P.value=e:null,"search-query":S(V),"onUpdate:searchQuery":c[2]||=e=>b(V)?V.value=e:null,items:S(R),searchable:!0,"search-placeholder":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:S(V)}),"search-results-text":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":S(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":Je},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):f(``,!0)])])):f(``,!0)])]),S(N)?(_(),p(`div`,O,[u(`div`,Ee,[c[24]||=u(`div`,null,[u(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),u(`div`,{text:`neutral-400 dark:neutral-500`},[u(`span`,null,`Customize how your AI assistant speaks`)])],-1),S(We)?(_(),p(`div`,De,[u(`div`,Oe,[h(S(a),{class:`w-full rounded-lg p-2.5 text-sm`},{default:v(()=>c[15]||=[u(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[15]}),u(`div`,ke,[h(S(a),{class:`w-full rounded-lg p-4 text-sm`},{default:v(()=>c[16]||=[u(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[16]}),h(S(a),{class:`w-full rounded-lg p-4 text-sm`},{default:v(()=>c[17]||=[u(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),h(S(a),{class:`w-full rounded-lg p-4 text-sm`},{default:v(()=>c[18]||=[u(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]})]),h(S(a),{class:`w-full rounded-lg p-3 text-sm`},{default:v(()=>c[19]||=[u(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]})])])):S(W)[S(N)]&&S(W)[S(N)].length>0?(_(),p(`div`,Ae,[h(S(te),{"search-query":G.value,"onUpdate:searchQuery":c[3]||=e=>G.value=e,"voice-id":S(I),"onUpdate:voiceId":c[4]||=e=>b(I)?I.value=e:null,voices:S(W)[S(N)]?.map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":S(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":qe},null,8,[`search-query`,`voice-id`,`voices`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`,`play-button-text`,`pause-button-text`])])):S(H)?(_(),d(S(o),{key:2,class:`mb-2`,title:`Error loading voices`,error:S(H)},null,8,[`error`])):(_(),d(S(s),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:v(()=>c[20]||=[m(` No voices available `,-1)]),content:v(()=>c[21]||=[m(` No voices were found for this provider. You can enter a custom voice name below. `,-1)]),_:1})),u(`div`,je,[h(S(r),{modelValue:S(L),"onUpdate:modelValue":c[5]||=e=>b(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`]),h(S(i),{modelValue:S(U),"onUpdate:modelValue":c[6]||=e=>b(U)?U.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!S(W)[S(N)]||S(W)[S(N)].length===0?(_(),p(`div`,Me,[h(S(ee),{modelValue:S(I),"onUpdate:modelValue":c[7]||=e=>b(I)?I.value=e:null,type:`text`,label:`Voice ID`,description:`Enter the voice ID for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`},null,8,[`modelValue`]),S(N)===`elevenlabs`?(_(),p(`div`,Ne,[c[23]||=u(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),y(u(`select`,{"onUpdate:modelValue":c[8]||=e=>b(P)?P.value=e:null,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`},c[22]||=[u(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),u(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),u(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[ae,S(P)]])])):f(``,!0),u(`div`,Pe,[h(S(r),{modelValue:S(L),"onUpdate:modelValue":c[9]||=e=>b(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])])):f(``,!0)])])):f(``,!0)]),u(`div`,Fe,[u(`div`,Ie,[u(`h2`,Le,[u(`div`,Re,[h(S(n)),u(`div`,null,C(S(w)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),u(`div`,ze,[h(S(i),{modelValue:K.value,"onUpdate:modelValue":c[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?y((_(),p(`textarea`,{key:1,"onUpdate:modelValue":c[12]||=e=>J.value=e,placeholder:`Enter SSML text...`,border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,512)),[[oe,J.value]]):(_(),d(S(e),{key:0,modelValue:q.value,"onUpdate:modelValue":c[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:S(w)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),u(`div`,Be,[u(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!S(F),class:fe({"opacity-50 cursor-not-allowed":Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!S(F)}),bg:`neutral-700 dark:neutral-300`,onClick:Ke},[u(`div`,He,[c[25]||=u(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),u(`span`,null,C(Y.value?S(w)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):S(w)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Ve),X.value?(_(),p(`button`,{key:0,border:`primary-300 dark:primary-800 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,"py-2":``,"text-sm":``,onClick:$},c[26]||=[u(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[u(`div`,{"i-solar:stop-circle-bold-duotone":``}),u(`span`,null,`Stop`)],-1)])):f(``,!0)]),X.value?(_(),p(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ue)):f(``,!0)])])])]),y((_(),p(`div`,k,c[27]||=[u(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[g]])],64)}}});typeof w==`function`&&w(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-5LZVOFch.js b/assets/stage-5LZVOFch.js new file mode 100644 index 0000000000000000000000000000000000000000..a5d2f68db1b0954c76785d2741c875053b460e04 --- /dev/null +++ b/assets/stage-5LZVOFch.js @@ -0,0 +1 @@ +import"./Basic-kTOabOY_.js";import{b as e,d as t}from"./theme-color-DY2bNlFZ.js";import{d$ as n,d8 as r,d9 as i,dV as a,dW as o,dX as s,d_ as c,da as l,dc as u,dh as d,e5 as f,e7 as p,ee as m,ef as h,ei as g,em as _,q as v}from"./index-BF1-WNuF.js";import"./HeaderLink-DVkQgheP.js";import{b as y}from"./route-block-gWR0cCIm.js";import{b}from"./Scenes-CogR6jTf.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-wua8MzWE.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),f(()=>R()),(e,t)=>(p(),o(E,null,{default:h(()=>[c(x,{class:`widgets top-widgets`,"fill-color":_(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:h(()=>[a(`div`,D,[a(`div`,O,[c(T,{class:`hidden md:flex`}),c(C,{class:`flex md:hidden`})]),a(`div`,k,[c(_(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:_(M).x.value,y:_(M).y.value},"x-offset":`${_(L)?_(P).x:_(P).x-10}%`,"y-offset":_(F).y,scale:_(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),_(L)?s(``,!0):(p(),o(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),_(L)?(p(),o(S,{key:1,onSettingsOpen:j})):s(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-BZBO0dUM.js b/assets/stage-BZBO0dUM.js deleted file mode 100644 index 0810a4d96612f4ec1395142142e157492e18aef4..0000000000000000000000000000000000000000 --- a/assets/stage-BZBO0dUM.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-DOfBA0ws.js";import{b as e,d as t}from"./theme-color-B02Jz7A8.js";import{d8 as n,d9 as r,dU as i,dV as a,dW as o,dZ as s,d_ as c,da as l,dc as u,dh as d,e4 as f,e6 as p,ed as m,ee as h,eh as g,el as _,q as v}from"./index-DEpwtsc8.js";import"./HeaderLink-Cg3P1d5b.js";import{b as y}from"./route-block-gWR0cCIm.js";import{b}from"./Scenes-C-Sbq7ai.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-BifePjRS.js";import"./import-url-browser-D0zVIqhu.js";import"./duckdb-mvp-P5KShsBk.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),f(()=>R()),(e,t)=>(p(),a(E,null,{default:h(()=>[s(x,{class:`widgets top-widgets`,"fill-color":_(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:h(()=>[i(`div`,D,[i(`div`,O,[s(T,{class:`hidden md:flex`}),s(C,{class:`flex md:hidden`})]),i(`div`,k,[s(_(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:_(M).x.value,y:_(M).y.value},"x-offset":`${_(L)?_(P).x:_(P).x-10}%`,"y-offset":_(F).y,scale:_(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),_(L)?o(``,!0):(p(),a(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),_(L)?(p(),a(S,{key:1,onSettingsOpen:j})):o(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-C66qPyvu.js b/assets/stage-C66qPyvu.js new file mode 100644 index 0000000000000000000000000000000000000000..c7d48300e6491e5c39ac975ff5dcbe66c11db1d0 --- /dev/null +++ b/assets/stage-C66qPyvu.js @@ -0,0 +1 @@ +import{d$ as e,d4 as t,dY as n,d_ as r,e7 as i,em as a}from"./index-BF1-WNuF.js";const o={text:`gray-700 dark:gray-200`,"h-full":``,"font-cute":``};var s=e({__name:`stage`,setup(e){return(e,s)=>(i(),n(`main`,o,[r(a(t))]))}}),c=s;export{c as default}; \ No newline at end of file diff --git a/assets/stage-DXskS9T5.js b/assets/stage-DXskS9T5.js deleted file mode 100644 index 0135f79b8b5ee974804539dbf4c5742d1d6bb077..0000000000000000000000000000000000000000 --- a/assets/stage-DXskS9T5.js +++ /dev/null @@ -1 +0,0 @@ -import{d4 as e,dX as t,dZ as n,d_ as r,e6 as i,el as a}from"./index-DEpwtsc8.js";const o={text:`gray-700 dark:gray-200`,"h-full":``,"font-cute":``};var s=r({__name:`stage`,setup(r){return(r,s)=>(i(),t(`main`,o,[n(a(e))]))}}),c=s;export{c as default}; \ No newline at end of file diff --git a/assets/sury-s6Akl-oc-9Lj4-L3G.js b/assets/sury-s6Akl-oc-BC_NKWkZ.js similarity index 71% rename from assets/sury-s6Akl-oc-9Lj4-L3G.js rename to assets/sury-s6Akl-oc-BC_NKWkZ.js index ae8996640705035917d9ad626e6cd839fd2b28b6..189a609ff74722a68ecb720842e00d81ab4ccefb 100644 --- a/assets/sury-s6Akl-oc-9Lj4-L3G.js +++ b/assets/sury-s6Akl-oc-BC_NKWkZ.js @@ -1 +1 @@ -import{bR as e,d7 as t}from"./index-DEpwtsc8.js";const n=async()=>{let{toJSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_sury_xsschema-NEutZrhx.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{bR as e,d7 as t}from"./index-BF1-WNuF.js";const n=async()=>{let{toJSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_sury_xsschema-NEutZrhx.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/theme-color-B02Jz7A8.js b/assets/theme-color-DY2bNlFZ.js similarity index 99% rename from assets/theme-color-B02Jz7A8.js rename to assets/theme-color-DY2bNlFZ.js index eccde933624547e953be3b4d73365bd762bf3aad..570a05ca82878b71a265d588f732fb95bd779e97 100644 --- a/assets/theme-color-B02Jz7A8.js +++ b/assets/theme-color-DY2bNlFZ.js @@ -1 +1 @@ -import{ca as e,cb as t,dc as n}from"./index-DEpwtsc8.js";const r=async e=>{let t=await e();for(;t instanceof Function;)t=await t();return t},i={retry:3,retryCount:0,retryDelay:500},a=(n,o)=>{let{onError:s,retry:c,retryCount:l,retryDelay:u}=t(i,o),d=async(...t)=>{try{return await n(...t)}catch(r){if(s?.(r),la(n,{onError:s,retry:c,retryCount:l+1,retryDelay:u})(...t);throw r}};return async(...e)=>r(async()=>d(...e))};function o(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;re[0]):a}function s(e){return c(e)===`string`}function c(e){let t=Object.prototype.toString.call(e);return(t.match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function l(e,{precision:t,unit:n}){return u(e)?`none`:f(e,t)+(n??``)}function u(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function d(e){return u(e)?0:e}function f(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}const p={deg:1,grad:.9,rad:180/Math.PI,turn:360};function m(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,n=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let e=[];return a[2].replace(i,(t,i)=>{let a=i.match(r),o=i;if(a){let e=a[0],t=o.slice(0,-e.length);e===`%`?(o=new Number(t/100),o.type=``):(o=new Number(t*p[e]),o.type=``,o.unit=e)}else n.test(o)?(o=new Number(o),o.type=``):o===`none`&&(o=new Number(NaN),o.none=!0);t.startsWith(`/`)&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),typeof o==`object`&&o instanceof Number&&(o.raw=i),e.push(o)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:e}}}function h(e){return e[e.length-1]}function g(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function _(e,t,n){return(n-e)/(t-e)}function v(e,t,n){return g(t[0],t[1],_(e[0],e[1],n))}function y(e){return e.map(e=>e.split(`|`).map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let e=new String(t[1]);return e.range=[+t[2],+t[3]],e}return e}))}function b(e,t,n){return Math.max(Math.min(n,t),e)}function x(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function S(e,t){return x(Math.abs(e)**t,e)}function C(e,t){return t===0?0:e/t}function w(e,t,n=0,r=e.length){for(;n>1;e[i]`,``,``]);function A(e,t,n,r){let i=Object.entries(e.coords).map(([e,i],a)=>{let o=t.coordGrammar[a],s=r[a],c=s?.type,l;if(l=s.none?o.find(e=>ne.has(e)):o.find(e=>e==c),!l){let t=i.name||e;throw TypeError(`${c??s.raw} not allowed for ${t} in ${n}()`)}let u=l.range;c===``&&(u||=[0,1]);let d=i.range||i.refRange;return u&&d&&(r[a]=v(u,d,r[a])),l});return i}function re(e,{meta:t}={}){let n={str:String(e)?.trim()};if(E.run(`parse-start`,n),n.color)return n.color;if(n.parsed=m(n.str),n.parsed){let e=n.parsed.name;if(e===`color`){let e=n.parsed.args.shift(),r=e.startsWith(`--`)?e.substring(2):`--${e}`,i=[e,r],a=n.parsed.rawArgs.indexOf(`/`)>0?n.parsed.args.pop():1;for(let r of M.all){let o=r.getFormat(`color`);if(o&&(i.includes(o.id)||o.ids?.filter(e=>i.includes(e)).length)){let i=Object.keys(r.coords).map((e,t)=>n.parsed.args[t]||0),s;return o.coordGrammar&&(s=A(r,o,`color`,i)),t&&Object.assign(t,{formatId:`color`,types:s}),o.id.startsWith(`--`)&&!e.startsWith(`--`)&&D.warn(`${r.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${o.id}) instead of color(${e}).`),e.startsWith(`--`)&&!o.id.startsWith(`--`)&&D.warn(`${r.name} is a standard space and supported in the CSS spec. Use color(${o.id}) instead of prefixed color(${e}).`),{spaceId:r.id,coords:i,alpha:a}}}let o=``,s=e in M.registry?e:r;if(s in M.registry){let e=M.registry[s].formats?.color?.id;e&&(o=`Did you mean color(${e})?`)}throw TypeError(`Cannot parse color(${e}). `+(o||`Missing a plugin?`))}else for(let r of M.all){let i=r.getFormat(e);if(i&&i.type===`function`){let a=1;(i.lastAlpha||h(n.parsed.args).alpha)&&(a=n.parsed.args.pop());let o=n.parsed.args,s;return i.coordGrammar&&(s=A(r,i,e,o)),t&&Object.assign(t,{formatId:i.name,types:s}),{spaceId:r.id,coords:o,alpha:a}}}}else for(let e of M.all)for(let r in e.formats){let i=e.formats[r];if(i.type!==`custom`||i.test&&!i.test(n.str))continue;let a=i.parse(n.str);if(a)return a.alpha??=1,t&&(t.formatId=r),a}throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function j(e){if(Array.isArray(e))return e.map(j);if(!e)throw TypeError(`Empty color reference`);s(e)&&(e=re(e));let t=e.space||e.spaceId;return t instanceof M||(e.space=M.get(t)),e.alpha===void 0&&(e.alpha=1),e}const ie=75e-6;var M=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;for(let e in this.white=te(r),this.formats=t.formats??{},this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace=t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,`path`,{value:N(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),E.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=ie}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Number.isNaN(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(typeof e==`object`)return e=ae(e,this),e;let t;return t=e===`default`?Object.values(this.formats)[0]:this.formats[e],t?(t=ae(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=j(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Number.isNaN(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;eo;e--)n=r[e].toBase(n);for(let e=o+1;e=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function N(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}function ae(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||=`function`,e.name||=`color`,e.coordGrammar=y(e.coords);let n=Object.entries(t).map(([t,n],r)=>{let i=e.coordGrammar[r][0],a=n.range||n.refRange,o=i.range,s=``;return i==``?(o=[0,100],s=`%`):i==``&&(s=`deg`),{fromRange:a,toRange:o,suffix:s}});e.serializeCoords=(e,t)=>e.map((e,r)=>{let{fromRange:i,toRange:a,suffix:o}=n[r];return i&&a&&(e=v(i,a,e)),e=l(e,{precision:t,unit:o}),e})}return e}var P=new M({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{name:`X`},y:{name:`Y`},z:{name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),F=class extends M{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=P,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=o(e.toXYZ_M,t);return this.white!==this.base.white&&(n=k(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=k(this.base.white,this.white,t),o(e.fromXYZ_M,t))),e.referred??=`display`,super(e)}};function I(e,t){return e=j(e),!t||e.space.equals(t)?e.coords.slice():(t=M.get(t),t.from(e))}function L(e,t){e=j(e);let{space:n,index:r}=M.resolveCoord(t,e.space),i=I(e,n);return i[r]}function oe(e,t,n){return e=j(e),t=M.get(t),e.coords=t.to(e.space,n),e}oe.returns=`color`;function R(e,t,n){if(e=j(e),arguments.length===2&&c(arguments[1])===`object`){let t=arguments[1];for(let n in t)R(e,n,t[n])}else{typeof n==`function`&&(n=n(L(e,t)));let{space:r,index:i}=M.resolveCoord(t,e.space),a=I(e,r);a[i]=n,oe(e,r,a)}return e}R.returns=`color`;var se=new M({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:P,fromBase:e=>k(P.white,`D50`,e),toBase:e=>k(`D50`,P.white,e)});const ce=216/24389,le=24/116,ue=24389/27;let de=O.D50;var z=new M({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:de,base:se,fromBase(e){let t=e.map((e,t)=>e/de[t]),n=t.map(e=>e>ce?Math.cbrt(e):(ue*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>le?t[0]**3:(116*t[0]-16)/ue,e[0]>8?((e[0]+16)/116)**3:e[0]/ue,t[2]>le?t[2]**3:(116*t[2]-16)/ue];return n.map((e,t)=>e*de[t])},formats:{lab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function B(e){return(e%360+360)%360}function fe(e,t){if(e===`raw`)return t;let[n,r]=t.map(B),i=r-n;return e===`increasing`?i<0&&(r+=360):e===`decreasing`?i>0&&(n+=360):e===`longer`?-1800?n+=360:r+=360):e===`shorter`&&(i>180?n+=360:i<-180&&(r+=360)),[n,r]}var pe=new M({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:z,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const me=25**7,he=Math.PI,ge=180/he,V=he/180;function _e(e){let t=e*e,n=t*t*t*e;return n}function ve(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=j([e,t]);let[a,o,s]=z.from(e),c=pe.from(z,[a,o,s])[1],[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=(c+f)/2,m=_e(p),h=.5*(1-Math.sqrt(m/(m+me))),g=(1+h)*o,_=(1+h)*u,v=Math.sqrt(g**2+s**2),y=Math.sqrt(_**2+d**2),b=g===0&&s===0?0:Math.atan2(s,g),x=_===0&&d===0?0:Math.atan2(d,_);b<0&&(b+=2*he),x<0&&(x+=2*he),b*=ge,x*=ge;let S=l-a,C=y-v,w=x-b,T=b+x,ee=Math.abs(w),E;v*y===0?E=0:ee<=180?E=w:w>180?E=w-360:w<-180?E=w+360:D.warn(`the unthinkable has happened`);let O=2*Math.sqrt(y*v)*Math.sin(E*V/2),te=(a+l)/2,k=(v+y)/2,ne=_e(k),A;A=v*y===0?T:ee<=180?T/2:T<360?(T+360)/2:(T-360)/2;let re=(te-50)**2,ie=1+.015*re/Math.sqrt(20+re),M=1+.045*k,N=1;N-=.17*Math.cos((A-30)*V),N+=.24*Math.cos(2*A*V),N+=.32*Math.cos((3*A+6)*V),N-=.2*Math.cos((4*A-63)*V);let ae=1+.015*k*N,P=30*Math.exp(-1*((A-275)/25)**2),F=2*Math.sqrt(ne/(ne+me)),I=-1*Math.sin(2*P*V)*F,L=(S/(n*ie))**2;return L+=(C/(r*M))**2,L+=(O/(i*ae))**2,L+=I*(C/(r*M))*(O/(i*ae)),Math.sqrt(L)}const ye=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],be=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],xe=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Se=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var H=new M({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:P,fromBase(e){let t=o(ye,e),n=t.map(e=>Math.cbrt(e));return o(xe,n)},toBase(e){let t=o(Se,e),n=t.map(e=>e**3);return o(be,n)},formats:{oklab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function Ce(e,t){[e,t]=j([e,t]);let[n,r,i]=H.from(e),[a,o,s]=H.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}const we=75e-6;function U(e,t,{epsilon:n=we}={}){e=j(e),!t&&(t=e.space),t=M.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function W(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Te(e,t,n=`lab`){n=M.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return isNaN(t)||isNaN(r)?e:e+(r-t)**2},0))}function Ee(e,t){return Te(e,t,`lab`)}const De=Math.PI,Oe=De/180;function ke(e,t,{l:n=2,c:r=1}={}){[e,t]=j([e,t]);let[i,a,o]=z.from(e),[,s,c]=pe.from(z,[i,a,o]),[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Number.isNaN(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Oe)):.36+Math.abs(.4*Math.cos((c+35)*Oe));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}const Ae=203;var je=new M({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:P,fromBase(e){return e.map(e=>Math.max(e*Ae,0))},toBase(e){return e.map(e=>Math.max(e/Ae,0))}});const Me=1.15,Ne=.66,Pe=2610/2**14,Fe=2**14/2610,Ie=3424/2**12,Le=2413/2**7,Re=2392/2**7,ze=1.7*2523/2**5,Be=2**5/(1.7*2523),Ve=-.56,He=16295499532821565e-27,Ue=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],We=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Ge=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Ke=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var qe=new M({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:je,fromBase(e){let[t,n,r]=e,i=Me*t-(Me-1)*r,a=Ne*n-(Ne-1)*t,s=o(Ue,[i,a,r]),c=s.map(function(e){let t=Ie+Le*(e/1e4)**Pe,n=1+Re*(e/1e4)**Pe;return(t/n)**ze}),[l,u,d]=o(Ge,c),f=(1+Ve)*l/(1+Ve*l)-He;return[f,u,d]},toBase(e){let[t,n,r]=e,i=(t+He)/(1+Ve-Ve*(t+He)),a=o(Ke,[i,n,r]),s=a.map(function(e){let t=Ie-e**Be,n=Re*e**Be-Le,r=1e4*(t/n)**Fe;return r}),[c,l,u]=o(We,s),d=(c+(Me-1)*u)/Me,f=(l+(Ne-1)*d)/Ne;return[d,f,u]},formats:{color:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),Je=new M({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,1],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:qe,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n){let n=S(t*Math.abs(e)*.01,ft);return 400*x(n,e)/(n+27.13)});return n}function St(e,t){let n=100/t*27.13**pt;return e.map(e=>{let t=Math.abs(e);return x(n*S(t/(400-t),pt),e)})}function Ct(e){let t=B(e);t<=G.h[0]&&(t+=360);let n=w(G.h,t)-1,[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2),s=G.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function wt(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2);return B((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Tt(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let s=e.map(e=>e*100);a.la=t,a.yb=n;let c=s[1],l=o(ht,s);r=vt[a.surround];let u=r[0];a.c=r[1],a.nc=r[2];let d=1/(5*a.la+1),f=d**4;a.fl=f*a.la+.1*(1-f)*(1-f)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/c,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let p=i?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(e=>g(1,c/e,p)),a.dRgbInv=a.dRgb.map(e=>1/e);let m=l.map((e,t)=>e*a.dRgb[t]),h=xt(m,a.fl);return a.aW=a.nbb*(2*h[0]+h[1]+.05*h[2]),a}const Et=Tt(dt,64/Math.PI*.2,20,`average`,!1);function Dt(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?wt(e.H)*bt:B(e.h)*bt;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=S(e.J,1/2)*.1;let s=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(s=4e-4*e.s**2*(t.aW+4)/t.c):s=e.M/t.flRoot/a:s=e.C/a;let c=S(s*(1.64-.29**t.n)**-.73,10/9),l=.25*(Math.cos(n+2)+3.8),u=t.aW*S(a,2/t.c/t.z),d=5e4/13*t.nc*t.ncb*l,f=u/t.nbb,p=23*(f+.305)*C(c,23*d+c*(11*r+108*i)),m=p*r,h=p*i,g=St(o(_t,[f,m,h]).map(e=>e*1/1403),t.fl);return o(gt,g.map((e,n)=>e*t.dRgbInv[n])).map(e=>e/100)}function Ot(e,t){let n=e.map(e=>e*100),r=xt(o(ht,n).map((e,n)=>e*t.dRgb[n]),t.fl),i=r[0]+(-12*r[1]+r[2])/11,a=(r[0]+r[1]-2*r[2])/9,s=(Math.atan2(a,i)%mt+mt)%mt,c=.25*(Math.cos(s+2)+3.8),l=5e4/13*t.nc*t.ncb*C(c*Math.sqrt(i**2+a**2),r[0]+r[1]+1.05*r[2]+.305),u=S(l,.9)*(1.64-.29**t.n)**.73,d=t.nbb*(2*r[0]+r[1]+.05*r[2]),f=S(d/t.aW,.5*t.c*t.z),p=100*S(f,2),m=4/t.c*f*(t.aW+4)*t.flRoot,h=u*f,g=h*t.flRoot,_=B(s*yt),v=Ct(_),y=50*S(t.c*u/(t.aW+4),1/2);return{J:p,C:h,h:_,s:y,Q:m,M:g,H:v}}var kt=new M({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:P,fromBase(e){let t=Ot(e,Et);return[t.J,t.M,t.h]},toBase(e){return Dt({J:e[0],M:e[1],h:e[2]},Et)}});const At=O.D65,jt=216/24389,Mt=24389/27;function Nt(e){let t=e>jt?Math.cbrt(e):(Mt*e+16)/116;return 116*t-16}function Pt(e){return e>8?((e+16)/116)**3:e/Mt}function Ft(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Pt(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=2e-12,l=15,u=0,d=1/0;for(;u<=l;){a=Dt({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e | `,` | `,` | `]}}});const zt=Math.PI/180,Bt=[1,.007,.0228];function Vt(e){e[1]<0&&(e=Rt.fromBase(Rt.toBase(e)));let t=Math.log(Math.max(1+Bt[2]*e[1]*Lt.flRoot,1))/Bt[2],n=e[0]*zt,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Ht(e,t){[e,t]=j([e,t]);let[n,r,i]=Vt(Rt.from(e)),[a,o,s]=Vt(Rt.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var K={deltaE76:Ee,deltaECMC:ke,deltaE2000:ve,deltaEJz:Ye,deltaEITP:ut,deltaEOK:Ce,deltaEHCT:Ht};function Ut(e){let t=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${t-2}`),1e-6)}const Wt={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function q(e,{method:t=D.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a={}}={}){if(e=j(e),s(arguments[1])?n=arguments[1]:n||=e.space,n=M.get(n),U(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=Kt(e,{space:n});else{if(t!==`clip`&&!U(e,n)){Object.prototype.hasOwnProperty.call(Wt,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Wt[t]);let s=ve;if(r!==``){for(let e in K)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=K[e];break}}let c=q(J(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(Object.keys(a).length===3){let t=M.resolveCoord(a.channel),n=L(J(e,t.space),t.id);if(u(n)&&(n=0),n>=a.max)return J({space:`xyz-d65`,coords:O.D65},e.space);if(n<=a.min)return J({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=M.resolveCoord(t),c=r.space,l=r.id,d=J(e,c);d.coords.forEach((e,t)=>{u(e)&&(d.coords[t]=0)});let f=r.range||r.refRange,p=f[0],m=Ut(i),h=p,g=L(d,l);for(;g-h>m;){let e=W(d);e=q(e,{space:n,method:`clip`});let t=s(d,e);t-ie.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=J(o,e.space)),e.coords=o.coords,e}q.returns=`color`;const Gt={WHITE:{space:H,coords:[1,0,0]},BLACK:{space:H,coords:[0,0,0]}};function Kt(e,{space:t}={}){let n=.02,r=1e-4;e=j(e),!t&&(t=e.space),t=M.get(t);let i=M.get(`oklch`);if(t.isUnbounded)return J(e,t);let a=J(e,i),o=a.coords[0];if(o>=1){let n=J(Gt.WHITE,t);return n.alpha=e.alpha,J(n,t)}if(o<=0){let n=J(Gt.BLACK,t);return n.alpha=e.alpha,J(n,t)}if(U(a,t,{epsilon:0}))return J(a,t);function s(e){let n=J(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return b(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=W(a),f=s(d),p=Ce(f,d);if(pr;){let e=(c+l)/2;if(d.coords[1]=e,u&&U(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Ce(f,d),pl(e,{precision:t})));let i=[...s];if(r===`color`){let t=n.id||n.ids?.[0]||e.space.id;i.unshift(t)}let o=e.alpha;t!==null&&(o=l(o,{precision:t}));let c=e.alpha>=1||n.noAlpha?``:`${n.commas?`,`:` /`} ${o}`;a=`${r}(${i.join(n.commas?`, `:` `)}${c})`}return a}const Jt=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],Yt=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var Xt=new F({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:Jt,fromXYZ_M:Yt});const Zt=1.09929682680944,Qt=.018053968510807;var $t=new F({id:`rec2020`,name:`REC.2020`,base:Xt,toBase(e){return e.map(function(e){return e=Qt?Zt*e**.45-(Zt-1):4.5*e})}});const en=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],tn=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var nn=new F({id:`p3-linear`,cssId:`--display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:en,fromXYZ_M:tn});const rn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],Y=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var an=new F({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:rn,fromXYZ_M:Y}),on={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let sn=[,,,].fill(` | [0, 255]`),cn=[,,,].fill(`[0, 255]`);var X=new F({id:`srgb`,name:`sRGB`,base:an,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:sn},rgb_number:{name:`rgb`,commas:!0,coords:cn,noAlpha:!0},color:{},rgba:{coords:sn,commas:!0,lastAlpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:cn},hex:{type:`custom`,toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0}={})=>{t<1&&e.push(t),e=e.map(e=>Math.round(e*255));let r=n&&e.every(e=>e%17==0),i=e.map(e=>r?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``);return`#`+i}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=on.black,t.alpha=0):t.coords=on[e],t.coords)return t}}}}),ln=new F({id:`p3`,cssId:`display-p3`,name:`P3`,base:nn,fromBase:X.fromBase,toBase:X.toBase});D.display_space=X;let un;if(typeof CSS<`u`&&CSS.supports)for(let e of[z,$t,ln]){let t=e.getMinCoords(),n={space:e,coords:t,alpha:1},r=qt(n);if(CSS.supports(`color`,r)){D.display_space=e;break}}function dn(e,{space:t=D.display_space,...n}={}){let r=qt(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!D.display_space)r=new String(r),r.color=e;else{let i=e,a=e.coords.some(u)||u(e.alpha);if(a&&!(un??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=W(e),i.coords=i.coords.map(d),i.alpha=d(i.alpha),r=qt(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=J(i,t),r=new String(qt(i,n)),r.color=i}return r}function fn(e,t){return e=j(e),t=j(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function Z(e){return L(e,[P,`y`])}function pn(e,t){R(e,[P,`y`],t)}function mn(e){Object.defineProperty(e.prototype,`luminance`,{get(){return Z(this)},set(e){pn(this,e)}})}var hn=Object.freeze({__proto__:null,getLuminance:Z,register:mn,setLuminance:pn});function gn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}const _n=.56,vn=.57,yn=.62,bn=.65,xn=.022,Sn=1.414,Cn=.1,wn=5e-4,Tn=1.14,En=.027,Dn=1.14;function On(e){return e>=xn?e:e+(xn-e)**Sn}function kn(e){let t=e<0?-1:1,n=Math.abs(e);return t*n**2.4}function An(e,t){t=j(t),e=j(e);let n,r,i,a,o,s;t=J(t,`srgb`),[a,o,s]=t.coords;let c=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175;e=J(e,`srgb`),[a,o,s]=e.coords;let l=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175,u=On(c),d=On(l),f=d>u;return Math.abs(d-u)0?r-En:r+En,i*100}function jn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}const Mn=5e4;function Nn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),r===0?Mn:(n-r)/r}function Pn(e,t){e=j(e),t=j(t);let n=L(e,[z,`l`]),r=L(t,[z,`l`]);return Math.abs(n-r)}const Fn=216/24389,In=24/116,Ln=24389/27;let Rn=O.D65;var zn=new M({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Rn,base:P,fromBase(e){let t=e.map((e,t)=>e/Rn[t]),n=t.map(e=>e>Fn?Math.cbrt(e):(Ln*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>In?t[0]**3:(116*t[0]-16)/Ln,e[0]>8?((e[0]+16)/116)**3:e[0]/Ln,t[2]>In?t[2]**3:(116*t[2]-16)/Ln];return n.map((e,t)=>e*Rn[t])},formats:{"lab-d65":{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});const Bn=5**.5*.5+.5;function Vn(e,t){e=j(e),t=j(t);let n=L(e,[zn,`l`]),r=L(t,[zn,`l`]),i=Math.abs(n**+Bn-r**+Bn),a=i**(1/Bn)*Math.SQRT2-40;return a<7.5?0:a}var Hn=Object.freeze({__proto__:null,contrastAPCA:An,contrastDeltaPhi:Vn,contrastLstar:Pn,contrastMichelson:jn,contrastWCAG21:gn,contrastWeber:Nn});function Un(e,t,n={}){s(n)&&(n={algorithm:n});let{algorithm:r,...i}=n;if(!r){let e=Object.keys(Hn).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}for(let n in e=j(e),t=j(t),Hn)if(`contrast`+r.toLowerCase()===n.toLowerCase())return Hn[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function Wn(e){let[t,n,r]=I(e,P),i=t+15*n+3*r;return[4*t/i,9*n/i]}function Gn(e){let[t,n,r]=I(e,P),i=t+n+r;return[t/i,n/i]}function Kn(e){Object.defineProperty(e.prototype,`uv`,{get(){return Wn(this)}}),Object.defineProperty(e.prototype,`xy`,{get(){return Gn(this)}})}var qn=Object.freeze({__proto__:null,register:Kn,uv:Wn,xy:Gn});function Jn(e,t,n={}){s(n)&&(n={method:n});let{method:r=D.deltaE,...i}=n;for(let n in K)if(`deltae`+r.toLowerCase()===n.toLowerCase())return K[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function Yn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1+t))}function Xn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1-t))}var Zn=Object.freeze({__proto__:null,darken:Xn,lighten:Yn});function Qn(e,t,n=.5,r={}){[e,t]=[j(e),j(t)],c(n)===`object`&&([n,r]=[.5,n]);let i=er(e,t,r);return i(n)}function $n(e,t,n={}){let r;tr(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||([e,t]=[j(e),j(t)],r=er(e,t,c));let l=Jn(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=Jn(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;te.color),d}function er(e,t,n={}){if(tr(e)){let[n,r]=[e,t];return er(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=j(e),t=j(t),e=W(e),t=W(t);let s={colors:[e,t],options:n};if(r=r?M.get(r):M.registry[D.interpolationSpace]||e.space,i=i?M.get(i):r,e=J(e,r),t=J(t,r),e=q(e),t=q(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[L(e,a),L(t,a)];isNaN(o)&&!isNaN(s)?o=s:isNaN(s)&&!isNaN(o)&&(s=o),[o,s]=fe(i,[o,s]),R(e,a,o),R(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return g(e,i,n)}),c=g(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=J(l,i)),l},{rangeArgs:s})}function tr(e){return c(e)===`function`&&!!e.rangeArgs}D.interpolationSpace=`lab`;function nr(e){e.defineFunction(`mix`,Qn,{returns:`color`}),e.defineFunction(`range`,er,{returns:`function`}),e.defineFunction(`steps`,$n,{returns:`array`})}var rr=Object.freeze({__proto__:null,isRange:tr,mix:Qn,range:er,register:nr,steps:$n}),ir=new M({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:X,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[NaN,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[` | `,``,``]},hsla:{coords:[` | `,``,``],commas:!0,lastAlpha:!0}}}),ar=new M({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:ir,fromBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r+n*Math.min(r,1-r);return[t,i===0?0:200*(1-r/i),100*i]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r*(1-n/2);return[t,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:`--hsv`,coords:[` | `,` | `,` | `]}}}),or=new M({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:ar,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1){let e=n/i;return[t,0,e*100]}let a=1-r,o=a===0?0:1-n/a;return[t,o*100,a*100]},formats:{hwb:{coords:[` | `,` | `,` | `]}}});const sr=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],cr=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var lr=new F({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:sr,fromXYZ_M:cr}),ur=new F({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:lr,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))});const dr=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fr=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var pr=new F({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:se,toXYZ_M:dr,fromXYZ_M:fr});const mr=1/512,hr=16/512;var gr=new F({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:pr,toBase(e){return e.map(e=>ee>=mr?e**(1/1.8):16*e)}}),_r=new M({id:`oklch`,name:`Oklch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:H,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n) | `,` | [0,1]`,` | `]}}});let vr=O.D65;const yr=216/24389,br=24389/27,[xr,Sr]=Wn({space:P,coords:vr});var Cr=new M({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:vr,base:P,fromBase(e){let t=[d(e[0]),d(e[1]),d(e[2])],n=t[1],[r,i]=Wn({space:P,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=yr?br*n:116*Math.cbrt(n)-16;return[a,13*a*(r-xr),13*a*(i-Sr)]},toBase(e){let[t,n,r]=e;if(t===0||u(t))return[0,0,0];n=d(n),r=d(r);let i=n/(13*t)+xr,a=r/(13*t)+Sr,o=t<=8?t/br:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),wr=new M({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Cr,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const Tr=216/24389,Er=24389/27,Dr=Y[0][0],Or=Y[0][1],kr=Y[0][2],Ar=Y[1][0],jr=Y[1][1],Mr=Y[1][2],Nr=Y[2][0],Pr=Y[2][1],Fr=Y[2][2];function Ir(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function Lr(e){let t=(e+16)**3/1560896,n=t>Tr?t:e/Er,r=n*(284517*Dr-94839*kr),i=n*(838422*kr+769860*Or+731718*Dr),a=n*(632260*kr-126452*Or),o=n*(284517*Ar-94839*Mr),s=n*(838422*Mr+769860*jr+731718*Ar),c=n*(632260*Mr-126452*jr),l=n*(284517*Nr-94839*Fr),u=n*(838422*Fr+769860*Pr+731718*Nr),d=n*(632260*Fr-126452*Pr);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function Rr(e,t){let n=t/360*Math.PI*2,r=Ir(e.r0s,e.r0i,n),i=Ir(e.r1s,e.r1i,n),a=Ir(e.g0s,e.g0i,n),o=Ir(e.g1s,e.g1i,n),s=Ir(e.b0s,e.b0i,n),c=Ir(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var zr=new M({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:X,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),a=Rr(e,r);i=n/a*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),a=Rr(e,t);i=a/100*n}return[r,i,t]},formats:{color:{id:`--hsluv`,coords:[` | `,` | `,` | `]}}});Y[0][0],Y[0][1],Y[0][2],Y[1][0],Y[1][1],Y[1][2],Y[2][0],Y[2][1],Y[2][2];function Q(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function Br(e){let t=Q(e.r0s,e.r0i),n=Q(e.r1s,e.r1i),r=Q(e.g0s,e.g0i),i=Q(e.g1s,e.g1i),a=Q(e.b0s,e.b0i),o=Q(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var Vr=new M({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:`self`,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),r=Br(e);i=n/r*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),t=Br(e);i=t/100*n}return[r,i,t]},formats:{color:{id:`--hpluv`,coords:[` | `,` | `,` | `]}}});const Hr=203,Ur=2610/2**14,Wr=2**14/2610,Gr=2523/2**5,Kr=2**5/2523,qr=3424/2**12,Jr=2413/2**7,Yr=2392/2**7;var Xr=new F({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:Xt,toBase(e){return e.map(function(e){let t=(Math.max(e**Kr-qr,0)/(Jr-Yr*e**Kr))**Wr;return t*1e4/Hr})},fromBase(e){return e.map(function(e){let t=Math.max(e*Hr/1e4,0),n=qr+Jr*t**Ur,r=1+Yr*t**Ur;return(n/r)**Gr})}});const Zr=.17883277,Qr=.28466892,$r=.55991073,ei=3.7743;var ti=new F({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:Xt,toBase(e){return e.map(function(e){return e<=.5?e**2/3*ei:(Math.exp((e-$r)/Zr)+Qr)/12*ei})},fromBase(e){return e.map(function(e){return e/=ei,e<=1/12?Math.sqrt(3*e):Zr*Math.log(12*e-Qr)+$r})}});const ni={};E.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=ii(e.W1,e.W2,e.options.method))}),E.add(`chromatic-adaptation-end`,e=>{e.M||=ii(e.W1,e.W2,e.options.method)});function ri({id:e,toCone_M:t,fromCone_M:n}){ni[e]=arguments[0]}function ii(e,t,n=`Bradford`){let r=ni[n],[i,a,s]=o(r.toCone_M,e),[c,l,u]=o(r.toCone_M,t),d=[[c/i,0,0],[0,l/a,0],[0,0,u/s]],f=o(d,r.toCone_M),p=o(r.fromCone_M,f);return p}ri({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),ri({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),ri({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),ri({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(O,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),O.ACES=[.32168/.33767,1,.34065/.33767];const ai=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],oi=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var si=new F({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:O.ACES,toXYZ_M:ai,fromXYZ_M:oi});const ci=2**-16,li=-.35828683,ui=(Math.log2(65504)+9.72)/17.52;var di=new F({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[li,ui],name:`Red`},g:{range:[li,ui],name:`Green`},b:{range:[li,ui],name:`Blue`}},referred:`scene`,base:si,toBase(e){let t=-5.279999999999999/17.52;return e.map(function(e){return e<=t?(2**(e*17.52-9.72)-ci)*2:e1||i===void 0?1:i<0?0:i;for(let e=0;ethis.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=dn(this,...t);return n.color=new e(n.color),n}static get(t,...n){return t instanceof e?t:new e(t,...n)}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(exports){if(exports.register)exports.register(e);else for(let n in exports)e.defineFunction(n,exports[n])}};$.defineFunctions({get:L,getAll:I,set:R,setAll:oe,to:J,equals:fn,inGamut:U,toGamut:q,distance:Te,toString:qt}),Object.assign($,{util:T,hooks:E,WHITES:O,Space:M,spaces:M.registry,parse:re,defaults:D});for(let e of Object.keys(fi))M.register(fi[e]);for(let e in M.registry)pi(e,M.registry[e]);E.add(`colorspace-init-end`,e=>{pi(e.id,e),e.aliases?.forEach(t=>{pi(t,e)})});function pi(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty($.prototype,n,{get(){let n=this.getAll(e);return typeof Proxy>`u`?n:new Proxy(n,{has:(e,n)=>{try{return M.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,r)=>{if(n&&typeof n!=`symbol`&&!(n in e)){let{index:r}=M.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,r)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||r>=0){let{index:a}=M.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}})},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}$.extend(K),$.extend({deltaE:Jn}),Object.assign($,{deltaEMethods:K}),$.extend(Zn),$.extend({contrast:Un}),$.extend(qn),$.extend(hn),$.extend(rr),$.extend(Hn);function mi(e,t){return async()=>{let n=a(()=>{let t=document.querySelector(e);if(!t)throw Error(`Widgets element not found`);return t},{retry:10,retryDelay:1e3}),r=await n();return window.getComputedStyle(r).getPropertyValue(t)}}function hi(e){return async()=>{if(typeof e==`string`)return e;{let t=n();return t.value?e.dark:e.light}}}function gi(e){async function t(){`document`in globalThis&&globalThis.document!=null&&`window`in globalThis&&globalThis.window!=null&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,new $(await e()).to(`srgb`).toString({format:`hex`}))}return{updateThemeColor:t}}export{mi as b,hi as c,gi as d}; \ No newline at end of file +import{ca as e,cb as t,dc as n}from"./index-BF1-WNuF.js";const r=async e=>{let t=await e();for(;t instanceof Function;)t=await t();return t},i={retry:3,retryCount:0,retryDelay:500},a=(n,o)=>{let{onError:s,retry:c,retryCount:l,retryDelay:u}=t(i,o),d=async(...t)=>{try{return await n(...t)}catch(r){if(s?.(r),la(n,{onError:s,retry:c,retryCount:l+1,retryDelay:u})(...t);throw r}};return async(...e)=>r(async()=>d(...e))};function o(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;re[0]):a}function s(e){return c(e)===`string`}function c(e){let t=Object.prototype.toString.call(e);return(t.match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function l(e,{precision:t,unit:n}){return u(e)?`none`:f(e,t)+(n??``)}function u(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function d(e){return u(e)?0:e}function f(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}const p={deg:1,grad:.9,rad:180/Math.PI,turn:360};function m(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,n=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let e=[];return a[2].replace(i,(t,i)=>{let a=i.match(r),o=i;if(a){let e=a[0],t=o.slice(0,-e.length);e===`%`?(o=new Number(t/100),o.type=``):(o=new Number(t*p[e]),o.type=``,o.unit=e)}else n.test(o)?(o=new Number(o),o.type=``):o===`none`&&(o=new Number(NaN),o.none=!0);t.startsWith(`/`)&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),typeof o==`object`&&o instanceof Number&&(o.raw=i),e.push(o)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:e}}}function h(e){return e[e.length-1]}function g(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function _(e,t,n){return(n-e)/(t-e)}function v(e,t,n){return g(t[0],t[1],_(e[0],e[1],n))}function y(e){return e.map(e=>e.split(`|`).map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let e=new String(t[1]);return e.range=[+t[2],+t[3]],e}return e}))}function b(e,t,n){return Math.max(Math.min(n,t),e)}function x(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function S(e,t){return x(Math.abs(e)**t,e)}function C(e,t){return t===0?0:e/t}function w(e,t,n=0,r=e.length){for(;n>1;e[i]`,``,``]);function A(e,t,n,r){let i=Object.entries(e.coords).map(([e,i],a)=>{let o=t.coordGrammar[a],s=r[a],c=s?.type,l;if(l=s.none?o.find(e=>ne.has(e)):o.find(e=>e==c),!l){let t=i.name||e;throw TypeError(`${c??s.raw} not allowed for ${t} in ${n}()`)}let u=l.range;c===``&&(u||=[0,1]);let d=i.range||i.refRange;return u&&d&&(r[a]=v(u,d,r[a])),l});return i}function re(e,{meta:t}={}){let n={str:String(e)?.trim()};if(E.run(`parse-start`,n),n.color)return n.color;if(n.parsed=m(n.str),n.parsed){let e=n.parsed.name;if(e===`color`){let e=n.parsed.args.shift(),r=e.startsWith(`--`)?e.substring(2):`--${e}`,i=[e,r],a=n.parsed.rawArgs.indexOf(`/`)>0?n.parsed.args.pop():1;for(let r of M.all){let o=r.getFormat(`color`);if(o&&(i.includes(o.id)||o.ids?.filter(e=>i.includes(e)).length)){let i=Object.keys(r.coords).map((e,t)=>n.parsed.args[t]||0),s;return o.coordGrammar&&(s=A(r,o,`color`,i)),t&&Object.assign(t,{formatId:`color`,types:s}),o.id.startsWith(`--`)&&!e.startsWith(`--`)&&D.warn(`${r.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${o.id}) instead of color(${e}).`),e.startsWith(`--`)&&!o.id.startsWith(`--`)&&D.warn(`${r.name} is a standard space and supported in the CSS spec. Use color(${o.id}) instead of prefixed color(${e}).`),{spaceId:r.id,coords:i,alpha:a}}}let o=``,s=e in M.registry?e:r;if(s in M.registry){let e=M.registry[s].formats?.color?.id;e&&(o=`Did you mean color(${e})?`)}throw TypeError(`Cannot parse color(${e}). `+(o||`Missing a plugin?`))}else for(let r of M.all){let i=r.getFormat(e);if(i&&i.type===`function`){let a=1;(i.lastAlpha||h(n.parsed.args).alpha)&&(a=n.parsed.args.pop());let o=n.parsed.args,s;return i.coordGrammar&&(s=A(r,i,e,o)),t&&Object.assign(t,{formatId:i.name,types:s}),{spaceId:r.id,coords:o,alpha:a}}}}else for(let e of M.all)for(let r in e.formats){let i=e.formats[r];if(i.type!==`custom`||i.test&&!i.test(n.str))continue;let a=i.parse(n.str);if(a)return a.alpha??=1,t&&(t.formatId=r),a}throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function j(e){if(Array.isArray(e))return e.map(j);if(!e)throw TypeError(`Empty color reference`);s(e)&&(e=re(e));let t=e.space||e.spaceId;return t instanceof M||(e.space=M.get(t)),e.alpha===void 0&&(e.alpha=1),e}const ie=75e-6;var M=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;for(let e in this.white=te(r),this.formats=t.formats??{},this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace=t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,`path`,{value:N(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),E.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=ie}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Number.isNaN(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(typeof e==`object`)return e=ae(e,this),e;let t;return t=e===`default`?Object.values(this.formats)[0]:this.formats[e],t?(t=ae(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=j(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Number.isNaN(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;eo;e--)n=r[e].toBase(n);for(let e=o+1;e=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function N(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}function ae(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||=`function`,e.name||=`color`,e.coordGrammar=y(e.coords);let n=Object.entries(t).map(([t,n],r)=>{let i=e.coordGrammar[r][0],a=n.range||n.refRange,o=i.range,s=``;return i==``?(o=[0,100],s=`%`):i==``&&(s=`deg`),{fromRange:a,toRange:o,suffix:s}});e.serializeCoords=(e,t)=>e.map((e,r)=>{let{fromRange:i,toRange:a,suffix:o}=n[r];return i&&a&&(e=v(i,a,e)),e=l(e,{precision:t,unit:o}),e})}return e}var P=new M({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{name:`X`},y:{name:`Y`},z:{name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),F=class extends M{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=P,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=o(e.toXYZ_M,t);return this.white!==this.base.white&&(n=k(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=k(this.base.white,this.white,t),o(e.fromXYZ_M,t))),e.referred??=`display`,super(e)}};function I(e,t){return e=j(e),!t||e.space.equals(t)?e.coords.slice():(t=M.get(t),t.from(e))}function L(e,t){e=j(e);let{space:n,index:r}=M.resolveCoord(t,e.space),i=I(e,n);return i[r]}function oe(e,t,n){return e=j(e),t=M.get(t),e.coords=t.to(e.space,n),e}oe.returns=`color`;function R(e,t,n){if(e=j(e),arguments.length===2&&c(arguments[1])===`object`){let t=arguments[1];for(let n in t)R(e,n,t[n])}else{typeof n==`function`&&(n=n(L(e,t)));let{space:r,index:i}=M.resolveCoord(t,e.space),a=I(e,r);a[i]=n,oe(e,r,a)}return e}R.returns=`color`;var se=new M({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:P,fromBase:e=>k(P.white,`D50`,e),toBase:e=>k(`D50`,P.white,e)});const ce=216/24389,le=24/116,ue=24389/27;let de=O.D50;var z=new M({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:de,base:se,fromBase(e){let t=e.map((e,t)=>e/de[t]),n=t.map(e=>e>ce?Math.cbrt(e):(ue*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>le?t[0]**3:(116*t[0]-16)/ue,e[0]>8?((e[0]+16)/116)**3:e[0]/ue,t[2]>le?t[2]**3:(116*t[2]-16)/ue];return n.map((e,t)=>e*de[t])},formats:{lab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function B(e){return(e%360+360)%360}function fe(e,t){if(e===`raw`)return t;let[n,r]=t.map(B),i=r-n;return e===`increasing`?i<0&&(r+=360):e===`decreasing`?i>0&&(n+=360):e===`longer`?-1800?n+=360:r+=360):e===`shorter`&&(i>180?n+=360:i<-180&&(r+=360)),[n,r]}var pe=new M({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:z,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const me=25**7,he=Math.PI,ge=180/he,V=he/180;function _e(e){let t=e*e,n=t*t*t*e;return n}function ve(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=j([e,t]);let[a,o,s]=z.from(e),c=pe.from(z,[a,o,s])[1],[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=(c+f)/2,m=_e(p),h=.5*(1-Math.sqrt(m/(m+me))),g=(1+h)*o,_=(1+h)*u,v=Math.sqrt(g**2+s**2),y=Math.sqrt(_**2+d**2),b=g===0&&s===0?0:Math.atan2(s,g),x=_===0&&d===0?0:Math.atan2(d,_);b<0&&(b+=2*he),x<0&&(x+=2*he),b*=ge,x*=ge;let S=l-a,C=y-v,w=x-b,T=b+x,ee=Math.abs(w),E;v*y===0?E=0:ee<=180?E=w:w>180?E=w-360:w<-180?E=w+360:D.warn(`the unthinkable has happened`);let O=2*Math.sqrt(y*v)*Math.sin(E*V/2),te=(a+l)/2,k=(v+y)/2,ne=_e(k),A;A=v*y===0?T:ee<=180?T/2:T<360?(T+360)/2:(T-360)/2;let re=(te-50)**2,ie=1+.015*re/Math.sqrt(20+re),M=1+.045*k,N=1;N-=.17*Math.cos((A-30)*V),N+=.24*Math.cos(2*A*V),N+=.32*Math.cos((3*A+6)*V),N-=.2*Math.cos((4*A-63)*V);let ae=1+.015*k*N,P=30*Math.exp(-1*((A-275)/25)**2),F=2*Math.sqrt(ne/(ne+me)),I=-1*Math.sin(2*P*V)*F,L=(S/(n*ie))**2;return L+=(C/(r*M))**2,L+=(O/(i*ae))**2,L+=I*(C/(r*M))*(O/(i*ae)),Math.sqrt(L)}const ye=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],be=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],xe=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Se=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var H=new M({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:P,fromBase(e){let t=o(ye,e),n=t.map(e=>Math.cbrt(e));return o(xe,n)},toBase(e){let t=o(Se,e),n=t.map(e=>e**3);return o(be,n)},formats:{oklab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function Ce(e,t){[e,t]=j([e,t]);let[n,r,i]=H.from(e),[a,o,s]=H.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}const we=75e-6;function U(e,t,{epsilon:n=we}={}){e=j(e),!t&&(t=e.space),t=M.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function W(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Te(e,t,n=`lab`){n=M.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return isNaN(t)||isNaN(r)?e:e+(r-t)**2},0))}function Ee(e,t){return Te(e,t,`lab`)}const De=Math.PI,Oe=De/180;function ke(e,t,{l:n=2,c:r=1}={}){[e,t]=j([e,t]);let[i,a,o]=z.from(e),[,s,c]=pe.from(z,[i,a,o]),[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Number.isNaN(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Oe)):.36+Math.abs(.4*Math.cos((c+35)*Oe));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}const Ae=203;var je=new M({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:P,fromBase(e){return e.map(e=>Math.max(e*Ae,0))},toBase(e){return e.map(e=>Math.max(e/Ae,0))}});const Me=1.15,Ne=.66,Pe=2610/2**14,Fe=2**14/2610,Ie=3424/2**12,Le=2413/2**7,Re=2392/2**7,ze=1.7*2523/2**5,Be=2**5/(1.7*2523),Ve=-.56,He=16295499532821565e-27,Ue=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],We=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Ge=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Ke=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var qe=new M({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:je,fromBase(e){let[t,n,r]=e,i=Me*t-(Me-1)*r,a=Ne*n-(Ne-1)*t,s=o(Ue,[i,a,r]),c=s.map(function(e){let t=Ie+Le*(e/1e4)**Pe,n=1+Re*(e/1e4)**Pe;return(t/n)**ze}),[l,u,d]=o(Ge,c),f=(1+Ve)*l/(1+Ve*l)-He;return[f,u,d]},toBase(e){let[t,n,r]=e,i=(t+He)/(1+Ve-Ve*(t+He)),a=o(Ke,[i,n,r]),s=a.map(function(e){let t=Ie-e**Be,n=Re*e**Be-Le,r=1e4*(t/n)**Fe;return r}),[c,l,u]=o(We,s),d=(c+(Me-1)*u)/Me,f=(l+(Ne-1)*d)/Ne;return[d,f,u]},formats:{color:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),Je=new M({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,1],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:qe,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n){let n=S(t*Math.abs(e)*.01,ft);return 400*x(n,e)/(n+27.13)});return n}function St(e,t){let n=100/t*27.13**pt;return e.map(e=>{let t=Math.abs(e);return x(n*S(t/(400-t),pt),e)})}function Ct(e){let t=B(e);t<=G.h[0]&&(t+=360);let n=w(G.h,t)-1,[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2),s=G.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function wt(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2);return B((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Tt(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let s=e.map(e=>e*100);a.la=t,a.yb=n;let c=s[1],l=o(ht,s);r=vt[a.surround];let u=r[0];a.c=r[1],a.nc=r[2];let d=1/(5*a.la+1),f=d**4;a.fl=f*a.la+.1*(1-f)*(1-f)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/c,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let p=i?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(e=>g(1,c/e,p)),a.dRgbInv=a.dRgb.map(e=>1/e);let m=l.map((e,t)=>e*a.dRgb[t]),h=xt(m,a.fl);return a.aW=a.nbb*(2*h[0]+h[1]+.05*h[2]),a}const Et=Tt(dt,64/Math.PI*.2,20,`average`,!1);function Dt(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?wt(e.H)*bt:B(e.h)*bt;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=S(e.J,1/2)*.1;let s=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(s=4e-4*e.s**2*(t.aW+4)/t.c):s=e.M/t.flRoot/a:s=e.C/a;let c=S(s*(1.64-.29**t.n)**-.73,10/9),l=.25*(Math.cos(n+2)+3.8),u=t.aW*S(a,2/t.c/t.z),d=5e4/13*t.nc*t.ncb*l,f=u/t.nbb,p=23*(f+.305)*C(c,23*d+c*(11*r+108*i)),m=p*r,h=p*i,g=St(o(_t,[f,m,h]).map(e=>e*1/1403),t.fl);return o(gt,g.map((e,n)=>e*t.dRgbInv[n])).map(e=>e/100)}function Ot(e,t){let n=e.map(e=>e*100),r=xt(o(ht,n).map((e,n)=>e*t.dRgb[n]),t.fl),i=r[0]+(-12*r[1]+r[2])/11,a=(r[0]+r[1]-2*r[2])/9,s=(Math.atan2(a,i)%mt+mt)%mt,c=.25*(Math.cos(s+2)+3.8),l=5e4/13*t.nc*t.ncb*C(c*Math.sqrt(i**2+a**2),r[0]+r[1]+1.05*r[2]+.305),u=S(l,.9)*(1.64-.29**t.n)**.73,d=t.nbb*(2*r[0]+r[1]+.05*r[2]),f=S(d/t.aW,.5*t.c*t.z),p=100*S(f,2),m=4/t.c*f*(t.aW+4)*t.flRoot,h=u*f,g=h*t.flRoot,_=B(s*yt),v=Ct(_),y=50*S(t.c*u/(t.aW+4),1/2);return{J:p,C:h,h:_,s:y,Q:m,M:g,H:v}}var kt=new M({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:P,fromBase(e){let t=Ot(e,Et);return[t.J,t.M,t.h]},toBase(e){return Dt({J:e[0],M:e[1],h:e[2]},Et)}});const At=O.D65,jt=216/24389,Mt=24389/27;function Nt(e){let t=e>jt?Math.cbrt(e):(Mt*e+16)/116;return 116*t-16}function Pt(e){return e>8?((e+16)/116)**3:e/Mt}function Ft(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Pt(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=2e-12,l=15,u=0,d=1/0;for(;u<=l;){a=Dt({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e | `,` | `,` | `]}}});const zt=Math.PI/180,Bt=[1,.007,.0228];function Vt(e){e[1]<0&&(e=Rt.fromBase(Rt.toBase(e)));let t=Math.log(Math.max(1+Bt[2]*e[1]*Lt.flRoot,1))/Bt[2],n=e[0]*zt,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Ht(e,t){[e,t]=j([e,t]);let[n,r,i]=Vt(Rt.from(e)),[a,o,s]=Vt(Rt.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var K={deltaE76:Ee,deltaECMC:ke,deltaE2000:ve,deltaEJz:Ye,deltaEITP:ut,deltaEOK:Ce,deltaEHCT:Ht};function Ut(e){let t=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${t-2}`),1e-6)}const Wt={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function q(e,{method:t=D.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a={}}={}){if(e=j(e),s(arguments[1])?n=arguments[1]:n||=e.space,n=M.get(n),U(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=Kt(e,{space:n});else{if(t!==`clip`&&!U(e,n)){Object.prototype.hasOwnProperty.call(Wt,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Wt[t]);let s=ve;if(r!==``){for(let e in K)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=K[e];break}}let c=q(J(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(Object.keys(a).length===3){let t=M.resolveCoord(a.channel),n=L(J(e,t.space),t.id);if(u(n)&&(n=0),n>=a.max)return J({space:`xyz-d65`,coords:O.D65},e.space);if(n<=a.min)return J({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=M.resolveCoord(t),c=r.space,l=r.id,d=J(e,c);d.coords.forEach((e,t)=>{u(e)&&(d.coords[t]=0)});let f=r.range||r.refRange,p=f[0],m=Ut(i),h=p,g=L(d,l);for(;g-h>m;){let e=W(d);e=q(e,{space:n,method:`clip`});let t=s(d,e);t-ie.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=J(o,e.space)),e.coords=o.coords,e}q.returns=`color`;const Gt={WHITE:{space:H,coords:[1,0,0]},BLACK:{space:H,coords:[0,0,0]}};function Kt(e,{space:t}={}){let n=.02,r=1e-4;e=j(e),!t&&(t=e.space),t=M.get(t);let i=M.get(`oklch`);if(t.isUnbounded)return J(e,t);let a=J(e,i),o=a.coords[0];if(o>=1){let n=J(Gt.WHITE,t);return n.alpha=e.alpha,J(n,t)}if(o<=0){let n=J(Gt.BLACK,t);return n.alpha=e.alpha,J(n,t)}if(U(a,t,{epsilon:0}))return J(a,t);function s(e){let n=J(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return b(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=W(a),f=s(d),p=Ce(f,d);if(pr;){let e=(c+l)/2;if(d.coords[1]=e,u&&U(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Ce(f,d),pl(e,{precision:t})));let i=[...s];if(r===`color`){let t=n.id||n.ids?.[0]||e.space.id;i.unshift(t)}let o=e.alpha;t!==null&&(o=l(o,{precision:t}));let c=e.alpha>=1||n.noAlpha?``:`${n.commas?`,`:` /`} ${o}`;a=`${r}(${i.join(n.commas?`, `:` `)}${c})`}return a}const Jt=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],Yt=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var Xt=new F({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:Jt,fromXYZ_M:Yt});const Zt=1.09929682680944,Qt=.018053968510807;var $t=new F({id:`rec2020`,name:`REC.2020`,base:Xt,toBase(e){return e.map(function(e){return e=Qt?Zt*e**.45-(Zt-1):4.5*e})}});const en=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],tn=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var nn=new F({id:`p3-linear`,cssId:`--display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:en,fromXYZ_M:tn});const rn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],Y=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var an=new F({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:rn,fromXYZ_M:Y}),on={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let sn=[,,,].fill(` | [0, 255]`),cn=[,,,].fill(`[0, 255]`);var X=new F({id:`srgb`,name:`sRGB`,base:an,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:sn},rgb_number:{name:`rgb`,commas:!0,coords:cn,noAlpha:!0},color:{},rgba:{coords:sn,commas:!0,lastAlpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:cn},hex:{type:`custom`,toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0}={})=>{t<1&&e.push(t),e=e.map(e=>Math.round(e*255));let r=n&&e.every(e=>e%17==0),i=e.map(e=>r?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``);return`#`+i}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=on.black,t.alpha=0):t.coords=on[e],t.coords)return t}}}}),ln=new F({id:`p3`,cssId:`display-p3`,name:`P3`,base:nn,fromBase:X.fromBase,toBase:X.toBase});D.display_space=X;let un;if(typeof CSS<`u`&&CSS.supports)for(let e of[z,$t,ln]){let t=e.getMinCoords(),n={space:e,coords:t,alpha:1},r=qt(n);if(CSS.supports(`color`,r)){D.display_space=e;break}}function dn(e,{space:t=D.display_space,...n}={}){let r=qt(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!D.display_space)r=new String(r),r.color=e;else{let i=e,a=e.coords.some(u)||u(e.alpha);if(a&&!(un??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=W(e),i.coords=i.coords.map(d),i.alpha=d(i.alpha),r=qt(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=J(i,t),r=new String(qt(i,n)),r.color=i}return r}function fn(e,t){return e=j(e),t=j(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function Z(e){return L(e,[P,`y`])}function pn(e,t){R(e,[P,`y`],t)}function mn(e){Object.defineProperty(e.prototype,`luminance`,{get(){return Z(this)},set(e){pn(this,e)}})}var hn=Object.freeze({__proto__:null,getLuminance:Z,register:mn,setLuminance:pn});function gn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}const _n=.56,vn=.57,yn=.62,bn=.65,xn=.022,Sn=1.414,Cn=.1,wn=5e-4,Tn=1.14,En=.027,Dn=1.14;function On(e){return e>=xn?e:e+(xn-e)**Sn}function kn(e){let t=e<0?-1:1,n=Math.abs(e);return t*n**2.4}function An(e,t){t=j(t),e=j(e);let n,r,i,a,o,s;t=J(t,`srgb`),[a,o,s]=t.coords;let c=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175;e=J(e,`srgb`),[a,o,s]=e.coords;let l=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175,u=On(c),d=On(l),f=d>u;return Math.abs(d-u)0?r-En:r+En,i*100}function jn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}const Mn=5e4;function Nn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),r===0?Mn:(n-r)/r}function Pn(e,t){e=j(e),t=j(t);let n=L(e,[z,`l`]),r=L(t,[z,`l`]);return Math.abs(n-r)}const Fn=216/24389,In=24/116,Ln=24389/27;let Rn=O.D65;var zn=new M({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Rn,base:P,fromBase(e){let t=e.map((e,t)=>e/Rn[t]),n=t.map(e=>e>Fn?Math.cbrt(e):(Ln*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>In?t[0]**3:(116*t[0]-16)/Ln,e[0]>8?((e[0]+16)/116)**3:e[0]/Ln,t[2]>In?t[2]**3:(116*t[2]-16)/Ln];return n.map((e,t)=>e*Rn[t])},formats:{"lab-d65":{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});const Bn=5**.5*.5+.5;function Vn(e,t){e=j(e),t=j(t);let n=L(e,[zn,`l`]),r=L(t,[zn,`l`]),i=Math.abs(n**+Bn-r**+Bn),a=i**(1/Bn)*Math.SQRT2-40;return a<7.5?0:a}var Hn=Object.freeze({__proto__:null,contrastAPCA:An,contrastDeltaPhi:Vn,contrastLstar:Pn,contrastMichelson:jn,contrastWCAG21:gn,contrastWeber:Nn});function Un(e,t,n={}){s(n)&&(n={algorithm:n});let{algorithm:r,...i}=n;if(!r){let e=Object.keys(Hn).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}for(let n in e=j(e),t=j(t),Hn)if(`contrast`+r.toLowerCase()===n.toLowerCase())return Hn[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function Wn(e){let[t,n,r]=I(e,P),i=t+15*n+3*r;return[4*t/i,9*n/i]}function Gn(e){let[t,n,r]=I(e,P),i=t+n+r;return[t/i,n/i]}function Kn(e){Object.defineProperty(e.prototype,`uv`,{get(){return Wn(this)}}),Object.defineProperty(e.prototype,`xy`,{get(){return Gn(this)}})}var qn=Object.freeze({__proto__:null,register:Kn,uv:Wn,xy:Gn});function Jn(e,t,n={}){s(n)&&(n={method:n});let{method:r=D.deltaE,...i}=n;for(let n in K)if(`deltae`+r.toLowerCase()===n.toLowerCase())return K[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function Yn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1+t))}function Xn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1-t))}var Zn=Object.freeze({__proto__:null,darken:Xn,lighten:Yn});function Qn(e,t,n=.5,r={}){[e,t]=[j(e),j(t)],c(n)===`object`&&([n,r]=[.5,n]);let i=er(e,t,r);return i(n)}function $n(e,t,n={}){let r;tr(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||([e,t]=[j(e),j(t)],r=er(e,t,c));let l=Jn(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=Jn(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;te.color),d}function er(e,t,n={}){if(tr(e)){let[n,r]=[e,t];return er(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=j(e),t=j(t),e=W(e),t=W(t);let s={colors:[e,t],options:n};if(r=r?M.get(r):M.registry[D.interpolationSpace]||e.space,i=i?M.get(i):r,e=J(e,r),t=J(t,r),e=q(e),t=q(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[L(e,a),L(t,a)];isNaN(o)&&!isNaN(s)?o=s:isNaN(s)&&!isNaN(o)&&(s=o),[o,s]=fe(i,[o,s]),R(e,a,o),R(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return g(e,i,n)}),c=g(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=J(l,i)),l},{rangeArgs:s})}function tr(e){return c(e)===`function`&&!!e.rangeArgs}D.interpolationSpace=`lab`;function nr(e){e.defineFunction(`mix`,Qn,{returns:`color`}),e.defineFunction(`range`,er,{returns:`function`}),e.defineFunction(`steps`,$n,{returns:`array`})}var rr=Object.freeze({__proto__:null,isRange:tr,mix:Qn,range:er,register:nr,steps:$n}),ir=new M({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:X,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[NaN,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[` | `,``,``]},hsla:{coords:[` | `,``,``],commas:!0,lastAlpha:!0}}}),ar=new M({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:ir,fromBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r+n*Math.min(r,1-r);return[t,i===0?0:200*(1-r/i),100*i]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r*(1-n/2);return[t,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:`--hsv`,coords:[` | `,` | `,` | `]}}}),or=new M({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:ar,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1){let e=n/i;return[t,0,e*100]}let a=1-r,o=a===0?0:1-n/a;return[t,o*100,a*100]},formats:{hwb:{coords:[` | `,` | `,` | `]}}});const sr=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],cr=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var lr=new F({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:sr,fromXYZ_M:cr}),ur=new F({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:lr,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))});const dr=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fr=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var pr=new F({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:se,toXYZ_M:dr,fromXYZ_M:fr});const mr=1/512,hr=16/512;var gr=new F({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:pr,toBase(e){return e.map(e=>ee>=mr?e**(1/1.8):16*e)}}),_r=new M({id:`oklch`,name:`Oklch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:H,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n) | `,` | [0,1]`,` | `]}}});let vr=O.D65;const yr=216/24389,br=24389/27,[xr,Sr]=Wn({space:P,coords:vr});var Cr=new M({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:vr,base:P,fromBase(e){let t=[d(e[0]),d(e[1]),d(e[2])],n=t[1],[r,i]=Wn({space:P,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=yr?br*n:116*Math.cbrt(n)-16;return[a,13*a*(r-xr),13*a*(i-Sr)]},toBase(e){let[t,n,r]=e;if(t===0||u(t))return[0,0,0];n=d(n),r=d(r);let i=n/(13*t)+xr,a=r/(13*t)+Sr,o=t<=8?t/br:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),wr=new M({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Cr,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const Tr=216/24389,Er=24389/27,Dr=Y[0][0],Or=Y[0][1],kr=Y[0][2],Ar=Y[1][0],jr=Y[1][1],Mr=Y[1][2],Nr=Y[2][0],Pr=Y[2][1],Fr=Y[2][2];function Ir(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function Lr(e){let t=(e+16)**3/1560896,n=t>Tr?t:e/Er,r=n*(284517*Dr-94839*kr),i=n*(838422*kr+769860*Or+731718*Dr),a=n*(632260*kr-126452*Or),o=n*(284517*Ar-94839*Mr),s=n*(838422*Mr+769860*jr+731718*Ar),c=n*(632260*Mr-126452*jr),l=n*(284517*Nr-94839*Fr),u=n*(838422*Fr+769860*Pr+731718*Nr),d=n*(632260*Fr-126452*Pr);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function Rr(e,t){let n=t/360*Math.PI*2,r=Ir(e.r0s,e.r0i,n),i=Ir(e.r1s,e.r1i,n),a=Ir(e.g0s,e.g0i,n),o=Ir(e.g1s,e.g1i,n),s=Ir(e.b0s,e.b0i,n),c=Ir(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var zr=new M({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:X,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),a=Rr(e,r);i=n/a*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),a=Rr(e,t);i=a/100*n}return[r,i,t]},formats:{color:{id:`--hsluv`,coords:[` | `,` | `,` | `]}}});Y[0][0],Y[0][1],Y[0][2],Y[1][0],Y[1][1],Y[1][2],Y[2][0],Y[2][1],Y[2][2];function Q(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function Br(e){let t=Q(e.r0s,e.r0i),n=Q(e.r1s,e.r1i),r=Q(e.g0s,e.g0i),i=Q(e.g1s,e.g1i),a=Q(e.b0s,e.b0i),o=Q(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var Vr=new M({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:`self`,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),r=Br(e);i=n/r*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),t=Br(e);i=t/100*n}return[r,i,t]},formats:{color:{id:`--hpluv`,coords:[` | `,` | `,` | `]}}});const Hr=203,Ur=2610/2**14,Wr=2**14/2610,Gr=2523/2**5,Kr=2**5/2523,qr=3424/2**12,Jr=2413/2**7,Yr=2392/2**7;var Xr=new F({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:Xt,toBase(e){return e.map(function(e){let t=(Math.max(e**Kr-qr,0)/(Jr-Yr*e**Kr))**Wr;return t*1e4/Hr})},fromBase(e){return e.map(function(e){let t=Math.max(e*Hr/1e4,0),n=qr+Jr*t**Ur,r=1+Yr*t**Ur;return(n/r)**Gr})}});const Zr=.17883277,Qr=.28466892,$r=.55991073,ei=3.7743;var ti=new F({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:Xt,toBase(e){return e.map(function(e){return e<=.5?e**2/3*ei:(Math.exp((e-$r)/Zr)+Qr)/12*ei})},fromBase(e){return e.map(function(e){return e/=ei,e<=1/12?Math.sqrt(3*e):Zr*Math.log(12*e-Qr)+$r})}});const ni={};E.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=ii(e.W1,e.W2,e.options.method))}),E.add(`chromatic-adaptation-end`,e=>{e.M||=ii(e.W1,e.W2,e.options.method)});function ri({id:e,toCone_M:t,fromCone_M:n}){ni[e]=arguments[0]}function ii(e,t,n=`Bradford`){let r=ni[n],[i,a,s]=o(r.toCone_M,e),[c,l,u]=o(r.toCone_M,t),d=[[c/i,0,0],[0,l/a,0],[0,0,u/s]],f=o(d,r.toCone_M),p=o(r.fromCone_M,f);return p}ri({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),ri({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),ri({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),ri({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(O,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),O.ACES=[.32168/.33767,1,.34065/.33767];const ai=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],oi=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var si=new F({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:O.ACES,toXYZ_M:ai,fromXYZ_M:oi});const ci=2**-16,li=-.35828683,ui=(Math.log2(65504)+9.72)/17.52;var di=new F({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[li,ui],name:`Red`},g:{range:[li,ui],name:`Green`},b:{range:[li,ui],name:`Blue`}},referred:`scene`,base:si,toBase(e){let t=-5.279999999999999/17.52;return e.map(function(e){return e<=t?(2**(e*17.52-9.72)-ci)*2:e1||i===void 0?1:i<0?0:i;for(let e=0;ethis.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=dn(this,...t);return n.color=new e(n.color),n}static get(t,...n){return t instanceof e?t:new e(t,...n)}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(exports){if(exports.register)exports.register(e);else for(let n in exports)e.defineFunction(n,exports[n])}};$.defineFunctions({get:L,getAll:I,set:R,setAll:oe,to:J,equals:fn,inGamut:U,toGamut:q,distance:Te,toString:qt}),Object.assign($,{util:T,hooks:E,WHITES:O,Space:M,spaces:M.registry,parse:re,defaults:D});for(let e of Object.keys(fi))M.register(fi[e]);for(let e in M.registry)pi(e,M.registry[e]);E.add(`colorspace-init-end`,e=>{pi(e.id,e),e.aliases?.forEach(t=>{pi(t,e)})});function pi(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty($.prototype,n,{get(){let n=this.getAll(e);return typeof Proxy>`u`?n:new Proxy(n,{has:(e,n)=>{try{return M.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,r)=>{if(n&&typeof n!=`symbol`&&!(n in e)){let{index:r}=M.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,r)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||r>=0){let{index:a}=M.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}})},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}$.extend(K),$.extend({deltaE:Jn}),Object.assign($,{deltaEMethods:K}),$.extend(Zn),$.extend({contrast:Un}),$.extend(qn),$.extend(hn),$.extend(rr),$.extend(Hn);function mi(e,t){return async()=>{let n=a(()=>{let t=document.querySelector(e);if(!t)throw Error(`Widgets element not found`);return t},{retry:10,retryDelay:1e3}),r=await n();return window.getComputedStyle(r).getPropertyValue(t)}}function hi(e){return async()=>{if(typeof e==`string`)return e;{let t=n();return t.value?e.dark:e.light}}}function gi(e){async function t(){`document`in globalThis&&globalThis.document!=null&&`window`in globalThis&&globalThis.window!=null&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,new $(await e()).to(`srgb`).toString({format:`hex`}))}return{updateThemeColor:t}}export{mi as b,hi as c,gi as d}; \ No newline at end of file diff --git a/assets/together-ai-DECvdY-v.js b/assets/together-ai-6XPxX9Zr.js similarity index 55% rename from assets/together-ai-DECvdY-v.js rename to assets/together-ai-6XPxX9Zr.js index 5b50b7f958f1fc9081448cf2425cc1dbce2bf853..65b702f85d8037d6f4abdf13c47c39cd34473349 100644 --- a/assets/together-ai-DECvdY-v.js +++ b/assets/together-ai-6XPxX9Zr.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`together-ai`;var x=o({__name:`together-ai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`togetherapi-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.together.xyz/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`together-ai`;var x=t({__name:`together-ai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`togetherapi-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.together.xyz/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/transformers.web-Dx6XCSrY.js b/assets/transformers.web-BCbx_Nx1.js similarity index 99% rename from assets/transformers.web-Dx6XCSrY.js rename to assets/transformers.web-BCbx_Nx1.js index a53e2299b4738edf07a0a480746b2bfc8972d2b4..312e713068c6b3d3d64e2a15d8725b5f0d7bb7dc 100644 --- a/assets/transformers.web-Dx6XCSrY.js +++ b/assets/transformers.web-BCbx_Nx1.js @@ -1,4 +1,4 @@ -import{er as e,es as t}from"./index-DEpwtsc8.js";const n=new Map,r=[],i=(e,t,i)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let a=n.get(e);if(a===void 0)n.set(e,{backend:t,priority:i});else if(a.priority>i)return;else if(a.priority===i&&a.backend!==t)throw Error(`cannot register backend "${e}" using priority ${i}`);if(i>=0){let t=r.indexOf(e);t!==-1&&r.splice(t,1);for(let t=0;t{let t=n.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},o=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),i=n.length===0?r:n,o,s=[],c=new Set;for(let e of i){let t=await a(e);typeof t==`string`?s.push({name:e,err:t}):(o||=t,o===t&&c.add(e))}if(!o)throw Error(`no available backend found. ERR: ${s.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of s)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let l=t.filter(e=>c.has(typeof e==`string`?e:e.name));return[o,new Proxy(e,{get:(e,t)=>t===`executionProviders`?l:Reflect.get(e,t)})]},s=`1.22.0`;let c=`warning`;const l={wasm:{},webgl:{},webgpu:{},versions:{common:s},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);c=e}},get logLevel(){return c}};Object.defineProperty(l,`logLevel`,{enumerable:!0});const u=l,d=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=4,p=0,m=1,h=2,g=3,_=0,v=d,y=d*2,b=-1;s===`RGBA`?(_=0,v=d,y=d*2,b=d*3):s===`RGB`?(_=0,v=d,y=d*2):s===`RBG`&&(_=0,y=d,v=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,p(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(p(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return p(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},h=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new T({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},g=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},_=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},v=(e,t,n)=>new T({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),y=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),b=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);let x=!1;const S=()=>{if(!x){x=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(y.set(`int64`,BigInt64Array),b.set(BigInt64Array,`int64`)),t&&(y.set(`uint64`,BigUint64Array),b.set(BigUint64Array,`uint64`)),r?(y.set(`float16`,n),b.set(n,`float16`)):y.set(`float16`,Uint16Array)}},C=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new T(e.type,e.data,t);case`cpu-pinned`:return new T({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new T({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new T({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new T({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var T=class{constructor(e,t,n){S();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=y.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=y.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=b.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=C(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return m(e,t)}static fromTexture(e,t){return h(e,t)}static fromGpuBuffer(e,t){return g(e,t)}static fromMLTensor(e,t){return _(e,t)}static fromPinnedBuffer(e,t,n){return v(e,t,n)}toDataURL(e){return d(this,e)}toImageData(e){return f(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return w(this,e)}};const E=T,D=(e,t)=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||console.timeStamp(`${e}::ORT::${t}`)},O=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`BEGIN`,e)},A=e=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`END`,e)};var ee=class e{constructor(e){this.handler=e}async run(e,t,n){k();let r={},i={};if(typeof e!=`object`||!e||e instanceof E||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof E)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof E)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof E?s[e]=t:s[e]=new E(t.type,t.data,t.dims)}return A(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){k();let a,s={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,o=0,c=t.byteLength;if(typeof n==`object`&&n)s=n;else if(typeof n==`number`){if(o=n,!Number.isSafeInteger(o))throw RangeError(`'byteOffset' must be an integer.`);if(o<0||o>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-o,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||o+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-o}].`);if(typeof i==`object`&&i)s=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,o,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[c,l]=await o(s),u=await c.createInferenceSessionHandler(a,l);return A(),new e(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const te=ee;var ne={};e(ne,{InferenceSession:()=>te,TRACE:()=>D,TRACE_FUNC_BEGIN:()=>k,TRACE_FUNC_END:()=>A,Tensor:()=>E,env:()=>u,registerBackend:()=>i});var re={};e(re,{InferenceSession:()=>Ge,TRACE:()=>B,TRACE_FUNC_BEGIN:()=>Ve,TRACE_FUNC_END:()=>V,Tensor:()=>Re,default:()=>rf,env:()=>L,registerBackend:()=>pe}); +import{es as e,et as t}from"./index-BF1-WNuF.js";const n=new Map,r=[],i=(e,t,i)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let a=n.get(e);if(a===void 0)n.set(e,{backend:t,priority:i});else if(a.priority>i)return;else if(a.priority===i&&a.backend!==t)throw Error(`cannot register backend "${e}" using priority ${i}`);if(i>=0){let t=r.indexOf(e);t!==-1&&r.splice(t,1);for(let t=0;t{let t=n.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},o=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),i=n.length===0?r:n,o,s=[],c=new Set;for(let e of i){let t=await a(e);typeof t==`string`?s.push({name:e,err:t}):(o||=t,o===t&&c.add(e))}if(!o)throw Error(`no available backend found. ERR: ${s.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of s)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let l=t.filter(e=>c.has(typeof e==`string`?e:e.name));return[o,new Proxy(e,{get:(e,t)=>t===`executionProviders`?l:Reflect.get(e,t)})]},s=`1.22.0`;let c=`warning`;const l={wasm:{},webgl:{},webgpu:{},versions:{common:s},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);c=e}},get logLevel(){return c}};Object.defineProperty(l,`logLevel`,{enumerable:!0});const u=l,d=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=4,p=0,m=1,h=2,g=3,_=0,v=d,y=d*2,b=-1;s===`RGBA`?(_=0,v=d,y=d*2,b=d*3):s===`RGB`?(_=0,v=d,y=d*2):s===`RBG`&&(_=0,y=d,v=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,p(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(p(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return p(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},h=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new T({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},g=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},_=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},v=(e,t,n)=>new T({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),y=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),b=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);let x=!1;const S=()=>{if(!x){x=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(y.set(`int64`,BigInt64Array),b.set(BigInt64Array,`int64`)),t&&(y.set(`uint64`,BigUint64Array),b.set(BigUint64Array,`uint64`)),r?(y.set(`float16`,n),b.set(n,`float16`)):y.set(`float16`,Uint16Array)}},C=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new T(e.type,e.data,t);case`cpu-pinned`:return new T({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new T({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new T({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new T({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var T=class{constructor(e,t,n){S();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=y.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=y.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=b.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=C(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return m(e,t)}static fromTexture(e,t){return h(e,t)}static fromGpuBuffer(e,t){return g(e,t)}static fromMLTensor(e,t){return _(e,t)}static fromPinnedBuffer(e,t,n){return v(e,t,n)}toDataURL(e){return d(this,e)}toImageData(e){return f(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return w(this,e)}};const E=T,D=(e,t)=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||console.timeStamp(`${e}::ORT::${t}`)},O=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`BEGIN`,e)},A=e=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`END`,e)};var ee=class e{constructor(e){this.handler=e}async run(e,t,n){k();let r={},i={};if(typeof e!=`object`||!e||e instanceof E||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof E)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof E)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof E?s[e]=t:s[e]=new E(t.type,t.data,t.dims)}return A(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){k();let a,s={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,o=0,c=t.byteLength;if(typeof n==`object`&&n)s=n;else if(typeof n==`number`){if(o=n,!Number.isSafeInteger(o))throw RangeError(`'byteOffset' must be an integer.`);if(o<0||o>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-o,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||o+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-o}].`);if(typeof i==`object`&&i)s=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,o,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[c,l]=await o(s),u=await c.createInferenceSessionHandler(a,l);return A(),new e(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const te=ee;var ne={};e(ne,{InferenceSession:()=>te,TRACE:()=>D,TRACE_FUNC_BEGIN:()=>k,TRACE_FUNC_END:()=>A,Tensor:()=>E,env:()=>u,registerBackend:()=>i});var re={};e(re,{InferenceSession:()=>Ge,TRACE:()=>B,TRACE_FUNC_BEGIN:()=>Ve,TRACE_FUNC_END:()=>V,Tensor:()=>Re,default:()=>rf,env:()=>L,registerBackend:()=>pe}); /*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/assets/valibot-DBCeetIe-CvO_piDA.js b/assets/valibot-DBCeetIe-CZqQHx2v.js similarity index 69% rename from assets/valibot-DBCeetIe-CvO_piDA.js rename to assets/valibot-DBCeetIe-CZqQHx2v.js index 309d9c620b55099c362bd1bf4324d44ed267f682..14cf7553531063a65538967221a9594ca57295a7 100644 --- a/assets/valibot-DBCeetIe-CvO_piDA.js +++ b/assets/valibot-DBCeetIe-CZqQHx2v.js @@ -1 +1 @@ -import{bR as e,d7 as t}from"./index-DEpwtsc8.js";const n=async()=>{let{toJsonSchema:n}=await e(t(()=>import(`./dist-tewfm9Ec.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{bR as e,d7 as t}from"./index-BF1-WNuF.js";const n=async()=>{let{toJsonSchema:n}=await e(t(()=>import(`./dist-tewfm9Ec.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/vibrant-BBcDcY4H.js b/assets/vibrant-LsjL0AjJ.js similarity index 54% rename from assets/vibrant-BBcDcY4H.js rename to assets/vibrant-LsjL0AjJ.js index 51fcf43994200f75fcf5edb03d292a71f19b4ba7..69287e115e919fccfbba8ecaba8becf08daa0038 100644 --- a/assets/vibrant-BBcDcY4H.js +++ b/assets/vibrant-LsjL0AjJ.js @@ -1 +1 @@ -import{b as e}from"./InputFile-BfCkG18J.js";import{dR as t,dU as n,dW as r,dX as i,dZ as a,d_ as o,e6 as s,e7 as c,ed as l,eh as u,el as d,eo as f,ep as p}from"./index-DEpwtsc8.js";import{b as m}from"./browser-bFm1l1qg.js";const h={flex:``,"flex-col":``,"gap-4":``},g={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},_={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},v={flex:``,"gap-2":``},y={"h-60":``,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"rounded-lg":``},b=[`src`];var x=o({__name:`vibrant`,setup(o){let x=u([]),S=u(),C=u([]),w=u([]);function T(e){let t=new Image;t.src=URL.createObjectURL(e),t.onload=E,S.value=t}async function E(){if(!S.value)return;let e=new m(S.value),t=await e.getPalette();C.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`),w.value=Object.values(t).map(e=>JSON.stringify(e))}return l(x,e=>{T(e[0])},{deep:!0}),(o,l)=>(s(),i(`div`,h,[n(`div`,g,[(s(!0),i(t,null,c(C.value,(e,t)=>(s(),i(`div`,{key:t,style:f({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),n(`div`,_,p(w.value),1),n(`div`,v,[a(d(e),{modelValue:x.value,"onUpdate:modelValue":l[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),n(`div`,y,[S.value?(s(),i(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):r(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file +import{b as e}from"./InputFile-CWezcrJG.js";import{d$ as t,dS as n,dV as r,dX as i,dY as a,d_ as o,e7 as s,e8 as c,ee as l,ei as u,em as d,ep as f,eq as p}from"./index-BF1-WNuF.js";import{b as m}from"./browser-bFm1l1qg.js";const h={flex:``,"flex-col":``,"gap-4":``},g={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},_={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},v={flex:``,"gap-2":``},y={"h-60":``,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"rounded-lg":``},b=[`src`];var x=t({__name:`vibrant`,setup(t){let x=u([]),S=u(),C=u([]),w=u([]);function T(e){let t=new Image;t.src=URL.createObjectURL(e),t.onload=E,S.value=t}async function E(){if(!S.value)return;let e=new m(S.value),t=await e.getPalette();C.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`),w.value=Object.values(t).map(e=>JSON.stringify(e))}return l(x,e=>{T(e[0])},{deep:!0}),(t,l)=>(s(),a(`div`,h,[r(`div`,g,[(s(!0),a(n,null,c(C.value,(e,t)=>(s(),a(`div`,{key:t,style:f({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),r(`div`,_,p(w.value),1),r(`div`,v,[o(d(e),{modelValue:x.value,"onUpdate:modelValue":l[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),r(`div`,y,[S.value?(s(),a(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):i(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file diff --git a/assets/volcengine-BXLg-lBL.js b/assets/volcengine-BQiNcwbw.js similarity index 69% rename from assets/volcengine-BXLg-lBL.js rename to assets/volcengine-BQiNcwbw.js index fb6015079f814ac6747dae341f98a7d7f313430b..e97d3485251e01f9707baf4763a4a3cd5a4a5315 100644 --- a/assets/volcengine-BXLg-lBL.js +++ b/assets/volcengine-BQiNcwbw.js @@ -1 +1 @@ -import{A as e,cN as t,cQ as n,d8 as r,dT as i,dU as a,dV as o,dZ as s,d_ as c,e as l,e4 as u,e6 as d,ed as f,ee as p,eh as m,el as h,f as g,v as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=c({__name:`volcengine`,setup(c){let y=m(1),C=_(),w=v(),{providers:T}=r(w),{t:E}=e(),D=i({get:()=>(T.value[x]?.app)?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=i(()=>!!T.value[x]?.apiKey),k=i(()=>C.availableVoices[x]||[]);async function A(e,t,n){let r=await w.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=w.getProviderConfig(x),a=i.model||S;return await C.speech(r,a,e,t,{...i})}return u(async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),f(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),f([T,D],async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(d(),o(h(l),{"provider-id":x,"default-model":S},{"basic-settings":p(()=>[a(`div`,b,[s(h(n),{modelValue:D.value,"onUpdate:modelValue":r[0]||=e=>D.value=e,label:h(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:h(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":p(()=>[s(h(t),{modelValue:y.value,"onUpdate:modelValue":r[1]||=e=>y.value=e,label:h(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:p(()=>[s(h(g),{"available-voices":k.value,"generate-speech":A,"api-key-configured":O.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{A as e,cN as t,cQ as n,d$ as r,d8 as i,dU as a,dV as o,dW as s,d_ as c,e as l,e5 as u,e7 as d,ee as f,ef as p,ei as m,em as h,f as g,v as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=r({__name:`volcengine`,setup(r){let y=m(1),C=_(),w=v(),{providers:T}=i(w),{t:E}=e(),D=a({get:()=>(T.value[x]?.app)?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=a(()=>!!T.value[x]?.apiKey),k=a(()=>C.availableVoices[x]||[]);async function A(e,t,n){let r=await w.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=w.getProviderConfig(x),a=i.model||S;return await C.speech(r,a,e,t,{...i})}return u(async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),f(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),f([T,D],async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(d(),s(h(l),{"provider-id":x,"default-model":S},{"basic-settings":p(()=>[o(`div`,b,[c(h(n),{modelValue:D.value,"onUpdate:modelValue":r[0]||=e=>D.value=e,label:h(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:h(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":p(()=>[c(h(t),{modelValue:y.value,"onUpdate:modelValue":r[1]||=e=>y.value=e,label:h(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:h(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:p(()=>[c(h(g),{"available-voices":k.value,"generate-speech":A,"api-key-configured":O.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/xai-2cc0qIXE.js b/assets/xai-CK1EupZF.js similarity index 54% rename from assets/xai-2cc0qIXE.js rename to assets/xai-CK1EupZF.js index d7ce9ffcce7618a2bba90b4ee361858bfc78369e..4013a57aef14fce34ea4bdd5c8f95437d875b3d2 100644 --- a/assets/xai-2cc0qIXE.js +++ b/assets/xai-CK1EupZF.js @@ -1 +1 @@ -import{A as e,d6 as t,d8 as n,dT as r,dV as i,dZ as a,d_ as o,e4 as s,e6 as c,ed as l,ee as u,el as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-DEpwtsc8.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`xai`;var x=o({__name:`xai`,setup(o){let{t:y}=e(),x=t(),S=v(),{providers:C}=n(S),w=r(()=>S.getProviderMetadata(b)),T=r({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=r({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),i(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[a(d(p),null,{default:u(()=>[a(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[a(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`xai-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),a(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[a(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.x.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{A as e,d$ as t,d6 as n,d8 as r,dU as i,dW as a,d_ as o,e5 as s,e7 as c,ee as l,ef as u,em as d,g as f,h as p,i as m,j as h,k as g,l as _,y as v}from"./index-BF1-WNuF.js";import{b as y}from"./route-block-gWR0cCIm.js";const b=`xai`;var x=t({__name:`xai`,setup(t){let{t:y}=e(),x=n(),S=v(),{providers:C}=r(S),w=i(()=>S.getProviderMetadata(b)),T=i({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=i({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});s(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),l([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,t)=>(c(),a(d(f),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>d(x).back()},{default:u(()=>[o(d(p),null,{default:u(()=>[o(d(m),{title:d(y)(`settings.pages.providers.common.section.basic.title`),description:d(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:u(()=>[o(d(g),{modelValue:T.value,"onUpdate:modelValue":t[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`xai-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),o(d(_),{title:d(y)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[o(d(h),{modelValue:E.value,"onUpdate:modelValue":t[1]||=e=>E.value=e,placeholder:`https://api.x.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/zod-Bw_60DVU-Bcmc6iZH.js b/assets/zod-Bw_60DVU-DrbGHdRQ.js similarity index 77% rename from assets/zod-Bw_60DVU-Bcmc6iZH.js rename to assets/zod-Bw_60DVU-DrbGHdRQ.js index 53437f9e2459cd0d574708393777a17edd0e46be..3bff722b722f8b13d558d1d4bf0362d99e6e719a 100644 --- a/assets/zod-Bw_60DVU-Bcmc6iZH.js +++ b/assets/zod-Bw_60DVU-DrbGHdRQ.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-BqSYgbr9.js","assets/index-DEpwtsc8.js","assets/index-DStbve3n.css"])))=>i.map(i=>d[i]); -import{bQ as e,d7 as t}from"./index-DEpwtsc8.js";const n=async()=>{let n=t=>{throw Error(`xsschema: Missing zod v4 dependencies "zod". see ${e}`)},r=t=>{throw Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${e}`)};try{let{toJSONSchema:e}=await t(async()=>{let{toJSONSchema:e}=await import(`./core-BqSYgbr9.js`);return{toJSONSchema:e}},__vite__mapDeps([0,1,2]));n=e}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:e}=await t(async()=>{let{zodToJsonSchema:e}=await import(`./esm-CNGDxrUe.js`);return{zodToJsonSchema:e}},[]);r=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>`_zod`in e?n(e):r(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-DnrPmW0D.js","assets/index-BF1-WNuF.js","assets/index-DStbve3n.css"])))=>i.map(i=>d[i]); +import{bQ as e,d7 as t}from"./index-BF1-WNuF.js";const n=async()=>{let n=t=>{throw Error(`xsschema: Missing zod v4 dependencies "zod". see ${e}`)},r=t=>{throw Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${e}`)};try{let{toJSONSchema:e}=await t(async()=>{let{toJSONSchema:e}=await import(`./core-DnrPmW0D.js`);return{toJSONSchema:e}},__vite__mapDeps([0,1,2]));n=e}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:e}=await t(async()=>{let{zodToJsonSchema:e}=await import(`./esm-CNGDxrUe.js`);return{zodToJsonSchema:e}},[]);r=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>`_zod`in e?n(e):r(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/index.html b/index.html index bdc2ed22aa73247301ba12b2844d3645299d79a9..9901801d51f9e6af234f0ee5ea1a5e5215c98368 100644 --- a/index.html +++ b/index.html @@ -32,7 +32,7 @@ src="/remote-assets/page-external-data/js/script.js" > - + diff --git a/sw.js b/sw.js index c9cd0a2ac8b8bc42b9e65215439c5ed0e8087dfb..cb1de0904ec6dd1fe1d0f559c0b2a1964f40100d 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const o=s=>l(s,n),a={module:{uri:n},exports:u,require:o};e[n]=Promise.all(r.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-DFqcVPwo.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-BcDABPW0.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-NEutZrhx.js",revision:null},{url:"assets/_...all_-Czwo4IOt.js",revision:null},{url:"assets/airi-card-Dt8lnkmS.js",revision:null},{url:"assets/alibaba-cloud-model-studio-CQtjyEa_.js",revision:null},{url:"assets/AnimatedWave-BifePjRS.js",revision:null},{url:"assets/AnimatedWave-CW4ij04Q.css",revision:null},{url:"assets/anthropic-B5Rr8xN4.js",revision:null},{url:"assets/appearance--O06LEpn.js",revision:null},{url:"assets/arktype-C-GObzDh-CYoI0Osm.js",revision:null},{url:"assets/audio-DFFpt6Vn.js",revision:null},{url:"assets/audio-record-OOMepqWr.js",revision:null},{url:"assets/azure-ai-foundry-BUeB-9vc.js",revision:null},{url:"assets/background-gradient-blending-6ss5Fg2-.css",revision:null},{url:"assets/background-gradient-blending-BBSUXTlB.js",revision:null},{url:"assets/background-remove-0JZi3Enw.js",revision:null},{url:"assets/Basic-DOfBA0ws.js",revision:null},{url:"assets/browser-bFm1l1qg.js",revision:null},{url:"assets/browser-DPkKpj_5.js",revision:null},{url:"assets/CardCreate-DNezsN8h.js",revision:null},{url:"assets/CardCreate-DO-bH_p3.js",revision:null},{url:"assets/CardCreationDialog-CxSxad_k.js",revision:null},{url:"assets/CardCreationDialog-UIvAa4Bx.css",revision:null},{url:"assets/CardCreationDialog-zZ6xk9W3.js",revision:null},{url:"assets/CardDetailDialog-CTtvzxCu.js",revision:null},{url:"assets/CardDetailDialog-h5b58PK2.js",revision:null},{url:"assets/CardListItem-DcGJophG.js",revision:null},{url:"assets/CardListItem-Dl6W0_Rh.js",revision:null},{url:"assets/chat-D1aTQy3Z.js",revision:null},{url:"assets/cloudflare-workers-ai-BXiaJYup.js",revision:null},{url:"assets/color-scheme-CG_WOyF8.js",revision:null},{url:"assets/color-scheme-r2m6hu6X.css",revision:null},{url:"assets/consciousness-CcGtuK1e.js",revision:null},{url:"assets/core-BqSYgbr9.js",revision:null},{url:"assets/deepseek-BlcTFZgO.js",revision:null},{url:"assets/default-browser-ZWdN_TIR.js",revision:null},{url:"assets/default-DkdbeVDA.js",revision:null},{url:"assets/default-node-D0HoLEZS.js",revision:null},{url:"assets/delays-BTktspbJ.js",revision:null},{url:"assets/DeleteCardDialog-D4etY9xD.js",revision:null},{url:"assets/DeleteCardDialog-emOJOrss.js",revision:null},{url:"assets/developer-HmG7Pz8z.js",revision:null},{url:"assets/DialogTitle-D3E9wBQi.js",revision:null},{url:"assets/dist-tewfm9Ec.js",revision:null},{url:"assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js",revision:null},{url:"assets/duckdb-browser-coi.worker-Ji2I_m5s.js",revision:null},{url:"assets/duckdb-browser-eh.worker-B2xnDV1H.js",revision:null},{url:"assets/duckdb-browser-mvp.worker-DCs3_EjR.js",revision:null},{url:"assets/duckdb-coi-CSr8FQO4.wasm",revision:null},{url:"assets/duckdb-eh-BJOC5S4x.wasm",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/duckdb-mvp-P5KShsBk.js",revision:null},{url:"assets/effect--zg3C1LQ-BC7uVPyf.js",revision:null},{url:"assets/elevenlabs-Bjs_ey_R.js",revision:null},{url:"assets/emotions-Dirlka9n.js",revision:null},{url:"assets/esm-CNGDxrUe.js",revision:null},{url:"assets/featherless-ai-s6uvg7Qq.js",revision:null},{url:"assets/filter-message-NvdjEGfA.js",revision:null},{url:"assets/fireworks-ai-CO6L0o7G.js",revision:null},{url:"assets/general-a1pJgmhe.js",revision:null},{url:"assets/gesture-circle-uev4Cm8I.js",revision:null},{url:"assets/google-generative-ai-D1AeaCUG.js",revision:null},{url:"assets/HeaderLink-4n3ShASi.css",revision:null},{url:"assets/HeaderLink-Cg3P1d5b.js",revision:null},{url:"assets/hearing-6WR66KfG.js",revision:null},{url:"assets/home-YPkPvYfc.js",revision:null},{url:"assets/icon-animation-C4P_W_Br.js",revision:null},{url:"assets/IconAnimation-DufoONwd.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-D4na5vq2.js",revision:null},{url:"assets/import-url-browser-D0zVIqhu.js",revision:null},{url:"assets/import-url-browser-DIrMeXJ_.js",revision:null},{url:"assets/import-url-node-Dl605kiZ.js",revision:null},{url:"assets/index-DEpwtsc8.js",revision:null},{url:"assets/index-DStbve3n.css",revision:null},{url:"assets/InputFile-BfCkG18J.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-Cz1bx8kl.js",revision:null},{url:"assets/memory-long-term-aOPg0SoZ.js",revision:null},{url:"assets/memory-short-term-3rd3oGvN.js",revision:null},{url:"assets/messages-OFTKTDnc.js",revision:null},{url:"assets/microsoft-speech-bW0zpaDE.js",revision:null},{url:"assets/mistral-ai-BtAe5JTJ.js",revision:null},{url:"assets/models-FPOqD7a1.js",revision:null},{url:"assets/modules-Butv2iNA.js",revision:null},{url:"assets/moonshot-ai-BTmYBRPo.js",revision:null},{url:"assets/novita-ai-DrCt992g.js",revision:null},{url:"assets/ollama-DRW2bGA7.js",revision:null},{url:"assets/openai-audio-speech-BJXomLm7.js",revision:null},{url:"assets/openai-audio-transcription-CNjeZbT4.js",revision:null},{url:"assets/openai-CgMQRKzs.js",revision:null},{url:"assets/openrouter-ai-Db66h2nl.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-DCVmkLmw.js",revision:null},{url:"assets/plain-CAqIfj7b.js",revision:null},{url:"assets/player2-eDuFfc86.js",revision:null},{url:"assets/player2-speech-66bux_II.js",revision:null},{url:"assets/polaroid-D7wvNIY_.js",revision:null},{url:"assets/process.worklet-CF6Ao8XG.js",revision:null},{url:"assets/providers-piPjwyiC.js",revision:null},{url:"assets/queue-B8eo5pBS.js",revision:null},{url:"assets/route-block-gWR0cCIm.js",revision:null},{url:"assets/scene-D_ELFQMq.js",revision:null},{url:"assets/Scenes-C-Sbq7ai.js",revision:null},{url:"assets/settings-DZLC48Fg.js",revision:null},{url:"assets/settings-XapIzgYq.js",revision:null},{url:"assets/speech-CKJ0G9iZ.js",revision:null},{url:"assets/stage-BZBO0dUM.js",revision:null},{url:"assets/stage-DXskS9T5.js",revision:null},{url:"assets/sury-s6Akl-oc-9Lj4-L3G.js",revision:null},{url:"assets/Textarea-BXmK5gJR.js",revision:null},{url:"assets/theme-color-B02Jz7A8.js",revision:null},{url:"assets/together-ai-DECvdY-v.js",revision:null},{url:"assets/transformers.web-Dx6XCSrY.js",revision:null},{url:"assets/valibot-DBCeetIe-CvO_piDA.js",revision:null},{url:"assets/vibrant-BBcDcY4H.js",revision:null},{url:"assets/volcengine-BXLg-lBL.js",revision:null},{url:"assets/worker-_4r9VDQB.js",revision:null},{url:"assets/xai-2cc0qIXE.js",revision:null},{url:"assets/zod-Bw_60DVU-Bcmc6iZH.js",revision:null},{url:"index.html",revision:"63aac5a110e3f4c19b73d947762e3be5"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"apple-touch-icon.png",revision:"b41f3c1ba3c98364c640fe2b7348bd39"},{url:"favicon.svg",revision:"47d50a7bc31b26d14f3895982906935f"},{url:"maskable_icon_x192.png",revision:"a6ed025fb1491e8b498c9f4c0064d190"},{url:"maskable_icon_x512.png",revision:"b7b2c2d9bda88c74a295695c8a0e7468"},{url:"web-app-manifest-192x192.png",revision:"c9731148ea6befa78a495f63536c82eb"},{url:"web-app-manifest-512x512.png",revision:"bcae855d5ff588b682314fe1c6e530f0"},{url:"manifest.webmanifest",revision:"0a5a207cc5b76af4bd35f0b587dd1902"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/docs\//,/^\/ui\//,/^\/remote-assets\//,/^\/api\//]}))}); +if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const o=s=>l(s,n),a={module:{uri:n},exports:u,require:o};e[n]=Promise.all(r.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-Cp7ZP3Cb.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-BcDABPW0.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-NEutZrhx.js",revision:null},{url:"assets/_...all_-DNDgokJ1.js",revision:null},{url:"assets/airi-card-BaqHfUxO.js",revision:null},{url:"assets/alibaba-cloud-model-studio-u_KMUc3I.js",revision:null},{url:"assets/AnimatedWave-CW4ij04Q.css",revision:null},{url:"assets/AnimatedWave-wua8MzWE.js",revision:null},{url:"assets/anthropic-BljXHKAw.js",revision:null},{url:"assets/appearance-Bqk97F-6.js",revision:null},{url:"assets/arktype-C-GObzDh-CYoI0Osm.js",revision:null},{url:"assets/audio-C2yPudG-.js",revision:null},{url:"assets/audio-record-DlZD02-W.js",revision:null},{url:"assets/azure-ai-foundry-CmnN_e4a.js",revision:null},{url:"assets/background-gradient-blending-6ss5Fg2-.css",revision:null},{url:"assets/background-gradient-blending-CykJ-DB6.js",revision:null},{url:"assets/background-remove-fLURqKXM.js",revision:null},{url:"assets/Basic-kTOabOY_.js",revision:null},{url:"assets/browser-bFm1l1qg.js",revision:null},{url:"assets/browser-DPkKpj_5.js",revision:null},{url:"assets/CardCreate-CVfo1sY1.js",revision:null},{url:"assets/CardCreate-D1L2CNWh.js",revision:null},{url:"assets/CardCreationDialog-Ccy00rjA.js",revision:null},{url:"assets/CardCreationDialog-DVYMLoWa.js",revision:null},{url:"assets/CardCreationDialog-UIvAa4Bx.css",revision:null},{url:"assets/CardDetailDialog-CTDWU09J.js",revision:null},{url:"assets/CardDetailDialog-Cz1N4FQk.js",revision:null},{url:"assets/CardListItem-CK8o7jg4.js",revision:null},{url:"assets/CardListItem-oFjJO8yD.js",revision:null},{url:"assets/chat-DL9i4zaS.js",revision:null},{url:"assets/cloudflare-workers-ai-DH8y1cuF.js",revision:null},{url:"assets/color-scheme-gSwocc3L.js",revision:null},{url:"assets/color-scheme-r2m6hu6X.css",revision:null},{url:"assets/consciousness-D-mOgB0P.js",revision:null},{url:"assets/core-DnrPmW0D.js",revision:null},{url:"assets/deepseek-DJ4XOLdP.js",revision:null},{url:"assets/default-browser-ZWdN_TIR.js",revision:null},{url:"assets/default-CKyRS7eC.js",revision:null},{url:"assets/default-node-whATspOv.js",revision:null},{url:"assets/delays-6S4zxQEt.js",revision:null},{url:"assets/DeleteCardDialog-BMk3CSBA.js",revision:null},{url:"assets/DeleteCardDialog-CAFkJEuJ.js",revision:null},{url:"assets/developer-BGgZf27o.js",revision:null},{url:"assets/DialogTitle-DeExZXr0.js",revision:null},{url:"assets/dist-tewfm9Ec.js",revision:null},{url:"assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js",revision:null},{url:"assets/duckdb-browser-coi.worker-Ji2I_m5s.js",revision:null},{url:"assets/duckdb-browser-eh.worker-B2xnDV1H.js",revision:null},{url:"assets/duckdb-browser-mvp.worker-DCs3_EjR.js",revision:null},{url:"assets/duckdb-coi-CSr8FQO4.wasm",revision:null},{url:"assets/duckdb-eh-BJOC5S4x.wasm",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/duckdb-mvp-P5KShsBk.js",revision:null},{url:"assets/effect--zg3C1LQ-ld3Bkn4f.js",revision:null},{url:"assets/elevenlabs-CIJ-36gn.js",revision:null},{url:"assets/emotions-BEnYe8CF.js",revision:null},{url:"assets/esm-CNGDxrUe.js",revision:null},{url:"assets/featherless-ai-5Km5myH_.js",revision:null},{url:"assets/filter-message-DeoOY8to.js",revision:null},{url:"assets/fireworks-ai-B-as3TcQ.js",revision:null},{url:"assets/general-CQDJm-ty.js",revision:null},{url:"assets/gesture-circle-BOzZAIEv.js",revision:null},{url:"assets/google-generative-ai-BJ5FqLIb.js",revision:null},{url:"assets/HeaderLink-4n3ShASi.css",revision:null},{url:"assets/HeaderLink-DVkQgheP.js",revision:null},{url:"assets/hearing-GzHWsAjD.js",revision:null},{url:"assets/home-QHat2eLA.js",revision:null},{url:"assets/icon-animation-DON3nMjf.js",revision:null},{url:"assets/IconAnimation-PgvikmZb.js",revision:null},{url:"assets/image-26XCOKEz.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/import-url-browser-D0zVIqhu.js",revision:null},{url:"assets/import-url-browser-DIrMeXJ_.js",revision:null},{url:"assets/import-url-node-Dl605kiZ.js",revision:null},{url:"assets/index-BF1-WNuF.js",revision:null},{url:"assets/index-DStbve3n.css",revision:null},{url:"assets/InputFile-CWezcrJG.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-CrPU-NEp.js",revision:null},{url:"assets/memory-long-term-DCk6zf2R.js",revision:null},{url:"assets/memory-short-term-DvyQeTmq.js",revision:null},{url:"assets/messages-DlXkV5Rk.js",revision:null},{url:"assets/microsoft-speech-Bko6hWlU.js",revision:null},{url:"assets/mistral-ai-teLdtiwv.js",revision:null},{url:"assets/models-BM2HFRNH.js",revision:null},{url:"assets/modules-D6tOd0hQ.js",revision:null},{url:"assets/moonshot-ai-u73XFCFi.js",revision:null},{url:"assets/novita-ai-7ipBHksn.js",revision:null},{url:"assets/ollama-CuqQePdH.js",revision:null},{url:"assets/openai-audio-speech-CbGH6VQ3.js",revision:null},{url:"assets/openai-audio-transcription-BiCtqKwn.js",revision:null},{url:"assets/openai-B9sunSqD.js",revision:null},{url:"assets/openrouter-ai-C4TWeOIO.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-CjjKzga2.js",revision:null},{url:"assets/plain-7iQYbl-w.js",revision:null},{url:"assets/player2-ClAVJB5x.js",revision:null},{url:"assets/player2-speech-BP2h--1L.js",revision:null},{url:"assets/polaroid-BoV0pdO1.js",revision:null},{url:"assets/process.worklet-CF6Ao8XG.js",revision:null},{url:"assets/providers-BRImID3U.js",revision:null},{url:"assets/queue-D90evycf.js",revision:null},{url:"assets/route-block-gWR0cCIm.js",revision:null},{url:"assets/scene-DQODToDR.js",revision:null},{url:"assets/Scenes-CogR6jTf.js",revision:null},{url:"assets/settings-BayMzedR.js",revision:null},{url:"assets/settings-DJ0YDc_8.js",revision:null},{url:"assets/speech-Bn9l8ac1.js",revision:null},{url:"assets/stage-5LZVOFch.js",revision:null},{url:"assets/stage-C66qPyvu.js",revision:null},{url:"assets/sury-s6Akl-oc-BC_NKWkZ.js",revision:null},{url:"assets/Textarea-DjE71tF2.js",revision:null},{url:"assets/theme-color-DY2bNlFZ.js",revision:null},{url:"assets/together-ai-6XPxX9Zr.js",revision:null},{url:"assets/transformers.web-BCbx_Nx1.js",revision:null},{url:"assets/valibot-DBCeetIe-CZqQHx2v.js",revision:null},{url:"assets/vibrant-LsjL0AjJ.js",revision:null},{url:"assets/volcengine-BQiNcwbw.js",revision:null},{url:"assets/worker-_4r9VDQB.js",revision:null},{url:"assets/xai-CK1EupZF.js",revision:null},{url:"assets/zod-Bw_60DVU-DrbGHdRQ.js",revision:null},{url:"index.html",revision:"c0c9108082f369eda2d7b87a87b48cfa"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"apple-touch-icon.png",revision:"b41f3c1ba3c98364c640fe2b7348bd39"},{url:"favicon.svg",revision:"47d50a7bc31b26d14f3895982906935f"},{url:"maskable_icon_x192.png",revision:"a6ed025fb1491e8b498c9f4c0064d190"},{url:"maskable_icon_x512.png",revision:"b7b2c2d9bda88c74a295695c8a0e7468"},{url:"web-app-manifest-192x192.png",revision:"c9731148ea6befa78a495f63536c82eb"},{url:"web-app-manifest-512x512.png",revision:"bcae855d5ff588b682314fe1c6e530f0"},{url:"manifest.webmanifest",revision:"0a5a207cc5b76af4bd35f0b587dd1902"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/docs\//,/^\/ui\//,/^\/remote-assets\//,/^\/api\//]}))});